I'll start of with the code, then ask the question....
#!/usr/bin/perl -w use strict; my $dir = "."; # relative path within chroot opendir(DIR, $dir) or die "can't open $dir for read: $!\n"; my @file = readdir DIR; closedir(DIR) or die "error closing $dir: $!\n"; foreach my $file (@file) { my $fsize = (-s $file); # get the file size my $isdir = (-d $file); # get the file size if ($fsize > 1 || $isdir =~ 1) { print ":$file:$fsize:$isdir:\n"; ...do more junk.... } else { print ":$file:$fsize:$isdir:\n"; ...do more junk.... } }
now I would expect this to return the filename followed by the file size and a value of 1 if it is a directory. which works great on 5.8.0 Active State... However when I run the same code on AIX running 5.005_3 I get "strange" results. the filename, size, and directory indicator are returned for '.' and '..' but every file or directory after that a size and directory indicator are not returned? I check 'perldoc -f -s' on the AIX box and it appears that the file test operators should work the same on 5.005_3 as they do on my windows box....??? can anybody shed some light on this for me?

In reply to file size test on 5.005_3? by djbiv

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.