Perl v5.28 allows you to initialize array and hash variables that you declare with state
. This is a feature a long time coming and that I’m quite happy as finally arrived.
Since v5.10 and up to v5.26 you could only initialize a state
variable if it was a scalar. You could declare a hash or array variable but you couldn’t give it an initial value at the same time. You could do this:
Continue reading “Initialize array and hash variables with state”