develooper Front page | perl.perl5.porters | Postings from November 2000

Re: [ID 20001130.012] Can't do '\'?

Thread Previous | Thread Next
From:
Casey R. Tweten
Date:
November 30, 2000 13:26
Subject:
Re: [ID 20001130.012] Can't do '\'?
Message ID:
Pine.OSF.4.21.0011301622550.24402-100000@home.kiski.net
Today around 4:19pm, Ronald J Kimball hammered out this masterpiece:

: On Thu, Nov 30, 2000 at 04:11:38PM -0500, WWW server user wrote:
: > A _very_ simple perl program:
: > 
: >    print '\';
: > 
: > causes
: >    "Can't find string terminator "'" anywhere before EOF at blah line 1."
: 
: That is the correct behavior.  The backslash escapes the second quote, so
: you are missing the terminating quote.
: 
: Perhaps you meant to escape the backslash?
: 
: print '\\';

I expected this to work too but:

[ctweten@ctweten ctweten]$ perl -le "print '\'"
Can't find string terminator "'" anywhere before EOF at -e line 1.
[ctweten@ctweten ctweten]$ perl -le "print '\\'"
Can't find string terminator "'" anywhere before EOF at -e line 1.
[ctweten@ctweten ctweten]$ perl -le "print '\\\'"
\
[ctweten@ctweten ctweten]$

This is behavior in bleadperl, 5.6 and 5.5.3  I would consider:

  print '\\';

to be broken.

-- 

print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'crt@kiski.net',site=>
'http://home.kiski.net/~crt'};print "\n",'.'x(length($sig->{site})+6),"\n";
print map{$_.': '.$sig->{$_}."\n"}sort{$sig->{$a}cmp$sig->{$b}}keys%{$sig};
my $VERSION = '0.01'; #'patched' by Jerrad Pierce <belg4mit at MIT dot EDU>


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About