Running unix commands through perl

Hi all,

In the directory '/temp/chris' the following files exist: chris.tar, chris.txt

What i am trying to do is to assign the 'chris.tar' filename in an argument through perl, in order to do that i use the system command:

$file=system("ls /temp/chris/*.tmp), but in the '$file' the exit code of the ls command is stored and not the filename.

How can i retrieve the filename and store it in an argument.

Thank you in advance,
Chris

From perldoc perlop

Couldn't you use opendir and readdir to get the contents of the directory?