Shivam05 has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I am trying to grep label(" in the array, it will generate error while executing . sample code:
$grepper=join('','label','(','"'); print "$grepper\n"; $array[0]="label("; $array[1]="label"; @LABEL = grep(/$grepper/, @array); print "@LABEL \n";
And also, i tried this line directly:
@LABEL = grep(/label\(\"/, @array); print "@LABEL \n";
if i use this it does not take " correctly in the label(". How can i over come the problemand solution for this.
--Shiva Prasad.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: grep Question
by Athanasius (Archbishop) on May 20, 2015 at 07:27 UTC | |
|
Re: grep Question
by GrandFather (Saint) on May 20, 2015 at 07:40 UTC | |
|
Re: grep Question
by Happy-the-monk (Canon) on May 20, 2015 at 07:26 UTC | |
|
Re: grep Question
by Utilitarian (Vicar) on May 20, 2015 at 07:20 UTC | |
|
Re: grep Question
by soonix (Chancellor) on May 20, 2015 at 10:30 UTC |