Created
July 9, 2012 18:14
-
-
Save swuecho/3077991 to your computer and use it in GitHub Desktop.
variables in perl
This file contains hidden or 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
| use Modern::Perl; | |
| # my (a, b, c) = 1, 2, 3 | |
| my $a=2; | |
| my $b=3; | |
| my $c=4; | |
| say ($a, $b, $c); | |
| sub test { | |
| # my $c=0; | |
| say $a; #2 | |
| say $b; #3 | |
| say $c; #4 | |
| $c+=1; | |
| say $c; #5 | |
| } | |
| test(); | |
| say ($a, $b, $c); # 235 | |
| =comment | |
| for varibles in perl, in if you can see it your can edit it. you can not see the | |
| varible outside. | |
| =cut |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment