PHP Perl equivalent get_file_contents ()?

The following PHP code does exactly what I want to do. The problem is that I need to recreate it in Perl, and I play with the open() and sysopen() functions of Perl, but I cannot do this. Can anyone help or know any links that might help? Thanks.

 $URL = "http://example.com/api.php?arguments=values"; echo file_get_contents($URL); 
+5
php perl get file-get-contents lwp
source share
1 answer

You can use LWP :

 use LWP::Simple; $contents = get $URL or die; print $contents; 
+12
source share

All Articles