Created
August 7, 2009 07:59
-
-
Save shelling/163774 to your computer and use it in GitHub Desktop.
Perl internal. package is just a special hash aka Symbol Table
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/env perl | |
# | |
use 5.010; | |
package Hello; | |
our $var = "scalar"; | |
our @var = qw(array); | |
our %var = ( | |
hash => "hash", | |
); | |
sub var { | |
"sub"; | |
} | |
package main; | |
use Data::Dumper; | |
say Dumper \%Hello::; | |
say $Hello::var; | |
say $Hello::var[0]; | |
say $Hello::var{hash}; | |
say Hello::var(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment