473,396 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Merge diff processes(.pl files) to one main program(.pl)

In my program I have different .pl files.I come to a last stage of merging all files.

my most of the program generate text file and that i need to give input to next process.Output of one file(Text file) to input to another.
for example
1)htmltotext.pl converts html file to text file then
2)tockenized.pl converts text file with all tockens which again i am storing in text file.

there are around 6 more processes i am doing at each point and alli need to do in sequence.

I tried writing main.pl but i don't understand, how do i call all .pl files.i am working on linux.
i tried by creating .pm files and calling all processes as a functions but somehow it don't work.
can any one give a thought on this ?
Nov 12 '06 #1
3 1795
GunnarH
83
Suggested reading:

perldoc perlmod
perldoc perlsub

If that doesn't help you solve the problem, show us some code.
Nov 12 '06 #2
Thanks, I do read but I still need to know which approach is good to use.
I am working on Linux.
I was thinking to use System and pipe commond
to call one program(.pl t.txt) at a time and send it's output to next .pl and next....

second apprach i was thinking was,
call diff modules:
exmp
main.pl

require htmltotext qw(get_html);
require tockenized qw(get_tocken);
require calculate qw(get_cal);
$file=@ARGV[0];
open(OUT,'Query.txt' )|| die "$!";
print OUT htmltotext::get_html($file);
my $tockenized_file=tockenized::get_tocken('Query.txt ');
calculate::get_cal($tockenized_file);

and output of calculate need to be displayed on console.

My problem with this approch is when i am trying to call diff functions from diff modules(.pm files) my program don't gives me output but individually runs perfectly well.
this each of the function is having many small subrutine and have used many modules used in it.
exp
get_html used HTML::Parser ..etc

all works with this main program alone but when i am trying to do next step.it don't give me any output.

is the module having it's own global variables ?

thanks ..

Suggested reading:

perldoc perlmod
perldoc perlsub

If that doesn't help you solve the problem, show us some code.
Nov 13 '06 #3
GunnarH
83
Thanks, I do read but I still need to know which approach is good to use.
I'd say that the preferred approach would be the use of modules in .pm files.

... output of calculate need to be displayed on console.

My problem with this approch is when i am trying to call diff functions from diff modules(.pm files) my program don't gives me output but individually runs perfectly well.
It's difficult to understand what your problem is. Please post some short and simplified code, that illustrates what it is you are trying to do. Something like this:
Expand|Select|Wrap|Line Numbers
  1. # main.pl
  2. use Mymodule;
  3. my @numbers = (2, 4, 3);
  4. my $product = Mymodule::multiply( @numbers );
  5. print "$product\n";
  6.  
  7. # Mymodule.pm
  8. package Mymodule;
  9. sub multiply {
  10.     my $product = shift;
  11.     $product *= $_[$_] for 0..$#_;
  12.     $product;
  13. }
  14. 1;
  15.  
Nov 14 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Luciano Cavallero | last post by:
Hi, I'm looking for a Diff utility for C++ class, able to show differences two class in term of methow, properties etc. I know that this is more complex that a common diff files because need a...
2
by: Colin Halliday | last post by:
I have a Word 2003 mail merge main document (form letter) that is linked to another Word document data source for the mail merge. If I open this doc using the Word GUI, it first asks me to...
6
by: Stefan Schwärzler | last post by:
hi ng, there is an html-file on a webserver, i.e. web34.htm every day, the file will be updated and extended. i'm looking for php-code, that show me the difference or better, the new text between...
1
by: G Gerard | last post by:
Hello I have built an application using MSAccess 2000 that has a feature where the user can select a list of clients and then send fields from the client table to a .txt file to be used...
2
by: Tom Costanza | last post by:
For the life of me, I can't seem to merge main menu items from child to parent with MDI forms. I can merge sub-menus, but not main menu items. So I have a parent form with: File Windows Help...
1
by: earthwormgaz | last post by:
Is there anything in Boost (or elsewhere if needs be) that will allow me to diff/merge files? I am writing out a data file, and I want to merge it with an existing on if its there.
3
by: =?Utf-8?B?UG9vamE=?= | last post by:
Hi I have been using Microsoft XmlDiffPatch to compare 2 XML files. I wanted to know if there is any Microsoft Tool which can be used to compare two HTML files in the similar manner or any...
1
by: turnerca902 | last post by:
Hi Folks, I am working on a little project and hoping someone out there might offer me some info/insight. I have a folder containing about 50 html files where the contents look like this: ...
1
by: Manish | last post by:
Hi i have a problem where as i want to use two different C# net program in a single system where i have used 2 different sql server name. when i execute those program each time iam renaming the...
0
by: newlasdjfk | last post by:
Is anyone familiar with Zend Pdf framework and knows how to use it to merge two pdf-files. Trying to open and merge 2 pdf-files. Gives me the following error. ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.