Reference to field name with variable

I have a field called {hl1}
ex: {hl1} = 100;
I would like to assign it a value like this way.
$x = 1;
{hl.$x} = 100;
how can I do?