This function returns the string that results from decoding the scalar value OCTETS, assumed to be a sequence of octets in ENCODING, into Perl's internal form. The returns the resulting string.

First, I don't see from your example that the string you are passing to decode is a sequence of octets which you got from some earlier call to encode.

Secondly, the string contains only digits and a few special characters, and they have the same encoding in most character encoding schemes (for instance, they have the same encoding in cp-1251 and ASCII). I wonder what output you have expected instead?

Well, I get this string from web form, which POSTS this into perl script when user inputs in Cyrillica. When I use this page http://2cyr.com/decode/ (last option in autodetect drop down), then from this string of characters

&#1092;&#1099;&#1074;&#1072;

I can successful decode to readable Cyrillic characters

фыва

So this is the result what I expected. If the problem is that this input string needs to be in those octets, then my next question is how do I convert this string into octets in Perl if it is possible?

Well, but then, this string denotes (HTML-) entities (in this case a so-called "numeric character reference"). But you are using Encode/Decode, which is for translating character sets, so you are applying these function to data they are not designed to work for.

1072 for instance is decimal value of the Unicode code point for the cyrillic 'a'. I'm not a specialist in dealing with Unicode, but I feel that you first need to convert the entity string denoting Unicode code points, into UTF-8, and then you can use a second conversion step to translate this into your target character set.