in reply to Reverse Function

How about an array?
my @array = map { s/oldpage/newpage/g; $_ } <DATA>; print reverse @array; __DATA__ title oldpage oldpage htm tab aaaaa

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: (jeffa) Re: Reverse Function
by screamingeagle (Curate) on Jun 29, 2002 at 03:33 UTC
    jeffa's answered the question, but , to indulge in a little golf, it can be done in one line :
    print reverse map {s/oldpage/newpage/g; $_} <DATA>;

      Well, if you're gonna golf... ;^)

      s/oldpage/newpage/g, print for reverse <DATA>; # 46 s/oldpage/newpage/g,print for reverse<DATA> # 43

          --k.


      A reply falls below the community's threshold of quality. You may see it by logging in.
Re: (jeffa) Re: Reverse Function
by thunders (Priest) on Jun 29, 2002 at 03:37 UTC
    what jeffa said cept I'd save some typing and chain it.
    print reverse map { s/oldpage/newpage/g; $_ } <DATA>; __DATA__ title oldpage oldpage htm tab aaaaa