How about:
use strict;
use warnings;
foreach my $i(1..10){$i="0" . $i if length($i)==1;print "$i\n";}
-----Original Message-----
From: lina [mailto:[email protected]]
Sent: Monday, June 11, 2012 8:49 AM
To: [email protected]
Subject: how to get a sequence of 01 02 ..
Hi,
$ for i in `seq -f '%02g' 1 10` ; do echo $i ; done
01
02
03
04
05
06
07
08
09
10
I wonder how can I get something like above in the perl.
Thanks ahead for your suggestions,
Best regards,
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/