in reply to Making my own PerlIO layer

Update:Sorry I haven't been more forthcoming on this. I rna into a project that's consumed a lot of my time. My original module looks like this:
package RDW; use strict; use warnings; use Carp; require Exporter; our( $VERSION, @ISA, @EXPORT ); $VERSION = "0.1"; @ISA = qw(Exporter); sub rdw_open { my $self; my $class = shift; my $file = shift; $file =~ s/^/</ if ( $file =~ m!^/?\w! ); open( my $fh, $file, @_ ) or return undef; $self->{FILE} = $fh; #$self->{FILENAME} = $filename; bless $self, $class; return $self; } sub rdw_close { my $self = shift; my $fh = $self->{FILE}; close($fh) or return undef; return 1; } sub read_rdw { my $self = shift; my $fh = $self->{FILE}; my ( $rec_len, $rc, $len, $ret_val ); # Read record length $rc = sysread( $fh, $rec_len, 2 ); ( !defined($rc) ) && die "ERROR: rdw_read() failed read.\n"; $len = unpack( "S", $rec_len ); # Read record data if ( !defined($len) ) { return undef; } $rc = sysread( $fh, $ret_val, $len ); ( !defined($rc) ) && die "ERROR: rdw_read() failed read.\n"; # Return record data return $ret_val; } sub write_rdw { my $self = shift; my $fh = $self->{FILE}; my $line = join "", @_; print( $fh pack( "S", length($line) ), $line ) or croak "Can't write record to file: $!"; }
My attempts at the PerlIO layer thus far are pretty pitiful. I guess I'm not understanding what the purpose of the PUSHED function is vs the OPEN function. From what I can tell, my OPEN will just be a call to my rdw_open. Similarly, FILL is just a wrapper around read_rdw and WRITE around write_rdw. I can't for the life of me figure out what PUSHED is supposed to do, however.

Also, feel free to comment on the original module. Perhaps there's some modifications that could be made there that would make the work here easier.

thor

Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come