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

Re: What way to weigh an AoA?

by Zaxo (Archbishop)
on May 17, 2006 at 00:43 UTC ( [id://549925]=note: print w/replies, xml ) Need Help??


in reply to What way to weigh an AoA?

I think use warnings; and use strict; would go a long way toward solving this for you. You call your arrayref $user sometimes, and some of those may be in the code.

The last index of $users will be in $#$users, not $$#users. Observe,

$ perl -Mstrict -we'my $foo = ["a".."z"];print $#$foo,$/' 25 $ perl -Mstrict -we'my $foo = ["a".."z"];print $$#foo,$/' 14354 $
I'm not entirely sure what $$#users represents, but that explains your extra array elements.

I'm leery of your hash keyed to surname. When you insert Minnie, Mickey will get clobbered.

After Compline,
Zaxo

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2024-04-18 15:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found