in reply to Print all derefs and method calls in a directory (Friday golf)
Addressing the golfing request,
# 123 rgrep -e'->' * | perl -ne '/(\S{3,80}->\S{5,80})/;print $1,"\n"' | pe +rl -pe's/^\(//' | perl -pe 's/^\+\+|^\-\-//' | sort | uniq
is sufficiently equivalent to
# 68 perl -ne's/^(\(|[+-]{2})//g,say for/(\S{3,80}->\S{5,80})/' *|sort -u
And since you already assume that you can't have two dereferencing expressions on the same line,
# 67 perl -ne's/^(\(|[+-]{2})//g,say for/\S{3,80}->\S{5,80}/g' *|sort -u
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Print all derefs and method calls in a directory (Friday golf)
by JavaFan (Canon) on Jan 09, 2009 at 12:11 UTC | |
by ikegami (Patriarch) on Jan 09, 2009 at 13:03 UTC |