new to perl

Discussion in 'Perl Misc' started by mani, Sep 24, 2003.

  1. mani

    mani Guest

    Hi,

    I read this sample code somewhere on the web and it is as follows:

    $db="/www/emailadd.txt";
    open (DB,"$db") || die "Can't Open mailadd: $!\n";
    while (<DB>) {
    chop;
    &SendMail;
    }
    close DB;



    I understand this code because i have been reading Learning Perl
    written by Randal Schwartz & Tom C. I am assuming this Sendmail is a
    subroutine
    but arent su routines called as is like SendMail instead of the & in
    the front... Or am i missing something here.... I have been reading
    Perl 5.0

    Please help me out

    regards
    Mani
     
    mani, Sep 24, 2003
    #1
    1. Advertising

  2. mani wrote:
    > Hi,
    >
    > I read this sample code somewhere on the web and it is as follows:
    >
    > $db="/www/emailadd.txt";
    > open (DB,"$db") || die "Can't Open mailadd: $!\n";
    > while (<DB>) {
    > chop;
    > &SendMail;
    > }
    > close DB;
    >
    >
    >
    > I understand this code because i have been reading Learning Perl
    > written by Randal Schwartz & Tom C. I am assuming this Sendmail is a
    > subroutine
    > but arent su routines called as is like SendMail instead of the & in
    > the front... Or am i missing something here.... I have been reading
    > Perl 5.0
    >
    > Please help me out
    >
    > regards
    > Mani


    For some of us the use of & before a subroutine says version 4 (of perl)
     
    Peter Hickman, Sep 24, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dpackwood
    Replies:
    3
    Views:
    1,830
  2. PerlFAQ Server

    FAQ 1.4 What are Perl 4, Perl 5, or Perl 6?

    PerlFAQ Server, Jan 23, 2011, in forum: Perl Misc
    Replies:
    0
    Views:
    313
    PerlFAQ Server
    Jan 23, 2011
  3. PerlFAQ Server
    Replies:
    0
    Views:
    705
    PerlFAQ Server
    Feb 3, 2011
  4. PerlFAQ Server

    FAQ 1.4 What are Perl 4, Perl 5, or Perl 6?

    PerlFAQ Server, Feb 27, 2011, in forum: Perl Misc
    Replies:
    0
    Views:
    308
    PerlFAQ Server
    Feb 27, 2011
  5. Replies:
    2
    Views:
    485
    Thomas 'PointedEars' Lahn
    Mar 11, 2008
Loading...

Share This Page