Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: One of these things is not like the others...

by McA (Priest)
on Oct 22, 2013 at 18:34 UTC ( #1059243=note: print w/replies, xml ) Need Help??


in reply to One of these things is not like the others...

The question is: What Perl version do you have on the dev box and what version do you have on the production machines?

Since Perl 5.14 the first expression to the function push can also be a array ref.

McA

  • Comment on Re: One of these things is not like the others...

Replies are listed 'Best First'.
Re^2: One of these things is not like the others...
by kennethk (Abbot) on Oct 22, 2013 at 18:36 UTC

    From push:

    Starting with Perl 5.14, push can take a scalar EXPR, which must hold a reference to an unblessed array. The argument will be dereferenced automatically. This aspect of push is considered highly experimental. The exact behaviour may change in a future version of Perl.
    Update: (which McA pointed out in an update)

    #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

      While looking up the version which introduced the new behaviour you answered it. A ++ for that.

      UPDATE: I've decided to upvote all answers which came in more or less at the same time referencing the new behaviour. It came faster in than I could hit the reload button. :))

      McA

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1059243]
help
Chatterbox?
[Corion]: Meh. My bank removed (part of) their CSV download facilities. Now I will either have to implement a full scraper or automate the download using the HBCI interface instead (or just get a new account elsewhere...)
[Corion]: On the upside, I spend a lot of time thinking this weekend about how to actually implement rate limiting for futures, and if things work out, maybe even loading a configuration from an external file makes sense
[Corion]: I've also found some interesting invariants that I have to think/write about more. A simple rate limiter will never change the order of the input, while a limiter that allows for parallel execution will change the order. But my API currently allows for bo
[Corion]: ... for both, and I'm not sure if I want to add the cruft from the parallel API (a token that you need to hold on to while you hold the lock) to the rate limiting API too, to allow seamless up/downgrades, or not.
[Corion]: Also, rate limiting will look great with await: my $token = await $limiter-> limit($hostname); instead of my $f = $limiter->limit( $hostname )->then(sub { my( $token)=@_; ... });

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (9)
As of 2017-10-23 08:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (277 votes). Check out past polls.

    Notices?