in reply to Python tricks

Personal choice, but I would swap out the C-ish loop from V:

my @list1 = qw/a b c d/; my @list2 = qw/p q r s/; for (0 .. $#list1) { say "$list1[$_] $list2[$_]"; }

Replies are listed 'Best First'.
Re^2: Python tricks
by pme (Monsignor) on Dec 18, 2018 at 15:05 UTC
    Your solution is better, more perlish.

      No, it's not perlish and please don't use it any more.

      $# is long deprecated, and will throw exception when using on 5.30 soon.

      Thank syphilis for pointing out my misunderstanding!





      I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

        $# is long deprecated

        It's true that the special perl variable $# is deprecated, but hippo is using "$#" in a different, quite allowable, context:
        C:\_32>perl -le "print $#;" $# is no longer supported as of Perl 5.30 at -e line 1. C:\_32>perl -wle "@x=(7,8,9);print $#x;" 2

        Cheers,
        Rob