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

The Perl-talk was great. Those who missed it and have to deal with Perl, should urgently watch it. Keep your popcorn ready! :-)

In an earlier announcement he writes: "Um 22:00 verspricht der Perl-Vortrag hochkarätig zu werden." (At 22:00 the Perl lecture promises to be top-class.) Being an influential guy and to some extent spokesman for the CCC (although he dismisses that, his label is associated with the CCC) I judge that as intolerable.

I haven't seen the video yet, but I have to admit that meditating about fat comma was worth talking about it.

Your meditations are valid, but building an edge case for "fat comma" as it is, breaks orthogonality. Array context is array context, and that applies to %hash as LHS value.

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

Replies are listed 'Best First'.
Re^4: Stop Using Perl
by LanX (Saint) on Jan 01, 2015 at 20:48 UTC
    > 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 :)

      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 ☆☆☆☆ :)