--- On Thu, 8/5/10, Ludwig, Michael <[email protected]> wrote:

> From: Ludwig, Michael <[email protected]>
> Subject: RE: Programmatically compiling (perl -c) a Perl file
> To: [email protected]
> Date: Thursday, August 5, 2010, 8:39 PM
> > -----Original Message-----
> > From: p sena
> 
> > Well, might be possible with those hacks. However
> there would be some
> > more simpler solutions to this if we just need to
> compile check a list
> > of perl files.
> > For example a file 'a' consisting a statement of
> requiring file 'b' at
> > runtime, compile checking file a with conditions which
> makes file b
> > execute does serve the purpose.
> 
> Thanks, P Sena. Guess you're right. I want to make sure the
> files I'm
> dealing with do each compile individually without relying
> on others to
> have declared their global variables. If I have only one
> process to
> check a list of Perl files, crappy stuff might still
> compile because of
> other stuff having initialized it from afar.
> 
> > some kind of custom test scenarios scripted down can
> also come as a
> > rescue...
> 
> Getting each file to compile individually is my first step
> in a series
> of measures to raise code quality. Then, we can think about
> more
> advanced things like testing or perlcritic. You might have
> better
> ideas - if so, please let me know. Thanks!
> 
> -- 
> Michael Ludwig

It also depends on how you declare the globals in the file and how you use them 
in another file from where you require the first file.
Use strict and warnings enabled or are they already have it or not ? if not how 
are the compiled results and if yes how are they?

Generate a kind of test frame so as to write and execute test scripts for each 
perl file  from within the framework. These individual test scripts would 
comprise of various test cases/scenarios.
Formulate the case/scenarios such that it tests all scenes whetrein some 
globals gets used and sometimes not used may be.
Also, in same lines the scenarios where at  run time one file is required at 
times and not required sometimes.
Take look at do and eval from perldoc and see if it helps somewhere from a to 
z. The globals much in question, can be taken care from each individual test 
script and similar other things if exists.
There may be more than one test script corresponding to a perl file (original 
perl program to be tested). This can be done sequentally or parallely and 
depends on situations. RUn framework and observer/collect results/reports...

Thanks,
p sena


      

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to