in reply to modify variable on pass by value

#!/usr/bin/perl -w sub remove_caps(\$) { ## ^^^ here's the magic... my $val = shift; $$val =~ s/[A-Z]+//g; #this removes _all_ caps... } my $test = 'Hello World'; remove_caps($test); print "$test\n";