Hi,
I've been assigned to convert our shell programs to perl and one
construct I'm having difficulty changing to Perl is the following
fragment:
grep "pattern" /my/file | sort
or generally
grep "pattern" /my/file | [some command].
I tried doing the following and it works but there's no sorting.
open (MYFILE,"/my/file");
while (<MYFILE>) {
if (/pattern/) {
print "$_";
}
}
I think it's something to do with 'piping.' Any solutions how to
'pipe' the output of the above into Perl's built-in 'sort'
function? Pls. email or post. Thanks!
--
- J -