2008å¹´05æ12æ¥18:15 ã«ãã´ãªLightweight Languages perl - @_ ã¯åç §ã§ãã ããã§ãæ£è§£ã§ã¯ããã¾ãããperlã®å ´åãã£ã¨ç°¡åãªæ¹æ³ãããã¾ãã åè¨èªéã®åç §ã¨å¤æ¸¡ã - @author pyridoxin sub swap { my ($x , $y) = @_; $$temp = $$y; $$y = $$x; $$x = $$temp } [codepad] sub swap { my $tmp = $_[0]; $_[0] = $_[1]; $_[1] = $tmp; } my ($a, $b) = (1, 2); print "\$a = $a, \$b = $b\n"; swap($a, $b); print "\$a = $a, \$b = $b\n"; ããã¯ãReferenceãåå¨ããªãã£ãPerl 4以åããã®ä»æ§ã§ãã
{{#tags}}- {{label}}
{{/tags}}