From: mmccaws2 on
I can't quite recall the printing term so please bear with me. When
you want your user to know that something is happening the app often
will print to the screen saying something like "load ...". I want to
create the same sort of script that produce a "." or similar symbol
for each fraction of second that goes by. If I knew the 'key' words
I'd search for it.

thanks

Mike
From: A. Sinan Unur on
mmccaws2 <mmccaws(a)comcast.net> wrote in
news:77a33807-b21d-4cd4-818f-23d53a67bbd5@
2g2000hsn.googlegroups.com:

> I can't quite recall the printing term so please bear with me.
> When you want your user to know that something is happening the
> app often will print to the screen saying something like "load
> ...". I want to create the same sort of script that produce a "."
> or similar symbol for each fraction of second that goes by.

Why? Does your user not have a watch or something?

> If I knew the 'key' words I'd search for it.

I would be much more interested in knowing how much 'progress' is
being made.

For example, I once wrote a script to generate 1536 png files after
some data processing. It ran in about 20 minutes.

### pseudo code

{
my $progress = 0;
while ( $datasets->next ) {
# process data set
++ $progress;
print STDERR '.' unless $progress % 100;
}
}

###

so that a dot was printed every time 100 data sets were completed.

In this throaway script, I used STDERR because STDOUT actually had
other important output going to it.

Sinan

--
A. Sinan Unur <1usa(a)llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
From: Ben Morrow on

Quoth mmccaws2 <mmccaws(a)comcast.net>:
> I can't quite recall the printing term so please bear with me. When
> you want your user to know that something is happening the app often
> will print to the screen saying something like "load ...". I want to
> create the same sort of script that produce a "." or similar symbol
> for each fraction of second that goes by. If I knew the 'key' words
> I'd search for it.

print? Which part of the program are you having a problem with?
Something like

use Time::HiRes qw/sleep/;

$| = 1;

print 'loading';

for (1..100) {
sleep 0.1;
print '.';
}

print "\n";

works, but presumably you don't *just* want to mark the passage of time.

Ben

From: mmccaws2 on
On Apr 17, 8:02 am, Ben Morrow <b...(a)morrow.me.uk> wrote:
> Quoth mmccaws2 <mmcc...(a)comcast.net>:
>
> > I can't quite recall the printing term so please bear with me.   When
> > you want your user to know that something is happening the app often
> > will print to the screen saying something like "load ...".  I want to
> > create the same sort of script that produce a "." or similar symbol
> > for each fraction of second that goes by.  If I knew the 'key' words
> > I'd search for it.
>
> print? Which part of the program are you having a problem with?
> Something like
>
>     use Time::HiRes qw/sleep/;
>
>     $| = 1;
>
>     print 'loading';
>
>     for (1..100) {
>         sleep 0.1;
>         print '.';
>     }
>
>     print "\n";
>
> works, but presumably you don't *just* want to mark the passage of time.
>
> Ben

Your code is almost exactly what I had. But what is the "$| = 1;"
for?

Mike
From: J�rgen Exner on
mmccaws2 <mmccaws(a)comcast.net> wrote:
>Your code is almost exactly what I had. But what is the "$| = 1;"
>for?

See "perldoc perlvar"

jue