use warnings;
use strict;
my $hash_name;
while (<DATA>) {
if (/%(\S*).+?=\s*\(/) {
$hash_name = $1;
}
}
print $hash_name;
__DATA__
my %address = (
or any such similar line in which i have defined the hash.
I want to find the character "(" in the line and store "address" in say $hash_name. How do I do it?
Basic idea is to capture the name of the hash defined in the files.
I am trying to do is,
foreach $line <MYFILE> {
if($line =~ /($/ {