in reply to Re: How can I use the values which is passed as arguments?
in thread How can I use the values which is passed as arguments?

Thank you very much for your responce,
Subroutine definition : sub func(\$@$)
Subroutine call is : func($a, @b, Sc)
In this case, how can I get the parameters by the statement
($first, $second, $thrid)=@_
regards,
Anbarasu

Replies are listed 'Best First'.
Re^3: How can I use the values which is passed as arguments?
by GrandFather (Saint) on Mar 10, 2009 at 08:05 UTC

    subroutine prototypes in Perl are much discussed because generally using them is a bad idea. For a recent discussion see subroutine prototypes still bad?.

    The bottom line is: don't do that. And a follow up line is: Always use strictures (use strict; use warnings;).

    Instead of using prototypes consider:

    use strict; use warnings; my $str = 'Welcome'; my @array = qw(to the world of); serious ($str, \@array, 'Perl'); sub serious { my ($str, $arrayRef, $constStr) = @_; print join (' ', $str, @$arrayRef, $constStr), ".\n"; }

    Prints:

    Welcome to the world of Perl.

    True laziness is hard work
      Thank you, I got the solution
      Anbarasu