Noob question here.
I'm sure the answer will create objects and store them in an array, but I want to see if there is an easier way.
In JSON notation, I can create an array of such objects:
[ { width : 100, height : 50 }, { width : 90, height : 30 }, { width : 30, height : 10 } ]
Nice and simple. Do not argue.
I know that Perl is not JS, but is there an easier way to duplicate an array of objects, then create a new "class", new objects and insert them into the array?
I suppose that would make it possible - this is a text entry of the type of object that JS provides.
Or is there another way to store two values, for example, higher? I guess I can only have two arrays, each with scalar values, but that seems ugly ... but much easier than creating a separate class and all that shit. If I were writing Java or something like that, then there would be no problem, but I do not want all this to bother when I just write a small script.
source share