in reply to How to deal with subroutine parameters that have $, @, or %?

Your password generator is unlikely to be doing this, use ' instead of " for your test, or get the test data from a __DATA__ section instead. If its a generated string, there won't be interpolation, f.e.

#!/usr/bin/perl -w use strict; my $user="bobjones"; my $password='abc$123a'; test($user,$password); sub test { my $user = shift; my $password = shift; print "$user - $password\n"; }
or
#!/usr/bin/perl -w use strict; use String::Random; my $user="bobjones"; my $password= generateme(); test($user,$password); sub test { my $user = shift; my $password = shift; print "$user - $password\n"; } sub generateme { my $random = String::Random->new(); return $random->randpattern('ss!ccnC!cncc'); }

Using String::Random in place of your random password generator. It will produce strings containing @s, %s and $s, without the need of interpolation.