Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > any perl tool to create a flow of perl scripts

Reply
Thread Tools

any perl tool to create a flow of perl scripts

 
 
iarunkumar@gmail.com
Guest
Posts: n/a
 
      02-24-2007
We have hundreds of perl scripts being used. It's hard to debug and
don't know the flow like which one is calling which. Is there any tool
that creates a flow chart like giving a visual view of multiple perl
scripts.

Thanks
Arun

 
Reply With Quote
 
 
 
 
Uri Guttman
Guest
Posts: n/a
 
      02-24-2007
>>>>> "i" == iarunkumar <> writes:

i> We have hundreds of perl scripts being used. It's hard to debug and
i> don't know the flow like which one is calling which. Is there any tool
i> that creates a flow chart like giving a visual view of multiple perl
i> scripts.

sounds like a bad design to begin with. having scripts calling scripts
is slower and harder to debug. convert most/many to modules and you will
be able to track their usage better, improve speed and ease
maintenance. otherwise tracking will need something like strace to see
what procs get called.

in other words, hire a quality perl professional to refactor your mess
into a cleanly designed system.

uri

--
Uri Guttman ------ -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
 
Reply With Quote
 
 
 
 
john.swilting
Guest
Posts: n/a
 
      02-24-2007
Uri Guttman wrote:

>>>>>> "i" == iarunkumar <> writes:

>
> i> We have hundreds of perl scripts being used. It's hard to debug and
> i> don't know the flow like which one is calling which. Is there any
> tool i> that creates a flow chart like giving a visual view of multiple
> perl i> scripts.
>
> sounds like a bad design to begin with. having scripts calling scripts
> is slower and harder to debug. convert most/many to modules and you will
> be able to track their usage better, improve speed and ease
> maintenance. otherwise tracking will need something like strace to see
> what procs get called.
>
> in other words, hire a quality perl professional to refactor your mess
> into a cleanly designed system.
>
> uri
>

:-[
 
Reply With Quote
 
john.swilting
Guest
Posts: n/a
 
      02-24-2007
john.swilting wrote:

> Uri Guttman wrote:
>
>>>>>>> "i" == iarunkumar <> writes:

>>
>> i> We have hundreds of perl scripts being used. It's hard to debug and
>> i> don't know the flow like which one is calling which. Is there any
>> tool i> that creates a flow chart like giving a visual view of multiple
>> perl i> scripts.
>>
>> sounds like a bad design to begin with. having scripts calling scripts
>> is slower and harder to debug. convert most/many to modules and you will
>> be able to track their usage better, improve speed and ease
>> maintenance. otherwise tracking will need something like strace to see
>> what procs get called.
>>
>> in other words, hire a quality perl professional to refactor your mess
>> into a cleanly designed system.
>>
>> uri
>>

> :-[

me, I start to improve me. I do not post any more in France. it does not
like me
(co)
 
Reply With Quote
 
john.swilting
Guest
Posts: n/a
 
      02-24-2007
Michele Dondi wrote:

> Here, instead, I bet most people like you as much as to acknowledge
> your contributions to the group along the lines of acknowledged people
> in

if I can help it, I would post a solution
 
Reply With Quote
 
xhoster@gmail.com
Guest
Posts: n/a
 
      02-24-2007
wrote:
> We have hundreds of perl scripts being used. It's hard to debug and
> don't know the flow like which one is calling which.


How is this calling taking place?

> Is there any tool
> that creates a flow chart like giving a visual view of multiple perl
> scripts.


I'd use the system's grep, find, etc.. Or maybe Perl.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
 
Reply With Quote
 
Mark Clements
Guest
Posts: n/a
 
      02-24-2007
wrote:
> We have hundreds of perl scripts being used. It's hard to debug and
> don't know the flow like which one is calling which. Is there any tool
> that creates a flow chart like giving a visual view of multiple perl
> scripts.


Autodia will help you to analyse individual scripts and the modules they
use. If your applications aren't modularized at all then this is going
to be of limited value.

Mark
 
Reply With Quote
 
steve
Guest
Posts: n/a
 
      02-25-2007
On Feb 24, 7:46 pm, Mark Clements <mark.clementsREMOVET...@wanadoo.fr>
wrote:
> iarunku...@gmail.com wrote:
> > We have hundreds of perl scripts being used. It's hard to debug and
> > don't know the flow like which one is calling which. Is there any tool
> > that creates a flow chart like giving a visual view of multiple perl
> > scripts.

>
> Autodia will help you to analyse individual scripts and the modules they
> use. If your applications aren't modularized at all then this is going
> to be of limited value.
>
> Mark


Hi Arun,
I'm working on something similar for testcases that have
dependancies on other testcases, build a graphical representation of
these dependancies

steve

 
Reply With Quote
 
gf
Guest
Posts: n/a
 
      02-26-2007
On Feb 23, 7:50 pm, iarunku...@gmail.com wrote:
> We have hundreds of perl scripts being used. It's hard to debug and
> don't know the flow like which one is calling which. Is there any tool
> that creates a flow chart like giving a visual view of multiple perl
> scripts.


This is a messy solution, but you've already got a messy problem so it
can only help...

Write a bit of code to add a line to each of the Perl scripts that are
in your execution paths. Since you don't know for sure what's called
by what you need the line in all scripts.

That line needs to append a trace message to a single file that you
define using a date/time stamp and the name of the running program,
plus its passed in arguments. You might even want to dump the
environment too if you suspect there's significant information being
used there too.

Something like this (untested line) should work...

1 and open (my $__LOG, '>>', '/absolute/path/to/writable/log'),
print $__LOG scalar(localtime),"\t","$0 @ARGV\n",
close($__LOG);

(I wrapped the line to help it survive formatting by news browsers so
unwrap it into a single line.)

You can insert that line into your scripts by running something like
this untested and simplistic code...

#!/usr/bin/perl

use warnings;
use strict;

my $code = q{
1 and open (my $__LOG, '>>', '/absolute/path/to/writable/log'),
print $__LOG scalar(localtime),"\t$0 @ARGV\n",
close($__LOG);
};
foreach (@ARGV)
{
if ( open( my $FI, '<', $_ ) && open( my $FO, '>', "$_.new" ) )
{
while (<$FI>)
{
print $FO $code, "\n" if ( $. == 2 );
print $FO $_;
}
}
close $FO;
close $FI;
rename $_, "$_.old";
rename "$_.new", $_;
}

Then, as the application runs each script will update the log file
showing when they were called and what their parameters were.

You'll have a starting point to track down the execution flow then.

As you get things figured out or don't want something writing to the
log, change the leading 1 to a 0 in the code files you understand and
that file will 'gnore the log statement.

Just be very aware that this can create a very large log file in a
very short time, depending on the activity and structure of the
overall application.

Greg

 
Reply With Quote
 
blazar
Guest
Posts: n/a
 
      02-27-2007
On 26 Feb, 18:53, "gf" <greg.fergu...@icrossing.com> wrote:
> On Feb 23, 7:50 pm, iarunku...@gmail.com wrote:


> Something like this (untested line) should work...
>
> 1 and open (my $__LOG, '>>', '/absolute/path/to/writable/log'),
> print $__LOG scalar(localtime),"\t","$0 @ARGV\n",
> close($__LOG);

[snip]
> As you get things figured out or don't want something writing to the
> log, change the leading 1 to a 0 in the code files you understand and
> that file will 'gnore the log statement.


1) At first I didn't understand the C<1 and> bit. In light of the
explanation above, I do. Yet I find it somehow confusing. People
generally use a C<DEBUG> constant set at the top of their scripts
instead. I understand that here the situation is slightly different,
because it's not a matter of debugging single scripts but a whole
bunch of them, and I see the usefluness of a simple "tag" to be
recognized and automatically changed. Anyway a thing like

use constant DEBUG => 1;

is also easy to find and replace with

use constant DEBUG => 0;

Alternatively one can use an environment variable, and even a mixed
approach like thus:

use constant DEBUG => $ENV{THIS_JOB_DEBUG};

So that she can turn it definitely on or off for individual scripts.

2) Your code as suggested won't work: a lexical variable is not
available in the same statement that defines it:

$ cat foo.pl
#!/usr/bin/perl

use strict;
use warnings;

1 and open (my $__LOG, '>>', '/absolute/path/to/writable/log'),
print $__LOG scalar(localtime),"\t","$0 @ARGV\n",
close($__LOG);

__END__

$ perl foo.pl
Global symbol "$__LOG" requires explicit package name at foo.pl line
7.
Global symbol "$__LOG" requires explicit package name at foo.pl line
8.
Execution of foo.pl aborted due to compilation errors.

Though you may convert it to something that *does* work:

if (DEBUG) {
open my $__LOG, '>>', '/absolute/path/to/writable/log'
or die "$!\n!";
print $__LOG scalar(localtime),"\t","$0 @ARGV\n",
}

3) In addition to your conceptually good suggestion, I don't know
*how* each script "calls" other ones, but the OP may want to "trap"
each of them by overloading some core functions or operators, if that
is possible.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is required for perl scripts to run correct when launched from rc scripts on HPUX 11? deanjones7@gmail.com Perl Misc 13 09-10-2007 11:58 AM
Query:difference between node flow and filter flow in java's I/O,system? Jack Dowson Java 0 05-07-2007 03:35 PM
Tool to create Perl based scripts IJALAB Perl Misc 3 02-22-2007 01:36 PM
501 PIX "deny any any" "allow any any" Any Anybody? Networking Student Cisco 4 11-16-2006 10:40 PM
OT: C/C++ flow tool? jj C++ 2 01-31-2004 03:43 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57