Skip to content

Instantly share code, notes, and snippets.

@ranguard
Created September 6, 2011 18:41
Show Gist options
  • Save ranguard/1198565 to your computer and use it in GitHub Desktop.
Save ranguard/1198565 to your computer and use it in GitHub Desktop.
Nasty global variables
#!/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