Hi, i have search a lot and cant find an answer, i want that perl execute a php file, i have tried with this but doesnt works: #$FilePath = "http://localhost/~sparkiiflor/test/write.php?men=hola"; #$file = "http://localhost/~sparkiiflor/test/write.php"; open(INFO, $file) or die "Error\n"; @lines = <INFO>;y close(INFO); print @lines; and with this system("write.php"); But doesnt works, any idea???
blind leading the blind here but this has worked for me in the past #!/usr/local/bin/perl -w use LWP::Simple; use CGI; my $URL="http://mysite.net/process_cache.php"; my $content = LWP::Simple::get($URL); print "$content"; Code (markup):
Yes that should work, but you don't need the use CGI; statement. You never call any methods from the package, so its not necessary.
If that doesn't work, this will: use WWW::Mechanize; my $mech = Mechanize->new(); my $url = "http://www.yahoo.com"; $mech->get($url); my $content = $mech->content(); I use Mechanize over LWP because it has some other cool functions (it can submit forms, does wonders for testing checkouts lol).