Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
The other day one of the other developers here was looking at some of my code where I'd done something like:
if (-d $foo) { ... } elsif (-s _) { ... }
He had never seen the _ file-test optimization and leaped to the conclusion that it was a syntax error. My response to him was not very kind--I literally told him to RTFM--but I can sort of sympathize with the position he was in. For whatever reason he was unaware of that particular feature, and it may not be immediately obvious where to find out about it. In hindsight, sure, go to the file-test-operator documentation, but it could just as easily have been some obscure variable/bareword syntax, or a call to a function named '_'. And for that matter, if you didn't know the right perldoc command to show the file-test documentation, it'd probably take a few tries to find it. I've been using perl since version 3.something, but there are lots of times I get tired of having to keep track of all the syntax idiosyncracies.

In reply to Re: Re: Just Cant Win by kjherron
in thread Just Cant Win by Kevman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found