À¼»¨ÏÉ×Ó wrote:
Hello,
Hello,
doesn't one-liner Perl command support __DATA__ handler?
No. It only works in an actual file located on a real file system.
Just found this:
# perl -e 'while(<DATA>){ print }
__DATA__
abc
123
def
'
run without any output.
You could always do it like this:
perl -e'
my $data = <<DATA;
abc
123
def
DATA
open FH, "<", \$data or die $!;
print while <FH>;
'
John
--
The programmer is fighting against the two most
destructive forces in the universe: entropy and
human stupidity. -- Damian Conway
|