smackdab has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

On Windows:
I am currently doing this and wonder if it a good technique...it has been working for me...

I probably wouldn't be asking about this except that I am trying to get my program to use -d:DProf and, while I CAN T prove it, it *seems* like DProf doesn't like this syntax 100% of the time. I get random crashes and *think* it might be related..anyone know how to get debug info out of this before the GP fault?

FILE=prog.pl { our $var1 = 'hi'; our $var2; FILE=subs/input.pm { if ($main::var1 =~ //) FILE=subs/output.pm { if ($main::var1 =~ //)

I don't like long source files and I want something similar for this type code and for OO modules. thanks!!!

Replies are listed 'Best First'.
Re: breaking apart program (and maybe DProf prob)
by pg (Canon) on Apr 03, 2003 at 06:11 UTC
    Couple of thoughts:
    1. I don't know whether you noticed that  $a =~ // matches anything, It evaluates to true even if $a is undef, although in this case a warning would be given. Not sure about your purpose of doing this.
    2. Use $main::var1 in an OO-style module violates the purpose of OO/encapsulation.
Re: breaking apart program (and maybe DProf prob)
by chromatic (Archbishop) on Apr 03, 2003 at 20:44 UTC

    I've had random crashes with DProf in many programs that otherwise worked fine. I don't particularly trust the module, preferring Devel::SmallProf. I seem to recall p5p discussions that came to similar conclusions, but don't know if it's been fixed in recent months.