RE: Formatting Numbers (was RE: reverse of substr?)

2002-04-17 Thread Alistair . McGlinchy
$Bill et al, Actually the results posted are probably wrong. I ran it and got results that were similar for CPU, but the N results were opposite - sprintf being lower. The CPU and N should correlate. The sprintf also has a missing conversion character after the

RE: reverse of substr?

2002-04-16 Thread Wang, Pin-Chieh
, 2002 9:53 AM To: Wang, Pin-Chieh; [EMAIL PROTECTED] Subject: RE: reverse of substr? Hi, Is there a good way to copy a sub-string into a fixed position of a longer string, kind like reverse of substr Yes indeed, and Perl does it really nicely too, using substr, but this time

RE: reverse of substr?

2002-04-16 Thread Matthew Musgrove
Now, Is there a way to move interger value (2 digit or 10 digit or some where in between) into a fixed string location (say 15th position) and the interger is right justified. Here's a simple example: -- #!/usr/bin/perl -w use strict; my $string=some text here 00 and

RE: reverse of substr?

2002-04-16 Thread Matthew Musgrove
Heh, found a mistake that was left from an earlier version I was messing with... my $string=some text here 00 and some more here; # the zeros start at 25 Ignore the comment ;) Of course, it could also be done like this: -- #!/usr/bin/perl -w use strict; my $string=some text.

RE: reverse of substr?

2002-04-16 Thread Wagner-David
; [EMAIL PROTECTED] Subject: RE: reverse of substr? Now, Is there a way to move interger value (2 digit or 10 digit or some where in between) into a fixed string location (say 15th position) and the interger is right justified. Here's a simple example: -- #!/usr/bin/perl -w use

RE: reverse of substr?

2002-04-16 Thread Alistair . McGlinchy
PROTECTED] Subject: RE: reverse of substr? Now, Is there a way to move interger value (2 digit or 10 digit or some where in between) into a fixed string location (say 15th position) and the interger is right justified. Here's a simple example: -- #!/usr/bin/perl

RE: reverse of substr?

2002-04-16 Thread Thomas_M
Matthew Musgrove [mailto:[EMAIL PROTECTED]] wrote: #!/usr/bin/perl -w use strict; my $string=some text. and some more here; my @integers = (1, 12, 123, 1234, 12345, 123456, 1234567, 12345678, 123456789, 1234567890); foreach my $integer (@integers) { my $len =