NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
array (Score:0)
Re: (Score:2)
You're right. I'm getting keys, not values. I should pay more attention to detail. :)
So what about the debugger is making it ignore the first part in braces, I wonder.
J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
My way of rembering it... (Score:1)
This might not help, but I remember hash slices as follows. First really it's just a hash:
Second we do our lookup:
Slices return lists, so we need an @ sign instead of the %:
Which gives us:
You can go the other di
Parsed as blocks (Score:1)
The expression you're supplying to the debugger is being parsed as a block:
tony@zeus:~$ perl -MO=Deparse -e '{%$r}{@f}'{
%$r;
}
{
@f;
}
-e syntax OK
eval()ling the same expression gives the result you saw in the debugger:
tony@zeus:~$ perl -e '$r = { this => "that", these => 17 }; @f = qw(this these); @foo = eval q"{%$r}{@f}"; use Data::Dumper; print Dumper \@foo'
$VAR1 = [
'this',
Re: (Score:2)
Ah! Thank you for the explanation!
J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers