Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Writing code that looks nice

by moritz (Cardinal)
on Apr 12, 2010 at 12:49 UTC ( [id://834261]=note: print w/replies, xml ) Need Help??


in reply to Writing code that looks nice

That's just a matter of personal preference, not of "correct"ness.

It is also a matter of the intended audience: The less Perl they know, the more verbose might have to write.

perlstyle collects some stilistic wisdom that's widely adopted in the Perl community, but YMMV.

Update: In this specific case I'd either leave out the $_ altogether, or use an explicitly named variable, like

print $file if -d $file;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-26 04:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found