Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^5: Symbolic references

by Anonymous Monk
on Apr 15, 2013 at 07:05 UTC ( #1028689=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Symbolic references
in thread Symbolic references

got it! phew!

foreach $argnum (0..$#ARGV){ $node=$ret; print "$ARGV[$argnum]\n"; @path=split /\//,$ARGV[$argnum]; print Dumper @path; #debugging helps! $node=$node->{$_} for @path; print $node; } print "\n"; }
Thanks!


Comment on Re^5: Symbolic references
Download Code
Re^6: Symbolic references
by LanX (Canon) on Apr 15, 2013 at 13:16 UTC
    Just a minor note: your way to iterate thru different arguments by index is rather cumbersome

    just do

    ~$ perl -E 'foreach $arg (@ARGV) { say split /\//,$arg }' 1/2 a/b/c 12 abc

    And plz consider using strict and warnings!

    Cheers Rolf

    ( addicted to the Perl Programming Language)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1028689]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2014-07-23 02:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (131 votes), past polls