in reply to What's going on here?

perl -MO=Deparse,-p -e '120*312-77728+2.22772.224792222->x' ((-40288) + "\cB\x{58f4}\x{d660e9e}"->x);

Still asking why?

2.22772.224792222 is not a number, it's "version" string, i.e. three characters whose ords are 2, 22772, and 224792222. The -> operator is called on this string which interprets it as a class name.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: What's going on here?
by bliako (Abbot) on Jul 13, 2023 at 09:50 UTC

    Good catch about the version string but I would only say The -> operator is called on this string which interprets it as a class name. It has nothing to do with version string, e.g. 42->x does the same. I think.

      Yes, 42 is turned into the string "42" which is interpreted as a class name. Basically, anything that's not a reference is stringified by the arrow operator.

      Update: See The Arrow Operator in perldoc.

      map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]