in reply to passing newline in string argument

$ perl -e 'use Getopt::Long;GetOptions( "string=s" => \my($string));ev +al qq|print("string = $string\n")|' - -string 'foo\nbar' string = foo bar

                "If it happens once, it's a bug. If it happens twice, it's a feature. If it happens more than twice, it's a design philosophy."

Replies are listed 'Best First'.
Re^2: passing newline in string argument
by haukex (Archbishop) on Aug 02, 2025 at 08:42 UTC

    I think it's very well worth mentioning that eval is a massive security hole with untrusted input.

      > I think it's very well worth mentioning that eval is a massive security hole with untrusted input

      Strongly agree!

      For string eval that is; block eval (now spelled try in latest versions of Perl) is fine.

      See also: avoid string eval References

      👁️🍾👍🦟