develooper Front page | perl.beginners | Postings from May 2007

Re: Passing arguments to subroutine

Thread Previous | Thread Next
From:
nobull67@gmail.com
Date:
May 31, 2007 15:48
Subject:
Re: Passing arguments to subroutine
Message ID:
1180614767.268697.320740@m36g2000hse.googlegroups.com
On May 31, 9:27 am, almatir...@gmail.com (Alma) wrote:
> sub delete_file()
> {
>         my $self = shift;
>         my $file_path = @_;

That sets $file_path to the number of arguments in the call to the
method delete_file().

To set $file_path to the first of the arguments in the call to the
method delete_file()...

        my ($file_path) = @_;


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About