/[psinib]/psinib.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /psinib.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21 by dpavlin, Sat Nov 8 01:46:53 2003 UTC revision 1.22 by dpavlin, Mon Mar 1 19:38:16 2004 UTC
# Line 87  my @subjects = ('Backup needs your atten Line 87  my @subjects = ('Backup needs your atten
87  my $sub_nr = 0;  my $sub_nr = 0;
88  my $email_body;  my $email_body;
89    
90    my $home_dir=$ENV{'HOME'};
91    $home_dir = '/tmp' if (! -w $home_dir);
92    
93  if ($email) {  if ($email) {
94          # It will use (and require) Tie::File only if --email=foo@bar.com          # It will use (and require) Tie::File only if --email=foo@bar.com
95          # arguement is used!          # arguement is used!
96          use Tie::File;          use Tie::File;
97          tie @subjects, 'Tie::File', "$basedir/subjects.txt" || xlog("CONFIG","Can't find $basedir/subjects.txt... using default (only one)");          tie @subjects, 'Tie::File', "$basedir/subjects.txt" || xlog("CONFIG","Can't find $basedir/subjects.txt... using default (only one)");
98          chdir; # this will change directory to HOME          chdir; # this will change directory to HOME
99          if (open(SN,".psinib.subject")) {          if (open(SN,"$home_dir/.psinib.subject")) {
100                  $sub_nr = <SN>;                  $sub_nr = <SN>;
101                  chomp($sub_nr);                  chomp($sub_nr);
102                  close(SN);                  close(SN);
# Line 105  if ($email) { Line 108  if ($email) {
108          }          }
109          $sub_nr = 0 if (! $subjects[$sub_nr]);          $sub_nr = 0 if (! $subjects[$sub_nr]);
110    
111          if (open(SN,"> .psinib.subject")) {          if (open(SN,"> $home_dir/.psinib.subject")) {
112                  print SN "$sub_nr\n";                  print SN "$sub_nr\n";
113                  close (SN);                  close (SN);
114          } else {          } else {
115                  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...");
116          };          };
117  }  }
118    

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

  ViewVC Help
Powered by ViewVC 1.1.26