Link to home
Start Free TrialLog in
Avatar of blnukem
blnukem

asked on

Change The Value Of A Item In An Array


While looping threw an array how do I change the value of a item?

my $NewNameToAdd = "Distance=584";
my $WordToRemove = "Distance::Required=584";

my @Array ('LeftSegmentHeight=45','Distance::Required=584','RightSegmentHeight=789');

DESIRED NEW ARRAY:
my @Array ('LeftSegmentHeight=45','Distance=584','RightSegmentHeight=789');
ASKER CERTIFIED SOLUTION
Avatar of ps15
ps15

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ps15
ps15

for (@Array) {
 if ($_ eq 'Something') {
  $_ = 'something_else';
 }
}
Avatar of ozo
s/::.*?=/=/ for @Array;