Nansh has asked for the wisdom of the Perl Monks concerning the following question:
Fruits{ Apple Mango Grape Watermelon }
My another file looks like thisFruit{ Apple }
My code works for both of the files here thing is we shouldn't use .* that affects my other code. so can anyone help me to solve this? logical part for this is below $_=~ m/^\s*Fruits\s*\{\s*(.*)?\s*\}/; Thing is I should not use .* so is there any other way to match that?, If so please help me. Thank you.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pattern Match
by Ratazong (Monsignor) on Jun 08, 2017 at 06:21 UTC | |
|
Re: Pattern Match
by Athanasius (Archbishop) on Jun 08, 2017 at 07:51 UTC | |
|
Re: Pattern Match
by haukex (Archbishop) on Jun 08, 2017 at 07:02 UTC | |
|
Re: Pattern Match
by hippo (Archbishop) on Jun 08, 2017 at 07:58 UTC | |
|
Re: Pattern Match
by tybalt89 (Monsignor) on Jun 08, 2017 at 10:24 UTC |