Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^3: Temporary text files with File::Temp

by ack (Deacon)
on Feb 28, 2008 at 16:02 UTC ( #670918=note: print w/replies, xml ) Need Help??

in reply to Re^2: Temporary text files with File::Temp
in thread Temporary text files with File::Temp

jarich, you wrote:

"Alternately if there is a special layer I can pass to binmode itself to say "treat as text" so that Perl can do it's special text-file magic by translating \n to the appropriate thing; I'd love to hear about that."

I was recently investigating the use of the I/O layers and seem to recall that there may be a way to do what you asked about. But I'm by no means an expert on the topic so it isn't something I've got much experience with.

But wouldn't that constitute exactly what you said you didn't want...special processing for each environment? And wouldn't that defeat your goal of keeping it simple for your students?

ack Albuquerque, NM
  • Comment on Re^3: Temporary text files with File::Temp

Replies are listed 'Best First'.
Re^4: Temporary text files with File::Temp
by jarich (Curate) on Mar 03, 2008 at 23:08 UTC

    It depends on what the special layer was. For example if I could write:

    binmode($fh, ":text");

    And have it do the right thing on all systems, it'd be an okay solution. Of course, the best place to fix this is still in File::Temp, because teaching the students that they'll need two commands isn't quite as cool as just giving them one.

    I've looked at the File::Temp code, and it looks pretty easy to patch, so as soon as I have time and access to a Windows box, I'll be working on that. Probably mid-April.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://670918]
[Discipulus]: Anyway many years passed, we had Perl 3 iirc.. ;=)
[1nickt]: erix looking ... which one?
[1nickt]: Ah hm, the article sction links don;t match the sections. Lowerdown there is info and a map

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (11)
As of 2017-11-21 12:15 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (299 votes). Check out past polls.