in reply to Perl copy Text from file to Script

print "$file[1]\n"; ... my $response = $ua->get($file[0]);

So what do you get when you print out $file[0] instead of $file[1]? Does it hold the URL?  Or, in case $file[1] should hold the URL, what happens if you pass it to ->get()?

Replies are listed 'Best First'.
Re^2: Perl copy Text from file to Script
by Appy16 (Sexton) on Mar 22, 2010 at 08:53 UTC
    If $file[0] = www.abcd.com and $file[1] = www.google.com. I get "www.abcd123.com" when i print $file[0] and "www.google.com" when i print $file[1]. Yes both File[0] and file[1] hold URLs. Whether I pass $file[0] to ->get( ) or $File[0] to ->get( ). I always get :

    The URL is Inactive.

    But if I directly pass http://www.google.com to ->get( ) I get :

    The URL is active.

      Well, there's one difference between what you pass via $file[0] and what you pass directly: the latter one has the protocol specifier "http://".  So, I would try $ua->get("http://$file[0]").