Re: Binding array to pattern
- From: Gunnar Hjalmarsson <noreply@xxxxxxxxx>
- Date: Fri, 09 Jun 2006 01:30:51 +0200
Shmuel (Seymour J.) Metz wrote:
I'd like to bind an array to a pattern.
Why?
Is there a better way to do this than
$_="@anarray";
while (/pattern/g) {
block;
}
?
This is more readable IMO:
foreach my $element ( @anarray ) {
while ( $element =~ /PATTERN/g ) {
...
}
}
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
.
- Follow-Ups:
- Re: Binding array to pattern
- From: Shmuel (Seymour J.) Metz
- Re: Binding array to pattern
- References:
- Binding array to pattern
- From: Shmuel (Seymour J.) Metz
- Binding array to pattern
- Prev by Date: Re: Need help
- Next by Date: Can I "break out" of an if{} block?
- Previous by thread: Re: Binding array to pattern
- Next by thread: Re: Binding array to pattern
- Index(es):
Relevant Pages
|