Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: converting strings to ints

by Hue-Bond (Priest)
on Mar 20, 2010 at 16:35 UTC ( #829822=note: print w/ replies, xml ) Need Help??


in reply to Re: converting strings to ints
in thread converting strings to ints

If you know you are going to be trying to treat null strings as numbers, turn it off:

Then perlcritic will complain:

Warnings disabled at line 10, column 5.  See page 431 of PBP.  (Severity: 4)

Solution 1 (ugly): no warnings 'numeric';  ## no critic (TestingAndDebugging::ProhibitNoWarnings)

Solucion 2 (dangerous): add the following to ~/.perlcriticrc:

[TestingAndDebugging::ProhibitNoWarnings] allow = numeric

--
 David Serrano
 (Please treat my english text just like Perl code, i.e. feel free to notify me of any syntax, grammar, style and/or spelling error. Thank you!).


Comment on Re^2: converting strings to ints
Select or Download Code
Re^3: converting strings to ints
by BrowserUk (Pope) on Mar 20, 2010 at 17:20 UTC
    Then perlcritic will complain:

    Quite frankly my dear, I don't give a damn! :)

    And if you're going to allow a piece of dumb software to override your own judgement, then I've got a link that will tell you your computer is riddled with virii and trojans and will only charge you $49.99 to rid you of them.

    As configured by default, it shouldn't be called perlcritic but perlblatentalarmist.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      As configured by default, it shouldn't be called perlcritic but perlblatentalarmist.

      Yes, I fully agree with that. Thankfully, it can be configured!

      --
       David Serrano
       (Please treat my english text just like Perl code, i.e. feel free to notify me of any syntax, grammar, style and/or spelling error. Thank you!).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2014-12-20 02:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls