Re: What with this open file descriptor/"Read on closed filehandle " stuff?
From: Rex Gustavus Adolphus (uffesterner_at_spamhole.com)
Date: 03/05/04
- Next message: gnari: "Re: Need to parse SQL statements...use regular expression?"
- Previous message: Bob Dubery: "Is it possible to impose a timeout on <>?"
- In reply to: Matt Garrish: "Re: What with this open file descriptor/"Read on closed filehandle " stuff?"
- Next in thread: Rex Gustavus Adolphus: "Re: What with this open file descriptor/"Read on closed filehandle " stuff?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 5 Mar 2004 01:03:37 -0800
Hi Matt and Tassilo!
Even if we're now deviating from my original question I like to
comment some of your input.
"Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message news:<IlP1c.8282$jw2.536723@news20.bellglobal.com>...
> "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de> wrote in message
> news:c2795a$t3o$1@nets3.rz.RWTH-Aachen.DE...
> > Also sprach Matt Garrish:
> >
> > > "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de> wrote in message
> > > news:c273gt$4o2$1@nets3.rz.RWTH-Aachen.DE...
> > >> Also sprach Rex Gustavus Adolphus:
> > >>
> > >> > Ben Morrow <usenet@morrow.me.uk> wrote in message
>
> > >> >> Don't call subs with & unless you need to (here you don't).
> > >> >
> > >> > Isn't this another case of TMTOWTDI?
> > >>
>
> >
> > Of the two side-effects that exist (passing @_ and circumventing the
> > prototype), only the latter could ever come into the game as the
> > parameters were passed explicitely. What remains are prototypes that
> > weren't used in this case.
> >
> > When speaking about prototypes, we have to acknowledge that they
> > themselves are a rather questionable concept. They were originally
> > introduced in order to create functions behaving similar to some
> > builtins (such as push() or map()). I don't see why the ampersand should
> > be condemned just because they affect something that is used in maybe 1%
> > of all function definitions in existing Perl code.
> >
>
> I don't disagree with you in principle, but you're still ackowledging that
> there are occasions where things may not happen as one expects when using an
> ampersand. The poster believed that it was just a style issue and Ben
> pointed out that this wasn't true, with the sound advice that one shouldn't
> use the & unless one needs to. You then countered to the effect that this
> was not true. Consequently, you leave the impression that it is just a style
> issue. It may only be < 1% of code that will ever be effected, but why not
> start someone off on a safer footing (i.e., have them discover the use of
> the ampersand when they need to pass the same @_ on, not by accident).
>
> I get the feeling that you're looking at the situation from the perspective
> of an experienced Perl programmer, in which case you don't need/want to be
> lectured on ampersands and their effects and just want to be left alone to
> use them (which is certainly your right). In the interests of promoting good
> programming techniques, however, I can't agree that the same hands-off
> approach should be taken with someone new to the language.
I get the same feeling, Matt, that you're looking at the situation
from the experienced Perl programmer perspective to.
I'm not very experienced in Perl, and so I never heard of the
different effects using/not using & in sub-calls.
A simple example would be great!
>
> >
> > Finally the statement
> >
> > Don't call subs with & unless you need to.
> >
> > is a violation against anything that Perl stands for.
>
> You're thinking of PERL. Perl stands for nothing... : )
What's PERL, Matt, ;) ?
quotes from perlfaq:
"Larry now uses "Perl" to signify the language proper and "perl" the
implementation of it, i.e. the current interpreter." +
"But never write "PERL", because perl is not an acronym, apocryphal
folklore and post-facto expansions notwithstanding."
RGA
- Next message: gnari: "Re: Need to parse SQL statements...use regular expression?"
- Previous message: Bob Dubery: "Is it possible to impose a timeout on <>?"
- In reply to: Matt Garrish: "Re: What with this open file descriptor/"Read on closed filehandle " stuff?"
- Next in thread: Rex Gustavus Adolphus: "Re: What with this open file descriptor/"Read on closed filehandle " stuff?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|