By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,851 Members | 1,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,851 IT Pros & Developers. It's quick & easy.

please help me

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

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



Expand|Select|Wrap|Line Numbers
  1. use strict;
  2. use warnings;
  3. #use diagnostics;
  4.  
  5. my $input_received=<STDIN>;
  6. exit if $input_recieved =~ /exit/i;
  7. print "Looks like you want to continue!\n";
can any one help me ........... Please
Feb 28 '08 #1
Share this Question
Share on Google+
6 Replies


RedSon
Expert 5K+
P: 5,000
Hi ,
i am new to the perl
it is showing the problem that

Global symbol "$input_recieved" 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.
Feb 28 '08 #2

KevinADC
Expert 2.5K+
P: 4,059
Hi ,
i am new to the perl
it is showing the problem that

Global symbol "$input_recieved" 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;
Feb 28 '08 #3

RedSon
Expert 5K+
P: 5,000
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?
Feb 28 '08 #4

eWish
Expert 100+
P: 971
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
Feb 29 '08 #5

KevinADC
Expert 2.5K+
P: 4,059
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.
Feb 29 '08 #6

RedSon
Expert 5K+
P: 5,000
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.
Feb 29 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.