The short answer is no.

The helpful answer is that readdir gets its information from the local filesystem, which you don't have access to unless you're running programs on that machine (this is generally construed to be a good thing). What your scripts can see of the filesystem of a remote machine depends entirely on what kind of access you have: are you relying entirely on a webserver? If so, you're limited to what the server wants to tell you about the remote directory structure, and you have to take it in the format that the server offers it to you (in which case, LWP and possibly HTML::Parser are worth a look).

Why do you want to serve up images off a remote server? There might be a better way to accomplish what you're looking to do, if you provide a few details...



If God had meant us to fly, he would *never* have give us the railroads.
    --Michael Flanders


In reply to Re: How do you read a directory on a foreign site? by ChemBoy
in thread How do you read a directory on a foreign site? by Sasquire

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.