Re: [MacPerl] simple global replace

2001-06-15 Thread Bart Lateur
On Wed, 13 Jun 2001 11:12:05 +0200, Allan Juul wrote: >am i going totally blind or? >from the snip below i want to output just: >aaa >aaa > >what i get is : >aaa >aaa > 333 444 > > >why is that? >tnanks >allan > > >#!perl >$str = "aaa 111 222 aaa 333 444"; >output($str); >sub output{ > $tex

Re: [MacPerl] simple global replace

2001-06-15 Thread Detlef Lindenthal
## Do this: $_ = "aaa 111 222 aaa 333 444"; s/(aaa)/print $1, "\n"/ge; Senne Hilsen (sagt man das so?) Detlef Allan Juul wrote: #!perl $str = "aaa 111 222 aaa 333 444"; output($str); sub output { $text = $_[0]; $text =~ s/.*?(aaa).*?/$1\n/ig; print $text;

[MacPerl] simple global replace

2001-06-15 Thread Allan Juul
hi am i going totally blind or? from the snip below i want to output just: aaa aaa what i get is : aaa aaa 333 444 why is that? tnanks allan #!perl $str = "aaa 111 222 aaa 333 444"; output($str); sub output{ $text = $_[0]; $text =~ s/.*?(aaa).*?/$1\n/ig; print $text;