At first glance, let me suggest that you uncomment use strict; and also make sure you use warnings; (You can also use warnings by placing -w at the end of your hashbang line: #!/usr/bin/perl -w).
I know the problem happens when I try to pass the variable from the array to the subroutine.
You are passing a scalar to the subroutine and then assigning that scalar to an array. You are not passing an array to the subroutine. I'll try to explain:
my $url = 'http://www.vegasinsider.com/nfl/odds/.../1300#J'; # Assigni +ng that url to the scalar url. save_file ($url); # Calling the subroutine while passing the scalar $u +rl sub save_file { # Initiating sub my @game = @_; # Populating an array with all the contents of the + arguments that are passed to the subroutine. In this case, just one; + $url
I assume you are going to pass multiple urls to the subroutine. Anyway, continuing on.
Do you know how I can pass the variable from the array into the subroutine with single quotes?
See my above explanation. I am confused as to what you mean here. Could you outline what you are trying to do?
I'm so adjective, I verb nouns!
chomp; # nom nom nom
In reply to Re^3: Anyone know why I can't scrape this page?
by Lawliet
in thread Anyone know why I can't scrape this page?
by lv211
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |