Hi Cliff-

It is an edge case where the lexical variable is not
cleared in the persistent context and the problem
is visible in the Devel::REPL shell and not just pdl2.
I'll take a look but definitely worth a bug ticket until
it is resolved.  The behavior may be consistent with
the current implementation---but I think it should
match the perl script/program result when ever possible.

--Chris




On Wed, Oct 9, 2013 at 11:48 PM, Clifford Sobchuk <
[email protected]> wrote:

>  Hi Folks, I received some unexpected results when using ‘my’ in the pdl2
> shell. I verified that the correct behaviour works from perl –e, but I am
> not sure if this is a pdl2 shell problem or a Term::ReadLine problem.****
>
> ** **
>
> Thanks Cliff.****
>
> ** **
>
> I tried the following code:****
>
> pdl> foreach $i (1..5) { my @a; print "my a is @a\n"; @a = (1,2,3);print
> "now  a  is @a\n";}****
>
> ** **
>
> not expecting to get :****
>
> my a is 1 2 3        <<<<<<<<< This should be blank.****
>
> now  a is 1 2 3****
>
> my a is****
>
> now  a is 1 2 3****
>
> my a is****
>
> now  a is 1 2 3****
>
> my a is****
>
> now  a is 1 2 3****
>
> my a is****
>
> now  a is 1 2 3****
>
> ** **
>
> to be sure that it was the values from the last run (as I had done it
> several times)****
>
> pdl> @a=(4,5,6)****
>
> ** **
>
> pdl> foreach $i (1..5) { my @a; print "my a is @a\n"; @a = (1,2,3);print
> "now  a is @a\n";}****
>
> my a is 4 5 6           <<<<<<<<< This should be blank, but is the last
> assignment to @a.****
>
> now  a is 1 2 3****
>
> my a is****
>
> now  a is 1 2 3****
>
> my a is****
>
> now  a is 1 2 3****
>
> my a is****
>
> now  a is 1 2 3****
>
> my a is****
>
> now  a is 1 2 3****
>
> ** **
>
> I am running Win7 64 bit with Strawberry Perl 5.16.3.1 32 bit with
> Term::ReadLine and Term::ReadLine::Perl both installed from CPAN this past
> week.PDL and pdl2 shell are:****
>
> C:\Users\eclisob>pdl2****
>
> load_rcfile: got $HOME = C:/Users/eclisob****
>
> load_rcfile: loading C:/Users/eclisob/.perldlrc****
>
> ** **
>
> **********************************************
>
> * Warning: TERM type is dumb!            *****
>
> * Limited ReadLine functionality will be *****
>
> * available.  Please unset TERM or use a *****
>
> * different terminal type.               *****
>
> **********************************************
>
> ** **
>
> Perldl2 Shell v0.008****
>
>       PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file****
>
>       'COPYING' in the PDL distribution. This is free software and you****
>
>       are welcome to redistribute it under certain conditions, see****
>
>       the same file for details.****
>
> Loaded plugins:****
>
>   CleanErrors****
>
>   Commands****
>
>   Completion****
>
>   CompletionDriver::LexEnv****
>
>   CompletionDriver::Methods****
>
>   DDS****
>
>   FindVariable****
>
>   History****
>
>   LexEnv****
>
>   MultiLine::PPI****
>
>   NiceSlice****
>
>   PDLCommands****
>
>   Packages****
>
>   PrintControl****
>
>   ReadLineHistory****
>
> Type 'help' for online help****
>
> Type Ctrl-D or quit to exit****
>
> Loaded PDL v2.006****
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> [image: Ericsson] <http://www.ericsson.com/>
>
> ****
>
> *CLIFF SOBCHUK *
> Engineer IV - Systems Developer
> BNET DURA****
>
>
> *Ericsson*
> Home Office
> T3K3Y5, Calgary, AB, Canada
> Phone +16139636957
> Mobile +14038199233
> [email protected]
> www.ericsson.com ****
>
>
>
> [image: 
> http://www.ericsson.com/current_campaign]<http://www.ericsson.com/current_campaign>
> ****
>
> ** **
>
> Legal entity: Ericsson Canada, registered office in Terry Fox. This
> Communication is Confidential. We only send and receive email on the basis
> of the terms set out at www.ericsson.com/email_disclaimer****
>
> ** **
>
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>
>

<<image006.jpg>>

<<image005.jpg>>

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to