Re: Strip charactes from every element in array

2001-08-23 Thread Luke Bakken
When you do a for loop : for (@array) { s/1//g; } the implicit $_ in the loop becomes an alias for the real element - so by modifying the element in the loop you're actually modifying the "real" one in the array. Luke PS you could use map here as well, but it's in a void context - big

RE: Strip charactes from every element in array

2001-08-23 Thread HOLLAND-MORITZ,MARCUS (A-hsgGermany,ex1)
August 23, 2001 4:49 PM | To: 'HOLLAND-MORITZ,MARCUS (A-hsgGermany,ex1)' | Subject: RE: Strip charactes from every element in array | | | and if the character isn't there | | @array(one1 two three1); | | I end up with | | one tw three | | -Original Message- |

RE: Strip charactes from every element in array

2001-08-23 Thread HOLLAND-MORITZ,MARCUS (A-hsgGermany,ex1)
2001 4:45 PM | To: Perl Beginners (E-mail) | Subject: Strip charactes from every element in array | | | Is there any easy way to strip a single character from every | element in an | array? | | @array = qw(one1 two1 three1); | | And I need the elements to be (one two three). | | | My only id

Strip charactes from every element in array

2001-08-23 Thread John Edwards
Is there any easy way to strip a single character from every element in an array? @array = qw(one1 two1 three1); And I need the elements to be (one two three). My only idea is copy to another array, run a foreach, s/// the char out and push into another array, then after the foreach has finish