in reply to Re: Use of system() considered harmful
in thread Use of system() considered harmful

system {$cmd}, $cmd;

What do the curlies do there? I don't see anything like that syntax in the manpage for system.

  • Comment on Re^2: Use of system() considered harmful

Replies are listed 'Best First'.
Re^3: Use of system() considered harmful
by Porculus (Hermit) on Jun 11, 2008 at 21:37 UTC

    This is the "system PROGRAM LIST" syntax. It's documented more fully under exec. There are some cross-references in the system page, but I can see how you could easily miss them if you weren't looking out for something like that. Maybe the documentation could usefully be expanded to add an example of this syntax.

    (pc88mxer's version actually contains a syntax error, BTW. There shouldn't be a comma after the curlies -- it's an indirect argument, like the filehandle in print.)