[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-unattended/var/se3/unattended/install/linuxaux/opt/perl/lib/5.10.0/Tie/ -> StdHandle.pm (source)

   1  package Tie::StdHandle; 
   2  
   3  use Tie::Handle;
   4  our @ISA = 'Tie::Handle';
   5  use Carp;
   6  
   7  sub TIEHANDLE 
   8  {
   9   my $class = shift;
  10   my $fh    = \do { local *HANDLE};
  11   bless $fh,$class;
  12   $fh->OPEN(@_) if (@_);
  13   return $fh;
  14  }
  15  
  16  sub EOF     { eof($_[0]) }
  17  sub TELL    { tell($_[0]) }
  18  sub FILENO  { fileno($_[0]) }
  19  sub SEEK    { seek($_[0],$_[1],$_[2]) }
  20  sub CLOSE   { close($_[0]) }
  21  sub BINMODE { binmode($_[0]) }
  22  
  23  sub OPEN
  24  {
  25   $_[0]->CLOSE if defined($_[0]->FILENO);
  26   @_ == 2 ? open($_[0], $_[1]) : open($_[0], $_[1], $_[2]);
  27  }
  28  
  29  sub READ     { read($_[0],$_[1],$_[2]) }
  30  sub READLINE { my $fh = $_[0]; <$fh> }
  31  sub GETC     { getc($_[0]) }
  32  
  33  sub WRITE
  34  {
  35   my $fh = $_[0];
  36   print $fh substr($_[1],0,$_[2])
  37  }
  38  
  39  
  40  1;


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1