X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperltie.pod;h=0323e32261340360c3cd9391456979958686be02;hb=6d1e6673d7386f4f9139111a6e44d555b8252741;hp=b4c2baf20f665a13efa58fba74235927b2c355d8;hpb=d74e8afc9309529cf5c6c4390fc311850865d506;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perltie.pod b/pod/perltie.pod index b4c2baf..0323e32 100644 --- a/pod/perltie.pod +++ b/pod/perltie.pod @@ -900,12 +900,14 @@ C function. X This method will be triggered every time the tied handle is printed to -with the C function. -Beyond its self reference it also expects the list that was passed to -the print function. +with the C or C functions. Beyond its self reference +it also expects the list that was passed to the print function. sub PRINT { $r = shift; $$r++; print join($,,map(uc($_),@_)),$\ } +C acts just like C except $\ will be localized to C<\n> so +you need do nothing special to handle C in C. + =item PRINTF this, LIST X @@ -950,6 +952,19 @@ This method will be called when the C function is called. sub GETC { print "Don't GETC, Get Perl"; return "a"; } +=item EOF this +X + +This method will be called when the C function is called. + +Starting with Perl 5.12, an additional integer parameter will be passed. It +will be zero if C is called without parameter; C<1> if C is given +a filehandle as a parameter, e.g. C; and C<2> in the very special +case that the tied filehandle is C and C is called with an empty +parameter list, e.g. C. + + sub EOF { not length $stringbuf } + =item CLOSE this X @@ -1010,7 +1025,7 @@ a scalar. sub TIESCALAR { my $class = shift; my $filename = shift; - my $handle = new IO::File "> $filename" + my $handle = IO::File->new( "> $filename" ) or die "Cannot open $filename: $!\n"; print $handle "The Start\n"; @@ -1166,7 +1181,7 @@ tie methods for slice operations. You cannot easily tie a multilevel data structure (such as a hash of hashes) to a dbm file. The first problem is that all but GDBM and Berkeley DB have size limitations, but beyond that, you also have problems -with how references are to be represented on disk. One experimental +with how references are to be represented on disk. One module that does attempt to address this need is DBM::Deep. Check your nearest CPAN site as described in L for source code. Note that despite its name, DBM::Deep does not use dbm. Another earlier attempt