#!/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";
In reply to RE: modify variable on pass by value
by cianoz
in thread modify variable on pass by value
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |