Counter or Pause function in Perl? 
Author Message
 Counter or Pause function in Perl?

Is there a counter or pause function built into Perl?  I am currently
achieving the pause effect by using

$count = 1;
while (count < 500000) {
$count ++;

Quote:
}

It's kind of a pain to have to keep using this.  I suppose I could build my
own module, but I thought surely there is something like this already
available, I just dont know what it's called.  Also, is there a clr or clear
screen function?

Thanks.



Fri, 17 Nov 2000 03:00:00 GMT  
 Counter or Pause function in Perl?

Quote:

>Is there a counter or pause function built into Perl?  

It's `sleep'.


Fri, 17 Nov 2000 03:00:00 GMT  
 Counter or Pause function in Perl?



Quote:
> Is there a counter or pause function built into Perl?  I am currently
> achieving the pause effect by using

# perldoc -f sleep

And to prevent your next question:

# perldoc perlfaq8
/How can I sleep() or alarm() for under a second?

Martien
--
Martien Verbruggen                  |
Webmaster www.tradingpost.com.au    | That's not a lie, it's a terminological
Commercial Dynamics Pty. Ltd.       | inexactitude.
NSW, Australia                      |



Fri, 17 Nov 2000 03:00:00 GMT  
 Counter or Pause function in Perl?

Martien,

Quote:
> /How can I sleep() or alarm() for under a second?

Take a look at the Perl built-in select(ready file descriptors) for a
higher-resolution sleep function.

-Gary

/---------------------------------------------------------------------------\
| Gary Trachier / U. S. Army Cold Regions Research & Engineering Laboratory |


| Telephone:    voice (603) 646-4303  fax (603) 646-4720                    |
| USnail: (.^.) USA CRREL / 72 Lyme Road / Hanover, NH USA / 03755-1290     |
\--------A--U--A------------------------------------------------------------/



Sat, 18 Nov 2000 03:00:00 GMT  
 Counter or Pause function in Perl?

[Posted and Mailed]



Quote:
> Martien,

>> /How can I sleep() or alarm() for under a second?

> Take a look at the Perl built-in select(ready file descriptors) for a
> higher-resolution sleep function.

Heh, well, thanks, Gary, but that above question was actually a
reference to the perl faq, part 8, where this question is answered.
I was merely trying to avoid the original poster's possible next
question, when he finds out that sleep() has a resolution of a second.

:)

Martien
--
Martien Verbruggen                  |
Webmaster www.tradingpost.com.au    | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd.       | cynical. It's perfectly easy to be
NSW, Australia                      | cynical.



Sat, 18 Nov 2000 03:00:00 GMT  
 Counter or Pause function in Perl?


...

Quote:
>    system clear;   # would be one way to do it

...

        system 'clear'; # would be the way to do it

assuming the 'clear' command is defined and accessible, of course.

--
Larry Rosler
Hewlett-Packard Laboratories



Sat, 18 Nov 2000 03:00:00 GMT  
 Counter or Pause function in Perl?


Date: Mon, 1 Jun 1998 10:56:36 -0700
Subject: Counter or Pause function in Perl?

Quote:
> Is there a counter or pause function built into Perl?  I am currently
> achieving the pause effect by using

> $count = 1;
> while (count < 500000) {
> $count ++;
> }

> It's kind of a pain to have to keep using this.  I suppose I could build my
> own module, but I thought surely there is something like this already
> available, I just dont know what it's called.  Also, is there a clr or clear
> screen function?

For the first item:

        sleep n;        # where n = number of second to sleep

For the second item:

        system clear;   # would be one way to do it

hth. ;-)

--
==============================================================================


==============================================================================
           The time for desperation is upon us.  Let's play.
                  First Wizard Zeddicus Zu'l Zorander
==============================================================================    



Sun, 19 Nov 2000 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Newbie, split function, and counter

2. Pause in perl ???

3. Putting a pause or a delay within a perl program

4. Pause or delay in perl?

5. Perl equivalent to UNIX 'pause' function?

6. PAUSE Status?

7. Image::Size 2.7 Uploaded to PAUSE

8. Image::Size 2.5 uploaded to PAUSE

9. Signing up for PAUSE?

10. Putting a wait/pause into a loop

11. PAUSE down?

12. X11::Fvwm 0.4 uploaded to PAUSE

 

 
Powered by phpBB® Forum Software