CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner: Re: [jay] Help from an Expert on simple code: Edit Log

Thaumaturge / Moderator

Sep 26, 2005, 2:19 AM

Views: 1428
Re: [jay] Help from an Expert on simple code

You use the qx() operator to execute an external command an capture the output.

my @cpuinfo = qw(grep processor /proc/cpuinfo);

You'll often see that written using backticks instead - that's just another version of the same thing.

my @cpuinfo = `grep processor /proc/cpuinfo`;

p.s. This really isn't "advanced", so I've moved the thread into the beginners' forum and removed the copy that you had already put there. Please don't ask the same question in multiple forums.

Dave Cross, Perl Hacker, Trainer and Writer
Get more help at Perl Monks

(This post was edited by davorg on Sep 26, 2005, 3:24 AM)

Edit Log:
Post edited by davorg (Thaumaturge) on Sep 26, 2005, 3:24 AM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives