On 12-06-11 11:04 AM, lina wrote:
#!/usr/bin/env perl
use strict;
use warnings;
use autodie qw(open close);
use Carp qw(croak);
use 5.012;
my $tra=7;
my @files=("01".."40");
foreach(@files){
$tra=process_onefile("replica_index_$_.xvg");
}
sub process_onefile{
my $b
On Mon, Jun 11, 2012 at 10:42 PM, Brian Fraser wrote:
> On Mon, Jun 11, 2012 at 10:49 AM, lina wrote:
>>
>> 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.
On Mon, Jun 11, 2012 at 10:49 AM, lina wrote:
> 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.
>
>
for my $i ("01".."10") {
say $i;
}
Hi,
On Mon, 11 Jun 2012 07:10:07 -0700
"Ron Bergin" wrote:
> >lina wrote:
> > 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.
> >
> perl -e
>lina wrote:
> 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.
>
perl -e "for (1..10){printf(qq(%02d\n), $_)}"
Ron
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.
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:lina.lastn...@gmail.com]
Sent: Monday, June 11, 2012 8:49 AM
To: beginners@perl.org
Subject: how to get a sequence of 01 02 ..
Hi,
$ for i in `s