it might be safer to use "\ls -l" instead
Under almost all circumstances, the backslash would not be needed. On the interactive command line, the backslash prevents alias expansion (such as "ls" —> "ls --color=auto", which then produces the ANSI escape sequences), because alias lookup happens before backslash escapes are processed, and there is no alias for "\ls".
However,
- alias expansion is only done for interactive shells, and not for sh -c ... (i.e. qx{...} ) — unless explicitly requested otherwise,
- alias expansion would be done by the shell, but unless there are any shell metacharacters in the command, no shell is involved anyway, as Perl will run ls directly.
| [reply] [d/l] [select] |
| [reply] |