in reply to Re^2: (nrd) Putting file contents into a scalar
in thread Putting file contents into a scalar
But that's much typing for oneliners...
Update: As merlyn correctly pointed out:
"Please don't do that. Your code is fragile. It will break when I pass an object that subclasses IO::File but acts in every way like an IO::File".So I went through my latest and greatest module, which grossly offends against this statement, and quietly changed my test to read:
The immediate benefit is that I now can use IO::Scalar from my test script to get output in a variable instead of a file (or STDOUT). Cool!... croak("Invalid type for 'outfile', missing method print()'") unless $outfile->can('print'); ...
--
Cheers, Joe
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Say no to ref $thing eq "Expected::Type"
by merlyn (Sage) on Oct 29, 2002 at 14:35 UTC | |
by Felonious (Chaplain) on Oct 29, 2002 at 14:44 UTC | |
by merlyn (Sage) on Oct 29, 2002 at 14:47 UTC | |
by rir (Vicar) on Oct 29, 2002 at 19:23 UTC | |
by merlyn (Sage) on Oct 29, 2002 at 19:34 UTC | |
|