[Bioperl-l] $_ assignment question

Dave Howorth dhoworth at mrc-lmb.cam.ac.uk
Fri Aug 1 10:04:51 EDT 2003


Aaron J Mackey wrote:
> You got caught by lists vs. arrays:

Well, I got caught but it wasn't by lists vs arrays. The for() statement 
takes a list, so the array is turned into a list by being used in the 
for statement. What I didn't realize is that for(list) aliases to the 
list members so that they're r/w access.  Now there's a whole new bag of 
tricks I can use :)

So I retract my
 >> (i) problems of this kind will show up pretty quickly
and agree with you when you say:
> So problems with reassigning to $_ that might arise in the second case are
> quite silent and insidious.

but I think it's still correct to say:
>>  (ii) they can be isolated by putting:
>>for ('once') { ... }
>>around the tests of any (all!) method calls.

Cheers, Dave
-- 
Dave Howorth
MRC Centre for Protein Engineering
Hills Road, Cambridge, CB2 2QH
01223 252960



More information about the Bioperl-l mailing list