in reply to isa() and taint checking

This code works for me. You have to type 'Child' at the prompt.

package Parent; package Child; @Child::ISA = 'Parent'; package main; chomp(my $in = <STDIN>); my $kid; if ($in =~ /(\w+)/) { $kid = $1; } print $kid->isa( 'Parent' ); print 'Child'->isa( 'Parent' );

My guess is that your untainter isn't doing what you think it's doing.

Replies are listed 'Best First'.
Re: Re: isa() and taint checking
by webby (Acolyte) on Oct 17, 2002 at 16:20 UTC
    Hmmm... Interesting. This is the actual code, where $directory is hard coded above. The require line (require $file) was broken until I fixed the taint checking.
    if($file =~ /^(\w*\.pm)$/) { $file = $1; $file = $directory."/".$file; require $file; $file =~ s/\//::/g; $file =~ s/\.pm$//; if ($file->isa('Objects::Parent')) { my $object = $file->new(); $object->doSomething(); } }