Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re^2: Perl oddities

by merlyn (Sage)
on Mar 01, 2005 at 19:41 UTC ( #435589=note: print w/replies, xml ) Need Help??

in reply to Re: Perl oddities
in thread Perl oddities

Perl doesn't DWIM in:
sleep 2.5;
But see:
use Time::HiRes qw(sleep); ... sleep 2.5;
You can't make core Perl do this, because the number of systems on which this worked was once miniscule compared to the number of systems on which it could never work.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^3: Perl oddities
by Limbic~Region (Chancellor) on Mar 01, 2005 at 19:46 UTC
    You can't make core Perl do this

    To the letter of the law, that's true. In spirit though, select(undef, undef, undef, 2.5); is usually close enough. It would be nice if you didn't have to use something so ugly with core Perl though.

    Cheers - L~R

Re^3: Perl oddities
by Anonymous Monk on Mar 02, 2005 at 13:25 UTC
    You can't make core Perl do this

    Did I say we should change Perl to allow this? No. Do you understand the premises of this thread? brian was asking for what people consider oddities of Perl thinking. Now I'm sure any oddity has its reason for being odd (after all, it's there the way it is because someone put it there, and not because Larry has a piece of radioactive material next to his computer and he's just watching how the rays mutate Perl) - but that's not the point.

    I expect Perl to DWIM (just like it does in many other things), and if on my system select undef, undef, undef, 2.5 waits for about 2500 milliseconds, then there's no reason to assume sleep 2.5 can't.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2020-10-25 16:33 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (249 votes). Check out past polls.