Unusing modules

Simon Taylor simon at unisolve.com.au
Mon Nov 10 19:44:27 CST 2003

Hi Rick,

> I have a CPAN module loaded (PDF::API2) that appears not to work too
> well creating multiple PDFs. It appears that if I could unload the
> module somehow, I'd be fine. I could trace through it all, but if
> anyone's ever looked at the innards of PDF they'd see that I'm
> screwed :)
> Is it possible to get perl to destroy the currently used module and
> then use it again?
> Yes, I'm hoping for some sort of hack and I know its not really the
> right way to do it, but I need something quick at the moment :)

I *was* going to reply saying: 

    "Does the 'no' command do what you want in this case?", 

but the following quick test didn't behave the way I thought it should:

#!/usr/bin/perl -w

use strict;

use CGI;
my $q1 = new CGI;
print $q1->header();

no CGI;
my $q2 = new CGI;
print $q2->header();

because $q2 works quite happily.... I must be misunderstanding 'no'.  Oops ;-)

exit 0; Simon
Unisolve Pty Ltd - Melbourne, Australia
+61 3 9568 2005

More information about the Melbourne-pm mailing list