in reply to quick "open->close" file

Lazy solution causing the whole file to be slurped up front:
my @match = do { open my $fh, '<', $file or die "$!"; grep /^$ARGV[0]\|/, <$fh>; };
If your file is large, it takes more effort.
my @match; { open my $fh, '<', $file or die "$!"; local $_; my $rx = qr/^$ARGV[0]\|/ m/$rx/ && push @match, $_ while <$fh>; }
If I need the latter more than once, I'd probably factor it out:
sub grep_file { my ($rx, $file) = @_; my @match; local $_; open my $fh, '<', $file or die "$!"; my $rx = qr/^$rx\|/ m/$rx/ && push @match, $_ while <$fh>; @match; }; my @match = grep_file($ARGV[0], $file);

Makeshifts last the longest.