The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-28-2008
userix userix is offline
Registered User
  
 

Join Date: May 2008
Posts: 21
[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

Code:
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.