Hi greetings to everyone.I am here to seek the wisdom of monks,here is my issue.In this this module(prerequest_collect_files_db_url) i have to create 2 text files and in next module(prerequest2.pl) i have to compare both text files.But text files are created only at the end of second module.so i cant find the difference.can some one please help me on this.I need those text files before it calls "prerequest2.pl"

sub prerequest_collect_files_db_url { open(FILE, "C:/Users/jeyakuma/Desktop/shipping project/input/input.txt +"); open HTML1,">C:/Users/jeyakuma/Desktop/shipping project/url processin +g/competitors_in_url.txt"; while(<FILE>) { chomp; $url=$_; foreach ($url) { do 'C:/Users/jeyakuma/Desktop/perl/xpathconfiguration.pl'; &domain_check(); $x="$competitor.html"; print HTML1 "$x\n"; } } open HTML2,">C:/Users/jeyakuma/Desktop/shipping project/url processing +/competitors_in_directory.txt"; opendir(DIR, "C:/Users/jeyakuma/Desktop/shipping project/database"); @files = grep(/\.html$/,readdir(DIR)); foreach $file (@files) { print HTML2"$file\n"; } } closedir dir; close HTML1; close HTML2; close FILE; do "C:/Users/jeyakuma/Desktop/perl/prerequest2.pl"; &find_missing_files();
sub find_missing_files { use strict; use warnings; use List::Compare; open F, "<C:/Users/jeyakuma/Desktop/shipping project/url processing/co +mpetitors_in_url.txt" ; open S, "<C:/Users/jeyakuma/Desktop/shipping project/url processing/co +mpetitors_in_directory.txt" ; my @a=<F>; my @b=<S>; my $lc = List::Compare->new(\@a,\@b); my @intersection = $lc->get_intersection; my @firstonly = $lc->get_unique; my @secondonly = $lc->get_complement; #print "Common Items:\n"."@intersection"."\n"; print "Please configure and create dump in Databse for this competitor +s !!\n"."\n@firstonly"."\n"; print "please give the input URL for the following competitiors !!\n". +"\n@secondonly"."\n"; } }

Expected out put at the end of "prerequest_collect_files_db_url"

text1

text2

expected o/p after prerequest.pl

file missed in dir are a,b,c

file missed in text

current result after prerequest.pl

text1

text2


In reply to text files are printed after the end of second module by myfrndjk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.