in reply to asigning a grep statment to a variable
One Perl-only way of doing it could be like this:
You could join @TTRAILS together if you want a single string, which is what the grep command would return.open(F, "/user/telalert/telalert.trail") or die "Error: $!\n"; @TTRAILS=grep /\]Send Started/, <F>; close(F);
I'm not sure if the grep on <F> will read the whole thing in memory at once or if it is intelligent enough to read it line by line, which could make a difference if the file is very large.
--ZZamboni
|
|---|