in reply to while modifier

I don't think that while as a modifier can set $_.
nope the problem is not there. the following line works as expected
 perl -e 'print $_ while <>'

The problem must be with peculiarities of lexical declared with a modifier in the same statement.

Anyway you could write:

#!/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
or
#!/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