TheGenius22
MIS
Hello All,
Hope your enjoying your day so far.
It's a really simple question.
For the FOR loop, I would like for it to count backwards.
EX:
for (1 .. 5)
{
print "$_\n";
}
it prints
1
2
3
4
5
I would like for it to print this way
5
4
3
2
1
I already have a work around by inserting an extra variable.
But I would like to know if the loop itslef can count backwards.
Something like :
reverse(for( 1.. 5))
{
print "$_\n";
}
Thanks,
Hope your enjoying your day so far.
It's a really simple question.
For the FOR loop, I would like for it to count backwards.
EX:
for (1 .. 5)
{
print "$_\n";
}
it prints
1
2
3
4
5
I would like for it to print this way
5
4
3
2
1
I already have a work around by inserting an extra variable.
But I would like to know if the loop itslef can count backwards.
Something like :
reverse(for( 1.. 5))
{
print "$_\n";
}
Thanks,