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