in reply to Re: Help to slurp records - $/ maybe?
in thread Help to slurp records - $/ maybe?

Joost,
I can see how this would work - if you know what the data is you are losing, once you slurp it in you just prepend it back on before processing it.

I am not sure I want to go this route, but I will keep it in my tool box. I am always looking for neat ways to do things.

Cheers - L~R

  • Comment on Re: Re: Help to slurp records - $/ maybe?

Replies are listed 'Best First'.
Re: Re: Re: Help to slurp records - $/ maybe?
by Joost (Canon) on May 02, 2003 at 14:19 UTC
    Well, you're not losing any data (with the $/ trick, that is). The value of the $/ variable is also put at the end of the read 'line'.

    If you want to lose that data, use chomp(), it will remove your current line-terminator.

    The only actual problem is matching the first line.

    -- Joost downtime n. The period during which a system is error-free and immune from user input.
      Since chomp returns the chomped value you could even do something like
      $next_line = chomp($cur_line) . $next_line;
      But I think that's starting to smell like a really dirty hack.

      Makeshifts last the longest.