When I write
#!/usr/bin/perl -w
use strict;
while( ) {
print \"\\n-------------------------\\n\\n\";
print;
<>;
}
I guess you're expecting this line
local $/ = "";
to change the behaviour of
to keep reading until the end of the data.
But in fact it takes something like this
{
local $/; # $/ becomes undef in this block
...
}
to enable slurp mode (and to contain that mode to the scope inside the {curlys}).
In effect it's saying "forget about thinking of newlines as the end-of-record marker",
Besides that... there's a tie fighter in your code!
while( ) {
print "\n-------------------------\n\n";
print;
<>; # <-- Feel the power of the DARK SIDE!!!
}
This little guy will read from STDIN, not from DATA - is that really what you want?