sub Grab($filename){ open (file1, "<$filename") or goto cont2; while (){ my($line) = $_; my ($exp) = $line =~ m/ kepler_ # Required (.+?) # Capture Desired Output (:?\s\(|\(|\s+) # One required - no capture /xi; $expr = "kepler_".$1; if(@Functions =~ /$expr/gi){goto cont1;} if($1 =~ ""){goto cont1;} $n += 1; print $expr."\n"; $value1 = "Exp_".$n; $key1 = $expr; $functions{ $key1 } = $value1; # hash, using variables cont1: } cont2: close file1; } #END GRAB