Re: Use of uninitialized value Error

2005-12-30 Thread Tom Phoenix
On 12/30/05, David Gilden <[EMAIL PROTECTED]> wrote: > $_ =~ /(\d+)/; > $num = int($1); If there's no digit in $_, then $1 will be undef (or worse; see below). I think that's probably your bug: Some filename isn't like the others. Instead of this: > my @files =<*>; Consider something like this:

Re: Use of uninitialized value Error

2005-12-30 Thread John W. Krahn
David Gilden wrote: > Hello, Hello, > In the Script below the line: last if ($num >= 35) > is giving me this error: Use of uninitialized value in int > > How do I avoid this error? You are using the results of a regular expression match without verifying that the regular expression matched s

Re: Use of uninitialized value Error

2005-12-30 Thread Adriano Ferreira
On 12/30/05, David Gilden <[EMAIL PROTECTED]> wrote: > In the Script below the line: last if ($num >= 35) > is giving me this error: Use of uninitialized value in int That's not an error, but a warning. You will find that execution goes after this. > How do I avoid this error? @files probably co

Re: Use of uninitialized value Error

2005-12-30 Thread JupiterHost.Net
David Gilden wrote: Hello, Hello, In the Script below the line: last if ($num >= 35) is giving me this error: Use of uninitialized value in int How do I avoid this error? a) Initialize it :) my $num = 0; b) don't use warnings - but don't do that c) turn off uninitialized wanring

RE: "Use of uninitialized value" error message

2002-03-14 Thread Jason Larson
> -Original Message- > From: John W. Krahn [mailto:[EMAIL PROTECTED]] > Subject: Re: "Use of uninitialized value" error message > > Jason Larson wrote: > > > > I'm still new to Perl myself, so I can't tell you exactly > what's h

Re: "Use of uninitialized value" error message

2002-03-13 Thread John W. Krahn
Jason Larson wrote: > > I'm still new to Perl myself, so I can't tell you exactly what's happening, > but it looks like $result_value1 is undef when it gets to the if statement. > I think a better way to accomplish what you're trying to do is simply: > > my $result_value1; > if ($result_valu

RE: "Use of uninitialized value" error message

2002-03-13 Thread Ho, Tony
using -w or use warnings; in your script that is causing the warning. perhaps attaching the code would help but we can't tell where the varible goes out of scope. -Original Message- From: Jason Larson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 11:06 AM To

RE: "Use of uninitialized value" error message

2002-03-13 Thread Jason Larson
Original Message- From: Ho, Tony [mailto:[EMAIL PROTECTED]] Subject: RE: "Use of uninitialized value" error message Hi Nikola/Jason Thanks for the help. The variable $result_value1 is declared within the subroutine and is never used outside the subroutine. I original

RE: "Use of uninitialized value" error message

2002-03-13 Thread Nikola Janceski
x27;t tell where the varible goes out of scope. -Original Message- From: Jason Larson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 11:06 AM To: 'Ho, Tony'; '[EMAIL PROTECTED]' Subject: RE: "Use of uninitialized value" error message >

RE: "Use of uninitialized value" error message

2002-03-13 Thread Jason Larson
> -Original Message- > From: Ho, Tony [mailto:[EMAIL PROTECTED]] > Subject: "Use of uninitialized value" error message > > Hi guys > I was wondering if you could help me with the following problem. > > I am getting the following error message: > > Use of uninitialized value in string