Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

use dirty .pm

by Jaap (Curate)
on Feb 21, 2005 at 09:52 UTC ( #432987=perlquestion: print w/ replies, xml ) Need Help??
Jaap has asked for the wisdom of the Perl Monks concerning the following question:

I'm currently using Doxygen which creates a .pm file that looks like this:
$doxydocs= { classes => [ ], namespaces => [ ], files => [ { name => 'agc_1fs.hdf.c', includes => [ ...
These are the first 10 lines, so there is no package declaration or anything.

How do i get to it's $doxydocs variable in a strict and warnings enabled way?

Comment on use dirty .pm
Select or Download Code
Replies are listed 'Best First'.
Re: use dirty .pm
by PodMaster (Abbot) on Feb 21, 2005 at 10:35 UTC
    How do i get to it's $doxydocs variable in a strict and warnings enabled way?
    You require the file as usual, but before you do, you predeclare the variable(s), namely $doxydocs, using vars or our.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Re: use dirty .pm
by betterworld (Deacon) on Feb 21, 2005 at 10:23 UTC
    The only solution I can think of is something like
    use strict; use warnings; my $doxydocs = do "";
      If i do that, $doxydocs contains the value "1", and i still can't access the data. Even when i do this:
      my $a = do "$ARGV[0]/"; print Dumper($doxydocs), "\n";
      I get the error that $doxydocs is empty.
        In your example, $doxydocs is in fact empty, but $a is not. Try print Dumper($a)."\n";

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://432987]
Approved by Arunbear
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2015-11-28 23:58 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (746 votes), past polls