[32479] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 3744 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 26 09:09:19 2012

Date: Thu, 26 Jul 2012 06:09:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 26 Jul 2012     Volume: 11 Number: 3744

Today's topics:
    Re: Pls help old perl-monger with new version syntax? <rweikusat@mssgmbh.com>
    Re: Pls help old perl-monger with new version syntax? <justin.1207@purestblue.com>
    Re: Pls help old perl-monger with new version syntax? <NoSpamPleaseButThisIsValid3@gmx.net>
    Re: Pls help old perl-monger with new version syntax? <NoSpamPleaseButThisIsValid3@gmx.net>
    Re: Pls help old perl-monger with new version syntax? <rweikusat@mssgmbh.com>
    Re: Pls help old perl-monger with new version syntax? <ben@morrow.me.uk>
    Re: Pls help old perl-monger with new version syntax? <rweikusat@mssgmbh.com>
    Re: Pls help old perl-monger with new version syntax? <news@lawshouse.org>
    Re: Pls help old perl-monger with new version syntax? <jurgenex@hotmail.com>
    Re: Pls help old perl-monger with new version syntax? <ben@morrow.me.uk>
    Re: Pls help old perl-monger with new version syntax? (Seymour J.)
    Re: Pls help old perl-monger with new version syntax? (Tim McDaniel)
    Re: Pls help old perl-monger with new version syntax? <rweikusat@mssgmbh.com>
    Re: Pls help old perl-monger with new version syntax? <rweikusat@mssgmbh.com>
    Re: Pls help old perl-monger with new version syntax? <rweikusat@mssgmbh.com>
    Re: Pls help old perl-monger with new version syntax? <jurgenex@hotmail.com>
    Re: Pls help old perl-monger with new version syntax? <NoSpamPleaseButThisIsValid3@gmx.net>
    Re: Pls help old perl-monger with new version syntax? <whynot@pozharski.name>
    Re: Pls help old perl-monger with new version syntax? <rweikusat@mssgmbh.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 25 Jul 2012 14:25:49 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: Pls help old perl-monger with new version syntax?
Message-Id: <87y5m82crm.fsf@sapphire.mobileactivedefense.com>

Ben Morrow <ben@morrow.me.uk> writes:
> Quoth Rainer Weikusat <rweikusat@mssgmbh.com>:
>> Ben Morrow <ben@morrow.me.uk> writes:
>> > Quoth Rainer Weikusat <rweikusat@mssgmbh.com>:
>> >> Ben Morrow <ben@morrow.me.uk> writes:
>> >> > Quoth Justin C <justin.1207@purestblue.com>:
>> >> 
>> >> >> (though it's definitely preferred to declare them
>> >> >> only within the scope of where they're used)
>> >> >
>> >> > Yes. In general, don't create a variable until you have something useful
>> >> > to put in it. (This isn't always possible.)
>> >> 
>> >> In general, don't declare variables in a lexical scope unless it
>> >> happens to be the outmost lexical scope of a subroutine. As soon as
>> >> this starts to become unwieldly, structure the code into a set of
>> >> subroutines and a controlling superroutine.
>> >
>> > Are you just contradicting me to be contrary, or do you have a point?
>> 
>> The point is that some odd 2x years of experience with it have taught
>> me that 'functional decomposition' is a good idea.
>
> I agree entirely. This has nothing to do with whether you declare the
> variables in a particular function in a group at the top, or as you need
> them.

"I agree entirely. Provided you don't actually do that". As soon as
variables are being declared in inner scopes, a natural candidate for
factoring something out into a new subroutine has been found.


------------------------------

Date: Wed, 25 Jul 2012 14:56:36 +0100
From: Justin C <justin.1207@purestblue.com>
Subject: Re: Pls help old perl-monger with new version syntax?
Message-Id: <kha5e9-06s.ln1@zem.masonsmusic.co.uk>

On 2012-07-24, Ben Morrow <ben@morrow.me.uk> wrote:
>
> Quoth Justin C <justin.1207@purestblue.com>:
>> On 2012-07-24, r.mariotti@fdcx.net <r.mariotti@fdcx.net> wrote:
>>
>> > my $fn = ''   unless defined($fn);
>> > my $ln = ''   unless defined($ln);
>> > my $opt = '' unless defined($opt);
>> > my $rr = 0   unless defined($rr);
>> > my $x1 = ''  unless defined($x1);
>> > my $x2 = ''  unless defined($x2);
>> > my $x3 = ''  unless defined($x3);
>> > my $x4 = ''  unless defined($x4);
>> 
>> In addition to what others have said, I think this is
>> standard practice these days:
>> 
>> my ($fh, $ln, $opt, $x1, $x2, $x3, $x4);
>> my $rr = 0;
>
> Neither '' nor 0 are the same as undef, so I'm not sure why you've
> singled out $rr here...

Of course, thank you for pointing this out. It's just that that is 
what I usually do, unless I need to define something explicitly. 
I've never had reason to define an empty string, 'undef' has always 
been adequate for my needs.


>> (though it's definitely preferred to declare them
>> only within the scope of where they're used)
>
> Yes. In general, don't create a variable until you have something useful
> to put in it. (This isn't always possible.)

Now you tell me. I've been bending over backwards trying bend some 
code to fit 'the rules' ;)


   Justin.

-- 
Justin C, by the sea.


------------------------------

Date: Wed, 25 Jul 2012 16:31:58 +0200
From: Wolf Behrenhoff <NoSpamPleaseButThisIsValid3@gmx.net>
Subject: Re: Pls help old perl-monger with new version syntax?
Message-Id: <5010035e$0$6564$9b4e6d93@newsspool4.arcor-online.net>

Am 25.07.2012 15:25, schrieb Rainer Weikusat:
> Ben Morrow <ben@morrow.me.uk> writes:
>> Quoth Rainer Weikusat <rweikusat@mssgmbh.com>:
>>> Ben Morrow <ben@morrow.me.uk> writes:
>>>> Quoth Rainer Weikusat <rweikusat@mssgmbh.com>:
>>>>> Ben Morrow <ben@morrow.me.uk> writes:
>>>>>> Quoth Justin C <justin.1207@purestblue.com>:
>>>>>
>>>>>>> (though it's definitely preferred to declare them
>>>>>>> only within the scope of where they're used)
>>>>>>
>>>>>> Yes. In general, don't create a variable until you have something useful
>>>>>> to put in it. (This isn't always possible.)
>>>>>
>>>>> In general, don't declare variables in a lexical scope unless it
>>>>> happens to be the outmost lexical scope of a subroutine. As soon as
>>>>> this starts to become unwieldly, structure the code into a set of
>>>>> subroutines and a controlling superroutine.
>>>>
>>>> Are you just contradicting me to be contrary, or do you have a point?
>>>
>>> The point is that some odd 2x years of experience with it have taught
>>> me that 'functional decomposition' is a good idea.
>>
>> I agree entirely. This has nothing to do with whether you declare the
>> variables in a particular function in a group at the top, or as you need
>> them.
> 
> "I agree entirely. Provided you don't actually do that". As soon as
> variables are being declared in inner scopes, a natural candidate for
> factoring something out into a new subroutine has been found.
> 

Just to make sure I understand you correctly: given the two following subs:

sub foo {
  ...
  for my $i (1..100) { ... }
  ...
}

sub bar {
  my $i;
  ...
  for $i (1..100) { ... }
  ...
}

are you suggesting to prefer bar over foo because in foo the scope for
$i is limited to the loop? Isn't it much better to limit the variable to
the variable to the inner scope of the loop? If the loop does something
"complicated", it is a candidate

I prefer to declare a variable where I need it, this often is an inner
scope. However I agree with Ben and you that 'functional decomposition'
is a good idea and loooong subs should probably be split into smaller ones.

- Wolf




------------------------------

Date: Wed, 25 Jul 2012 16:43:35 +0200
From: Wolf Behrenhoff <NoSpamPleaseButThisIsValid3@gmx.net>
Subject: Re: Pls help old perl-monger with new version syntax?
Message-Id: <50100618$0$6560$9b4e6d93@newsspool4.arcor-online.net>

I wrote:
> If the loop does something
> "complicated", it is a candidate

 ... for moving it into a new sub, of course. But if it just does some
"simple" operation, I wouldn't move it away.

(sorry, I had accidentally deleted this from the prev posting)



------------------------------

Date: Wed, 25 Jul 2012 17:59:22 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: Pls help old perl-monger with new version syntax?
Message-Id: <87ehnzkc9h.fsf@sapphire.mobileactivedefense.com>

Wolf Behrenhoff <NoSpamPleaseButThisIsValid3@gmx.net> writes:
> Am 25.07.2012 15:25, schrieb Rainer Weikusat:
>> Ben Morrow <ben@morrow.me.uk> writes:
>>> Quoth Rainer Weikusat <rweikusat@mssgmbh.com>:
>>>> Ben Morrow <ben@morrow.me.uk> writes:
>>>>> Quoth Rainer Weikusat <rweikusat@mssgmbh.com>:
>>>>>> Ben Morrow <ben@morrow.me.uk> writes:
>>>>>>> Quoth Justin C <justin.1207@purestblue.com>:
>>>>>>
>>>>>>>> (though it's definitely preferred to declare them
>>>>>>>> only within the scope of where they're used)
>>>>>>>
>>>>>>> Yes. In general, don't create a variable until you have something useful
>>>>>>> to put in it. (This isn't always possible.)
>>>>>>
>>>>>> In general, don't declare variables in a lexical scope unless it
>>>>>> happens to be the outmost lexical scope of a subroutine. As soon as
>>>>>> this starts to become unwieldly, structure the code into a set of
>>>>>> subroutines and a controlling superroutine.
>>>>>
>>>>> Are you just contradicting me to be contrary, or do you have a point?
>>>>
>>>> The point is that some odd 2x years of experience with it have taught
>>>> me that 'functional decomposition' is a good idea.
>>>
>>> I agree entirely. This has nothing to do with whether you declare the
>>> variables in a particular function in a group at the top, or as you need
>>> them.
>> 
>> "I agree entirely. Provided you don't actually do that". As soon as
>> variables are being declared in inner scopes, a natural candidate for
>> factoring something out into a new subroutine has been found.
>> 
>
> Just to make sure I understand you correctly: given the two following subs:
>
> sub foo {
>   ...
>   for my $i (1..100) { ... }
>   ...
> }
>
> sub bar {
>   my $i;
>   ...
>   for $i (1..100) { ... }
>   ...
> }
>
> are you suggesting to prefer bar over foo because in foo the scope for
> $i is limited to the loop?

There's no variable being declared in an inner scope in either example
so why do you ask? (NB: That's a stupid retort based on tangential
technicalities of the example).

> Isn't it much better to limit the variable to the variable to the
> inner scope of the loop?

Why?


------------------------------

Date: Wed, 25 Jul 2012 18:37:25 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Pls help old perl-monger with new version syntax?
Message-Id: <lfn5e9-fj8.ln1@anubis.morrow.me.uk>


Quoth Rainer Weikusat <rweikusat@mssgmbh.com>:
> Wolf Behrenhoff <NoSpamPleaseButThisIsValid3@gmx.net> writes:
> >
> > Just to make sure I understand you correctly: given the two following subs:
> >
> > sub foo {
> >   ...
> >   for my $i (1..100) { ... }
> >   ...
> > }
> >
> > sub bar {
> >   my $i;
> >   ...
> >   for $i (1..100) { ... }
> >   ...
> > }
> >
> > are you suggesting to prefer bar over foo because in foo the scope for
> > $i is limited to the loop?
> 
> There's no variable being declared in an inner scope in either example
> so why do you ask?

Yes there is. In the first example $i is scoped over the loop block,
rather than the whole sub. Even in an example like this:

    sub foo {
        my ($x) = @_;
        $x or return;
        my $y = ...;
    }

$y is in a smaller scope than $x, that scope just doesn't happen to be a
full BLOCK.

> (NB: That's a stupid retort based on tangential
> technicalities of the example).

No, it's a stupid retort based on a complete misunderstanding of the
example, and of the way lexical scoping works in Perl. Perl is not C,
and variables are not tied to blocks in quite the same way.

Ben



------------------------------

Date: Wed, 25 Jul 2012 19:01:06 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: Pls help old perl-monger with new version syntax?
Message-Id: <87394fk9el.fsf@sapphire.mobileactivedefense.com>

Ben Morrow <ben@morrow.me.uk> writes:

> Quoth Rainer Weikusat <rweikusat@mssgmbh.com>:
>> Wolf Behrenhoff <NoSpamPleaseButThisIsValid3@gmx.net> writes:
>> >
>> > Just to make sure I understand you correctly: given the two following subs:
>> >
>> > sub foo {
>> >   ...
>> >   for my $i (1..100) { ... }
>> >   ...
>> > }
>> >
>> > sub bar {
>> >   my $i;
>> >   ...
>> >   for $i (1..100) { ... }
>> >   ...
>> > }
>> >
>> > are you suggesting to prefer bar over foo because in foo the scope for
>> > $i is limited to the loop?
>> 
>> There's no variable being declared in an inner scope in either example
>> so why do you ask?
>
> Yes there is.

Don't try to tell me what I "really meant to say". That's something I
know and you don't.



------------------------------

Date: Wed, 25 Jul 2012 19:14:12 +0100
From: Henry Law <news@lawshouse.org>
Subject: Re: Pls help old perl-monger with new version syntax?
Message-Id: <VLGdneZYvb_pqo3NnZ2dnUVZ8tCdnZ2d@giganews.com>

On 25/07/12 18:37, Ben Morrow wrote:
>
> Quoth Rainer Weikusat <rweikusat@mssgmbh.com>:

I long since plonked Herr Weikusat.  It's almost fun reconstructing what 
he must have said out of irritated posts from people who haven't done 
the same.


-- 

Henry Law            Manchester, England




------------------------------

Date: Wed, 25 Jul 2012 11:18:57 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Pls help old perl-monger with new version syntax?
Message-Id: <24e018tl9ao0h65fom0hf41d5v6oc535sl@4ax.com>

Henry Law <news@lawshouse.org> wrote:
>On 25/07/12 18:37, Ben Morrow wrote:
>>
>> Quoth Rainer Weikusat <rweikusat@mssgmbh.com>:
>
>I long since plonked Herr Weikusat.  It's almost fun reconstructing what 
>he must have said out of irritated posts from people who haven't done 
>the same.

:-)))


jue



------------------------------

Date: Wed, 25 Jul 2012 19:44:52 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Pls help old perl-monger with new version syntax?
Message-Id: <4er5e9-j09.ln1@anubis.morrow.me.uk>


Quoth Henry Law <news@lawshouse.org>:
> On 25/07/12 18:37, Ben Morrow wrote:
> >
> > Quoth Rainer Weikusat <rweikusat@mssgmbh.com>:
> 
> I long since plonked Herr Weikusat.  It's almost fun reconstructing what 
> he must have said out of irritated posts from people who haven't done 
> the same.

I apologise if my replies are becoming irritating.

Ben



------------------------------

Date: Wed, 25 Jul 2012 16:55:44 -0400
From: Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>
Subject: Re: Pls help old perl-monger with new version syntax?
Message-Id: <50105d50$44$fuzhry+tra$mr2ice@news.patriot.net>

In <fmmu08t4a735s3j189rt3bjncq4jkea4k9@4ax.com>, on 07/24/2012
   at 10:51 PM, r.mariotti@fdcx.net said:

>The snippet of code I included in my post was an attempt to come up
>with a process that would initialize these fields if they were not
>aleady defined.

Do you mean already declared or already initialized? They are two
different issues. If the later use

 $foo //= '';

-- 
Shmuel (Seymour J.) Metz, SysProg and JOAT  <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action.  I reserve the
right to publicly post or ridicule any abusive E-mail.  Reply to
domain Patriot dot net user shmuel+news to contact me.  Do not
reply to spamtrap@library.lspace.org



------------------------------

Date: Wed, 25 Jul 2012 22:14:34 +0000 (UTC)
From: tmcd@panix.com (Tim McDaniel)
Subject: Re: Pls help old perl-monger with new version syntax?
Message-Id: <jupr4a$l09$1@reader1.panix.com>

In article <4er5e9-j09.ln1@anubis.morrow.me.uk>,
Ben Morrow  <ben@morrow.me.uk> wrote:
>
>Quoth Henry Law <news@lawshouse.org>:
>> On 25/07/12 18:37, Ben Morrow wrote:
>> >
>> > Quoth Rainer Weikusat <rweikusat@mssgmbh.com>:
>> 
>> I long since plonked Herr Weikusat.  It's almost fun reconstructing
>> what he must have said out of irritated posts from people who
>> haven't done the same.
>
>I apologise if my replies are becoming irritating.

No, no!  Your posts are almost always valuable.  Irritating messages
annoy the recipient; irritated messages are when that annoyed reader
writes about it.  Irritated articles are sometimes among the funniest
or most informative.  Exemplia gratia, http://notalwaysright.com/ , or
Mark Twain on Cecil Rhodes.

-- 
Tim McDaniel, tmcd@panix.com


------------------------------

Date: Wed, 25 Jul 2012 23:49:01 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: Pls help old perl-monger with new version syntax?
Message-Id: <87a9ynwj6q.fsf@sapphire.mobileactivedefense.com>

Ben Morrow <ben@morrow.me.uk> writes:
> Quoth Rainer Weikusat <rweikusat@mssgmbh.com>:
>> Wolf Behrenhoff <NoSpamPleaseButThisIsValid3@gmx.net> writes:
>> >
>> > Just to make sure I understand you correctly: given the two following subs:
>> >
>> > sub foo {
>> >   ...
>> >   for my $i (1..100) { ... }
>> >   ...
>> > }
>> >
>> > sub bar {
>> >   my $i;
>> >   ...
>> >   for $i (1..100) { ... }
>> >   ...
>> > }
>> >
>> > are you suggesting to prefer bar over foo because in foo the scope for
>> > $i is limited to the loop?
>> 
>> There's no variable being declared in an inner scope in either example
>> so why do you ask?
>
> Yes there is. In the first example $i is scoped over the loop block,
> rather than the whole sub. Even in an example like this:
>
>     sub foo {
>         my ($x) = @_;
>         $x or return;
>         my $y = ...;
>     }
>
> $y is in a smaller scope than $x, that scope just doesn't happen to be a
> full BLOCK.
>
>> (NB: That's a stupid retort based on tangential
>> technicalities of the example).
>
> No, it's a stupid retort based on a complete misunderstanding of the
> example,

I assumed that 'inner scope' was sufficiently clear to be understood
as it was meant, namely, variable declared in a block contained in
another block. Actually, I very strongly suspect that you did
understand that as well and consequently, I also suspect that you are
completely aware that you are evading the discussion by starting a
sideline quarrel on something which doesn't reall matter.


------------------------------

Date: Wed, 25 Jul 2012 23:51:15 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: Pls help old perl-monger with new version syntax?
Message-Id: <87394fwj30.fsf@sapphire.mobileactivedefense.com>

Henry Law <news@lawshouse.org> writes:
> On 25/07/12 18:37, Ben Morrow wrote:
>>
>> Quoth Rainer Weikusat <rweikusat@mssgmbh.com>:
>
> I long since plonked Herr Weikusat.

The interesting question is: Why do you feel the desire to talk about
that?


------------------------------

Date: Thu, 26 Jul 2012 01:55:21 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: Pls help old perl-monger with new version syntax?
Message-Id: <87ehnzbati.fsf@sapphire.mobileactivedefense.com>

Rainer Weikusat <rweikusat@mssgmbh.com> writes:
> Henry Law <news@lawshouse.org> writes:
>> On 25/07/12 18:37, Ben Morrow wrote:
>>>
>>> Quoth Rainer Weikusat <rweikusat@mssgmbh.com>:
>>
>> I long since plonked Herr Weikusat.
>
> The interesting question is: Why do you feel the desire to talk about
> that?

I'll even take the liberty to supply an answer to that: Begging for
approval.


------------------------------

Date: Wed, 25 Jul 2012 21:15:48 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Pls help old perl-monger with new version syntax?
Message-Id: <9vf118976ops48824rmtctd2uf3rb0gqci@4ax.com>

r.mariotti@fdcx.net wrote:
>The snippet of code I included in my post was an attempt to come up
>with a process that would initialize these fields if they were not
>aleady defined.  That's why I used the unless defined clause.

By using 'my' you just created this local variable, therefore by
definition this variable will be undefined. Therefore your check for
defined() is meaningless, even if the right-hand side were referencing
the new local variable (it is not!).

Introduce variables when you need them and where you need them. Unless
there are exceptional circumstances you should know the real desired
initial value at that time and there should be no need to initialize
them to some dummy value. 

>My understanding of this function was that it was the perl equivalent
>of the php isset function.  However, even when I remove the unless
>portion of the statements I still receive the same use of
>uninitialized variable blah blah.

I don't believe you.

A 
	my $ln = '';
compiles and runs perfectly fine, even with strict and warnings enabled.

>All I'm trying to do is understand how I can satisfy the syntax so the
>programs resume working.  They were in production.

Maybe you should think about semantic first. Do you now what "my" does?
If you don't then adding random statements into your code is not likely
to fix anything.

>So please keep up the comments as I and I'm sure others find them
>informative.  And if you understand my issue more clearly perhaps more
>suggestions will follow.

Honestly I don't. If you want to refactor your code to take advantage of
new Perl features, then that's great. 
But new versions of Perl are usually quite backward compatible.
Therefore usually there is little need to change anything to make older
programs run with newer versions. Yes, that is a generalization and
there are counter-examples, but "my" isn't one of them.

Or to put it in different words: if you want to change your code from
global variables to local variables then IMNSHO this is a great idea.
But it has nothing to do with switching to a newer version of Perl.

jue


------------------------------

Date: Thu, 26 Jul 2012 10:06:05 +0200
From: Wolf Behrenhoff <NoSpamPleaseButThisIsValid3@gmx.net>
Subject: Re: Pls help old perl-monger with new version syntax?
Message-Id: <5010fa6d$0$9508$9b4e6d93@newsspool1.arcor-online.net>

Am 25.07.2012 18:59, schrieb Rainer Weikusat:
> Wolf Behrenhoff <NoSpamPleaseButThisIsValid3@gmx.net> writes:
>> Just to make sure I understand you correctly: given the two following subs:
>> [...]
>> are you suggesting to prefer bar over foo because in foo the scope for
>> $i is limited to the loop?
> 
> There's no variable being declared in an inner scope in either example
> so why do you ask? (NB: That's a stupid retort based on tangential
> technicalities of the example).

I didn't put "Just to make sure I understand you correctly" for fun!
Based on your reply I assume the answer is "no".

You also wrote:
> I assumed that 'inner scope' was sufficiently clear to be understood
> as it was meant, namely, variable declared in a block contained in
> another block.

So, would this example be the "correct" one:

sub foo {
  ...
  for my $i (1..100) {
    my $inner = do_something($i);
    ...
  }
  ...
}

The $inner is now declared in a block (the "for") of a block ("sub"). So
the $inner should be declared before the loop?

We could even make it more inner, for example
sub bar {
  for my $x (1..5) { for my $y (1..5) {
    my $inner = $array2d[$x][$y];
    ...
  }}
}

Maybe I really completely misunderstood what you've said... Why not make
an example to clarify what you really mean?



------------------------------

Date: Thu, 26 Jul 2012 08:44:53 +0300
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: Pls help old perl-monger with new version syntax?
Message-Id: <slrnk11mal.ejk.whynot@orphan.zombinet>

with <slrnk0vbfc.qhv.hjp-usenet2@hrunkner.hjp.at> Peter J. Holzer wrote:
> On 2012-07-25 02:51, r.mariotti@fdcx.net <r.mariotti@fdcx.net> wrote:

>> Not until I began working with this version (5.14.2) included with
>> Ubuntu 12.04 LTS did I start receiving the referenced  error message.
>> My prior version is what came with Ubuntu 8.04 so I can't say exactly
>> which one that was.
> Probably 5.8.8 or 5.10.0. The code you posted definitely wouldn't have
> worked with those versions.

according to <http://distrowatch.com/table.php?distribution=ubuntu>, it
was 5.10.0.

*CUT*

-- 
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom


------------------------------

Date: Thu, 26 Jul 2012 13:52:08 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: Pls help old perl-monger with new version syntax?
Message-Id: <87vcha1y87.fsf@sapphire.mobileactivedefense.com>

Wolf Behrenhoff <NoSpamPleaseButThisIsValid3@gmx.net> writes:
> Am 25.07.2012 18:59, schrieb Rainer Weikusat:
>> Wolf Behrenhoff <NoSpamPleaseButThisIsValid3@gmx.net> writes:

[...]

> You also wrote:
>> I assumed that 'inner scope' was sufficiently clear to be understood
>> as it was meant, namely, variable declared in a block contained in
>> another block.
>
> So, would this example be the "correct" one:
>
> sub foo {
>   ...
>   for my $i (1..100) {
>     my $inner = do_something($i);
>     ...
>   }
>   ...
> }
>
> The $inner is now declared in a block (the "for") of a block ("sub"). So
> the $inner should be declared before the loop?

Decidedly yes, because (AFAIK) this code creates a new my variable on
each iteration and creating 100 different 'use once' variables instead
of using one variable 100 times is seriously wasteful. But that's a
different question.

> We could even make it more inner, for example
> sub bar {
>   for my $x (1..5) { for my $y (1..5) {
>     my $inner = $array2d[$x][$y];
>     ...
>   }}
> }
>
> Maybe I really completely misunderstood what you've said...

And maybe, you are deliberately constructing nonsense-examples by
exploiting ambiguities in natural language. The fact that you've
adjusted your example to be still applicable to my clarified statement
suggests so. Since natural language always contains ambiguities, you
will succeed in finding a way to misinterpret whatever else I may
write on this topic until kingdom come.


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 3744
***************************************


home help back first fref pref prev next nref lref last post