Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: match multi-lines from config file

by mreece (Friar)
on Aug 07, 2007 at 06:23 UTC ( #630967=note: print w/replies, xml ) Need Help??


in reply to Re: match multi-lines from config file
in thread match multi-lines from config file

/^description/ && last while <IN>;
that confused the heck out of me! how about this form?
$_ = <IN> until /^description/;
doh!

Replies are listed 'Best First'.
Re^3: match multi-lines from config file
by GrandFather (Saint) on Aug 07, 2007 at 10:41 UTC

    Because that tests $_ before the first value is assigned to it and doesn't terminate for a file that doesn't include a matching line!


    DWIM is Perl's answer to Gödel

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://630967]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2023-03-24 18:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (61 votes). Check out past polls.

    Notices?