Hmm. Odd, I went ahead and double checked it (my code) on my box and I can't seem to reproduce what you are seeing. However, I did notice a lil annoyance that I went ahead and fixed. Before getting to that though I will show you what I see when I run the script on my box:

Do you mind pasting a screenshot of what you see with your output?

Now, for the annoyance. I noticed unneeded linefeeds getting in the fixed files. Easy to fix. Go to the lines where it does this:


     61             ( my $newline = $line ) =~ s/\.html/\.asp/g;
     62
     63             #print "Substitution written was: [[ ";
     64             #print "$newline";
     65             #print " ]]\n";
     66
     67             $changed = "1";
     68             $lcount++;
     69
     70 # append that to the new file.
     71             print NEW "$newline\n";
     72         } else {
     73 # otherwise just append the old line into
     74 # the file.
     75             print NEW "$_\n";
     76         }

Remove the '\n's in the print statements. That fixed that lil problem for me. As for the code you are writing to supplement what I have done, unfortunately I don't have a lot of time to look at it right now being that I am at work and should be...he hem..well, working =P. I will check it closer tonight (later for me...gotta spend time with my family. I usually wait till my wife goes to sleep to play).

Good luck. If you want, we can talk more about it in real time in irc /server irc.openprojects.net #perl or we can continue to do this.

----------
- Jim


In reply to Re: Re: Re: Re: Re: Changing .html to .asp by snafu
in thread Changing .html to .asp by Anonymous Monk

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.