The problem must be with peculiarities of lexical declared with a modifier in the same statement.
Anyway you could write:
or#!/usr/bin/perl -w use strict; my $foo_text; while ( <DATA> ) { $foo_text .= $_; } print "$foo_text\n"; __DATA__ foo wears foo shoes at the foo store
#!/usr/bin/perl -w use strict; my $foo_text; { local $/; undef $/; # see perlvar $foot_text = <DATA>; # slurps contents after __DATA_ } print "$foo_text\n"; __DATA__ foo wears foo shoes at the foo store
-- stefp
In reply to Re: while modifier
by stefp
in thread while modifier
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |