in reply to My first attempt at inheritance
You might be interested in Subclass::Of, an idea I've been working on recently...
#!/usr/bin/env perl use strict; use warnings; use Subclass::Of "IO::Dir", -as => "My_IO_Dir", -methods => [ read_pl => sub { my $self = shift; warn "Ok We got here.\n"; return undef; }, ]; my $dh = My_IO_Dir->new('.'); while (my $file_name = $dh->read_pl()) { print STDOUT "$file_name\n"; }
|
|---|