473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Error : Use of uninitialized value in string at perl25.plx

34
Hi All,

I have the following code.

The array @sub_data will contain integers or a string"NO". I have to validate if the array contain integer. If it contain "NO" then no need to validate.

for ($i=1;$i<10;$i++)
{
Tie::CheckVariables->on_error(sub{print "ERROR!"});
tie my $data,'Tie::CheckVariables','integer';
$data = $sub_data[$i];

if ("$data" ne "NO") {

if (($data < $firstVar) || ($data > $secVar))
{
#print " the subscriber $subph dosnot have valid data field $sub_fld .\n";
$erracur = 1;
}

} else {
print "NO";
}
}


I am getting following error.

Use of uninitialized value in string at perl25.plx line 269.
Use of uninitialized value in numeric lt (<) at perl25.plx line 273.
Use of uninitialized value in string at perl25.plx line 269.
Use of uninitialized value in numeric lt (<) at perl25.plx line 273.
ERROR!ERROR!



If any thing wrong please let me Know.


Regards
Naveen
Apr 26 '07 #1
2 6991
KevinADC
4,059 Expert 2GB
those are warnings, not errors. The problem is probably in here:

Expand|Select|Wrap|Line Numbers
  1. $data = $sub_data[$i];
  2.  
  3. if ("$data" ne "NO") {
  4.  
  5. if (($data < $firstVar) || ($data > $secVar))

$data must not be getting defined which means $sub_data[$i] must not be defined. Print $data to the screen as the script runs to check its value. Did you get Tie::CheckVariables working?
Apr 26 '07 #2
pnsreee
34
those are warnings, not errors. The problem is probably in here:

Expand|Select|Wrap|Line Numbers
  1. $data = $sub_data[$i];
  2.  
  3. if ("$data" ne "NO") {
  4.  
  5. if (($data < $firstVar) || ($data > $secVar))

$data must not be getting defined which means $sub_data[$i] must not be defined. Print $data to the screen as the script runs to check its value. Did you get Tie::CheckVariables working?

Hi kevin,

I got working Tie::CheckVariables .

The array @sub_data have to empty fields.So I got that warning message.

Now i solved It.
Thanks for your help.

Regards
Naveen
Apr 27 '07 #3

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

Similar topics

1
by: G Kannan | last post by:
Hey all! I have written a perl script to retrieve information from a HTML Form and insert the data into an Oracle database table. I am gettting the the following error message: "Use of...
1
by: rk | last post by:
Hi, I'm a beginner for perl/cgi programs and i tried to write a cgi script and when i ran it, i got the following error. But when i verified it from the book i typed exactly whatever it is there...
2
by: Liang | last post by:
Hi, I use "defined $r_libs->{$name}" to check first if a key exists in a hash table. But Perl gives a warning WHENEVER the key exists: "Use of uninitialized value". Would u please help to...
2
by: Michael | last post by:
I need some help. I have the following code: cmSQL = New SqlCommand("nf_AddPurchaseOrder", cnSQL) cmsql.CommandType = CommandType.StoredProcedure cmsql.Parameters.Add("@PurchaseOrderId",...
7
by: supachamp | last post by:
Hi everybody, I am having great problems with the following classes. I just can't figure out why I keep getting the error message: Building file: ../edge.cc Invoking: GCC C++ Compiler g++...
6
by: samthemist | last post by:
When perl comes out with errors like this: Use of uninitialized value in concatenation (.) or string at NQII.pl line 18, <STDIN> line 2. Argument "" isn't numeric in numeric ne (!=) at NQII.pl...
2
by: bprabhu17 | last post by:
Hello, Could some please help me fix this error. Use of uninitialized value in concatenation (.) or string at MQ.pm line 450. Thanks in advance
1
by: cxyliu | last post by:
All, I met one issue when using perl in Apache. the following is my conf of httpd for perl usage: <Location /> PerlFixupHandler My_Filter </Location> Sometime, I met this error: ...
1
by: swkr | last post by:
I have the following code. const TCHAR * pTemp = X->Fn(index); X is an object of a class and Fn is a method in it which returns a const TCHAR *. Building this in Windows is fine, but not in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.