S a typo? Does that mean you didn't copy and paste the code but wrote it down a second time? In that case are you sure both programs are identical now?

One thing you might do now is debugging. I.e. put print statements into you code to check the changes in $_. Your loop might look like this:

print "REPLACE <$pattern> with <$replacement>\n"; while (<IN>) { # print "<$_>\n"; S/$pattern/$replacement/g; print "AFTER <$_>\n"; print OUT $_; } # end while

Or you might use perls debugger where you can execute a line, look at any and all variables you like, execute the next line, look at .... Just call your script with perl -d and use 's' or 'n' to single step and 'p $_' to see the contents of variable $_, for example. 'h' gives you a help page. It is really simple and easy to work with, read 'man perldebug if you want to know more'


In reply to Re^2: Not A Rockstar File Manipulator Today by jethro
in thread Not A Rockstar File Manipulator Today by koolgirl

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.