in reply to Re: Setting a filehandle attribute for just one filehandle
in thread Setting a filehandle attribute for just one filehandle

I don't see how this solves the problem asked. You're still doing a local $/ = ... every time the file is read from. You're just doing it in a much more complicated manner. *shrug* The question was a little vague (IMHO) so I might be misinterpreting it...

Basically, I don't think that it can be done. If it could, I think IO::Handle would've done it.

bbfu
Seasons don't fear The Reaper.
Nor do the wind, the sun, and the rain.
We can be like they are.

  • Comment on (bbfu) Re(2): Setting a filehandle attribute for just one filehandle
  • Download Code

Replies are listed 'Best First'.
Re: (bbfu) Re(2): Setting a filehandle attribute for just one filehandle
by bikeNomad (Priest) on Jun 27, 2001 at 18:42 UTC
    The problem I heard asked was:

    How can I have a per-filehandle $/ so I don't have to do an explicit local $/ = something every time I change file handles?

    My solution answers this by moving the local $/ = ... out of the user's program entirely, and adding per-file-handle setting of $/. How is this not an improvement?

      Ah.. I guess the key word being "explicit." I guess I was thinking of it more in a sense that princepawn was trying to avoid doing the local each time through, not just hide it. As I said, different interpretations of the question. :-) Your solution certainly does accomplish your interpretation of the problem (and after a re-reading, your interpretation seems to be closer to what he was asking). ++

      bbfu
      Seasons don't fear The Reaper.
      Nor do the wind, the sun, and the rain.
      We can be like they are.