--- psinib.pl 2003/11/08 01:46:53 1.21 +++ psinib.pl 2004/03/01 19:38:16 1.22 @@ -87,13 +87,16 @@ my $sub_nr = 0; my $email_body; +my $home_dir=$ENV{'HOME'}; +$home_dir = '/tmp' if (! -w $home_dir); + if ($email) { # It will use (and require) Tie::File only if --email=foo@bar.com # arguement is used! use Tie::File; tie @subjects, 'Tie::File', "$basedir/subjects.txt" || xlog("CONFIG","Can't find $basedir/subjects.txt... using default (only one)"); chdir; # this will change directory to HOME - if (open(SN,".psinib.subject")) { + if (open(SN,"$home_dir/.psinib.subject")) { $sub_nr = ; chomp($sub_nr); close(SN); @@ -105,11 +108,11 @@ } $sub_nr = 0 if (! $subjects[$sub_nr]); - if (open(SN,"> .psinib.subject")) { + if (open(SN,"> $home_dir/.psinib.subject")) { print SN "$sub_nr\n"; close (SN); } else { - xlog("CONFIG","Can't open .psinib.subject -- I can't cycle subjects..."); + xlog("CONFIG","Can't open $home_dir/.psinib.subject -- I can't cycle subjects..."); }; }