From: Gurusamy Sarathy Date: Wed, 23 Sep 1998 03:40:57 +0000 (+0000) Subject: better diagnostic for do{} used as lvalue X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=638bc1181648408738bc0f85920fa60225c46a73;p=p5sagit%2Fp5-mst-13.2.git better diagnostic for do{} used as lvalue p4raw-id: //depot/perl@1808 --- diff --git a/op.c b/op.c index 5b06f6f..58cf511 100644 --- a/op.c +++ b/op.c @@ -1135,7 +1135,8 @@ mod(OP *o, I32 type) if (type == OP_GREPSTART || type == OP_ENTERSUB || type == OP_REFGEN) break; yyerror(form("Can't modify %s in %s", - op_desc[o->op_type], + (o->op_type == OP_NULL && (o->op_flags & OPf_SPECIAL) + ? "do block" : op_desc[o->op_type]), type ? op_desc[type] : "local")); return o; @@ -1264,7 +1265,9 @@ mod(OP *o, I32 type) break; case OP_NULL: - if (!(o->op_flags & OPf_KIDS)) + if (o->op_flags & OPf_SPECIAL) /* do BLOCK */ + goto nomod; + else if (!(o->op_flags & OPf_KIDS)) break; if (o->op_targ != OP_LIST) { mod(cBINOPo->op_first, type); diff --git a/pod/perlport.pod b/pod/perlport.pod index 79ca767..0b9d054 100644 --- a/pod/perlport.pod +++ b/pod/perlport.pod @@ -84,7 +84,7 @@ should be considered a perpetual work in progress =head2 Newlines -In most operating systems, lines in files are separated with newlines. +In most operating systems, lines in files are terminated by newlines. Just what is used as a newline may vary from OS to OS. Unix traditionally uses C<\012>, one kind of Windows I/O uses C<\015\012>, and S uses C<\015>.