Hi all,
I've a hash that contains some regex strings as keys and some numbers as their
values. The value for each keys will primarily be used to identify which part
to print for that particular rx. eg:- for the first rx string, ${$rx{$string1}}
(eg: $2) and for the second, $1 etc. And I want to store the matched string to
a variable like:
my $c = ${$rx{$string1}}; #$c should store the value of $2
I can get the desired result if I don't use strict refs. However, with strict
refs, I'm getting the following error:
Can't use string ("3") as a SCALAR ref while "strict refs" in use at test.pl
I tried to overcome this issue using scalar(), but didn't help. Could someone
please let me know what is the workaround here. Thank you!
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to be a genius to
understand the simplicity - Dennie Richie
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/