New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
readline() not quite as equal as <> #4116
Comments
From @jhi$ perl -we 'open(X, "/etc/motd");<X>' $ perl -Mstrict -e 'open(X, "/etc/motd");<X>' $ perl -we 'open(X, "/etc/motd");readline(X)' $ perl -Mstrict -e 'open(X, "/etc/motd");readline(X)' $ perl -v This is perl, v5.6.1 built for alpha-dec_osf Copyright 1987-2000, Larry Wall Perl may be copied only under the terms of either the Artistic License or the Complete documentation for Perl, including FAQ lists, should be found on Ditto for bleadperl. Perl Info
|
From [Unknown Contact. See original ticket]perlfunc only documents the use of C<readline *FH>, but I agree that (Also appended is an entirely unrelated typo fix.) - ams Inline Patch--- perl/opcode.pl~ Sat Jun 23 04:22:46 2001
+++ perl/opcode.pl Sat Jun 23 04:59:32 2001
@@ -444,7 +444,7 @@
backtick quoted execution (``, qx) ck_open t%
# glob defaults its first arg to $_
glob glob ck_glob t@ S?
-readline <HANDLE> ck_null t%
+readline <HANDLE> ck_fun t% F
rcatline append I/O operator ck_null t%
# Bindable operators.
--- perl/toke.c~ Fri Jun 22 23:57:53 2001
+++ perl/toke.c Sat Jun 23 04:23:15 2001
@@ -43,7 +43,7 @@
#define UTF ((PL_linestr && DO_UTF8(PL_linestr)) || (PL_hints & HINT_UTF8))
#endif
-/* In variables name $^X, these are the legal values for X.
+/* In variables named $^X, these are the legal values for X.
* 1999-02-27 mjd-perl-patch@plover.com */
#define isCONTROLVAR(x) (isUPPER(x) || strchr("[\\]^_?", (x))) |
From @gsarSee: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-10/msg00795.html
I'm not entirely sure that this change will be a no-op wrt functionality. Sarathy |
From @jhiI'm actually rather confused by this whole thing... (1) if one takes a look a the the original flip failure (by japhy, IIRC), readline(FOO);$.=1;print "ok\n" if 1..10; versus <FOO>;$.=1;print "ok\n" if 1..10; The readline() version dumped core, the diamond version didn't. (2) Now, however, *somehow* an exactly opposite (in Boolean sense) version readline(FOO);$.=1;print "ok\n" unless 1..10; Notice the unless instead of an if. Why so, I don't know, but I (3) Now with Abhijit's patch the more sensible (right?) version of the
|
From @gsarHugo, you mean.
Well, Hugo's original patch has the "unless" in it. See the archive
I'm not so sure. Sarathy |
From [Unknown Contact. See original ticket]It appears not, because C<readline;> will now die with "Not enough
The shape is preserved in all cases, as is the functionality, but now
The overload.t failure worries me more, although I'm not sure what to The appended patches revert to the original behaviour, with the sole - ams Inline Patch--- current/opcode.pl~ Mon Jun 25 17:54:34 2001
+++ current/opcode.pl Mon Jun 25 22:10:39 2001
@@ -444,7 +444,7 @@
backtick quoted execution (``, qx) ck_open t%
# glob defaults its first arg to $_
glob glob ck_glob t@ S?
-readline <HANDLE> ck_fun t% F
+readline <HANDLE> ck_null t% F?
rcatline append I/O operator ck_null t%
# Bindable operators.
--- current/lib/overload.t~ Mon Jun 25 22:23:18 2001
+++ current/lib/overload.t Mon Jun 25 17:55:37 2001
@@ -729,7 +729,7 @@
$iter = iterator->new(5);
test scalar <${iter}>, '5'; # 176
$acc = '';
- $acc .= " $out" while $out = <${iter}>;
+ $acc .= " $out" while $out = <$iter>;
test $acc, ' 4 3 2 1 0'; # 177
}
{
--- current/t/op/flip.t~ Mon Jun 25 21:31:54 2001
+++ current/t/op/flip.t Mon Jun 25 21:32:00 2001
@@ -32,5 +32,5 @@
# coredump reported in bug 20001018.008
readline(UNKNOWN);
$. = 1;
- print "ok 10\n" if 1 .. 10;
+ print "ok 10\n" unless 1 .. 10;
} |
From @jhiDone.
|
From @vanstynLooking at it now, it looks wrong to me: I'd expect bool(1..10) to be Hugo |
From @smpeters
The orignal intent of this ticket was that the <> operator takes just X |
From @jhiSteve Peters via RT wrote:
I think this was discussed and played around with back when, and yes, P.S. Steve, you seem to be cleaning up the treacherous jungle known as -- |
@smpeters - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#7154 (status was 'resolved')
Searchable as RT7154$
The text was updated successfully, but these errors were encountered: