bdawg613 has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: mod function
by cLive ;-) (Prior) on Nov 11, 2002 at 19:11 UTC
    Which takes more effort:
    • Posting this question to Perlmonks?
    • Trying the damn code to see if it works?
    ffs!

    cLive ;-)

Re: mod function
by BrowserUk (Patriarch) on Nov 11, 2002 at 19:01 UTC

    That is the mod function. Or at least the mod operator. What problems are you having?


    Nah! You're thinking of Simon Templar, originally played (on UKTV) by Roger Moore and later by Ian Ogilvy
Re: mod function
by tachyon (Chancellor) on Nov 11, 2002 at 19:40 UTC
    $y % 3 == 0 && do { } $y % 3 || do { } do { } if $y % 3 == 0 do { } unless $y % 3

    Or of course you could just drop the do: and use the code you posted!!!

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

      Don't forget...

      unless ($y % 3) { }

      I think that, for the most part, I prefer the explicitness of if ($y % 3 == 0) { } though.

      -sauoq
      "My two cents aren't worth a dime.";
      
        I'm curious (genuinely curious, not picking a fight) as to why if (...) is more explicit than unless (...)? Is it because if is more ubiquitous?
Re: mod function
by pg (Canon) on Nov 11, 2002 at 19:20 UTC
    ;-), obviously you did the right thing... See, it is the same as in other languages. A tiny suggestion, you also can say things like:
    if (!($y % 3)) { }