Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: system call how-to

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

in reply to system call how-to

$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?

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2023-12-09 22:20 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (38 votes). Check out past polls.