Skip to content

Instantly share code, notes, and snippets.

@brianwisti
Created October 14, 2010 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianwisti/626686 to your computer and use it in GitHub Desktop.
Save brianwisti/626686 to your computer and use it in GitHub Desktop.
# 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
# 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
$ 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