in reply to Re^2: Vertical Regex
in thread Vertical Regex

my ($frg) = @ARGV; $frgfile = "$frg"; open(frgfile) or die("Unable to open FRG file");

That's very confusing form. It's a good practice to always start your scripts with

use strict; use warnings;
this may help you to avoid many problems. In this case you would see some warnings. I'd write this as follows:
open my $fd, '<', $ARGV[0] or die $!; while (<$fd>) { ...
Note how you can store filehandle in scalar variable.