J
Jure Simsic
Let's say I have code like this:
$a="a:1 b:3 c:foo d:4";
while ($a =~ m/(\w)
\w+)/g){
# do stuff with $1 and $2
if ($2 eq "foo"){
&sub( ${what's left of $a} )
}
}
One way that I can think of is
$a =~ s/^.*$2//;
before calling &sub($a), but that seems awkward..
Is there any nicer way to achieve this?
Tnx
Jure
$a="a:1 b:3 c:foo d:4";
while ($a =~ m/(\w)
# do stuff with $1 and $2
if ($2 eq "foo"){
&sub( ${what's left of $a} )
}
}
One way that I can think of is
$a =~ s/^.*$2//;
before calling &sub($a), but that seems awkward..
Is there any nicer way to achieve this?
Tnx
Jure