Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Juerd, the overlooked (ORMs, Webapps)

by jettero (Monsignor)
on Jul 31, 2008 at 13:57 UTC ( #701422=note: print w/replies, xml ) Need Help??


in reply to Juerd, the overlooked (ORMs, Webapps)

I enjoyed your article, but ... in the synopsis of DBIx::Simple I was rather shocked to find $db->member_name = 2 ... what? I then browsed the code and found this:
sub package::member_name : lvalue { $_->[0]{property_name} }

I had no idea you could do that. No comment on your actual article, I just thought that was really neat. I wonder what else I'm missing.

UPDATE: the argv and sigil ones I did know... But I'm sure there's many others I don't. There should be a thread on Weird Crap about Perl You Don't Yet Know...

-Paul

Replies are listed 'Best First'.
Re^2: Juerd, the overlooked (ORMs, Webapps)
by moritz (Cardinal) on Jul 31, 2008 at 14:12 UTC
    Again wandering off into off-topic land
    I wonder what else I'm missing.
    I guess you never stop discovering stuff in Perl. After a few years of perl programming I always discover something new. I didn't know that ARGV was magic, for example, or that you could actually insert a space after the sigil and the name of a variable:
    $ perl -wle 'my $ x = 3; print $ x' 3

    I think that Perl is like one of these really old and huge castles (think Hogwarts), where you discover a shortcut or a secret trap door every now and then if you explore its corners (or watch Fred and George strolling around, to stay at Hogwarts).

    Of course there are maps, but they are sometimes a bit boring to read when you don't have a good reason to do so (and after all you can reach your goal with the "normal" ways usually), and not everybody likes to sit in the libraries for hours ;-)

      that you could actually insert a space after the sigil and the name of a variable
      ... I think that Perl is like one of these really old and huge castles (think Hogwarts)

      Whitespace? castle? reminds me immediately of the famous interview to Abigail...

      --shmem

      _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                    /\_¯/(q    /
      ----------------------------  \__(m.====·.(_("always off the crowd"))."·
      ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
      I didn't know that ARGV was magic
      I knew ARGV was magical, but it was only recently that I found out just how magical it was.

      Just one of the reasons I love Perl!

Re^2: Juerd, the overlooked (ORMs, Webapps)
by kyle (Abbot) on Jul 31, 2008 at 15:13 UTC

    Since perlsub says that lvalue subs are still experimental, I wouldn't recommend writing an interface like that, if you have a choice.

      Experimental like "(?{ code })" or experimental like pseudo-hashes? That's the question.

      -Paul

        You question boils down to experimental like "not working reliably, and being marked experimental for the last two major releases" or experimental like "removed in newer perls"?

        I don't think lvalue subs have been removed in blead, so it's more likely the first option.

        lvalue returns are orthodox in Perl 6, and with the trend to back-porting Perl 6 features to 5.x, I don't see them dropping it.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://701422]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2019-06-25 19:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (107 votes). Check out past polls.

    Notices?