summaryrefslogtreecommitdiff
path: root/lib/Term/ReadLine.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Term/ReadLine.pm')
-rw-r--r--lib/Term/ReadLine.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Term/ReadLine.pm b/lib/Term/ReadLine.pm
index a23208c420..8c58694fd8 100644
--- a/lib/Term/ReadLine.pm
+++ b/lib/Term/ReadLine.pm
@@ -6,11 +6,11 @@ no real package is found, substitutes stubs instead of basic functions.
=head1 SYNOPSIS
use Term::ReadLine;
- $term = new Term::ReadLine 'Simple Perl calc';
- $prompt = "Enter your arithmetic expression: ";
- $OUT = $term->OUT || STDOUT;
+ my $term = new Term::ReadLine 'Simple Perl calc';
+ my $prompt = "Enter your arithmetic expression: ";
+ my $OUT = $term->OUT || \*STDOUT;
while ( defined ($_ = $term->readline($prompt)) ) {
- $res = eval($_), "\n";
+ my $res = eval($_), "\n";
warn $@ if $@;
print $OUT $res, "\n" unless $@;
$term->addhistory($_) if /\S/;