in reply to Re: isa() and taint checking
in thread isa() and taint checking
File 2 - Objects/Parent.pm#!/usr/bin/perl -wT use strict; use lib '.'; use Objects::Parent; loadObjects('Objects'); sub loadObjects { my $directory = shift; opendir(DIR, $directory) or die "Object Templates can't be loa +ded: Can't open $directory: $!"; while (defined(my $file = readdir(DIR))) { if($file =~ /^(.*\.pm)$/) { $file = $1; $file = $directory."/".$file; require $file; $file =~ s/\//::/g; $file =~ s/\.pm$//; if($file->isa('Objects::Parent')) { my $tempObject = $file->new(); $tempObject->doSomething(); } } } }
File 3 - Objects/Child.pmpackage Objects::Parent; sub new { bless {}, shift; } sub doSomething { print "Something\n"; } 1;
package Objects::Child; use base 'Objects::Parent'; 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(bbfu) (cheap hack) Re3: isa() and taint checking
by bbfu (Curate) on Oct 17, 2002 at 18:45 UTC | |
by chromatic (Archbishop) on Oct 17, 2002 at 19:08 UTC | |
by bbfu (Curate) on Oct 17, 2002 at 21:11 UTC | |
|
Re: Re: Re: isa() and taint checking
by antifun (Sexton) on Oct 17, 2002 at 19:04 UTC |