Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Re: what's this loo code?

by Anonymous Monk
on Feb 06, 2003 at 15:07 UTC ( #233155=note: print w/replies, xml ) Need Help??


in reply to Re: what's this loo code?
in thread what's this loo code?

that's interesting. how does that '}{die' thing work ? why doesn't perl complain of mismatched braces or something

Replies are listed 'Best First'.
Re: Re: Re: what's this loo code?
by BrowserUk (Pope) on Feb 06, 2003 at 16:04 UTC

    Take a look at the documentation for the -p and -n switches in perlrun. In prasee er...short, it says

    -p causes Perl to assume the following loop around your program, which ma +kes it iterate over filename arguments somewhat like sed: LINE:while (<>) { # your program goes here } continue { print or die "-p destination: $!\n"; }

    If you substitute the 'program' eg. "}{die" where the comment above says " your program goes here", then you willl see how the thing works.


    Examine what is said, not who speaks.

    The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://233155]
help
Chatterbox?
[Corion]: Greetings from the German Perl Workshop ;)
[1nickt]: Isn't it YAPC::NA too?
[Corion]: Yes, but I think there's not that much overlap in our audiences ;))
[1nickt]: Sheesh, I would have thought they would be satellite-linked somehow!
[1nickt]: Who's writing all the code this week, then?

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2017-06-27 20:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (613 votes). Check out past polls.