From: <[EMAIL PROTECTED]> To: <beginners@perl.org> Subject: how to globalize a lexical variable inside a sub routine Date sent: Thu, 10 Apr 2008 07:30:32 +0800
> Hi, > Assuming my script use a strict pragma. > If I have a lexical variable declared inside a sub routine and I wish > to globalize this lexical variable, what are the various options to > globalise this variable? > > Thanks > > ############### > use strict; > use warnings; > > testing(); > > sub testing { > my $variable = 2; > print "I can see you Mr $variable\n"; > } > > print "So what are the various options to globalise this \$variable which is > $variable\n"; What do you mean by "globalise"? Jenda ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/