SPUG: Some changes I'd like in Perl
SPUG-list-owner
tim at consultix-inc.com
Fri Nov 29 22:42:43 CST 2002
On Fri, Nov 29, 2002 at 06:55:21PM -0800, ced at carios2.ca.boeing.com wrote:
>
> Actually, I seem to recall Abigail (a wonderfully deranged hacker)
> came up with this first.
Yes, s/he's deranged, but very interesting. A real out-of-the-box thinker!
I spent some time with him at YAPC/Amsterdam last year.
> |that would work with -p also.
>
> Just to prove you can, here's a doodle to plumb the depths of silliness :)
>
> perl -wlpe '$_ ne "" or next } continue { print;print "Finished with line $.";
> exit if eof}{'
> --
> Charles DeRykus
Aw, c'mon Charles; look what your forcing the poor compiler to swallow;
*two* continue blocks, and an empty ; block too!
BEGIN { $^W = 1; }
BEGIN { $/ = "\n"; $\ = "\n"; }
LINE: while (defined($_ = <ARGV>)) {
chomp $_;
next unless $_ ne '';
}
continue {
print $_;
print "Finished with line $.";
exit if eof;
}
{
;
}
continue {
die "-p destination: $!\n" unless print $_;
}
-Tim
*----------------------------------------------------------------------------*
| Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) DOC-PERL; (866) DOC-LINUX |
| Ph.D. & JAWCAR ("Just Another White Camel Award Recipient") |
| tim at consultix-inc.com teachmeunix.com teachmeperl.com teachmelinux.net |
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| CLASSES: Hashes and Arrays in Perl: 12/5; Minimal Perl Programming: 12/6 |
*----------------------------------------------------------------------------*
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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