in reply to Re: Apple, quoting, and system()
in thread Apple, quoting, and system()
Actually, Perl's system and exec only invoke a shell if you pass them a single string and that string contains shell meta characters.
Note that this can still break things similar to the original story:
Note that no shell is involved in the above problem. - tye (but my friends call me "Tye")my $root= "/usr/local "; # oops system( "rm -rf $root/lib" ); # goodbye /lib (and /usr/local) # However, if you instead do: system( "rm", "-rf", "$root/lib" ); # then nothing gets deleted unless # "/usr/local /lib" exists.
|
|---|