What do you mean by "it seems to not work"?

You can help us improve the quality of the answers we're giving by answering the following questions directly in your first post:

What is the exact code you are running? Please show the exact code. This code should be self-sufficient and be shorter than 20 lines.

What is the exact input you are giving? Please show the exact input you are giving to the above program.

What is the output you expect? Please describe the output you expect.

What is the exact output you get? Please show the exact output together with the complete error message(s) that Perl returns you.

Why are you using List::Util? Have you read perlfaq or run perldoc -q random ? This will show you the many frequently asked questions (and their answers) pertaining to getting a random element of an array.


In reply to Re^3: Simplify code in Perl with "unless" conditionnal by Corion
in thread Simplify code in Perl with "unless" condition by Chaoui05

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.