From 30d7375bba8b179dedf1c2ca322d758e5330752d Mon Sep 17 00:00:00 2001 From: Stevan Little Date: Sun, 1 Sep 2013 13:27:33 -0400 Subject: twigils --- lib/Reply/Plugin/Nopaste.pm | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'lib/Reply/Plugin/Nopaste.pm') diff --git a/lib/Reply/Plugin/Nopaste.pm b/lib/Reply/Plugin/Nopaste.pm index 8ecf0e1..85106eb 100644 --- a/lib/Reply/Plugin/Nopaste.pm +++ b/lib/Reply/Plugin/Nopaste.pm @@ -28,43 +28,43 @@ like [DataDump], etc). =cut class Reply::Plugin::Nopaste extends Reply::Plugin { - has $history = ''; - has $service; + has $!history = ''; + has $!service; - has $prompt; - has $line; - has $result; + has $!prompt; + has $!line; + has $!result; method prompt ($next, @args) { - $prompt = $next->(@args); - return $prompt; + $!prompt = $next->(@args); + return $!prompt; } method read_line ($next, @args) { - $line = $next->(@args); - $line = "$line\n" if defined $line; - return $line; + $!line = $next->(@args); + $!line = "$!line\n" if defined $!line; + return $!line; } method print_error ($next, $error) { - $result = $error; + $!result = $error; $next->($error); } method print_result ($next, @result) { - $result = @result ? join('', @result) . "\n" : ''; + $!result = @result ? join('', @result) . "\n" : ''; $next->(@result); } method loop ($continue) { - $history .= "$prompt$line$result" - if defined $prompt - && defined $line - && defined $result; + $!history .= "$!prompt$!line$!result" + if defined $!prompt + && defined $!line + && defined $!result; - undef $prompt; - undef $line; - undef $result; + undef $!prompt; + undef $!line; + undef $!result; $continue; } @@ -73,11 +73,11 @@ class Reply::Plugin::Nopaste extends Reply::Plugin { $cmd_line = "Reply session" unless length $cmd_line; print App::Nopaste->nopaste( - text => $history, + text => $!history, desc => $cmd_line, lang => 'perl', - (defined $service - ? (services => [ $service ]) + (defined $!service + ? (services => [ $!service ]) : ()), ) . "\n"; -- cgit v1.2.3-54-g00ecf