develooper Front page | perl.beginners | Postings from November 2002

how do i make a script run for a certain period of time?

Thread Next
From:
Juban, Nix
Date:
November 26, 2002 19:53
Subject:
how do i make a script run for a certain period of time?
Message ID:
9D59DE8695E6D5118E2700508BEEFA380401A8A0@cvsmsx101.icv.intel.com
i want to insert this script in one of my programs appearing like its
processing or doing something..since my loop is while(1), meaning always
true, it will run forever until i halt it.  
1)How do I time it to run for only few seconds?
2) What if im really processing something like extracting data through ftp
and parsing it, how do i run this while its doing all that?

Need help. thanks

#!/usr/bin/perl -w
  use strict;

  my @e=qw(|  \  -  /);
  while (1)
  {   foreach (@e)    {   print $_."\b";   }  }


-----Original Message-----
From: Juban, Nix [mailto:nix.juban@intel.com]
Sent: Wednesday, November 27, 2002 11:47 AM
To: 'Andres L. Figari'
Cc: beginners@perl.org
Subject: RE: My script doesn't print out the output i like


thanks, its now working..

lesson learned: to identify the items inside the list, have to separate it
using a space.

-nix

-----Original Message-----
From: Andres L. Figari [mailto:andres@photoplankton.com]
Sent: Wednesday, November 27, 2002 11:43 AM
To: Juban, Nix
Cc: beginners@perl.org
Subject: Re: My script doesnt print out the output i like


#!/usr/bin/perl -w
  use strict;

  my @e=qw(| \ - /);
  while (1)
  {
   foreach (@e)
   {
   print $_."\b";
   }
  }


you needed a space between each character or it thought it was one word :)

----- Original Message -----
From: "Juban, Nix" <nix.juban@intel.com>
To: "'Andres L. Figari'" <andres@photoplankton.com>; "Juban, Nix"
<nix.juban@intel.com>
Cc: <beginners@perl.org>
Sent: Tuesday, November 26, 2002 7:33 PM
Subject: RE: My script doesnt print out the output i like


> Nope, it didnt work but thanks for responding.
>
> it cancelled the \b, now it prints it.
>
>
\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\
> _/\b
>
|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/
> \b|\
>
_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b
> |\_/
>
\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\
> _/\b
>
|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/
> \b|\
>
_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b
> |\_/
>
\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\
> _/\b
>
|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/
> \b|\
>
_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b
> |\_/
>
\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\
> _/\b
>
> -----Original Message-----
> From: Andres L. Figari [mailto:andres@photoplankton.com]
> Sent: Wednesday, November 27, 2002 11:25 AM
> To: Juban, Nix
> Cc: beginners@perl.org
> Subject: Re: My script doesnt print out the output i like
>
>
> BlankI think that when you print "\" it thinks it is an escape character,
so
> you would need "\\"  check these  out, I always have to look them up :)
>   ----- Original Message -----
>   From: Juban, Nix
>   To: 'beginners@perl.org'
>   Sent: Tuesday, November 26, 2002 7:19 PM
>   Subject: My script doesnt print out the output i like
>
>
>   Hi!
>
>   Im just new to PERL and im trying this out...its suppose to make this
line
> tumble like a cartwheel.
>
>   ##!/usr/intel/bin/perl -w
>   use strict;
>   use warnings;
>
>   my @e=qw(|\_/);
>   while (1)
>   {
>    foreach (@e)
>    {
>    print $_."\b";
>    }
>   }
>
>   its just printing, something like this:
>
>   _|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|
>   |\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\
>   _|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|
>   |\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\
>   _|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|
>   |\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\
>   _|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|
>   |\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\_|\
>
>   need help !
>
>   cheers ,
>   nix juban
>   Northwood-V Product Development Engineer
>   PG12 Tel. # 8-859-2354 (INET)
>   nix.juban@intel.com
>
>
> --------------------------------------------------------------------------
--
> --
>
>
>   --
>   To unsubscribe, e-mail: beginners-unsubscribe@perl.org
>   For additional commands, e-mail: beginners-help@perl.org
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
>

-- 
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About