Perl Home
PERL Functions
© 2011 TutorialsPoint.COM
|
PERL sleep Function
Syntax
Definition and Usage
Pauses the script for EXPR seconds, or forever if EXPR is not specified. Returns the number of seconds actually slept. Can be interrupted by a signal handler, but you should avoid using sleep with alarm, since many systems use alarm for the sleep implementation.
Return Value
Example
Try out following example: You will understand the functionality of sleep.
#!/usr/bin/perl
$num = 5;
while($num--){
sleep(1);
}
|
|

|
|
|