Someone plz help with my first pl script

Discussion in 'Perl' started by sakthi.abdullah, Mar 24, 2007.

  1. sakthi.abdullah

    sakthi.abdullah New Member

    Joined:
    Mar 15, 2007
    Messages:
    29
    Likes Received:
    1
    Trophy Points:
    0
    This is the program:

    #!/usr/bin/perl -w
    use warnings;
    print "Your name please";
    $name = <STDIN>;
    chomp( $name );
    print "Hello $name Welcome to the world of perl\n"


    I m getting this error ...
    username.pl[2]: use: not found.
    Your name please
    username.pl[4]: Syntax error at line 5 : `;' is not expected.


    Is there any problem with this script..
    or any other probs..
    I suspect some problem with perl executable ... but i dont know how to fix it.

    Guys plz help.

    Thanks .

    Sakthi.Abdullah
     
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    What OS are you using??
     
  3. sakthi.abdullah

    sakthi.abdullah New Member

    Joined:
    Mar 15, 2007
    Messages:
    29
    Likes Received:
    1
    Trophy Points:
    0
  4. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    try installing the latest distibution of Perl.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice