Hi greetings to everyone.I am here to seek the wisdom of monks,here is my issue.

This seems familiar, maybe you missed my reply from yesterday Re: loop exits after printing the file

do is not how perl programmers make modules, or use modules; modules should only define/create subroutines, they shouldn't do anything on their own ... there should be no code outside of subroutines, subroutines should be self contained

Making a real module is easy if you follow these examples: Re: loop exits after printing the file, zentara package/module tutorial

If you write code this way and create real modules, with subroutines that take arguments and return values, it will be easy to figure out why you need to call your program twice for the files to be created in time to do the comparison

MakeFilesOrDie( $these, $files ); CompareFilesOrDie( $these, $files );

What you have posted is like a magic act

$url=$_; &domain_check(); $x="$competitor.html";

What does domain_check do? Where does $competitor come from?

Why doesn't domain_check take arguments?

Why doesn't domain_check return values?

Maybe it should be  my $competitor = domain_check( $url ); but its impossible to know, your posted program has many missing pieces...

Its like a buying stuff at a store, the buyer doesn't reach into the cash register to pay for items and get change, the buyer gives money to cashier, the cashier gives change back or ask for more money

my $change = gimmeChange( '20USD', 'milk','cookies' ); sub gimmeChange { my( $payment , @items ) = @_; my $price = gimmePrice( @items ); my $diff = $payment - $price; if( $payment < $price ){ warn "You don't have enough money, you need $diff"; } return $diff; }

In reply to Re: text files are printed after the end of second module by Anonymous Monk
in thread 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.