How do I process/modify each element of an array?

Use for/foreach:

    for (@lines) {
	s/foo/bar/;
	tr[a-z][A-Z];
    }

Here's another; let's compute spherical volumes:

    for (@radii) {
	$_ **= 3;
	$_ *= (4/3) * 3.14159;  # this will be constant folded
    }