I using perl v5.8.4 on a HPUX platform, i have a script that needs to be able to determine if a file is for today or not.
My thought was to use the file test operators in perl, so i did a small test script posting the file and various test operators.
My problem is that every file has the same test results.

foreach my $logfile ( <./report*> ) { chomp($logfile); chomp(my @ll = `ll $logfile`); print "\n\n--------------------------------\n@ll\n"; printf ("%22s %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n", $logfile, -M + _, -A _, -C _, -r _, -w _, -O _); }

file test returns the same for all files.

---------------------------------------------------------- -rw-rw-r-- 1 not_me mygroup 50555 Mar 25 16:44 ./report.txt ./report.txt 0.99 0.00 0.99 1.00 1.00 1.00 ---------------------------------------------------------- -rw-rw-r-- 1 me mygroup 38322 Oct 22 19:34 ./report.txt. +bak ./report.txt.bak 0.99 0.00 0.99 1.00 1.00 1.00 ---------------------------------------------------------- -rw-rw-r-- 1 me mygroup 38322 Oct 22 19:34 ./report.txt. +sav ./report.txt.sav 0.99 0.00 0.99 1.00 1.00 1.00 ---------------------------------------------------------- -rw-r--r-- 1 not_me mygroup 38322 Oct 22 19:09 ./report.txts +av ./report.txtsav 0.99 0.00 0.99 1.00 1.00 1.00 ---------------------------------------------------------- -rw------- 1 not_me mygroup 38322 Oct 22 19:09 ./report.txts +av2 ./report.txtsav2 0.99 0.00 0.99 1.00 1.00 1.00 ---------------------------------------------------------- -rw-rw-r-- 1 me mygroup 41397 Jul 31 2014 ./report_7_30 +.txt ./report_7_30.txt 0.99 0.00 0.99 1.00 1.00 1.00

Any Ideas why this is happening?


In reply to Help with file test operators by justame

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.