Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > how to globaliz...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 7 Topic 10914 of 11751
Post > Topic >>

how to globalize a lexical variable inside a sub routine

by itshardtogetone@[EMAIL PROTECTED] Apr 10, 2008 at 07:30 AM

------=_NextPart_000_0006_01C89ADC.C23D2990
Content-Type: text/plain;
	charset="gb2312"
Content-Transfer-Encoding: quoted-printable

Hi,
Assuming my script use a strict pragma.=20
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 =3D 2;
    print "I can see you Mr $variable\n";
}

print "So what are the various options to globalise this \$variable =
which is $variable\n";

------=_NextPart_000_0006_01C89ADC.C23D2990--
 




 7 Posts in Topic:
how to globalize a lexical variable inside a sub routine
itshardtogetone@[EMAIL PR  2008-04-10 07:30:32 
Re: how to globalize a lexical variable inside a sub routine
Jenda@[EMAIL PROTECTED]   2008-04-10 02:08:56 
Re: how to globalize a lexical variable inside a sub routine
itshardtogetone@[EMAIL PR  2008-04-11 05:49:11 
Re: how to globalize a lexical variable inside a sub routine
Jenda@[EMAIL PROTECTED]   2008-04-11 00:23:12 
Re: how to globalize a lexical variable inside a sub routine
Peter@[EMAIL PROTECTED]   2008-04-11 04:55:40 
Re: how to globalize a lexical variable inside a sub routine
krahnj@[EMAIL PROTECTED]   2008-04-10 16:34:07 
Re: how to globalize a lexical variable inside a sub routine
chas.owens@[EMAIL PROTECT  2008-04-09 20:40:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 3:08:17 CDT 2008.