Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^4: Creating Multidimensional Hashed Arrays?

by spickles (Scribe)
on Aug 28, 2009 at 02:48 UTC ( [id://791813]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Creating Multidimensional Hashed Arrays?
in thread Creating Multidimensional Hashed Arrays?

toolic -

You nailed it. I was reading the perl doc you linked for a couple of hours before posting, so I was on the right track. But decoding all of those parenthesis, brackets, commas, etc. can get confusing quickly. So now my question would be how to add a new vlan?

  • Comment on Re^4: Creating Multidimensional Hashed Arrays?

Replies are listed 'Best First'.
Re^5: Creating Multidimensional Hashed Arrays?
by Anonymous Monk on Aug 28, 2009 at 03:25 UTC
    to add a new vlan assuming vlan number is unique
    unless (exists $vlan_nums{$new_num}){ $vlan_nums{$new_num}{name} = xyz; .... }
    If update is needed for the existing number you can add an else loop

      The following code, taken from here, worked for me!

      # Either build your data as a hashref my $hashref = { username => someusername, etc => ..., }; # or assign a reference to a hash my %data = (username => someusername, etc => ...); my $hashref = \%data; # Then pass it off my $valid = verify($hashref); # You can also pass like so my $valid = verify(\%data); # Then, in your verify sub: sub verify { my $ref = shift; # do something with your data $ref->{'username'} =~ /yourregex/; return $something; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2025-06-16 02:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.