problems with "for" loop in perl

newbie_10's Avatar
Light Poster
if ($string =~ /(.*?)u(.*)/s)
{

my $pre = $1;
my $post = $2;

for my $index(0..4)
{
print "$pre$index$post\n";
push(@register_list, "$pre$index$post");
}

}

is there a way to make it print like 0,1,2,3,4 and not just 1,2,3,4??
0
Scripting's Avatar, Join Date: Jun 2010
John Hoder
Try to change 0 with -1. But Im not 100% suree.
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
Code:
[pradeep@dev tmp]# perl -e ' for my $i(0..4) { print "$i\n"; }'
0
1
2
3
4