Skip to content

Instantly share code, notes, and snippets.

@Code-Hex
Created August 20, 2014 14:05
Show Gist options
  • Save Code-Hex/8824612ec14643852e78 to your computer and use it in GitHub Desktop.
Save Code-Hex/8824612ec14643852e78 to your computer and use it in GitHub Desktop.
sub で return が省略できることを知った
#! /usr/bin/perl
use strict;
use warnings;
my $n = "\n";
my $result = max(10,20);
print $result . $n;
sub max {
my ($a, $b) = @_;
$a + $b; #最後に式を持っていけば、自動的に戻り値になる
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment