in reply to Backticks without shell
You can use the list syntax for piped open if your perl is recent enough. This works in my 5.8.x,
while,$ perl -e'open my $fh, "-|", "ls", "-l", glob("READ*") or die $!; prin +t <$fh>' -rw-rw-r-- 1 Zaxo Zaxo 1510 Jan 15 1999 README -rw-rw-r-- 1 Zaxo Zaxo 251 Jan 15 1999 README_FIRST -rw-rw-r-- 1 Zaxo Zaxo 245 Jan 15 1999 README_FIRST.~ +1~ $
proving that the shell is truly bypassed.$ perl -e'open my $fh, "-|", "ls", "-l", "READ*" or die $!; print <$fh +>' ls: READ*: No such file or directory $
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Backticks without shell
by Anonymous Monk on Jan 21, 2004 at 03:36 UTC | |
by BUU (Prior) on Jan 21, 2004 at 10:22 UTC |