#!/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);