> > 
> > --- Wiggins d Anconia <[EMAIL PROTECTED]> wrote:
> > [snip]
> > [snip]
> > > In the above line, as the error suggests 'keys' must take a hash
as its
> > > argument, $printers{jobs} is a scalar, so essentially you need to
> > > dereference its value back into a hash, ending up with,
> > > 
> > > foreach my $keys (keys %{ $printers{jobs} }) {
> > [snip]
> > 
> > Was that! Every time a hash reference is returned i need to derefence!
> Oh! god! 
> > Is this kind of reference like the C pointer, or something like this?
> > 
> 
> You only have to dereference if you are trying to do something to the
> structure in aggregate, aka you have to supply a hash, such as is the
> case for 'keys', 'values', and 'each'.  If you want to access a single
> value from the nested hash, you can access it directly using the little
> arrow syntax,
> 
> $printers->{jobs}->{4};

Dammit, $printers is not a hash reference, so the above will not work
(boy everyone can see how I normally do it ;-)), for your example that
should read,

$printers{jobs}->{4};

Which going back to your post, I see you already had. Sorry for the noise,

http://danconia.org


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to