#! perl use strict; use warnings; sub name(*;**) { printf "First argument: %s\n" . "Second argument: %s\n" . "Third argument: %s\n\n", @_; } printf "\nname() has prototype (%s)\n\n", prototype('name'); my @array = ('foo', 'bar'); &name('1a', 'u', 'v'); name('1b', 'u', 'v'); &name('2a', ('x', 'y')); name('2b', ('x', 'y')); &name('3a', @array, 'extra_1'); name('3b', @array, 'extra_2'); my $fp = \&name; $fp->('3c', @array, 'extra_3'); #### 16:19 >perl 833_SoPW.pl Useless use of a constant ("x") in void context at 833_SoPW.pl line 29. name() has prototype (*;**) First argument: 1a Second argument: u Third argument: v First argument: 1b Second argument: u Third argument: v First argument: 2a Second argument: x Third argument: y Missing argument in printf at 833_SoPW.pl line 19. First argument: 2b Second argument: y Third argument: First argument: 3a Second argument: foo Third argument: bar First argument: 3b Second argument: 2 Third argument: extra_2 First argument: 3c Second argument: foo Third argument: bar 16:19 >