in reply to Re: my variables in a subroutine
in thread my variables in a subroutine

Your example isn't a hack as such, it is, as lakshmananindia pointed out, a closure.

A user level that continues to overstate my experience :-))

Replies are listed 'Best First'.
Re^3: my variables in a subroutine
by cdarke (Prior) on Mar 23, 2009 at 11:59 UTC
    Semantics, one man's hack is another's feature. I view it as a hack because it fulfills functionality missing from the language, i.e. a 'state' variable type (aka 'static') (and if it wasn't a missing feature then it wouldn't have been added).
      That's not a hack, it's a Design Pattern!