Re: qw(l i s t) vs (l, i, s, t)

2003-07-26 Thread Tor Hildrum
[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

Re: qw(l i s t) vs (l, i, s, t)

2003-07-22 Thread Randal L. Schwartz
> "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

Re: qw(l i s t) vs (l, i, s, t)

2003-07-22 Thread Jean-Pierre Vidal
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

Re: qw(l i s t) vs (l, i, s, t)

2003-07-22 Thread John Douglas Porter
"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

Re: qw(l i s t) vs (l, i, s, t)

2003-07-22 Thread Randal L. Schwartz
> "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

Re: qw(l i s t) vs (l, i, s, t)

2003-07-22 Thread Yitzchak Scott-Thoennes
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

Re: qw(l i s t) vs (l, i, s, t)

2003-07-22 Thread Jasper McCrea
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%

Re: qw(l i s t) vs (l, i, s, t)

2003-07-22 Thread Stefan Stiasny
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

qw(l i s t) vs (l, i, s, t)

2003-07-22 Thread Tor Hildrum
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 =