in reply to What are multiple $_[0] =~ operations doing?

some kind of dynamic referencing

Take the following code, for instance:

my @a = (1, 2, 3); add(@a); sub add { for (@_) { $_++; } }

Now try printing @a; it contains (2, 3, 4), because the add() function acted directly upon it's arguments.

Likewise, your statements are changing the first input parameter directly, by performing substitutions upon $_[0], which is the first value of @_.