Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Leaking Function Return

by haukex (Abbot)
on Oct 06, 2017 at 15:15 UTC ( #1200835=note: print w/replies, xml ) Need Help??

in reply to Leaking Function Return

this is my first post on here. If I am violating any rules, I apologize in advance. Also, if you see a simple way I can improve my conventions for coding

Welcome, and no worries, for a first post it's fine :-) Some good introductory reading is PerlMonks for the Absolute Beginner, The Perl Monks Guide to the Monastery, and How do I post a question effectively?

Sorry, I can't reproduce the issue, neither with your original code with strict turned off, or with it turned on and the appropriate my declarations added (although I'm not surprised by the latter). Without seeing more code (a representative Short, Self-Contained, Correct Example), I can only guess: Either you're making a mistake somewhere in the "manipulations occur here producing a new array with 6 values", which you haven't shown us, or, since you're apparently not using strict, meaning all of those variables are global, there is some "cross-contamination" happening between the arrays (Update 2: I just wrote some more on that here). This is one reason you should always Use strict and warnings*, since it helps enforce proper scoping of your variables!

* Update: Your program should begin with this, see the Basic debugging checklist:

use strict; use warnings; use diagnostics;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1200835]
and the universe expands...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2018-07-22 05:30 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (452 votes). Check out past polls.