in reply to Explaining

Looks like you cut and paste this from some HTML. Here's the cleaned up version:
sub load_array($$) { my ($a_ref, $file) = @_; open (FILE, $file) or die "Can't open $file:$!\n"; @{$a_ref} = <FILE>; close FILE; chomp @{$a_ref}; }
What this does is pass and array reference and a filename to a sub. The file is opened and all lines of the file are read into the array. The final chomp removes the newlines from the array.

Cheers,
Ovid

Update: I missed the ($$) on the sub call. In recent versions of Perl, this creates what is called a prototype and specifies the types of arguments to pass. This should allow you to call the subroutine just as you would call in a built-in function and it will behave like a built-in function. I've not had much use for them (but then, I've not had much use for map until recently).