Bio-BioVeL
view release on metacpan or search on metacpan
lib/Bio/BioVeL/Service.pm view on Meta::CPAN
=cut
sub get_handle {
my ( $self, $location ) = @_;
# location is a URL
if ( $location =~ m#^(?:http|ftp|https)://# ) {
my $ua = LWP::UserAgent->new;
my $response = $ua->get($location);
if ( $response->is_success ) {
my $content = $response->decoded_content;
open my $fh, '<', \$content;
return $fh;
}
}
else {
open my $fh, '<', $location or die $!;
return $fh;
}
}
( run in 0.300 second using v1.01-cache-2.11-cpan-26ccb49234f )