Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Desperatly seeking the wisdom of the Monks

by Albannach (Monsignor)
on Oct 26, 2001 at 20:11 UTC ( [id://121657]=note: print w/replies, xml ) Need Help??


in reply to Problem with while loop

Not Hopeless, but definitely "needs work". For starters, you will want to use strict; and use warnings; (or -w depending on the age of your Perl). This and some careful thinking of where you use your variables (and where you don't) should go a long way to clearing up your confusion.

A quick look did reveal that you never assign to $idx1 so that part of your last loop probably isn't doing what you think it is. That loop also refers to $replica which is the loop variable from the previous foreach and also not likely what you want as it will always just be the last element in @replicas. You also use $rephash(stuff) in that loop when you need to use {} as you have declared it as a hash. Again, you need to step back a bit and figure out just what you are doing with all these variables.

There are lots of other things that could be done to make this more Perlish, but you need to get your logic straight first.

--
I'd like to be able to assign to an luser

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-25 13:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found