root/lang/perl/App-Hachero/trunk/lib/App/Hachero/Plugin/Input/Stdin.pm
@
18806
| Revision 18806, 330 bytes (checked in by lopnor, 5 years ago) | |
|---|---|
|
|
| Line | |
|---|---|
| 1 | package App::Hachero::Plugin::Input::Stdin; |
| 2 | use strict; |
| 3 | use warnings; |
| 4 | use base qw(App::Hachero::Plugin::Base); |
| 5 | |
| 6 | sub init { |
| 7 | my ($self, $context) = @_; |
| 8 | $self->{fh} = *STDIN; |
| 9 | } |
| 10 | |
| 11 | sub input : Hook { |
| 12 | my ($self, $context, $args) = @_; |
| 13 | my $fh = $self->{fh}; |
| 14 | my $line = <$fh>; |
| 15 | $context->currentline( $line ); |
| 16 | } |
| 17 | |
| 18 | 1; |
Note: See TracBrowser
for help on using the browser.
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)