in reply to Can't capture STDERR to Variable

With your call to open you only capture Perl's STDERR, not that of processes that Perl starts.

IPC::Run or IPC::Open3 allow you to capture STDERR of external commands.

I hope that your use of ls is only an example - directory listings are easily obtained in Perl with opendir, readdir and closedir, which make errors readily available in $!. (Or File::Find if you want recursive directory listings).