Hi PerlPhi,

In question 1, the thing that's left around is the results of doing a stat of the file.  An implicit stat is done when you use "-s" on a file, but a stat gives you a number of other pieces of information, which you already have in-memory.

For question 2, yes, your understanding is correct.

For question 3, you are misusing "_" as you speculated.  You can't print it out, you can only use it in conjunction with one of the -x tests.  However, you could do the following to print the file when it matches the tests -s and -A:

#!/perl/bin/perl use strict; my @original_files = qw/ fred /; my @big_old_files; foreach (@original_files) { if ((-s) > 0 and -A _ > 0) { push @big_old_files, $_; print "$_\n"; # Display the file name if it passes -s and -A +tests. } }

Note, too, that when you say "(-s)", you're implicitly saying "(-s $_)".


s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

In reply to Re: About Special Underscore Filehandle by liverpole
in thread About Special Underscore Filehandle by PerlPhi

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.