Tom Christiansen wrote: >What do we get today? Bowdlerization! > > How can I open a file with a leading ">" or trailing blanks? ... > Unless you have a particular reason to use the two argument form you > should use the three argument form of open() which does not treat any > characters in the filename as special. I don't see Bowdlerisation here. I see a better way to achieve the objective. >HELLO? What happened to the right answer that was there before? It was superseded by this simpler right answer, when the three-argument form of open() became available. >But what should I expect? The perl faq is now a document that thinks >this is somehow clear and consistent code, and it's anything but: I agree with your problems with this one, however. >To this day, Perl's implicit closing of files doesn't warn you of errors, >let alone exit nonzero. This makes it do wrong thing and not even tell you >it did them wrong. I wholeheartedly agree with you in this gripe. I often (but, admittedly, not always) end up writing wrappers along the lines of sub IO::Handle::safe_print { shift->print(@_) or die $! } sub IO::Handle::safe_flush { shift->flush or die $! } and I wish such dying versions of I/O functions were standardised and the norm. Proper use of the exception mechanism makes it a lot easier to write correct programs. Roll on autodie. -zeframThread Previous | Thread Next