I have this error: Undefined subroutine &main::savemail called at skrypt.pl line 36, <FD> line 2.

Can anyone help me? What i do wrong?

My code:

use strict; my $mails = @ARGV[0]; my $username; my $password; my $domena; my $i=0; my $p_wp = "wp.txt"; my $p_interia = "interia.txt"; my $p_onet = "onet.txt"; my $p_gmail = "gmail.txt"; my $p_inne = "inne.txt"; open(FD, $mails) or die "Nie moge otworzyc pierwszego pliku"; while(<FD>) { $_ =~ m/([^:]*):(\S*)/; $username = $1; $password = $2; &checkdomain($username); } sub checkdomain { my $login = shift(@_); if($login =~ m/^([^@]+)@(wp\.pl|WP\.PL)/i) { $domena = "wp.txt"; &savemail($domena,$username,$password); } elsif($login =~ m/^([^@]+)@(onet\.pl|ONET\.PL|onet\.eu|ONET\.EU +|vp\.pl|VP\.PL|OP\.PL|op\.pl|spoko\.pl|poczta\.onet\.pl|vip\.onet\.pl +|autograf\.pl|onet\.com\.pl|opoczta\.pl|buziaczek\.pl|amorki\.pl|buzi +aczki.onet.pl|poczta.onet.eu)/i) { $domena = "onet.txt"; &savemail($domena,$username,$password); } elsif($login =~ m/^([^@]+)@(interia\.pl|poczta\.fm|interia\.eu| +INTERIA\.EU|INTERIA\.PL|POCZTA\.FM)/i) { $domena = "interia.txt"; &savemail($domena,$username,$password); } elsif($login =~ m/^([^@]+)@(o2\.pl|O2\.PL|tlen\.pl|TLEN\.PL|pro +konto\.pl)/i) { $domena = "o2.txt"; &savemail($domena,$username,$password); } elsif($login =~ m/^([^@]+)@(poczta\.pl)/i) { $domena = "poczta.txt"; &savemail($domena,$username,$password); } elsif($login =~ m/^([^@]+)@(1gb\.pl|2gb\.pl|serwus\.pl|vip\.int +eria\.pl|akcja\.pl|czateria\.pl)/i) { $domena = "interia.txt"; &savemail($domena,$username,$password); } elsif($login =~ m/^([^@]+)@(gmail\.com)/i) { $domena = "gmail.txt"; &savemail($domena,$username,$password); }}


In reply to Undefined subroutine &main::savemail called at skrypt.pl line 36, <FD> line 2. by wz34az

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.