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
if( <HANDLE>) vs WHILE ( <HANDLE> ) #356
Comments
From bbense@networking.stanford.eduThe following program illustrates my problem. Why does if ( <FOO> ) leave $_ empty ? Using -w gives this warning #/usr/bin/perl open(FOO,'>./foo') ; print FOO "valueA\tvalueB\n" ; close (FOO); # this does not work open(FOO,"<./foo") or die "open foo failed" ; if ( <FOO> ) { close (FOO) ; # this does work open(FOO,"<./foo") or die "open foo failed" ; while ( <FOO> ) { close (FOO) ; Perl Info
|
From [Unknown Contact. See original ticket]Booker Bense <bbense@networking.stanford.edu> writes:
Because you have not to assigned anything to $_. "In scalar context, evaluating a filehandle in angle brackets yields Ordinarily you must assign the returned value to a variable, but " |
From [Unknown Contact. See original ticket]Booker Bense writes:
Because while() is the only place that <> is special. See the Ordinarily you must assign the returned value to a Nat |
Migrated from rt.perl.org#1190 (status was 'resolved')
Searchable as RT1190$
The text was updated successfully, but these errors were encountered: