Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: preserve quotes after $0 interpolation

by afoken (Chancellor)
on Dec 13, 2019 at 10:11 UTC ( [id://11110060]=note: print w/replies, xml ) Need Help??


in reply to Re: preserve quotes after $0 interpolation
in thread preserve quotes after $0 + @ARGV interpolation

use String::ShellQuote qw( shell_quote );

The last two times I looked at String::ShellQuote (Re^2: Passing values from Perl script to shell script in 2009 and Re^4: quoting/escaping file names in 2014), it did not look good. The last change is from 2010. So, String::ShellQuote still has the same problems as in 2009, quoting myself:

It works just for some unnamed version of some unnamed bourne shell. The author wanted to add more shells, but he did not since 2005. The test.t look very strange, especially I don't see any reasonable test for passing arguments via a shell. So, it's old, unmaintained, not well-tested, and broken for all shells except for that unspecified bourne shell. Use the multi-argument forms of exec, system, or open instead, they do not need quoting.

See also The problem of "the" default shell.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^3: preserve quotes after $0 interpolation
by ikegami (Patriarch) on Dec 13, 2019 at 14:47 UTC

    You seem to allege some problem with shell_quote, but none of the linked post identify one. The all seemed centered around the idea of avoiding the shell is better. While true, that's not a problem with shell_quote.

Re^3: preserve quotes after $0 interpolation
by ikegami (Patriarch) on Sep 18, 2022 at 21:13 UTC

    What do you mean by "It did not look good". What problem does it have?

    The posts you link only rant the module about the fact the module only supports sh. Claiming that makes the module broken is ridiculous.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-19 03:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found