Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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 "dirty.pm";
      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]/DoxyDocs.pm"; 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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://432987]
Approved by Arunbear
help
Chatterbox?
[erix]: I've been to Amsterdam before you were born
[LanX]: 1899?
[chacham]: Just paint the white house black again.
dbander snorts
LanX Gesundheit! :)
talexb wonders about dividing developers in those born before the Unix timestamp of zero .. and after. Spoiler: I'm before.
chacham remebers I am a mad scientist
[stevieb]: talexb I'm after by a few years, but we can still be friends because you live in my hometown ;)

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (12)
As of 2017-08-18 13:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (302 votes). Check out past polls.

    Notices?