in reply to Re^2: Show different text based on random number
in thread Show different text based on random number

I didn't say it was invalid, I said it was perl4 style with gotchas. I don't think I've ever seen a Seeker of Perl Wisdom who uses it and is aware of its side-effects. :P It whispers cargo-cult and cgi-lib.pl to me.

  • Comment on Re^3: Show different text based on random number

Replies are listed 'Best First'.
Re^4: Show different text based on random number
by Discipulus (Canon) on Apr 22, 2016 at 11:39 UTC
    I'm not for sure a model for others perl programmers, but i still use it, and i'm aware of what i'm doing (disable prototypes and pass current @_ to the sub, but just in case of ⊂ ), to visually tell at glance locally (same file) defined subroutines from others imported by used modules.

    perlsub states:

    The & is optional in modern Perl, as are parentheses if the subroutine has been predeclared. The & is not optional..

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
      > to visually tell at glance locally (same file) defined subroutines

      That seems to be your convention, but Perl allows you to &-sigilize an imported subroutine:

      #!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use POSIX; say &ceil(1.23);

      ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,