#! /usr/local/bin/perl

# This example will pass a value to a subroutine in a 
# pass-by-value mode.

$var = "Outside sub"; #make the assignment

print "Before Sub: $var\n";

&PrintVar($var); #call the sub and pass-by-value

print "After Sub: $var\n";

# declare the sub and set it up
sub PrintVar
{
    local($var)=@_;

	$var = "Inside sub";

	print "During Sub: $var\n";
}

    Source: geocities.com/siliconvalley/vista/6493/perl/code

               ( geocities.com/siliconvalley/vista/6493/perl)                   ( geocities.com/siliconvalley/vista/6493)                   ( geocities.com/siliconvalley/vista)                   ( geocities.com/siliconvalley)