jiwei800715 has asked for the wisdom of the Perl Monks concerning the following question:
program2 : read TXT files and write them in one bin file$FH = FileHandle::Rollback->new("> $filepath") or die "cannot open fil +ehandle: $!"; select($FH); for my $i(0..$#{$temp_array1[0]}) { my $stringline=join(" ",@{$temp_array1[0]->[$i]}); print("$stringline \n"); } $FH->commit;
usually, I run program2 when program1 is finished, but now it is a need to run both on the same time,which means we need interprocess comunication between these two programs. I dont want to connect them in threads way, It is not stable on windows Xp . Is there any easy way to send task from program1 to program2 ,and let program2 waiting for task? thanksopendir(my $FILELIST,"temp")|| die $_; while(my $filename=readdir($FILELIST)) { my @temp_ref=grep{($_->{SecID}.substr($_->{Date},0,4).subs +tr($_->{Date},5,2).substr($_->{Date},8,2).".TXT") eq $filename}@Task_ +list; my $TaskRef=$temp_ref[0]; if((-e-r $TXTfilepath.$filename)&&defined($TaskRef)) { &writebin($TaskRef) } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: send info between 2 programs
by Anonymous Monk on Mar 17, 2009 at 10:02 UTC | |
by jiwei800715 (Novice) on Mar 17, 2009 at 10:41 UTC | |
by frieduck (Hermit) on Mar 17, 2009 at 20:46 UTC |