[ABE.pm] searching the archives
Hans Dieter Pearcey
hdp at pobox.com
Wed Aug 13 12:45:42 PDT 2008
On Wed, Aug 13, 2008 at 03:25:50PM -0400, Ricardo SIGNES wrote:
> > I want to look up the reason Rick gave for using the new style open()
> > command
> >
> > open my $fh, '>', $filename;
> >
> > as opposed to the old style
> >
> > open(FH, ">$filename");
>
> For one thing, having a string that contains multiple args is awful. It's like
> if you had to say:
>
> $sum = add_up("1:2:3:10"); # returns 16
>
> More importantly, though, the old style creates a global filehandle. Globals
> are evil.
Well, there are two things there. You can have 2-arg open and a lexical or
3-arg and a global. Both 2-arg open and global filehandles are bad.
2-arg open is especially scary when opening a pipe.
hdp.
More information about the ABE-pm
mailing list