Subroutine parameters problem

Hello i was trying to make subroutine to print names of people to have less of writting but this doesnt work and i dont know which parameters i should use i was trying everything which come to my brain. If somebody can look at it and tell me what parameters should be inside function i would be thankful. Here is code
elsif($winners eq "denmark\n") { print "Denmark - people at competition:\n"; foreach $guest(@people) { if(length($guest->{'id'}) == 15 && $guest->{'id'} =~ /^20[ +0-5]|^26|^28/) { &write(#dont know what parameters should give) } } } # My function sub write { print "$guest->{'surname'} "; print "$guest->{'name'}"; print ":$guest->{'id'}\n"; } If i do it like this it works without problem elsif($winners eq "denmark\n") { print "Denmark - people at competition:\n"; foreach $guest(@people) { if(length($guest->{'id'}) == 15 && $guest->{'id'} =~ /^20[ +0-5]|^26|^28/) { print "$guest->{'surname'} "; print "$guest->{'name'}"; print ":$guest->{'id'}\n"; } } }

In reply to Problem with parameters in subroutines by aatrox

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.