Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I can't use split because the junk data in between my valid matches isn't consistant. I know I will always have exactly three matches. I thought that the backreferences were returned in a list, but I can't remember what that is. Thanks! f.foreach (@biglonglist) { if (/(thing1)misc stuff(thing2)random garbage(thing3)/) { $x->{a} = $1; $x->{b} = $2; $x->{c} = $3; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: pattern matching and return values
by davido (Cardinal) on Jul 18, 2004 at 05:20 UTC | |
by wfsp (Abbot) on Jul 18, 2004 at 05:39 UTC | |
|
Re: pattern matching and return values
by saintmike (Vicar) on Jul 18, 2004 at 05:23 UTC | |
by Anonymous Monk on Jul 18, 2004 at 05:32 UTC | |
|
Re: pattern matching and return values
by tachyon (Chancellor) on Jul 18, 2004 at 05:43 UTC | |
by Your Mother (Archbishop) on Jul 18, 2004 at 06:26 UTC | |
by tachyon (Chancellor) on Jul 18, 2004 at 09:31 UTC | |
|
Re: pattern matching and return values
by Anonymous Monk on Jul 18, 2004 at 05:12 UTC |