Skip to content

Instantly share code, notes, and snippets.

@taiyoh
Created December 5, 2011 07:13
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 taiyoh/1432658 to your computer and use it in GitHub Desktop.
Save taiyoh/1432658 to your computer and use it in GitHub Desktop.
package Foo {
use IO::Prompt;
sub new { bless {}, shift }
sub ask {
my ($self, $msg) = @_;
my $echo = prompt("next: ");
print "You said '$echo'\n";
}
}
my $foo = Foo->new;
eval { $foo->ask; };
if ($@) {
print "failed\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment