Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Subroutine does not sleep

by monkey_boy (Priest)
on Oct 06, 2006 at 14:29 UTC ( #576681=note: print w/ replies, xml ) Need Help??


in reply to Subroutine does not sleep

change

sub wait{ my $time =@_; sleep $time; }

to
sub wait{ my ($time) =@_; sleep $time; }

As in this scalar context $time is being set to the size of @_ (i.e. 1) instead of the value.


This is not a Signature...


Comment on Re: Subroutine does not sleep
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://576681]
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: (7)
As of 2016-02-07 18:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (257 votes), past polls