use bytes;
my $progname = $0; $progname =~ s@.*/@@g;
-my ($version) = ('$Revision: 1.41 $' =~ m/\s(\d[.\d]+)\s/s);
+my ($version) = ('$Revision: 1.44 $' =~ m/\s(\d[.\d]+)\s/s);
my $verbose = 0;
my $http_proxy = undef;
my $got_any_p = 0;
$body =~ s@\\\n@@gs;
+ $body =~ s@^[ \t]*#[^\n]*$@@gm;
if ($body =~ m/^[.*]*textMode:[ \t]*([^\s]+)\s*$/im) {
$text_mode = $1;
$text_file =~ s@^~/@$ENV{HOME}/@s; # allow literal "~/"
- if (open (my $in, '<', $text_file)) {
+ if (open (my $in, '<:raw', $text_file)) {
print STDERR "$progname: reading $text_file\n" if ($verbose);
+ binmode (STDOUT, ':raw');
if (($wrap_columns && $wrap_columns > 0) || $truncate_lines) {
# read it, then reformat it.
$load_p = 0; }
elsif (m/^--?text$/) { $text_mode = 'literal';
$text_literal = shift @ARGV || '';
+ $text_literal =~ s@\\n@\n@gs;
+ $text_literal =~ s@\\\n@\n@gs;
$load_p = 0; }
elsif (m/^--?file$/) { $text_mode = 'file';
$text_file = shift @ARGV || '';