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

Fellow monasterians,

This is a new error for me and in researching it I haven't turned up anything definitive.

my $filename="http://www.acmestudios.com/clients/SM724/beta/com/com.co +nfig.style1.smf"; open (DATA, ">$filename") or print "Error opening $filename: $!"; print DATA $filevalue; close (DATA);

Thought it might be permissions so chmodded the directory 777 (don't worry, didn't leave it). And when I run it from the URL window, I get the "no such file or directory" error. If I just enter the file name as a URL, it prints the contents of the file to screen. So, I know it's there.

Ideas? TIA


—Brad
"The important work of moving the world forward does not wait to be done by perfect men." George Eliot

Replies are listed 'Best First'.
Re: Bad file descriptor error
by merlyn (Sage) on Jul 13, 2005 at 00:31 UTC
    my $filename="http://www.acmestudios.com/clients/SM724/beta/com/com.co +nfig.style1.smf"; open (DATA, ">$filename") [.... rest deleted ...]
    What do you expect that to do? http is a web protocol, not the prefix of a pathname. Opening a filename that starts "h t t p colon slash slash" is not likely to do anything useful, and in fact would give you the errors you describe.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      Yikes! Thanks merlyn. I was trying for the absolute path and now realize I need to use the server's path.

      Sometimes we need a little push over the bump, even if it's a bit embarrassing.


      —Brad
      "The important work of moving the world forward does not wait to be done by perfect men." George Eliot