On Sat, Apr 19, 2008 at 1:57 PM, Rob Dixon <[EMAIL PROTECTED]> wrote:
> Chas. Owens wrote:
>  > On Sat, Apr 19, 2008 at 1:03 PM, Rob Dixon <[EMAIL PROTECTED]> wrote:
>  > snip
>  >>  foreach my $i (1 .. 9999) {
>  >>   my $zfill = substr("0000$i", -4);
>  >>   my $longer = "dbt${zfill}dsfg";
>  >>   print $longer, "\n";
>  >>  }
>  >>
>  >>  Rob
>  > snip
>  >
>  > TIMTOWTDI fight!
>  >
>  > for my $i (1 .. 9999) {
>  >     my $longer = "0" x (4 - length $i) . $i;
>  >    print "$longer\n";
>  > }
>
>  You're on!
>
>
>  foreach my $i (1 .. 9999) {
>   (my $longer = $i + 10000) =~ s/1(....)$/dbt$1dsfg/;
>   print $longer, "\n";
>  }
>

#!/usr/bin/perl

use strict;
use warnings;

for my $i (1, 10, 100, 1000) {
        chop(my $longer = reverse(10000 + $i));
        print scalar reverse($longer), "\n";
}

-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to