Things that jump out at first glance:
- Version 5.14 is pretty long in the tooth (if you're actually using 5.14; see the documentation on feature for what's twiddled by a specific bundle tag)
- @frame[0] etc is wrong. You mean $frame[0] to reference a single element of an array (using @foo is only for referencing the entire array or a slice of values).
- Writing $result += $increment is more idiomatic
- You call count but don't do anything with the return value
- Which is probably for the best because without an explicit return I'd actually need to go experimentally figure out what the implicit return value would be
- And now having written that I see that you've got $result declared outside the scope of count so I'll just mention that my functional preference would be to have an explicit argument rather than relying on shared state.
Edit: Just to be clear these aren't "terrible" problems (well aside from @ vs $ will someday cause yourself much pain if you don't cut that off quick but that's a common beginner thing; it's along the same lines why @_ vs using shift was mentioned elsewhere)
The cake is a lie.
The cake is a lie.
The cake is a lie.