Well, besides the _ construct you might want to have a look at the File::stat module. I prefer it for situations like you describe. If only because if a non perl guru needs to maintain the code it'll be a lot easier to track down the appropriate documentation.

Other tricks? Hmm, well getting the hang of $" $, $\ $/ $; is worth your time, as well as learning the use and flexibility of perls command line options is also cool, I recommend having a look -l and -i as they are pretty useful for small scripts (thanks to various people, merlyn wog for pointing these out). Also for smaller scripts I have developed a fondness for using 1 argumnet opens as I mention here Re: auto-vivifying file handles. While it may not count as tricks, there is lots of stuff to know about perls extended regex syntax, watch for japhy posts as he seems to be an expert.

Anyways, one of the things that I like about perl is that whenever you think that you've learned all the perl tricks there are to learn some guru comes along and shows you five more that you never heard of....

:-)

Yves
--
You are not ready to use symrefs unless you already know why they are bad. -- tadmc (CLPM)


In reply to Re: Does anyone use underscore pseudo-filehandle? by demerphq
in thread Does anyone use underscore pseudo-filehandle? by ajt

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.