Thread (21 messages) 21 messages, 3 authors, 2016-06-15

Re: [PATCHv7.1 3/4] gitweb: File based caching layer (from git.kernel.org)

flat view

From: demerphq <hidden>
Date: 2016-06-15 22:50:08

2010/11/13 Jakub Narebski [off-list ref]:
quoted hunk ↗ jump to hunk
-       binmode STDOUT, ':raw';
-       print <$fd>;
-       binmode STDOUT, ':utf8'; # as set at the beginning of gitweb.cgi
+       if ($caching_enabled) {
+               open BINOUT, '>', $fullhashbinpath or die_error(500, "Could not open bin dump file");
+       }else{
+               open BINOUT, '>', \$fullhashbinpath or die_error(500, "Could not open bin dump file");
+       }
+       binmode BINOUT, ':raw';
+       print BINOUT <$fd>;
+       binmode BINOUT, ':utf8'; # as set at the beginning of gitweb.cgi
+       close BINOUT;
Why do you use dynamically scoped file handles here as opposed to
lexically scoped ones?

And why do you change the output discipline on BINOUT immediately
before closing the file, and after you print data to it?

Doing so sortof makes sense when the filedhandle is STDOUT, but not
when it is BINOUT.

cheers,
Yves



-- 
perl -Mre=debug -e "/just|another|perl|hacker/"
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help