my $start = q{ }; my $end = q{}; my @list; { local $\ = ""; # file slurping mode my $filecontents = <>; # take in the whole file @list = ($filecontents =~ /$start(.*?)$end/sg); } print "\n\n\nDOODAH: @list\n";