Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Array of variables

by frozenwithjoy (Priest)
on May 28, 2013 at 20:54 UTC ( #1035724=note: print w/replies, xml ) Need Help??


in reply to Re^2: Array of variables
in thread Array of variables

What part of what you wrote are you confused about?

Replies are listed 'Best First'.
Re^4: Array of variables
by dbuckhal (Pilgrim) on May 28, 2013 at 21:06 UTC

    I thought I replicated the OP's code, but did not have a problem with the post-increment of the array element. So, I am confused that my code seems to work, whereas the OP's does not.

    Note how my output does increment the elements. Did I present code that replicates the OP's scenario, or am I off target here?

    Thanks!
      The difference is that you are actually printing the thing you are incrementing rather than incrementing one item and printing another completely distinct item. What the OP did is more like the final print statement here:
      perl -E ' my ( $x, $y, $z ) = ( 1, 2, 3 ); my @a = ( $x, $y, $z ); say join " ", map { $_++, $_ } @a; say "@a"; say "$x $y $z"; ' 1 2 2 3 3 4 2 3 4 1 2 3
        Well, let me just
        perl -E ' say "Thanks!" '

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1035724]
help
Chatterbox?
[stevieb]: heh, yeah, sorry. This is integration testing for certain. In fact, it's even Continuous Integration ;)
[stevieb]: Obviously, Travis CI just won't cut it for these distributions...
[stevieb]: I went on my merry way writing a cross-platform, network-aware system that works across Perlbrew and Berrybrew systems and runs unit tests for Perl dists on all installed versions, with the ability to manage *brew commands themselves
[stevieb]: That worked out exceptionally well, as when I started that project, I hadn't delved into hardware development yet.

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2017-06-25 23:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (572 votes). Check out past polls.