home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl560.zip / t / lib / tie-push.t < prev    next >
Text File  |  1999-07-20  |  418b  |  25 lines

  1. #!./perl
  2.  
  3. BEGIN {
  4.     chdir 't' if -d 't';
  5.     unshift @INC, '../lib';
  6. }    
  7.  
  8. {
  9.  package Basic;
  10.  use Tie::Array;
  11.  @ISA = qw(Tie::Array);
  12.  
  13.  sub TIEARRAY  { return bless [], shift }
  14.  sub FETCH     { $_[0]->[$_[1]] }
  15.  sub STORE     { $_[0]->[$_[1]] = $_[2] }
  16.  sub FETCHSIZE { scalar(@{$_[0]}) }
  17.  sub STORESIZE { $#{$_[0]} = $_[1]-1 }
  18. }
  19.  
  20. tie @x,Basic;
  21. tie @get,Basic;
  22. tie @got,Basic;
  23. tie @tests,Basic;
  24. require "op/push.t"
  25.