Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: How can one determine context within FETCH?

by Sidhekin (Priest)
on Oct 01, 2007 at 13:15 UTC ( #641877=note: print w/replies, xml ) Need Help??


in reply to How can one determine context within FETCH?

You can probably use overload to overload the use of your objects(!) as arrayrefs and hashrefs. See the cookbook section on "Two-face references" for an example.

However, your (whole) array context will need to look like this:

@names = @{$root->{'var'}->{'spool'}}; # List of files/dirs

(Which to my mind is a plus; having a hash element lookup return a list is at best just too surprising and at worst downright abuse of syntax. YMMV.)

print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://641877]
help
Chatterbox?
[AnomalousMonk]: LanX: I should have written "vessel". Rama was (is? - I'm still hoping) no asteroid.
[erix]: itym vehicle (vessel is for water-vehicles)
[erix]: then again you may be a native speaker and I'd do better to shut up :)
[AnomalousMonk]: erix: s/vessel/vehicle/

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (13)
As of 2017-11-22 17:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (327 votes). Check out past polls.

    Notices?