> I have seen Ex #1 "corrected" (as being more well written) to Ex #2. > In this case it is just being passed a $ but the data being passed was > irrelevant. (though not a ref) I still don't see why, i guess i don't > fully understand "shift". Any light shedder's appreciated, thanks : -) > > EX #1: > sub makeArray{ > my @array = @_; > foreach(@array){ > print $_ . "\n"; > } > } > > > Ex #2 > sub makeArray{ > my @array = shift @_; > foreach(@array){ > print $_ . "\n"; > } > } >
The second example is nonsense. The my @array = shift @_; will pull the first parameter and store it in ONE ELEMENT array @array. The other parameters will stay in @_. Jenda Thank you, that is my understanding of shift. ;-)