S
Shmuel (Seymour J.) Metz
I'd like to bind an array to a pattern. I couldn't find anything in
the Camel book about the context for the left side of the binding
operator. I ran some tests, and it appears that I get scalar context
if I write
while (@anarray =~ /pattern/g) {
block;
}
which means that I match against the size rather than the contents. I
tried
while ("@anarray" =~ /pattern/g) {
block;
}
but that went into a loop. Is there a better way to do this than
$_="@anarray";
while (/pattern/g) {
block;
}
?
Is there a description that I missed of interpolation for the left
side of the binding operator?
--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>
Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to (e-mail address removed)
the Camel book about the context for the left side of the binding
operator. I ran some tests, and it appears that I get scalar context
if I write
while (@anarray =~ /pattern/g) {
block;
}
which means that I match against the size rather than the contents. I
tried
while ("@anarray" =~ /pattern/g) {
block;
}
but that went into a loop. Is there a better way to do this than
$_="@anarray";
while (/pattern/g) {
block;
}
?
Is there a description that I missed of interpolation for the left
side of the binding operator?
--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>
Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to (e-mail address removed)