in reply to Changing each item in an array
You already have enough answers to your immediate question so I'll just add an advice:
If the code behaves funny, test whether the data look the way you expected.
In this case the very first thing should should have done is printing either the contents of @array or the value of $item before you modified it. Eg.
If you did this you'd see that the @array contains the variable NAMES, not their values.print "\@array = ( '" . join( "', '", @array) . "')\n";
Jenda
Always code as if the guy who ends up maintaining your code
will be a violent psychopath who knows where you live.
-- Rick Osborne
Edit by castaway: Closed small tag in signature
|
|---|