in reply to Slurping information and storing it in an array.

If you are just trying to slurp the contents of a file into an array, where each element of the array corresponds to one line of the file, then this is one way to do it:
#!/usr/bin/env perl use warnings; use strict; print read_file('foo.txt'); exit; sub read_file { my $file = shift; open my $fh, '<', $file or die "Can not open file '$file' $!\n"; my @all_lines = <$fh>; close $fh; return @all_lines; }

If file "foo.txt" contains these 3 lines:

apple banana orange

then the script output will be:

apple banana orange
You can then manipulate the array contents to suit your needs.