in reply to Running perl and outputting to file

Don't use system to call a perl script. It's kind of messy I googled around for the script you were talking about and I found that It was not at all difficult to convert it to a subroutine

#!/usr/bin/perl use SOAP::Lite; print join "\n", googly(q|insert key here|,"super friends",2); sub googly{ @_ == 3 or die "Usage: googly <key> <query> <number of results>\n"; my($key, $q, $maxResults) = @_; # key, q, start, maxResults, filter, restrict, safeSearch, # lr, ie, oe my @params = ($key, $q, 0, $maxResults, 0, '', 0, '', 'latin1', 'latin1'); my $result = SOAP::Lite -> service("file:./GoogleSearch.wsdl") -> doGoogleSearch(@params); @matches = map( { qq{<a href="$_->{URL}">} . ($_->{title} || $_->{URL}) . qq{</a><br />} } @{$result->{resultElements}} ); }

This was the orignal code I found it here

#!/usr/bin/perl use SOAP::Lite; @ARGV == 3 or die "Usage: googly <key> <query> <number of results>\n" my($key, $q, $maxResults) = @ARGV; # key, q, start, maxResults, filter, restrict, safeSearch, # lr, ie, oe my @params = ($key, $q, 0, $maxResults, 0, '', 0, '', 'latin1', 'latin1'); my $result = SOAP::Lite -> service("file:GoogleSearch.wsdl") -> doGoogleSearch(@params); print join "\n", map( { qq{<a href="$_->{URL}">} . ($_->{title} || $_->{URL}) . qq{</a> <br />} } @{$result->{resultElements}} );