By saying it "didn't work" I mean it doesn't respond. I don't get any messages that give me a hint (I'm using use warnings; and use diagnostics;). Update, solution:
The problem was with my function.
sub extract_html_to_temp_file #url, path&file { my $temp_var = ""; my $url = $_[0]; chomp($url); my $filename = $_[1]; chomp($filename); open(OUTPUT_FILE,">$filename") or die "COULDN'T OPEN FILE!!!, $!\n +"; $_ = get($url);#read HTML file contents into variable $temp_var = $_; print OUTPUT_FILE $temp_var; close(OUTPUT_FILE); }
After the line $temp_var = $_; I had several lines of code that stripped the string of things I didn't want, eg. $temp_var = s/ / /g; etc. I have no idea why this would be a problem, but once I removed these lines the function worked.
The fact that my function worked for webpages with an extension and not for webpages without an extension caused me to look for the wrong kind of solution.
Thanks for the reply :-)

In reply to Re^4: Read webpage into a variable by liverpaul
in thread Read webpage into a variable by liverpaul

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.