in reply to Troubles with Unshift and Push

Is this is correct way of creating array with three elements?, Did you try printing the values in @num_weights array?

my @num_weights = [36,264,188]; my @leftovers = [1,2,3,4];

All is well. I learn by answering your questions...

Replies are listed 'Best First'.
Re^2: Troubles with Unshift and Push
by nat47 (Sexton) on Mar 04, 2015 at 05:19 UTC
    Yeah, say Dumper(@num_weights)shows whats in the array.

      But it creates array with one element with anonymous array.


      All is well. I learn by answering your questions...
        Sorry, I'm new to Perl and I don't know what you're saying. When say Dumper(@num_weights) is said, shouldn't it show
        [1, 36, 264, 188 ];
        ?