[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] code reduction



I guess I should post this too. This is the little demo I wrote myself
to prove it worked.  :)

j


$ cat j.pl

my $apply_this_card_to_all = "new";

my $before = <<EOT;
...xxx...
...xxx...
...xxx...
EOT

my $after = $before;
$after =~ s/(.{3}).{3}(.*?\n)/$1$apply_this_card_to_all$2/gs;
print "$before$after";


$ perl j.pl
...xxx...
...xxx...
...xxx...
...new...
...new...
...new...