#! /usr/bin/perl use strict; use warnings; use LWP::Simple; # fetch data from URL my $content = get( "http://example.org/cgi-bin/whatever.pl" ); # process data into desired structure my @array = do_your_magic_with(\$content); # let's assume, that we got a string with whitespace separated values sub do_your_magic_with { my $ref = shift; return split m/\s+/, $$ref; }