Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: find a string in an array of arrays

by ww (Archbishop)
on Feb 07, 2008 at 02:35 UTC ( [id://666718]=note: print w/replies, xml ) Need Help??


in reply to find a string in an array of arrays

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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://666718]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-25 16:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found