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

Re: moving the filehandle to anyline of a file

by GrandFather (Saint)
on May 02, 2006 at 04:54 UTC ( [id://546818]=note: print w/replies, xml ) Need Help??


in reply to moving the filehandle to anyline of a file

I'd refactor that slightly to:

while ( <FH> ) { next if $_ !~ /^Confname/; ... }

DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: moving the filehandle to anyline of a file
by Tanalis (Curate) on May 02, 2006 at 08:58 UTC
    Or simply, if we're refactoring,
    while ( <FH> ) { next unless /^Confname/; ... }
    I've always found unless clearer than a negated if for short single-condition conditionals like that. I do accept that that's personal preference, though .. :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-19 23:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found