¿ Alguien me podría explicar por qué?
Using perl Syntax Highlighting
- use LWP::UserAgent;
- use URI::Split qw(uri_split);
- use HTML::LinkExtor;
- my $nave = LWP::UserAgent->new;
- $nave->agent( "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12" );
- $nave->timeout(10);
- download_all("http://localhost/test.php");
- sub download_all {
- my $page = "http://localhost/test.php";
- my $code = toma($page);
- chomp $code;
- my @links_all = get_links($code);
- print "paso";
- for my $page_down (@links_all) {
- print $page_down. "\n";
- #download_this($page_down);
- }
- }
- sub toma {
- return $nave->get( $_[0] )->content;
- }
- sub get_links {
- $test = HTML::LinkExtor->new( \&agarrar )->parse($code);
- return @links;
- sub agarrar {
- my ( $a, %b ) = @_;
- push( @links, values %b );
- }
- }
Coloreado en 0.003 segundos, usando GeSHi 1.0.8.4