Created
October 14, 2010 18:09
-
-
Save brianwisti/626686 to your computer and use it in GitHub Desktop.
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
# No weirdness | |
.sub 'main' :main | |
.local string name | |
.local string greeting | |
.local pmc stdin | |
.local string prompt | |
prompt = "Please enter your name: " | |
print prompt | |
stdin = getstdin | |
name = stdin.'readline_interactive'() | |
greeting = "Hello, " . name | |
greeting .= "!" | |
say greeting | |
.end |
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
# Shows the weirdness | |
.sub 'main' :main | |
.local string name | |
.local string greeting | |
.local pmc stdin | |
stdin = getstdin | |
name = stdin.'readline_interactive'("Please enter your name: ") | |
greeting = "Hello, " . name | |
greeting .= "!" | |
say greeting | |
.end |
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
$ parrot funky.pir | |
Please enter your name:�'�!Brian | |
Hello, Brian! | |
$ parrot fine.pir | |
Please enter your name: Brian | |
Hello, Brian! | |
$ parrot -V | |
This is Parrot version 2.6.0 built for i386-linux. | |
Copyright (C) 2001-2010, Parrot Foundation. | |
This code is distributed under the terms of the Artistic License 2.0. | |
For more details, see the full text of the license in the LICENSE file | |
included in the Parrot source tree. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment