CARVIEW |
Select Language
HTTP/2 200
cache-control: max-age=43200
server: Combust/Plack (Perl)
vary: Accept-Encoding
content-encoding: gzip
content-length: 1832
content-type: text/html; charset=utf-8
last-modified: Sat, 11 Oct 2025 20:51:37 GMT
traceparent: fa2170fb82565aedfab174346c3135a3
strict-transport-security: max-age=15768000
Re: Removing files called minus (was: MAGIC MAGIC MAGIC) - nntp.perl.org
Front page | perl.perl5.porters |
Postings from July 2008
nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About

Re: Removing files called minus (was: MAGIC MAGIC MAGIC)
Thread Previous | Thread NextFrom:
TelsDate:
July 30, 2008 11:05Subject:
Re: Removing files called minus (was: MAGIC MAGIC MAGIC)Message ID:
200807302005.05971@bloodgate.comOn Wednesday 30 July 2008 15:22:57 Zefram wrote: > Tom Christiansen wrote: > > Ignoring surrounding whitespace also helps for when you > > read a filename in from a different file, and forget to > > trim it before opening: > > Forget? If you forget to chomp your input lines then you'll have > extraneous newlines pop up in many places, not just filenames. > Ignoring the newline if the string is used in one place risks > misleading this forgetful programmer into thinking that the newline > isn't there, allowing the mistake to spread to other parts of the > program. Seems like a misfeature to me. I'd like to inject here that chomp() is not enough to get rid of windows or macintosh-style newlines. So you want: $_ =~ s/[\r\n]//g; # or whatever to get really rid of them. Otherwise, the first time someone feeds your code a textfile that has been "converted" on Win32, your code will fail in interesting ways. Just one of these captchas that beginners only learn after painful experience :( All the best, Tels -- Signed on Wed Jul 30 20:02:27 2008 with key 0x93B84C15. Get one of my photo posters: https://bloodgate.com/posters PGP key on https://bloodgate.com/tels.asc or per email. "Elliot, Sie Schwachkopf!"Thread Previous | Thread Next
- Removing files called minus (was: MAGIC MAGIC MAGIC) by Tom Christiansen
- Re: Removing files called minus (was: MAGIC MAGIC MAGIC) by Aaron Crane
- Re: Removing files called minus (was: MAGIC MAGIC MAGIC) by Zefram
- Re: Removing files called minus (was: MAGIC MAGIC MAGIC) by Tels
- Re: Removing files called minus (was: MAGIC MAGIC MAGIC) by David Nicol
- Re: Removing files called minus by Mark Mielke
- Re: Removing files called minus (was: MAGIC MAGIC MAGIC) by Aristotle Pagaltzis
- RE: Removing files called minus (was: MAGIC MAGIC MAGIC) by Ed Avis
nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About