Update:While submitting this answer I assume that you are expecting the command ("alias"), written within backticks, to run like it does inside a shell
Read perldoc for system
perldoc -f systemIt says -
...If there is only one scalar argument, the argument is checked for shell metacharacters, and if there are any, the entire argument is passed to the system’s command shell for parsing (this is "/bin/sh -c" on Unix platforms, but varies on other platforms). If there are no shell metacharacters in the argument, it is split into words and passed directly to "execvp",...
Check the return value of system or open. They indicate errors.
# perl -e 'print system("alias")' -1 # perl -e 'open (PIPE, "alias |") or die $@;' Died at -e line 1.
When you do system("alias") perl searches for an executable file named alias which, as expected, is not found
I don't know but I think backtick operators (``) and open should alsotype alias alias is a shell builtin
The things I want to say are
Kind monks! Please correct me if I am wrong
In reply to Re: Gathering current ksh shell aliases in perl
by samarzone
in thread Gathering current ksh shell aliases in perl
by kreon3
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |