Created
September 6, 2011 18:41
-
-
Save ranguard/1198565 to your computer and use it in GitHub Desktop.
Nasty global variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
package mytest; | |
our $global_var = "hello \n"; | |
sub print_global_var { | |
print $global_var ."\n"; | |
} | |
package main; | |
&mytest::print_global_var; | |
$mytest::global_var = "bye\n"; | |
&mytest::print_global_var; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment