$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
, 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
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
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.
; [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
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
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 =