in reply to Anon Struct Instance
and then say:$sn = $entry3; $$sn = new DEVICE;
That's not an anonymous reference. You've set $sn equal to the value of $entry3 and are then trying to use that value as a reference. That's not going to work, because it's not a reference.> I think the error is bogus, and that it somehow doesn't > like the anon reference thingie.
Try this:
Assuming that $entry is an array reference. Isn't it, the first time you tried to use it?$entry->[3] = new DEVICE;
In addition: you haven't shown us all of your code, but if you're just looping through data and creating a new DEVICE for each line of the data, then adding that to an array... are you by any chance using an incremented loop counter to hold your array index? :)
If so, you should try this instead:
which eliminates the need for the "synthetic" array size indicator. For more on this sort of thing, see Mark-Jason Dominus's Return of Program Repair Shop and Red Flags.push @$entry, new DEVICE;
|
|---|