in reply to CR-LF Newlines as 2 distinct characters
Bonus points if you can golf this down- I'm just glad it finally works :) Thanks again to those who pointed me in the right direction.#Add the header lines. Note extra undef for extra newline unshift @playlist, ("PLP PLAYLIST", "VERSION 1.20", undef); #Cheapo packing into two bytes s/(.)/\1\x{00}/gc for @playlist; #Explicit newlines added $playlist = join "\x{0D}\x{00}\x{0A}\x{00}", @playlist; open PLAYLIST, ">", 'playlist.plp' or die "Couldn't open playlist.plp: + $!"; #Hey perl, no funny stuff binmode PLAYLIST; $\ = undef; print PLAYLIST $playlist;
"One is enough. If you are acquainted with the principle, what do you care for the myriad instances and applications?"
- Henry David Thoreau, Walden
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CR-LF Newlines as 2 distinct characters ("golf")
by tye (Sage) on May 18, 2006 at 22:33 UTC |