in reply to My first attempt at inheritance
Then fix the @ISA assignment by using parent.
#!/usr/bin/perl use strict; use warnings; use autodie; use IO::Dir; my $dh = IO::Dir::pl->new('.'); while (my $file_name = $dh->read){ print STDOUT "$file_name\n"; } package IO::Dir::pl; use parent -norequire, qw(IO::Dir); sub read{ my $self = shift; warn "Ok We got here.\n"; return undef; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: My first attempt at inheritance
by fishmonger (Chaplain) on Jun 01, 2013 at 14:15 UTC | |
by BillKSmith (Monsignor) on Jun 01, 2013 at 20:32 UTC |