[hildrum:~] tor% perl -v
This is perl, version 5.005_03 built for i386-freebsd
Thanks guys, newer version is on it's way.
Tor
> "John" == John Douglas Porter <[EMAIL PROTECTED]> writes:
John> "Randal L. Schwartz" <[EMAIL PROTECTED]> wrote:
>> ... the last element of a list in a scalar context.
John> Randal said "...a list in a scalar context". /me faints.
I said "last element of a list" "in a scalar context". Do
Le Mardi 22 Juillet 2003 01:48, Tor Hildrum a écrit :
> Not sure if this belongs here, but anyway:
[snip...]
as said Randal :
In modern versions of Perl [...] returning either
- a list in a list context,
- or the last element of a list in a scalar context.
(don't forget 'scalar @array' return t
"Randal L. Schwartz" <[EMAIL PROTECTED]> wrote:
> ... the last element of a list in a scalar context.
Randal said "...a list in a scalar context". /me faints.
--
John Douglas Porter
__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design softw
> "Tor" == Tor Hildrum <[EMAIL PROTECTED]> writes:
Tor> Could someone please explain what is happening here?
In older versions of Perl, qw(STRING) was implemented as a runtime
split(" ", STRING,) and inherited the scalar property of split(),
including the annoying warning under -w about the d
On Tue, 22 Jul 2003 03:48:53 +0200, [EMAIL PROTECTED] wrote:
>
>Could someone please explain what is happening here?
>I came across it, and had a hard time trying to figure out what was
>going on.
When you use an array in scalar context (e.g. scalar(@ARGV)==foo, or even
just @ARGV==foo), it gives
Tor Hildrum wrote:
>
> Not sure if this belongs here, but anyway:
>
> [hildrum:~] tor% perl -e '@ARGV = qw(1 2); if(scalar(@ARGV)==qw(2 3) )
> {print "yes\n"}'
> yes
> [hildrum:~] tor%
>
> [hildrum:~] tor% perl -e '@ARGV = qw(1 2); if(scalar(@ARGV)==(2, 3) )
> {print "yes\n"}'
> [hildrum:~] tor%
hi
> Could someone please explain what is happening here?
> I came across it, and had a hard time trying to figure out what was
> going on.
in 5.6.1 it seems to work the correct way, i.e. the first two examples
aren't true, while the third and fourth evaluate as true. maybe something
was changed
Not sure if this belongs here, but anyway:
[hildrum:~] tor% perl -e '@ARGV = qw(1 2); if(scalar(@ARGV)==qw(2 3) )
{print "yes\n"}'
yes
[hildrum:~] tor%
[hildrum:~] tor% perl -e '@ARGV = qw(1 2); if(scalar(@ARGV)==(2, 3) )
{print "yes\n"}'
[hildrum:~] tor%
&&
[hildrum:~] tor% perl -e '@ARGV =