GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  PERLIO::VIA::DYNAMIC (3)

.ds Aq ’

NAME

PerlIO::via::dynamic - dynamic PerlIO layers

CONTENTS

SYNOPSIS



 open $fh, $fname;
 $p = PerlIO::via::dynamic->new
  (translate =>
    sub { $_[1] =~ s/\$Filename[:\w\s\-\.\/\\]*\$/\$Filename: $fname\$/e},
   untranslate =>
    sub { $_[1] =~ s/\$Filename[:\w\s\-\.\/\\]*\$/\$Filename\$/});
 $p->via ($fh);
 binmode $fh, $p->via; # deprecated



DESCRIPTION

PerlIO::via::dynamic is used for creating dynamic PerlIO layers. It is useful when the behavior or the layer depends on variables. You should not use this module as via layer directly (ie :via(dynamic)).

Use the constructor to create new layers, with two arguments: translate and untranslate. Then use $p-via ($fh)> to wrap the handle. Once <$fh> is destroyed, the temporary namespace for the IO layer will be removed.

Note that PerlIO::via::dynamic uses the scalar fields to reference to the object representing the dynamic namespace.

OPTIONS

translate A function that translate buffer upon write.
untranslate A function that translate buffer upon read.
use_read Use READ instead of FILL for the layer. Useful when caller expect exact amount of data from read, and the untranslate function might return different length.

By default PerlIO::via::dynamic creates line-based layer to make translate implementation easier.

AUTHORS

Chia-liang Kao <clkao@clkao.org>

COPYRIGHT

Copyright 2004 by Chia-liang Kao <clkao@clkao.org>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See <http://www.perl.com/perl/misc/Artistic.html>

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DYNAMIC (3) 2012-11-04

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.