Binding array to pattern
- From: "Shmuel (Seymour J.) Metz" <spamtrap@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 08 Jun 2006 18:05:54 -0300
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 spamtrap@xxxxxxxxxxxxxxxxxx
.
- Follow-Ups:
- Re: Binding array to pattern
- From: Brian McCauley
- Re: Binding array to pattern
- From: Tad McClellan
- Re: Binding array to pattern
- From: Gunnar Hjalmarsson
- Re: Binding array to pattern
- From: xhoster
- Re: Binding array to pattern
- Prev by Date: Re: Multiple Line output using Win32::Printer
- Next by Date: Re: Unable to connect to SQLite database file
- Previous by thread: Need help
- Next by thread: Re: Binding array to pattern
- Index(es):
Relevant Pages
|