Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Leaking Function Return

by haukex (Monsignor)
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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1200835]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2017-10-20 05:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (258 votes). Check out past polls.

    Notices?