Richard Lee wrote:
say I have @data which below was pushed(bunch of them) with below hash
of hash refernce
$VAR1 = {
'element' => {
'element2' => 'now',
'element3' => '2',
'element4' => 'serverxxx',
}
};
and then I would call sub do_it like
do_it(somevalue, $data)
sub do_it {
my $something = shift;
for (@_) {
foreach my $XX ( keys %_ ) {
if ( exists ( $XX->{ element }{ element2 } ) && $XX->{ element
}{ element4} eq "$something" ) {
for my $key ( keys %{ $XX{ element } } ) { <------ Global
symbol "%XX" requires explicit package name <--------------------?????
print "$key\n";
print "$XX and $XX{ element}{$key}\n";
}
}
}
}
why does it not like XX in above line ??
The above mix of English and Perl is confusing, and it's difficult to
guess what you are trying to accomplish. You can't just introduce
variables such as $data and %_, without showing how they were populated,
and expect others to follow your line of thinking.
Please post a _complete_ program that we can copy and run, and that
illustrates the issue you want help to resolve.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/