By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,806 Members | 1,506 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,806 IT Pros & Developers. It's quick & easy.

function return values

P: n/a
If I assign a variable to a function, say,
$x = f($y);
and then f happens not to return anything, does $x just remain unset? Or is
this illegal?
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"sinister" <si******@nospam.invalid> writes:
If I assign a variable to a function, say,
$x = f($y);
and then f happens not to return anything, does $x just remain unset? Or is
this illegal?


What happened when you tried it?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
Jul 17 '05 #2

P: n/a

"Michael Fuhr" <mf***@fuhr.org> wrote in message
news:3f**********@omega.dimensional.com...
"sinister" <si******@nospam.invalid> writes:
If I assign a variable to a function, say,
$x = f($y);
and then f happens not to return anything, does $x just remain unset? Or is this illegal?
What happened when you tried it?

<omission of laziness>Haven't.</omission of laziness>

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

Jul 17 '05 #3

P: n/a

"sinister" <si******@nospam.invalid> wrote in message
news:Bi******************@nwrddc03.gnilink.net...

"Michael Fuhr" <mf***@fuhr.org> wrote in message
news:3f**********@omega.dimensional.com...
"sinister" <si******@nospam.invalid> writes:
If I assign a variable to a function, say,
$x = f($y);
and then f happens not to return anything, does $x just remain unset? Or is this illegal?
What happened when you tried it?

<omission of laziness>Haven't.</omission of laziness>


Of course, that should read <admission ...>

One reason I wanted to ask, not just test, is that I couldn't find the
answer in documentation, and there's always the danger that one
instantiation of the language will do it one way, and another another way.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/


Jul 17 '05 #4

P: n/a
No. $x would return NULL

"sinister" <si******@nospam.invalid> wrote in message
news:mP*****************@nwrddc03.gnilink.net...
If I assign a variable to a function, say,
$x = f($y);
and then f happens not to return anything, does $x just remain unset? Or is this illegal?

Jul 17 '05 #5

P: n/a
Couldn't f() return NULL when it does not specifically returns something else?

"Michel" <pl*******@spam.nl> wrote in message news:<bp**********@news.cistron.nl>...
No. $x would return NULL

"sinister" <si******@nospam.invalid> wrote in message
news:mP*****************@nwrddc03.gnilink.net...
If I assign a variable to a function, say,
$x = f($y);
and then f happens not to return anything, does $x just remain unset? Or

is
this illegal?

Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.