#!/user/perl5/bi/perl require "getopt.pl" Getopt(i"); $file = "usr/local/home/pfuser/CURRENT_54_USERS"; # I want to remove this hard coding and use # the Getopts::STD, but how do I pass info # from a cron job? @sids = (); @sindinfo = (); $numbers = 0; $DATE = 'date + %Y%m%d'; #Is this a Unix call? If so, how can I use Perl for this? chomp $DATE; if (! open(USERFILE, $file)) { die "could not open $file.\n"; } while () { $curline = $_; chomp($curline); push(@sids, $curline); push(@sidinfo, " "); numbers++ } close USERFILE; Sfile - $opt_i; if (! open(INFILE, $file)) {die "could not open $file. \n"; } while() { $curline = $_; chomp($curline); $startpos = 0; $length = index $curline, " "; $checksid = substr $curline, $startpos, $length; $startpos = $length + 1; $cheinfoadd = substr $curline, $startpos; $foundsid = 0; $index = 0; while ( $index < $numbers ) { if ( $sids[$index] eq $checksid ) { $sidinfo[$index] = $checkinfoadd; } $index++; } } close INFILE;