Bob Woodman has asked for the wisdom of the Perl Monks concerning the following question:

I am attempting to read a secure password protected file using perl 5.8.8

open (TXT, "<", 'https://bwoodman:kophill2013@login.kophillclimb.info/api/entrants/status/3') || die("No file access $!");

I get nothing back, not even the error message!

If I copy and paste the file details to my address bar everything works OK! - confused - What am I doing wrong?

Replies are listed 'Best First'.
Re: Open File Absolute Address
by Corion (Patriarch) on Apr 23, 2013 at 12:48 UTC

    http:// URLs and filenames are not the same. Maybe you want to look at LWP::Simple to retrieve data via HTTP?

    I'm also pointing out that IO::All seems quite convenient but opens up horrible security holes, because it makes it very easy to tread all kinds of input parameters as readable resources.

Re: Open File Absolute Address
by choroba (Cardinal) on Apr 23, 2013 at 12:51 UTC
    open cannot be used to open remote files. Check LWP::Simple for an alternative.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re: Open File Absolute Address
by InfiniteSilence (Curate) on Apr 23, 2013 at 14:13 UTC
    Ok, I'll admit this is silly, but technically you could use curl with a pipe like so:
    perl -e 'my $page; open(H,qq~curl www.google.com|~); while(<H>){print +}; close(H);'

    Celebrate Intellectual Diversity