develooper Front page | perl.beginners | Postings from April 2010

function return

Thread Next
Akhthar Parvez K
April 29, 2010 04:31
function return
Message ID:

The following line stores the first return value by the function Function1 to the variable $name:

my ($name) = @_[0] = &Function1 ($arg);

but this one doesn't work:
my ($name) = $_[0] = &Function1 ($arg);

Eventhough I've no issues to use the first one as long as it works well for me, but I'm getting the following warning:
Scalar value @_[0] better written as $_[0] 

I hate warnings, but how can I fix that? As I said, $_[0] doesn't work. Can someone shed some light on this?

Akhthar Parvez K
UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity - Dennie Richie

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About