[PERL] Running unix commands within Perl Scripts

I understand that in order to run basic unix commands I would normally type at the prompt, I would have to use the following format

system(ls -l);
or
exec(ls -l);

But when I actually try to use the command, the script fails to compile and keeps telling me there is an error with this line. How exactly do I run commands in perl? I have the proper shebang that points to the perl exec. Thanks.

To learn more about the perl system function, at your command line type
perldoc -f system

(to learn more about using perldoc, type 'man perldoc' at the command prompt).

Your problem is that system() is expecting a LIST of things you want done. You are providing it with two items which aren't even separated by a comma, so Perl is going crazy trying to figure out what you want.

Try system("ls -l") to provide system() with just one thing you want it to do. Same with exec. Be sure to perldoc -f exec to discover the differences between these two commands.