in reply to Changing $/ mid-file

All these answers are extremely fine, but why doesn't the original program work? Where are the Really Great Minds ?

Replies are listed 'Best First'.
Re: Re: Changing $/ mid-file
by Corion (Patriarch) on Jan 17, 2001 at 13:28 UTC

    What all solutions above at least implicitly discussed was the need to preserve $/ for the next round in the outer while{} loop. That's why all solutions use at least one local statement to keep the old value of $/.

    You should take some time to study the solutions and next time maybe be more explicit at what dosen't work with your program, as the program works almost well (except for one warning on undefinded data). I guess a more representative dataset would have been

    XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXaaaa abcdefghijklm%nopqrstuvw%xyz XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXaaaa abcdefghijklm%nopqrstuvw%xyz
    which dosen't work that well with your original program.