in reply to how to store values from system command

When you want to capture output, use backticks

my $val = `ls -lrt`;

or

my $val = qx/ls -lrt/;

Ref: perlop