SPUG: Some changes I'd like in Perl
ced at carios2.ca.boeing.com
ced at carios2.ca.boeing.com
Fri Nov 29 20:55:21 CST 2002
On Fri, Nov 29, 2002 at 09:46:08AM -0800, Yitzchak Scott-Thoennes wrote:
....
>
> You can actually do this. Try:
> perl -wlne'$_ ne "" or next; print } continue { print "Finished with line $." '
>
> That is, you have to say -e'foo } continue { bar' where foo is the body of the
> loop and bar is the contents of the continue block.
|Right, but at that point it would be simpler to dispense with the -n
|altogether and just write your own loop, to keep from going crazy!
|I admire your ingenuity for sneaking a continue block into the implicit
|-n loop, but I'd like a more conventional way to accomplish this goal,
Actually, I seem to recall Abigail (a wonderfully deranged hacker)
came up with this first.
|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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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