Function parameters are passed by reference. This means @_ contained $1 which is modified by any successful regex. You can modify values in @_ directly to watch this.
Most of the time you aren't passing something like $1 in and don't have to worry about the issue you ran into
In reply to Re^3: Strange behavior: passing $1 to AUTOLOAD
by diotalevi
in thread Strange behavior: passing $1 to AUTOLOAD
by johnnywang
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |