in reply to -E behavior with stdin script
AFAIK, there is no way to pick the features enabled by -E automatically other than by using it.
But you can require just what you need inside the code chunk:
That's the most future-proof solution.perl -wn -- - /etc/passwd <<'EOF' use feature 'say'; next unless / ([^:]*) : [^:]* : ([0-9]+) /x; my ($w, $n) = (uc $1, 5000 + $2); say qq{log=$w id=$n} EOF
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: -E behavior with stdin script (updated)
by haukex (Archbishop) on Sep 05, 2021 at 13:50 UTC |
In Section
Seekers of Perl Wisdom