in reply to Re: Question about input pipes and sub-shells
in thread Question about input pipes and sub-shells

Thanks for the advice. I'd planned to use taint mode too, but my experience with taint-perl so far is that the biggest gains are from ensuring that you cannot pass along values that haven't been properly checked. My problem, though, is that I'm really not able to do much validation since I want to be able to pass through almost any valid POSIX regular expression to the 'search' command.

Just so I'm clear, won't using \Q and \E mangle the contents of $pattern in such a way that if it contained:

(tcp|udp)RxPacket

as an example, the 'search' command would see:

\(tcp\|udp\)RxPacket

Which would cause it to treat it as a regular expression with no special characters in it, ie, it would be looking for a string "(tcp|udp)RxPacket" rather than "tcpRxPacket" or "udpRxPacket".

-J.

Replies are listed 'Best First'.
Re: Re: Re: Question about input pipes and sub-shells
by suaveant (Parson) on Nov 14, 2001 at 20:45 UTC
    No, the escapes are for the shell, and it handles them. Your script gets what you want.

    of course, you could always use fork and exec, that would end your shell issues... but make the code more difficult.

                    - Ant
                    - Some of my best work - (1 2 3)