Probably most people know about the "Eskimo greeting" "secret operator". I'm not sure if the following trick is common knowledge, but I just saw it for the first time in this blog post by Yary:
$ perl -MO=Deparse -M'5;print "foo"' -ne '}{print "bar"' sub BEGIN { require 5; () } print 'foo'; LINE: while (defined($_ = readline ARGV)) { (); } { print 'bar'; }
A neat little trick :-)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Inserting Code Before an -n/-p Loop
by Eily (Monsignor) on Dec 18, 2018 at 10:03 UTC | |
Re: Inserting Code Before an -n/-p Loop
by LanX (Saint) on Dec 17, 2018 at 21:07 UTC | |
Re: Inserting Code Before an -n/-p Loop -- oneliner
by Discipulus (Canon) on Dec 18, 2018 at 09:32 UTC | |
by Anonymous Monk on Dec 18, 2018 at 18:04 UTC |