# #!/usr/bin/perl; use strict; use warnings; my $hashfile = 'dumpparse.txt'; unless ( open(DUMPPARSE, $hashfile) ) { print "Could not open file $hashfile!\n"; exit; } my @hashfile = ; foreach my $line (@hashfile){ if ($line = ~s/ $VAR1/ my %hash /) } # Close the file. close DUMPPARSE; exit;