En op 11 september 2002 sprak Greg Allen:
> now how about a quotes/sig file with one line descriptions of golf aphorisms?
> here we go:
> 
> ~$a -- true if ASCII string is non-empty, works for "0"
> [$a^abc] -- toggle a charset by making $a non-empty
> $|++ -- alternately 0 and 1
> $^I -- variable efficiently initialised with -i
> perl -[np] -e 'every line}once;for(list){' -- exploit -n or -p

Just "perl -p" would suffice. Is there any reason you'd want to use this
constuct with -n? Compare:

perl -ne'push @a,foo}for(@a){bar'
perl -e'for(map foo,<>){bar}'

Also:

~~foo -- call foo in scalar context
"a@{[foo]}b" -- interpolate call to foo
v32 -- same as " ", but often different tiebreaker score
$a^$b^$b -- pad $a with "\0"'s to the length of $b


(-ugene

-- 
Hackers do it with fewer instructions.

Reply via email to