From 4ec2216f20a53a69267b31ce136e7410687cbe32 Mon Sep 17 00:00:00 2001 From: Nick Ing-Simmons Date: Thu, 11 Jul 2002 09:16:46 +0000 Subject: (Re-)instate :pop as a "back door" to perl level layer stack manipulation. p4raw-id: //depot/perlio@17479 --- lib/PerlIO.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/PerlIO.pm') diff --git a/lib/PerlIO.pm b/lib/PerlIO.pm index 1028c11013..1ee5b88815 100644 --- a/lib/PerlIO.pm +++ b/lib/PerlIO.pm @@ -133,6 +133,22 @@ a known base on which to build e.g. will construct a "binary" stream, but then enable UTF-8 translation. +=item pop + +A pseudo layer that removes the top-most layer. Gives perl code +a way to manipulate the layer stack. Should be considered +as experimental. Note that C<:pop> only works on real layers +and will not undo the effects of pseudo layers like C<:utf8>. +An example of a possible use might be: + + open($fh,...) + ... + binmode($fh,":encoding(...)"); # next chunk is encoded + ... + binmode($fh,":pop"); # back to un-encocded + +A more elegant (and safer) interface is needed. + =back =head2 Alternatives to raw -- cgit v1.2.1