in reply to Problem with parameters in subroutines

As written, you subroutine can be called without parameters. Note that write is not a good subroutine name, though, as write already has a meaning in Perl.

On the other hand, you can write the subroutine in a way it expects a parameter:

sub mywrite { my $candidate = shift; print "$candidate->{firstname} $candidate->{surname}:$candidate->{ +id}\n"; }

This still look wrong, though. What's the relation between $guest and $kandydatkonkursu?

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Problem with parameters in subroutines
by aatrox (Initiate) on Jun 02, 2014 at 12:24 UTC
    its the same it was my big fault i forgot to translate subroutine sorry :F
Re^2: Problem with parameters in subroutines
by aatrox (Initiate) on Jun 02, 2014 at 12:30 UTC
    Yeah this works !! Thank you so much!