Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: system call how-to

by elsiddik (Scribe)
on May 01, 2007 at 11:04 UTC ( [id://612960]=note: print w/replies, xml ) Need Help??


in reply to system call how-to

well
$files = join ' ', glob '/usr/bin/*'; system "whatis $files";
gave me the same results so far - and  perl -e 'chdir shift || "/usr/bin"; system whatis => <*> ended up with  whatis : unknown option. ill give basename a shot - maybe it helps

Replies are listed 'Best First'.
Re^2: system call how-to
by naikonta (Curate) on May 01, 2007 at 12:40 UTC
    Yikes! Where did my parentheses go? So sorry elsiddik, it's really supposed to be:
    perl -e 'chdir (shift || "/usr/bin"); system whatis => <*>'
    as long as one-liner is concerned. The chdir functions takes higher precedence than the logical OR (||) operator. The truth is, I added the shift || part later on the textbox without retesting. My fault, my fault....

    shmem privately messaged me correcting my answer, and suggested me to have some coffee. But I think I need more than that, perhaps taking a fresh bath :D Thanks, shmem :-)


    Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://612960]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-25 23:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found