in reply to Re: sub functions, and strings
in thread sub functions, and strings

Perl doesn't exactly pass by value -- you can modify the calling arguments by monkeying with the values of @_.

All that seems needed here is :
sub concat { join '', @_ } my $joined = concat( $first_part, $second_part );


Updated to remove misplaced rant about symbolic references - see below.

Replies are listed 'Best First'.
Re: Re: Re: sub functions, and strings
by jdporter (Paladin) on Nov 11, 2002 at 21:10 UTC
    Why the symbolic reference?
    Huh? He didn't say anything about symbolic references. He said "references", and his illustration was as valid for hard references as symbolic ones.

    jdporter
    ...porque es dificil estar guapo y blanco.

      You're right - it was just such a weird way to modify an argument that it threw me for a loop. It still risks weird symbolic reference behavior if you accidentally assign a scalar instead of a scalar ref to that variable, so I'll stick to my guns( albeit with less tenacity ).