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