#! C:/Perl64/bin/perl # Calls the PERL interpreter use strict; #use features that provide detailed warning and cleanup use warnings; #use features that provide detailed warning and cleanup use autodie; #sometimes prevents the program from hanging and kills it use LWP::Simple; # PERL module to connect to Internet my $out_file = 'recipe.txt'; #Defines output my $encoding = ":encoding(UTF-8)"; #Defines encoding type for text typical of western webpages open (my $handle2, ">> $encoding", $out_file) || die "Could not open $out_file: $!"; #Opens output and assigns an internal name independent of file name my $content=get("http://allrecipes.com/recipe/11253/mock-peanut-brittle/") or die "ouch"; #Gets the webpage as xml print $handle2 $content."\n"; #Writes the URL as text to the output file exit;