Jeremy Kister on 21 Jan 2009 18:37:07 -0800 |
On 1/21/2009 10:18 AM, Walt Mankowski wrote: Don't forget we're having a tech meeting tonight. I"ll be giving a talk on becoming a Perl one-liners ninja. Thanks for the talk, Walt.we were talking about the -n switch, when i asked if we could trick perl into running two loops with some extra curly braces. there seemed to be some confusion about what i was talking about, so here's what i found: your example was along the line of: perl -ne 'print if length > 80' fooand i was wondering what exactly perl did with the -n switch -- did it simply wrap the code with while(<>){ and } ? so to test, i tried this: perl -ne 'print if length > 80 } { for(1..3){ print }' foo which works how i figured it may. might be useful sometime... -- Jeremy Kister http://jeremy.kister.net./ - **Majordomo list services provided by PANIX <URL:http://www.panix.com>** **To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**
|
|