syntax error at - line 62, near "[some output from my command pipe]"
Execution of - aborted due to compilation errors.
####
-p causes Perl to assume the following loop around your
program, which makes it iterate over filename arguments
somewhat like sed:
LINE:
while (<>) {
... # your program goes here
} continue {
print or die "-p destination: $!\n";
}
####
% perl -MO=Deparse -pl40
^D
LINE: while (defined($_ = )) {
chomp $_;
}
continue {
print $_;
}
- syntax OK
% perl -MO=Deparse -pl40 -e 1
LINE: while (defined($_ = )) {
chomp $_;
'???';
}
continue {
print $_;
}
-e syntax OK
####
% cat >foo
foo
bar:
^D
% cat foo | perl -p
syntax error at - line 2, near "foo
bar:"
Execution of - aborted due to compilation errors.
####
% cat >foo
print "hello, world\n"
^D
% cat foo | perl
hello, world