Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^2: search for a pattern in file without opening the fileby perl-diddler (Chaplain) |
on Jan 29, 2007 at 22:38 UTC ( [id://597208]=note: print w/replies, xml ) | Need Help?? |
In the spirit of "thinking outside the box"...*cough*...
You would need to: As others have said, within the definition of your problem is an "inherent" open to be able to look into the contents of the file. What are you trying to do that you want to avoid opening the file in perl? FWIW, I'd change Ted's answer, above, to use "pcregrep" instead of "grep" to maintain use of perl-compatible regular expressions :-). p.s. -- sometimes you just have to put on your hat of "literalness" :-)
In Section
Seekers of Perl Wisdom
|
|