in reply to Re^2: How it works?
in thread How it works?

Implicit int-ing also works at run-time:

c:\@Work\Perl\monks>perl -wMstrict -le "my @ra = qw(e h l o); my ($i, $j, $k, $l) = (0.99876, 1.00123, 2.499999, 3.5); print $ra[$j], $ra[$i], $ra[$k], $ra[$k], $ra[$l]; " hello c:\@Work\Perl\monks>perl -wMstrict -MO=Deparse,-p -le "my @ra = qw(e h l o); my ($i, $j, $k, $l) = (0.99876, 1.00123, 2.499999, 3.5); print $ra[$j], $ra[$i], $ra[$k], $ra[$k], $ra[$l]; " BEGIN { $^W = 1; } BEGIN { $/ = "\n"; $\ = "\n"; } use strict 'refs'; (my(@ra) = ('e', 'h', 'l', 'o')); (my($i, $j, $k, $l) = (0.99876, 1.00123, 2.499999, 3.5)); print($ra[$j], $ra[$i], $ra[$k], $ra[$k], $ra[$l]); -e syntax OK
Dunno about the documentation.


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^4: How it works?
by kcott (Archbishop) on Jan 22, 2016 at 06:43 UTC

    ++ Thanks for the runtime examples, AnomalousMonk.

    "Dunno about the documentation."

    After much delving in that musty library beneath the lower catacombs, I believe I may have found an ancient scroll of particular relevance:

    $ perldoc perlglossary
    ...
        dwimmer
            DWIM is an acronym for “Do What I Mean”, the principle that something
            should just do what you want it to do without an undue amount of fuss.
            A bit of code that does “dwimming” is a “dwimmer”. Dwimming can
            require a great deal of behind-the-scenes magic, which (if it doesn’t
            stay properly behind the scenes) is called a dweomer instead.
    ...
    

    Perhaps, to avoid this dwimmer becoming a dweomer, we should stop poking it. :-)

    — Ken