in reply to replace a value in an array

Concurring with davido's suggestion that we need a clearer problem statement (and probably one that seeks to deal with a single topic at a time), here's an answer to question in your node title:
C:>perl -E "my @x=qw(3 4 5); say @x; $x[2] = E; say @x;" 345 34E

Questions containing the words "doesn't work" (or their moral equivalent) will usually get a downvote from me unless accompanied by:
  1. code
  2. verbatim error and/or warning messages
  3. a coherent explanation of what "doesn't work actually means.