[Omaha.pm] code reduction

Jay Hannah jhannah at omnihotels.com
Thu May 10 15:51:35 PDT 2007


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...




More information about the Omaha-pm mailing list