I'm not entirely sure what your trying to achieve as you seem to be reading from both files and writing back to one, but hopefully this will put you more on the right track

1) I think your copy and pasting has added some things you don't need nor use, this will harm your understanding. Please remove.

use IO::File; use LWP::Simple;

You really don't seem to need them for this task

2) What exactly are you doing with your input and output files? they seem to be the wrong way round ? you seem to be attempting to read from your output file (even though you haven't opened them correctly. If you want to read from 'input.txt' and write to 'output.txt' you would do something like this.

open(INPUTFILE, "< input.txt") or die "cannot open file for reading $! +"; open(OUTPUTFILE, "> output.txt") or die "cannot open file for writing +$!"; ..... code goes here close INPUTFILE; close OUTPUTFILE;

Now you are in a position to read from the files, so maybe something like this

while(my $line = <INPUTFILE>) { $line =~ s/&+/&amp;/; # Assuming you have a good reason for this # See $line has now been declared, where before it wasn't my ($isbn, $ocln, $title, $author, $call_number) = split(/\t/, $li +ne);# See the variables have been declared # .. do something here }

In reply to Re: input tab delimited file by ropey
in thread input tab delimited file by libmonk

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.