You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
329 B
Perl

#!/usr/bin/perl
use warnings;
use strict;
sub definelexical {
my $lexvar = "the original value";
return \$lexvar;
}
sub printlexicalref {
my $lexvar = ${$_[0]}; # dereference the reference
print "The variable still contains $lexvar \n";
}
my $ref = definelexical();
printlexicalref($ref);