Scope of variables in a function

Greg McCarroll greg at mccarroll.org.uk
Sat Jun 1 19:03:52 BST 2013


On 1 Jun 2013, at 18:23, Dirk Koopman wrote:

> It is very annoying. The more so because this is an artefact that is  
> (apparently) relied on by a lot of legacy code.
>
> Quite a lot of other perl artefacts have been deprecated and then  
> removed. Why does this one persist? In what way is it useful or  
> intuitive?
>

Yes but mixing declarations and conditionals is a bit like demanding  
the waiter bring you your main course and pudding in the same plate  
and then complaining when it tastes funny. There is a certain cost to  
providing a rich language like Perl in terms of complexity and  
sometimes you have to accept that you have to read the documentation.  
I'm sure someone like Nick can give a better response,

G.


More information about the london.pm mailing list