{ #start a lexical block
    my $x = "hello"; #lexically scoped to this block
    sub f {
        print "x is $x\n"; #we are within the block and can see $x
    }
} #close the lexical block
f(); #will use and invoke the subroutine and print "x is hello"
