in reply to Re: Legitimate use for combined 'local' and 'our'
in thread Legitimate use for combined 'local' and 'our'
If you now remove the second our, the program doesn't compile.#!/usr/bin/perl use strict; use warnings; { our $V = 'non-local'; sub print_v { print "$V\n"; } } { local our $V = 'local'; print_v; } print_v __END__
|
|---|