in reply to RE: RE: Re: scalar doesn't work values returned by a function?
in thread scalar doesn't work values returned by a function?
From man perldata:
In a context not requiring a list value, the value of the list literal is the value of the final element, as with the C comma operator. For example, @foo = ('cc', '-E', $bar); assigns the entire list value to array foo, but $foo = ('cc', '-E', $bar); assigns the value of variable bar to variable foo.Also:
If you evaluate a named array in a scalar context, it returns the length of the array. (Note that this is not true of lists, which return the last value...From man perlfunc:
sort LIST
Sorts the LIST and returns the sorted list value.
So, you see, since sort returns "the sorted list value," and lists evaluate to "the value of the final element," I would expect (at first glance) to get the last element from the list which sort returns.
BTW, I hope I didn't offend you somehow. If so, I am terribly sorry. Your response seemed a bit hostile. Please accept my apologies...
Just a nice guy trying to contribute,
Russ
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: RE: RE: Re: scalar doesn't work values returned by a function?
by perlmonkey (Hermit) on May 11, 2000 at 09:12 UTC | |
|
Re: scalar doesn't work values returned by a function?
by ZZamboni (Curate) on May 11, 2000 at 09:37 UTC | |
by perlmonkey (Hermit) on May 11, 2000 at 11:08 UTC |