in reply to Re^3: Need sleep walking help
in thread Need sleep walking help
This should work fine...
I would not use "Sleep" as the subroutine name. Lower case "sleep" is the library's function name. This kind of upper vs lower case thing can lead to big and confusing troubles! I used "mysleep" instead of "Sleep".#!/usr/bin/perl use strict; use warnings; $|=1; # turns off stdout buffering mysleep(10); sub mysleep { my $seconds = shift; print "Sleeping for $seconds seconds ... "; for my $second (1..$seconds) { sleep(1); print " $second"; } print " done!\n"; }
PS: Something is very odd about your <code>...</code> tags. Do not enclose the <code>...</code> tags inside of something else.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Need sleep walking help
by Anonymous Monk on Feb 02, 2017 at 07:23 UTC | |
by haukex (Archbishop) on Feb 02, 2017 at 08:50 UTC | |
by Marshall (Canon) on Feb 02, 2017 at 08:47 UTC | |
by haukex (Archbishop) on Feb 02, 2017 at 08:59 UTC | |
by Marshall (Canon) on Feb 02, 2017 at 09:14 UTC | |
by haukex (Archbishop) on Feb 02, 2017 at 09:22 UTC | |
|