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!