Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

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?

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 (Curate) 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
Domain Nodelet?
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 romping around the Monastery: (3)
As of 2021-10-19 08:20 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (76 votes). Check out past polls.