@subj= cat somefile.txt print @subj;
foreach (@subj) {
$subject_no=chomp($_);
This assigns the return value of chomp() to the variable not the chomp'ed version of $_;
perldoc -f chomp
Try this, it works the the same each time :
perl -mstrict -we 'my @subj = ("01\n","02\n","03\n");print @subj;for(@subj) { chomp; print $_,"\n"; }'
print $subject_no,"\n"; }
HTH
Lee.M - JupiterHost.Net
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>