Last active
September 10, 2018 16:07
-
-
Save nicomen/044d58f7444762412d91e98aae8f84e6 to your computer and use it in GitHub Desktop.
' allowed as package delimiter vs. syntax error, passing a string into foo and correct interpolation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✔ 18:00 /projects/perl-git [ blead | ✚ 14 …2 ] $ perl -wle "package foo'bar; sub lol { print 'lol'; }; foo'bar::lol()" | |
lol | |
✔ 18:00 /projects/perl-git [ blead | ✚ 14 …2 ] $ ./perl -wle "package foo'bar; sub lol { print 'lol'; }; foo'bar::lol()" | |
Bareword found where operator expected at -e line 1, near "'bar; sub lol { print 'lol" | |
(Missing operator before lol?) | |
Unquoted string "lol" may clash with future reserved word at -e line 1. | |
String found where operator expected at -e line 1, near "lol'; }; foo'" | |
Bareword found where operator expected at -e line 1, near "'; }; foo'bar::lol" | |
(Missing operator before bar::lol?) | |
Invalid version format (non-numeric data) at -e line 1, near "package foo" | |
syntax error at -e line 1, near "package foo'bar; sub lol { print '" | |
Execution of -e aborted due to compilation errors. | |
$ ./perl -wle "sub foo { print 'yay,' . shift; }; foo'bar';"; | |
yay,bar | |
$ ./perl -wle "my \$foo = q{bar}; print qq{\$foo's}"; | |
bar's |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment