## Do this:
$_ = "aaa 111 222 aaa 333 444<END>";
s/(aaa)/print $1, "\n"/ge;
Senne Hilsen (sagt man das so?)
Detlef
Allan Juul wrote:
#!perl
$str = "aaa 111 222 aaa 333 444<END>";
output($str);
sub output {
$text = $_[0];
$text =~ s/.*?(aaa).*?/$1\n/ig;
print $text; }
i want to output just:
aaa
aaa
what i get is :
aaa
aaa
333 444<END>
- [MacPerl] simple global replace Allan Juul
- Re: [MacPerl] simple global replace Detlef Lindenthal
- Re: [MacPerl] simple global replace Bart Lateur
