in reply to How do I get both the return value and text? backticks vs. system()
Here is the output, you'll see that the "$4" and "$PATH" were not interpreted as variables before being sent to ls.open(CMD, '-|', '/usr/bin/ls', '$4', '$PATH'); my $output = do { local $/; <CMD> }; close CMD; print "$output\n";
ls: 0653-341 The file $4 does not exist. ls: 0653-341 The file $PATH does not exist.
|
|---|