source:
trunk/essentials/dev-lang/perl/t/lib/TieIn.pm@
3400
| Last change on this file since 3400 was 3181, checked in by , 19 years ago | |
|---|---|
| File size: 281 bytes | |
| Line | |
|---|---|
| 1 | package TieIn; |
| 2 | |
| 3 | sub TIEHANDLE { |
| 4 | bless( \(my $scalar), $_[0]); |
| 5 | } |
| 6 | |
| 7 | sub write { |
| 8 | my $self = shift; |
| 9 | $$self .= join '', @_; |
| 10 | } |
| 11 | |
| 12 | sub READLINE { |
| 13 | my $self = shift; |
| 14 | $$self =~ s/^(.*\n?)//; |
| 15 | return $1; |
| 16 | } |
| 17 | |
| 18 | sub EOF { |
| 19 | my $self = shift; |
| 20 | return !length $$self; |
| 21 | } |
| 22 | |
| 23 | 1; |
Note:
See TracBrowser
for help on using the repository browser.
