my $action = $mech->current_form()->action(); $action =~ s{ \.pl \z}{_del.pl}x; $mech->current_form()->action( $action );