in reply to Re: using variable inside system call
in thread using variable inside system call

Well, calling system with a list as parameters isn't necessarely 'safer'. It means that the shell is bypassed. Since you don't know what's inside $node, you don't know whether it matters or not. Perhaps $node contains whitespace, or backticks, or dollar signs, making it vital that the shell plays it part.

Don't suggest alternatives without pointing out what may break.

Abigail

Replies are listed 'Best First'.
Re: Re: using variable inside system call
by tinita (Parson) on Apr 02, 2004 at 15:54 UTC
    Well, calling system with a list as parameters isn't necessarely 'safer'.

    ok, granted, i meant 'in most cases'. in most cases you don't need the shell. i think. (!)

    Since you don't know what's inside $node, you don't know whether it matters or not.

    that's what i said. i said i don't know what's a 'node' supposed to be. i stated clearly that i'm making a guess.

    Don't suggest alternatives without pointing out what may break.

    if i always pointed all things that could possibly go wrong i wouldn't have time for anything else. what is perlmonks all about if i can't suggest alternatives when i state at the same time that i'm guessing? ok, a link to the system() function would have been nice.