in reply to How to morph a plain module to OO
is still going to break if someone passes a reference argument that isn't an instance of the class. ($file will end up holding the errant reference.) You might as well just dosub isFile { my $self = shift if ref $_[0] && ref $_[0] eq $_[0]->{class}; my $file = shift; # a file in current directory expected
sub isFile { my $self = shift if ref $_[0]; my $file = shift;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How to morph a plain module to OO
by sauoq (Abbot) on Sep 07, 2002 at 19:22 UTC |