in reply to Re^3: Stop Using Perl
in thread Stop Using Perl

> At 22:00 the Perl lecture promises to be top-class.

Which implies he didn't see it before. YAPC talks aren't vetted why should CCC talks be? Have you given a talk before?

And after attending some CCC meetings I'd been very surprised of such level of review by a heterogeneous group of chaotic punks who love to see themselves in the hacker image of Hollywood media.

> Array context is array context, and that applies to %hash as LHS value.

The context isn't fixed by the top statement which is the list-assignment to %hash .

That's why you can easily write

DB<103> sub func { return 3,4,5 } DB<104> $href = {a => scalar func(), b => "x" } => { a => 5, b => "x" }

So again, why shouldn't => have a built-in scalar at RHS?

Cheers Rolf

(addicted to the Perl Programming Language and ☆☆☆☆ :)

¹) maybe unfair, but I heard much harder stuff there... especially after reading fefe blogs :)

Replies are listed 'Best First'.
Re^5: Stop Using Perl
by shmem (Chancellor) on Jan 01, 2015 at 23:52 UTC

    More to the point: the fat comma particularities apply to the LHS in any expression. The fat comma is just a comma. A comma in list context... yadda yadda, I won't expand that further. The RHS of a fat comma is already in list context, if the (fat) comma is a list operator.

    qwurx [shmem] ~ > perl -le 'sub f{qw(foo bar baz)}$_=(f=>f);print' baz qwurx [shmem] ~ > perl -le 'sub f{qw(foo bar baz)}@_=(f=>f);print"@_"' f foo bar baz

    That's easy. Introducing scalar context to the RHS of the fat comma is just quirky IMHO.

    Why should it be too hard to grasp that an array (or a function return which yields a list) expands into a list in list context?

    The context isn't fixed by the top statement which is the list-assignment to %hash . That's why you can easily write DB<103> sub func { return 3,4,5 } DB<104> $href = {a => scalar func(), b => "x" } => { a => 5, b => "x" }

    This is bull. The scalar in there does what? There.

    In my book, the context of the (finally discarded) last value of an assignment is set up by the LHS. But then, I might be entirely wrong about context in perl.

    perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
      > This is bull

      bull like in "red bull" ?

      Cheers Rolf

      (addicted to the Perl Programming Language and ☆☆☆☆ :)

        bull like in "red bull" ?

        *blush* well... more like bull => 'sh*t', but then, hey! maybe more like this bull for redundancy...

        qwurx [shmem] ~ > perl -le '%h=qw(Buffalo buffalo Buffalo buffalo buff +alo buffalo Buffalo buffalo);print"$_ => $h{$_}" for keys %h' Buffalo => buffalo buffalo => buffalo
        Sorry for any offense.

        update: added meaningful code to be explored
        perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
        t