Skip to Content.
Sympa Menu

devel - Re: [sympa-developpers] [sympa-commits] sympa[7924] branches/db_list_cache: [dev] References to global %Conf hash were replaced with Site class accessors.

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: IKEDA Soji <address@concealed>
  • To: address@concealed
  • Subject: Re: [sympa-developpers] [sympa-commits] sympa[7924] branches/db_list_cache: [dev] References to global %Conf hash were replaced with Site class accessors.
  • Date: Tue, 13 Nov 2012 18:12:14 +0900

Forgive partial reply...

On Mon, 12 Nov 2012 18:38:56 +0100
David Verdin <address@concealed> wrote:

[snip]
> >>> I want to add one thing to the list:
> >>>
> >>> - use context-local variables as filehandles and directoryhandles:
> >>> open my $fh, '>', 'file';
> >>> print $fh 'blah blah blah';
> >>> close $fh;
> >> I may be wrong, but I thought such form woul be the only one allowed in
> >> "use strict" context. Isn't it the case?
> > If you're refering as the usage of 'my' in front of the variable
> > declaration, you're correct. But if you're refering to the usage of
> > variable ($fh) against typeglobs (fh), you're not, they are perfectly
> > legal in strict mode. Hence the interest of variables here.
> Sorry, I was completely out of focus here.
> What is the interest of this notation?
> >
> > BTW, the Soji proposal actually covers two aspects:
> > - use the 3-parameters form for open(), meaning the mode is the 2nd
> > parameter, and the filename the 3rd
> > - use local variables, not typeglobs, for file/directory handles

I meant second one: open() should use (brand-new) variables instead
of barewords. Barewords taint namespace.

But well... 3-parameter open() is desirable, too. 'open $fh, $file;'
is insecure because $file can contain garbage.

[snip]

Thanks,

--
株式会社 コンバージョン セキュリティ&OSSソリューション部 池田荘児
〒231-0004 神奈川県横浜市中区元浜町3-21-2 ヘリオス関内ビル7F
e-mail address@concealed TEL 045-640-3550
http://www.conversion.co.jp/



Archive powered by MHonArc 2.6.19+.

Top of Page