in reply to Re: passing variables to a subroutine
in thread passing variables to a subroutine

thanks for the explanation, my $proph = $_[0]; # be explicit about wanting the first element helps, I now have some other errors to try and fix
  • Comment on Re^2: passing variables to a subroutine

Replies are listed 'Best First'.
Re^3: passing variables to a subroutine
by AnomalousMonk (Archbishop) on Jul 04, 2012 at 16:23 UTC

    Just to pound the point completely into the ground:

    >perl -wMstrict -le "F('success'); ;; sub F { my $scalar_context = @_; my ( $list_context ) = @_; ;; print qq{in scalar context: '$scalar_context'}; print qq{in list context: '$list_context'}; } " in scalar context: '1' in list context: 'success'