f



any perl tool to create a flow of perl scripts

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

0
2/24/2007 2:50:24 AM
comp.lang.perl.misc 33233 articles. 2 followers. brian (1246) is leader. Post Follow

11 Replies
670 Views

Similar Articles

[PageSpeed] 56

>>>>> "i" == iarunkumar  <iarunkumar@gmail.com> 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  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org
0
Uri
2/24/2007 4:37:15 AM
Uri Guttman wrote:

>>>>>> "i" == iarunkumar  <iarunkumar@gmail.com> 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
> 
:-[
0
john
2/24/2007 10:19:59 AM
john.swilting wrote:

> Uri Guttman wrote:
> 
>>>>>>> "i" == iarunkumar  <iarunkumar@gmail.com> 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)
0
john
2/24/2007 11:03:02 AM
On Sat, 24 Feb 2007 12:03:02 +0100, "john.swilting"
<john.swilting@wanadoo.fr> wrote:

>> :-[
>me, I start to improve me. I do not post any more in France. it does not
>like me

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

http://www.scsh.net/docu/html/man.html


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
0
Michele
2/24/2007 2:24:23 PM
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
0
john
2/24/2007 3:09:57 PM
On Sat, 24 Feb 2007 16:09:57 +0100, "john.swilting"
<john.swilting@wanadoo.fr> 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

If you can't help it, then do so.
If you can, please DON'T!


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
0
Michele
2/24/2007 4:56:08 PM
iarunkumar@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.

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
0
xhoster
2/24/2007 7:16:37 PM
iarunkumar@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
0
Mark
2/24/2007 7:46:01 PM
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

0
steve
2/25/2007 9:49:09 AM
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

0
gf
2/26/2007 5:53:04 PM
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.

0
blazar
2/27/2007 10:17:46 AM
Reply:

Similar Artilces:

deisng perl perl programmibng langs in perl
then liberate big war zones with notes on their download pages. -r www.thevoid1.net/ ...

Perl Help
Hello, I have two different scripts that do pretty much the same thing. The main perl script is on Windows. It runs and in the middle of it, it then calls out another perl script that then should run on a Unix box I have. Both scripts run ok, except for the part when Windows try's to call out the Unix script. I have it set up where the Unix is mapped through a drive letter and can drop stuff into the Unix box. It is going through another server to do that. So I can see the script and drop files into the Unix box but just can't figure out why perl will not call out the script. When I c...

how to run perl script from a perl script?
I have a rather interesting requirement. I have 2 perl scripts, and one of them should execute the other one. So lets say script a.pl should execute script b.pl. The output of the script b.pl should go into a specific file which only a.pl knows about. So I could do this from a.pl: system("perl b.pl >>mylog.log 2>&1"); But is there a better way? Currently I am doing this: require "b.pl"; But it doesn't redirect the output as I want it to. I am a perl noobie, so I am probably overlooking the correct way of doing this. anywherenotes@gmail.com wrote: &...

Running a Perl script from another Perl script
Hi all, I have two scripts: 1/ parser.pl which parses a text file and stuffs the relevant data into a mySQL DB - works fine no probs there 2/ importer.pl which I want to run through all the relevant files in a directory and run them through parser.pl I've got importer.pl to the stage where it can run through a directory and select the correct files to be processed, but I'm not sure how to pass each file over to parser.pl. I also need it to wait until parser.pl has finished processing a file before it passes it another file to process. I've read the fantastic Perl Cookbook but ...

perl script invoking a chain of other perl scripts ....
Hi , this question deals with a perl script that calls other perl scripts using 'exec' or 'system' call. I think it is a mute point and of no concern but I decided to ask just to be sure. Bascially I have something like this : Calling script file ---> #!/usr/bin/perl ..... ..... ..... my $cdpat2 = 'C:\Program Files'; my $cdpat1 = 'C:\DIR1 my $cdpat3 = 'C:\DIR2\STUFF\bin'; exec ("CalledScript1.pl $cdpath1 $cdpath2 $cdpath3"); exec ("CalledScript2.pl $cdpath1 $cdpath2 $cdpath3"); The question I have is that, do I need to worry about t...

Execute another perl script from my perl script
Hi, I have a perl script where I want to call another perl script. The perl script I want to call is ( including files): ${arc_bin}/addproj -p $project -r $release -i $isit -V $view I have tried eval() that I used in my shell script but it did not work. Any hints? //Mikael Petterson Mikael wrote: > Hi, > > I have a perl script where I want to call another perl script. > The perl script I want to call is ( including files): > > ${arc_bin}/addproj -p $project -r $release -i $isit -V $view > > I have tried eval() that I used in my shell script but it did not wor...

Trouble running Perl script from within a Perl script
Hi, I'm using Perl 5.10.1 on Ubuntu Linux 11.04. I want to run a Perl script B from within Perl script A. I can run Perl script B fine from the bash shell, but when I try and run it within Perl script A, it fails to execute with a "No such file or directory " error. I'm hoping someone might have some advice about what I'm overlooking. Here's how I create and spawn Perl script B ... my $cmd = "perl /opt/scripts/selenium/generate_test_suite.pl \"$ {project} USA Tests - ${module}\" \"$destTestDir\" \"$testSuiteFile\" "; runS...

perl script to pass data to another perl script?
Hello, Can anyone advise me how to pass data from one script to another script? The first script monitors data, and I want to pass parameters to that running script. A simple solution would be nice, but will I need to look into DDE, or Threads? Hope someone has done this :-) -- James (Ukjay) "PhEaSaNt PLuCKeR" <news@cutmeukjay.com> wrote: > Hello, > > Can anyone advise me how to pass data from one script to another script? There are lots of ways. The best is often not to do it in the first place. > The first script monitors data, and I want to pass param...

US-CA: Beverly Hills-Perl Developer - Perl Programmer - Perl Engineer
************************************************************** JobCircle.com is the largest regional job board in the Mid-Atlantic region, with tens of thousands of job offerings in PA, NJ, DE, MD, NY, and Washington D.C. To learn more, visit http://www.jobcircle.com?source=ng ************************************************************** Job Title: Perl Developer - Perl Programmer - Perl Engineer - Perl... Job Location: CA: Beverly Hills Pay Rate: competitive Job Length: full time Start Date: 2010-11-19 Company Name: Cybercoders Contact: Shea Stone ...

Compiling perl? perl??
I suspect this has been discussed in the past before, and so I searched around the web and virtually everything I found out there says perlcc is buggy and not to use it, especially in production, so my question is are there any reliable alternatives? Or is there some magic incantation to get perlcc to build without segment faulting as that's what it's doing to me? The problem I'm interesting is solving is getting something to run on a system that doesn't have perl installed. I know there are also those who want to compile as a way of hiding source, but I don't car...

Perl vs. perl
this is for T. do you know the difference between Perl (the language) and perl (the program)? let's hear you explain the difference. uri On 08/13/2015 08:07 PM, Uri Guttman wrote: > > this is for T. do you know the difference between Perl (the language) > and perl (the program)? let's hear you explain the difference. > > uri > Hi Uri, Homework! Homework! Why! Why! Why! K-I-D-S T-H-E-S-E D-A-Y-S! Wait! This is a test! Test! Test! I didn't know there was going to be a test! I over slept! My dog ate my paper! I went to Publik ...

CGI: Execute a perl script inside another perl script
Hello, I am using perl scripts as CGI. What I want to do is to call another perl script where I only set environment variables (envCGI.pl). If I set these variables in my initial perl script, it works well (I get my HTML page) but if I call the other perl script, I get: [12/Jan/2005:10:43:22] failure ( 632): for host 10.70.176.104 trying to POST /surcouf.cgi, cgi_scan_headers reports: HTTP4044: the CGI program C:\Perl\bin\perl.exe did not produce a valid header (program terminated without a valid CGI header. Check for core dump or other abnormal termination). Here is my perl script: #!C:...

problem calling perl script from SOAP server perl script
Hi I am trying to call a perl script from SOAP server side perl script, but no luck. following is the SOAP server perl script where I call other perl script. read_query function writes to a file okay, but does nothing for the two system calls after that. Any ideas? thanks in advance #!/usr/bin/perl use lib '../lib'; use SOAP::Transport::HTTP; SOAP::Transport::HTTP::CGI -> dispatch_to('predictor') -> handle; package predictor; sub read_query{ my $file=$_[0]; open (fileOUT, "> dBDataFiles/$file"); foreach $line (@_) { print fileOUT &q...

Issue in executing more than one perl script from Single perl script
Hi, I am calling "1.pl" from "main.pl" file. using #main.pl system ("perl 1.pl"); In this case it works fine. But when I am doing #main.pl system ("perl 1.pl"); system ("perl 2.pl"); then it doesn't executes "1.pl" properly. So I would like to know, is there any constraint for this? Do I need to take any precautions for this? Thanks, nilesh.sonawane@gmail.com <nilesh.sonawane@gmail.com> wrote: > But when I am doing > #main.pl > system ("perl 1.pl"); > system ("perl 2.pl"); > > the...

Web resources about - any perl tool to create a flow of perl scripts - comp.lang.perl.misc

Seal script - Wikipedia, the free encyclopedia
Seal script ( simplified Chinese : 篆书 ; traditional Chinese : 篆書 ; pinyin : zhuànshū ) is an ancient style of Chinese calligraphy . It evolved ...

China must follow its own reform script
Can China's authorities loosen up enough for China to complete its economic transition?

Tron is the ultimate PC cleanup script
... the process of disinfecting, cleaning and repairing a Windows PC. This isn’t as limited as it sounds, because the package is more than a script: ...

‘Star Wars: Episode VIII’ script is so incredible that J.J. Abrams now regrets not directing it
The range of emotions sparked by Star Wars: The Force Awakens is quite vast. While some moviegoers thought the film was an absolute triumph, ...

Gilead Sciences, Inc. Faces Troubled HCV Scripts as AbbVie Inc Scripts Go Up
Gilead HCV prescriptions decline, while AbbVie sees an increase in HCV scripts.

Google Apps Script: Tracking add-on usage with Google Analytics
... blog Posted by Romain Vialard, a Google Developer Expert and developer of Yet Another Mail Merge , a Google Sheets add-on. Google Apps Script ...

Bulls flip the script in stunning Christmas Day victory over Thunder
Chicago Tribune Bulls flip the script in stunning Christmas Day victory over Thunder Chicago Tribune The Bulls swept away their negative vibes ...

The Hateful Eight Ending Differences from Script Revealed - Collider
Brian Formo attended a live read of 'The Hateful Eight' in 2014 and he reveals all the ending changes from Quentin Tarantino's script to the ...

John Boyega Says Star Wars Episode VIII Has A Much Darker Script
, then Episode VIII will take cues from The Empire Strikes Back, adopting a darker tone, according [...]

The police protection playbook: how Ohio officials followed the script to the letter
The day ended with impassioned calls for calm; that Cleveland and Ohio residents be respectful and mindful of the process and the inevitable ...

Resources last updated: 2/3/2016 11:13:08 AM