$i = 3;
$array[$i] = $new_value;

Full example

examples/replace_element_of_array.pl

use strict;
use warnings;

use Data::Dumper;
my @authors = ('Issac Asimov', 'Arthor C. Clarke', 'Ray Bradbury', 'Foo Bar', 'Philip K. Dick', 'H. G. Wells', 'Frank Herbert');

print Dumper \@authors;

$authors[3] = 'Jules Verne';

print Dumper \@authors;

Before:

$VAR1 = [
          'Issac Asimov',
          'Arthor C. Clarke',
          'Ray Bradbury',
          'Foo Bar',
          'Philip K. Dick',
          'H. G. Wells',
          'Frank Herbert'
        ];

After:

$VAR1 = [
          'Issac Asimov',
          'Arthor C. Clarke',
          'Ray Bradbury',
          'Jules Verne',
          'Philip K. Dick',
          'H. G. Wells',
          'Frank Herbert'
        ];

Read more about arrays in Perl.