in reply to Re: How do I assign a variable to the file content?
in thread How do I assign a variable to the file content?
A couple of notes:
prints the entire contents of the open file since <> in an array context reads all remaining lines.print( <COUNTTHIS> );
The first line above doesn't set $_ like while(<COUNTTHIS>) does. So the second line doesn't leave $thenumber set properly.print (<COUNTTHIS>); $thenumber = $_;
This version fixes all of these problems. - tye (but my friends call me "Tye")$thenumber = <COUNTTHIS>; print $thenumber;
|
|---|