SPUG: flip-flops

Adam Monsen adamm at wazamatta.com
Tue Feb 12 19:53:01 CST 2002


On 12/02/02 19:48 -0500, Michael R. Wolf wrote:
[...]
> perl -n -e '$body   .= $_ if /^$/ .. eof();' \
>         -e '$head   .= $_ if (1 .. /^$/);' \
>         -e 'END{print $head, "\n", "="x40, "\n", $body;}'
[...]

That's cool.

I'm currently taking a C class, and it's fun as hell to prototype the
smaller problems in Perl one-liners. It is actually helpful, too, to
start with extremely terse Perl, expand [loops, range/flip-flop
operations, etc] into verbose Perl, then rewrite it in C.

-- 
Adam Monsen

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org





More information about the spug-list mailing list