Web Hosting Talk







View Full Version : Runing a linux command with perl, how?


aeav
04-28-2006, 05:28 PM
What command I have to use to execute Linux commands with Perl?

like the command "ls -a".

Thanks

namelayer
04-28-2006, 05:30 PM
if its a .pl file you can ./filename.pl
or perl filename.cgi iirc

FHDave
04-28-2006, 05:46 PM
I don't think that's what he means.

to run "ls -la", you can do system("ls -la");

Slidey
04-28-2006, 05:50 PM
or use backticks:


`ls -al`;

aeav
04-28-2006, 05:54 PM
what I wanted was that, thank-you guys!

command system(), works :D

topic solved

namelayer
04-28-2006, 05:58 PM
Duhhhhh me, "Running system commands within a Perl script" would of got the right answer from me ;)