in reply to (ar0n) Re: I've never seen this syntax before
in thread I've never seen this syntax before

Thanks, that was what I thought, but there is no return in the Execute() sub, so it looks like it's useless code.

Your Humble Servant,
-Chuck
  • Comment on Re: (ar0n) Re: I've never seen this syntax before

Replies are listed 'Best First'.
Re: Re: (ar0n) Re: I've never seen this syntax before
by suaveant (Parson) on Apr 04, 2001 at 23:26 UTC
    No necessarily useless... the last line of a subroutine becomes its return value if none is specified explicitly... so: <CODE> sub foo { 1; } #and sub foo2 { return 1; } both return 1
                    - Ant
(jeffa) 2Re: (ar0n) Re: I've never seen this syntax before
by jeffa (Bishop) on Apr 04, 2001 at 23:28 UTC
    In Perl, the value of last evaluated statement is returned in a subroutine - the return token is optional, but you shouldn't abuse this (too much).

    Jeff

    R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
    L-L--L-L--L-L--L-L--L-L--L-L--L-L--
    
      In Perl, the value of last evaluated statement is returned in a subroutine
      expression, not statement. You can't evaluate a statement.

      -- Randal L. Schwartz, Perl hacker