please help me

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mail2choudhari
    New Member
    • Feb 2008
    • 1

    please help me

    Hi ,
    i am new to the perl
    it is showing the problem that

    Global symbol "$input_recieve d" requires explicit package name at test.pl line 7
    Execution of test.pl aborted due to compilation errors.



    [CODE=perl]use strict;
    use warnings;
    #use diagnostics;

    my $input_received =<STDIN>;
    exit if $input_recieved =~ /exit/i;
    print "Looks like you want to continue!\n";[/CODE]

    can any one help me ........... Please
    Last edited by eWish; Feb 28 '08, 11:04 PM. Reason: Please use [CODE][/CODE] tags
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    Originally posted by mail2choudhari
    Hi ,
    i am new to the perl
    it is showing the problem that

    Global symbol "$input_recieve d" requires explicit package name at test.pl line 7
    Execution of test.pl aborted due to compilation errors.



    use strict;
    use warnings;
    #use diagnostics;

    my $input_received =<STDIN>;
    exit if $input_recieved =~ /exit/i;
    print "Looks like you want to continue!\n";

    can any one help me ........... Please
    Help YOU?! Help ME! Help me try to understand why you didn't post this to the perl forum in the first place.

    Comment

    • KevinADC
      Recognized Expert Specialist
      • Jan 2007
      • 4092

      #3
      Originally posted by mail2choudhari
      Hi ,
      i am new to the perl
      it is showing the problem that

      Global symbol "$input_recieve d" requires explicit package name at test.pl line 7
      Execution of test.pl aborted due to compilation errors.



      use strict;
      use warnings;
      #use diagnostics;

      my $input_received =<STDIN>;
      exit if $input_recieved =~ /exit/i;
      print "Looks like you want to continue!\n";

      can any one help me ........... Please

      You miss-spelled the variable name, this is exactly the kind of small yet important mistake that "strict" and "warnings" is will help you find in your perl scripts.

      my $input_received=<STDIN>;
      exit if $input_recieved =~ /exit/i;

      Comment

      • RedSon
        Recognized Expert Expert
        • Jan 2007
        • 4980

        #4
        Originally posted by KevinADC
        You miss-spelled the variable name, this is exactly the kind of small yet important mistake that "strict" and "warnings" is will help you find in your perl scripts.

        my $input_received=<STDIN>;
        exit if $input_recieved =~ /exit/i;
        Kevin,

        Just because I am a perl idiot, can you tell me what strict and warnings will do if you "use" them or if you don't "use" them?

        Comment

        • eWish
          Recognized Expert Contributor
          • Jul 2007
          • 973

          #5
          Redson,

          Did you mean because you are not a perl idiot?

          strict - Perl pragma to restrict unsafe constructs
          warnings - Perl pragma to control optional warnings

          --Kevin

          Comment

          • KevinADC
            Recognized Expert Specialist
            • Jan 2007
            • 4092

            #6
            Originally posted by RedSon
            Kevin,

            Just because I am a perl idiot, can you tell me what strict and warnings will do if you "use" them or if you don't "use" them?

            warnings just prints out warning messages that perl thinks is a possible problem the programmer or user might want to look into. Very useful when writing a program or debugging a program, it will alert you to all sorts of potential problems.

            strict forces the programmer to use good perl programming practices. The official definition is that it "restricts unsafe constructs". It basically makes sure you've crossed all your T's and dotted all your I's and everyting is kosher before letting you unleash your programs on the world.

            Comment

            • RedSon
              Recognized Expert Expert
              • Jan 2007
              • 4980

              #7
              Originally posted by eWish
              Redson,

              Did you mean because you are not a perl idiot?

              strict - Perl pragma to restrict unsafe constructs
              warnings - Perl pragma to control optional warnings

              --Kevin
              No, I *am* a perl idiot. I don't know nufin' about perl, except that it looks messy.

              Comment

              Working...