Re: print on the same line

2009-01-04 Thread Chas. Owens
On Sun, Jan 4, 2009 at 23:11, Eric Krause wrote: snip > Thank you for the reply, but I tried \b and that was one of the escape > characters activeState perl has trouble with. snip What version of ActivePerl are you using? I just tested this code against build 1004 (Perl 5.10) on WinXP SP3 and it

Re: print on the same line

2009-01-04 Thread Chas. Owens
On Sun, Jan 4, 2009 at 22:36, Mr. Shawn H. Corey wrote: snip > my $Backup_Count = 0; > > sub back_and_print { > my $text = shift @_; # no tabs, no newlines! > > print "\b" x $Backup_Count; > print " " x $Backup_Count; > print "\b" x $Backup_Count; > $Backup_Count = length $text; > print $te

Re: print on the same line

2009-01-04 Thread Eric Krause
Mr. Shawn H. Corey wrote: On Sun, 2009-01-04 at 19:33 -0700, bft wrote: Hello all, I am on a windows box and I am trying to have a count down timer print out the seconds remaining without new lining it. i.e. I do not want a screen that looks like this... 19 seconds remaining 18 seconds r

Re: print on the same line

2009-01-04 Thread Mr. Shawn H. Corey
On Sun, 2009-01-04 at 19:33 -0700, bft wrote: > Hello all, > I am on a windows box and I am trying to have a count down timer print > out the seconds remaining without new lining it. i.e. I do not want a > screen that looks like this... > > > 19 seconds remaining > 18 seconds remaining > 17 ...

print on the same line

2009-01-04 Thread bft
Hello all, I am on a windows box and I am trying to have a count down timer print out the seconds remaining without new lining it. i.e. I do not want a screen that looks like this... 19 seconds remaining 18 seconds remaining 17 ... I would like it to print all on the same line. And I cannot

Re: inverting List::Compare

2009-01-04 Thread John W. Krahn
John Refior wrote: Rob Dixon wrote: David Newman wrote: # get files open(DAT, $lfile) or die("unable to open"); my @Llist = ; close(DAT); You should include the $! variable in the die string so that you know why the open failed. I suggest my @llist; { open my $fh, '<', $lfile or d

Re: Was re: inverting List::Compare

2009-01-04 Thread Jay Savage
On Sun, Jan 4, 2009 at 11:45 AM, Bob goolsby wrote: > Not 'wrong headed', just a compiler compiler optimization. By putting > the declarations before the usage, you reduced the number of complete > passes through the source by one and made the parsing code easier. > This is an artifact from the t

Re: inverting List::Compare

2009-01-04 Thread John Refior
>> # get files >> open(DAT, $lfile) or die("unable to open"); >> >> my @Llist = ; >> >> close(DAT); > > You should include the $! variable in the die string so that you know why the > open failed. I suggest > > my @llist; > { >open my $fh, '<', $lfile or die "Unable to open '$lfile': $!"; >

Re: Was re: inverting List::Compare

2009-01-04 Thread Bob goolsby
Not 'wrong headed', just a compiler compiler optimization. By putting the declarations before the usage, you reduced the number of complete passes through the source by one and made the parsing code easier. This is an artifact from the time when Machine-Time was expensive and Programmer-Time was (

Was re: inverting List::Compare

2009-01-04 Thread Telemachus
On Sat Jan 03 2009 @ 11:00, John W. Krahn wrote: >>> David Newman wrote: >> I always found it "cleaner", and have heard others say it's preferable, >> to declare all variables at the top of the program (although admittedly >> I didn't do that even in this short script). > > It is always better to l