On Wed, May 20, 2009 at 05:00:24PM -0400, Chas. Owens wrote:
> On Wed, May 20, 2009 at 16:50, wrote:
> snip
> > for my $i ($client->{count}) {
> snip
>
> The problem is one of precedence, dereferencing with @ takes
> precedence over ->, so Perl sees
>
> for my $i (@{$client}->{count}) {
>
>
On May 20, 2009, at 4:50 PM, pa...@compugenic.com wrote:
I have the following data structure defined:
my @clients = (
{
name=> 'joe',
count => [ qw( one two three ) ]
}
);
Then I try running the following routine:
for my $client (@clients) {
for my $i ($client->{
On Wed May 20 2009 @ 1:50, pa...@compugenic.com wrote:
> I have the following data structure defined:
>
> my @clients = (
> {
> name=> 'joe',
> count => [ qw( one two three ) ]
> }
> );
>
> Then I try running the following routine:
>
> for my $client (@clients) {
>
On Wed, May 20, 2009 at 16:50, wrote:
snip
> for my $i ($client->{count}) {
snip
The problem is one of precedence, dereferencing with @ takes
precedence over ->, so Perl sees
for my $i (@{$client}->{count}) {
The solution is to use @{} to tell Perl what expression to use to
produce the refe