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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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



davorg
Thaumaturge / Moderator

Sep 26, 2005, 2:19 AM


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

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


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


Code
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
http://www.dave.org.uk/
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