armenica Posted May 15, 2007 Share Posted May 15, 2007 Hi! This is not quite a PHP problem, but a PERL one. Does anyone know how I could convert the following PHP code to PERL? (openning a file stream to an URL and reading its replied content?) $URL = "http://www.exampleurl.com"; $handle = fopen ($URL, "r"); $key = str_replace(' ', '%20', fread($handle, 1000000)); I would like to implement it in PERL... Thanks in advance, /V Quote Link to comment https://forums.phpfreaks.com/topic/51450-help-with-php-code-conversion-to-perl/ Share on other sites More sharing options...
effigy Posted May 15, 2007 Share Posted May 15, 2007 Something like this (untested): use warnings; use strict; use WWW::Mechanize; my $mech = WWW::Mechanize->new(); my $url = 'http://www.exampleurl.com'; $mech->get($url); my $content = $mech->content(); $content =~ s/ /%20/g; Quote Link to comment https://forums.phpfreaks.com/topic/51450-help-with-php-code-conversion-to-perl/#findComment-253607 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.