We don't bite newbies here... much | |
PerlMonks |
Re: find a string in an array of arraysby ww (Archbishop) |
on Feb 07, 2008 at 02:35 UTC ( [id://666718]=note: print w/replies, xml ) | Need Help?? |
As I'm a bit puzzled your (larger) intent -- ie: why you would want to use a script for a job so easily done with ls text2.txt or dir text2.txt -- I'll guess you may wish to know the contents of the element rather than just a filename. If that's the case, here's a tiny, incremental step, building on the above, to print the full content of the element (annonymous array) containing test2.txt: print "Found \$SearchStr in \@cdata: @{$GrepResult}\n";If, instead, you wish to store the information for further processing, you can substitute an appropriate construct to hold @{$GrepResult}. PS: your reference to "the way I am referencing @Config" is the kind of typo that can create confusion or lead to a sequence of off-track replies. Yes, I've inferred (correctly, one hopes) that you meant @cdata but sometimes typos or cut'n'paste errors can confound your hope of help. The preview button is best used both to the check formatting... and to proofread. ...of course, as anyone who's noted the number of "Update" notes in my posts will recognize, this is advice I need to practice more effectively, myself. :-) Update :-( and I still missed a typo I've now had to correct. ....aaargh!
In Section
Seekers of Perl Wisdom
|
|