Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^5: Simplify code in Perl with "unless" conditionnal

by Corion (Patriarch)
on May 30, 2016 at 11:18 UTC ( [id://1164491]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Simplify code in Perl with "unless" conditionnal
in thread Simplify code in Perl with "unless" condition

The code you show above does not work stand-alone.

Please remove all parts that are not relevant to the problem at hand.

If your problem is to rearrange the elements of @browsers in a random fashion, write a program that shows the array before being shuffled, shuffle it and then show the array after having been shuffled.

The next step is then to inspect whether the array is getting shuffled as you want it.

The next step after you are certain that the shuffling in itself works is to apply the new shuffled values to your code.

Have you verified that you are using the shuffled elements? For debugging, printing all values at every step is often helpful to show the values as your program progresses through the program.

Replies are listed 'Best First'.
Re^6: Simplify code in Perl with "unless" conditionnal
by Chaoui05 (Scribe) on May 30, 2016 at 13:13 UTC
    You said "If your problem is to rearrange the elements of @browsers in a random fashion, write a program that shows the array before being shuffled, shuffle it and then show the array after having been shuffled." . Not exactly. I don't want to rearrange the elements , but take them randomly for each comparison i have to do. As i said above. Thanks for debug idea.
    Lost in translation

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-24 15:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found