in reply to list in input

pabla23:

You can merge your programs fairly easily, it seems. Turn them both into subroutines by wrapping the "interesting" bits:

# Array declarations, use modules and initialization stuff for # both scripts go here sub get_list_of_foo { my @out_list; # the interesting part of your first script # in your loop { # Replace your print statement with something like: push @out_list, $mio2; # } return @out_list; } sub report_on_all_foos { # get the list on things we want to report my @input_list = @_; # Now we'll wrap your second script in a for loop so you # can do it for each match in the list previously # generated for my $match (@input_list) { # the interesting part of your second script goes here } } # Now, to put it together: report_on_all_foos( get_list_of_foos() );

Overall, it's usually not terribly difficult to merge scripts like this. There are a few details you'll likely have to clean up, such as conflicting variable names, but that's the basic approach. If either script is slow, then the resulting program is likely to be slow, too. If that happens, you may have to look over your script(s) for operations that are repeated often (such as scanning through the files) and put the interesting information into arrays or hashes so you can reuse the results.

...roboticus

When your only tool is a hammer, all problems look like your thumb.