I'd add in use warnings; as a matter of course, but that won't make any difference to your problem.
I'd $test .= $_ while <DATA>;, but that won't make any difference either (although it means you don't need to init $test in the previous line).
Rather than the while loop I'd more likely write: my $test = join '', <DATA>;, but that won't make any difference either (Update: actually if I were a couple more cups of coffee through the day I'd use $/ as moritz suggests).
In fact, I can't see how the code you've shown could fail in the manner you describe. Does your sample code actually fail, or have you golfed it down from a larger piece of code that does fail? If the sample is golfed, try generating a sample that actually does fail and show us that.
In reply to Re: __DATA__ Inconsistency
by GrandFather
in thread __DATA__ Inconsistency
by bichonfrise74
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |