Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: how to always round up in perl? (selective import)

by toolic (Bishop)
on Feb 25, 2011 at 14:25 UTC ( #890174=note: print w/ replies, xml ) Need Help??


in reply to Re: how to always round up in perl?
in thread how to always round up in perl?

if you do not want to import a mass of functions into your namespace from the POSIX module
... just do this:
use warnings; use strict; use POSIX qw(ceil); for (3.3, 3.6, 3003.3) { print $_, "\t", ceil($_), "\n"; } __END__ 3.3 4 3.6 4 3003.3 3004
According to How to Import, this selectively imports only the ceil function.

Alternately, you could import nothing and call the function using POSIX::ceil.


Comment on Re^2: how to always round up in perl? (selective import)
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (17)
As of 2015-07-02 17:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (44 votes), past polls