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

function return

Thread Next
From:
Akhthar Parvez K
Date:
April 29, 2010 04:31
Subject:
function return
Message ID:
201004291701.38553.akhthar@sysadminguide.com
Hi,

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?

Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity - Dennie Richie

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