ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> activeperl
activeperl
Re: PERL create file
by Ingo Schwarze other posts by this author
Jul 6 2009 2:32AM messages near this date
Re: PERL create file | Re: PERL create file
Hi Bill and Brian,

Bill Luebkert wrote on Fri, Jul 03, 2009 at 04:26:46AM -0700:
>  Brian Raven wrote:

> > I would advise using the 3 argument form of open,
> > localise the file handle, 

>  Neither of those suggestions 'should' change a thing.

No, but they are excellent advice anyway, and a strict style can help
a lot when chasing bugs.

The two-argument form of open(3p) really ought to be considered legacy,
and there is no excuse for using it in new code, except in very
special circumstances.  I feel two-argument open nearly as ugly as
the failure to use strict and warnings.  At least, the multi-argument
form is required for anything security-related.  Even in cases where
two-argument open can actually been proven to be correct as well, like
in the case discussed here, the correctness of the multi-argument form
is definitely easier to verify by code inspection, so using it is
always a gain in security.

The same applies to non-local file handles.  They should have no place
in new code, except in very special circumstances.

I think the regulars should consistently encourage good coding
practices (which both of you almost always do, thanks!), even if
the sloppiness at hand cannot be proven to be causing the problem
or to be hiding the cause of the problem presented.

Yours,
  Ingo

-- 
Ingo Schwarze <ischwarze@[...].com>  | Software Engineer | Framework Team
Astaro AG | www.astaro.com | 76227 Karlsruhe | Germany
_______________________________________________
ActivePerl mailing list
ActivePerl@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Saqib Rafique
Brian Raven
Bill Luebkert
Ingo Schwarze
Bill Luebkert
Serguei Trouchelle
Bill Luebkert
Jan Dubois
Ingo Schwarze
Mohammed Mustafa
Stanislaw Romanski

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved