Do you really want to just silence the warning? Are you sure it does what you want?

I can see plenty of true cases which are not covered by the || 0 part to return 0 on false ...

DB<6> $rx->{"ping_$i"} = "abc" DB<7> p delete $rx->{"ping_$i"} || 0 abc # not numeric DB<8> p "" || 0 0 # was false DB<9> p undef || 0 0 # was false DB<10> p " " || 0 # " " is true DB<11> p "abc" || 0 abc DB<12> p int "abc" 0 # not numeric evaluates t +o 0 tho in numeric context DB<13> p int "7abc" 7 # beware that leading cip +hers are accepted tho DB<14> use warnings; say int "7abc" Argument "7abc" isn't numeric in int at ... # but will thro a warning + too ... DB<15> p int "" # the || 0 part is redund +ant in all false cases 0 DB<16> p int " " # sic 0 DB<17> p int undef # sic 0 DB<18>

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery


In reply to Re: Argument spamming terminal by LanX
in thread Argument spamming terminal by CougarXR7

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.