This is very bizarre and I don't know if anyone can actually test this. I have a very simple script as follows:
#!/usr/bin/perl -w my $foo="/tmp/*"; my @glob=glob($foo); my $size=scalar(@glob); print "Content-type: text/html\n\n"; print "<html><head>\n"; print "SIZE: $size\n"; print"</head></html>\n";
and as expected, when I run it on a webserver it reports the number of files in /tmp.

But when I run in on RHEL6.2 in a VirtualBox VM it reports 0. Furthermore, when I point it to a different directory, in my case /usr/share/collectl/plotfiles, it works correctly. Since /tmp has the sticky bit set I even created /tmp2 and tried it against that directory. Still reported 0.

I had convinced myself it was a problem in RHEL6.2 but then I remembered I has another system running VMware/RHEL6.2 and I tried it there and it works fine! This makes me wonder if there's something funky about a vm in the virtualbox environment and/or a possible problem with glob itself in such an environment.

I did try running readdir instead of glob and it worked just fine, but I'd really like to get to the bottom of this if th is really is a bug.

Can anyone suggest any other experiments I might be able to try to add more context to this?

-mark


In reply to Might there be some bug in glob under apache? by markseger

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.