Skip to content

Instantly share code, notes, and snippets.

@syohex
Created November 14, 2012 13:24
Show Gist options
  • Save syohex/4072045 to your computer and use it in GitHub Desktop.
Save syohex/4072045 to your computer and use it in GitHub Desktop.
Perl prototype is too difficult to understand
#!/usr/bin/env perl
use strict;
use warnings;
sub with_prototype ($) {
print "@_\n";
}
with_prototype(()); # OK, pass undef
with_prototype(("a", "b")); # OK, pass 'b', ignore 'a'
with_prototype("a", "b"); # Compile Error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment