in reply to 'Transparent grep'
Hello Perl Monks,
thanks for your answers. I investigated and tested a bit myself. The code seems to work as expected.
- Everything is printed.
- Exit code depends on whether the pattern matches or not.
Remarks:
1. "exit" function is not recommended within an END block. Do assign $? instead.
2. One might easily build more complex tools in this way, where UNIX constructs seem to be clumsy, not flexible enough, require multiple pipes or writing temporary files.