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




Reply via email to