Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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


In reply to Re: Desperatly seeking the wisdom of the Monks by Albannach
in thread Problem with while loop by Hopeless

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2022-12-09 11:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?