Re: Use of uninitialized value for perl

2017-11-05 Thread John W. Krahn
On Sun, 2017-11-05 at 00:43 +, Dong Liu wrote: > I try used perl script to get characters from data: > > #!/usr/bin/perl -w > use v5.14; > while (){ > chomp; > my $line = ''; > $line = (split //,@_)[5]; At no point in your script do you or perl assign a value to the array @_ so th

Re: Use of uninitialized value for perl

2017-11-04 Thread Uri Guttman
On 11/04/2017 08:43 PM, Dong Liu wrote: I try used perl script to get characters from data: #!/usr/bin/perl -w use v5.14; while (){ chomp; my $line = ''; $line = (split //,@_)[5]; You are using @_ which is the array of args to a sub. you aren't in a sub there. also you shouldn't be

Re: Use of uninitialized value $j in numeric eq (==) at myfile line 125

2015-07-06 Thread Илья Рассадин
Hi everybody! I think, problem code is ``` if($buf eq chr hex $xhtmlbegin[$j + 1]) { $doread = 1; $j = $j + 1; } else { if($j == 0) { $doread = 1; } else { #this line is very suspicious $j = $

Re: Use of uninitialized value $j in numeric eq (==) at myfile line 125

2015-07-06 Thread Kent Fredric
On 6 July 2015 at 19:43, Nagy Tamas (TVI-GmbH) wrote: > > Yes, I can produce an XML file. I mean, can you paste-bin or attach an XML file which is minimal in size, yet, still causes this problem to occur, so that we may also attempt to see what is happening using said file. I presently have no

Re: Use of uninitialized value $j in numeric eq (==) at myfile line 125

2015-07-06 Thread Kent Fredric
On 6 July 2015 at 19:15, Nagy Tamas (TVI-GmbH) wrote: > use XML::writer; Is that supposed to be XML::Writer , or is it really XML::writer? Either way, its irrelevant because its not used anywhere. Can you produce an XML file that will repeat the problem, the attached script I can't trigger a f

Re: Use of uninitialized value $j in numeric eq (==) at myfile line 125

2015-07-03 Thread Shlomi Fish
Hi Tamas, On Fri, 3 Jul 2015 15:10:18 + "Nagy Tamas (TVI-GmbH)" wrote: > Hi, > > My code: > > Use strict; > Use warnings; > > my $j = 0; > my $doread = 0; > my ($buf, $data, $n); > $n = read FILE, $data, 1; > $buf = $data; > while($n != 0) { > > $doread = 0; > > # there has to be a begi

Re: Use of uninitialized value $j in numeric eq (==) at myfile line 125

2015-07-03 Thread Brandon McCaig
On Fri, Jul 3, 2015 at 11:10 AM, Nagy Tamas (TVI-GmbH) wrote: > Hi, Hello, > My code: It's evident that this is not actually your code, let alone the full code... > Use strict; > > Use warnings; Those must be 'use', not 'Use'. Obviously you aren't actually using them or at least this isn't ac

Re: Use of uninitialized value in length

2012-05-17 Thread John W. Krahn
Chris Stinemetz wrote: Hello List, Hello, I'm stumped on this one. I'm getting this error: Use of uninitialized value in length at ./DBSR.pl line 21,<> line 6. Use of uninitialized value in length at ./DBSR.pl line 21,<> line 8. Use of uninitialized value in length at ./DBSR.pl line 21,<>

Re: Use of uninitialized value in length

2012-05-17 Thread Shawn H Corey
On 12-05-17 10:47 AM, Chris Stinemetz wrote: Hello List, I'm stumped on this one. I'm getting this error: Use of uninitialized value in length at ./DBSR.pl line 21,<> line 6. Use of uninitialized value in length at ./DBSR.pl line 21,<> line 8. Use of uninitialized value in length at ./DBSR.p

RE: Use of uninitialized value in concatenation (.) or string

2012-03-29 Thread Kronheim, David (Contr)
timothy adigun [2teezp...@gmail.com] wrote: >#!/usr/bin/perl >use warnings; >use strict; > >my @wanted = qw( dad mum children); >my @children = qw(tim dan mercy); >my $ref = { >dad => "mick", >mum => "eliz", >children => { first => 'tim', second => 'dan', third => 'merc

Re: Use of uninitialized value in concatenation (.) or string

2012-03-28 Thread Jim Gibson
On 3/28/12 Wed Mar 28, 2012 10:02 AM, "timothy adigun" <2teezp...@gmail.com> scribbled: > Hi Chris, > > On Wed, Mar 28, 2012 at 12:02 PM, Chris Stinemetz > wrote: > >>> >> foreach my $cell ( @wanted ) { >> print "$cell:"; >> foreach my $hr ( @hours ) { >> >foreach(keys %{$href-

Re: Use of uninitialized value in concatenation (.) or string

2012-03-28 Thread timothy adigun
Hi David, On Wed, Mar 28, 2012 at 4:36 PM, Kronheim, David (Contr) < david.kronh...@ftr.com> wrote: > timothy adigun [2teezp...@gmail.com] wrote: > >#!/usr/bin/perl > >use warnings; > >use strict; > > > >my @wanted = qw( dad mum children); > >my @children = qw(tim dan mercy); > >my $ref =

Re: Use of uninitialized value in concatenation (.) or string

2012-03-28 Thread timothy adigun
Hi Chris, On Wed, Mar 28, 2012 at 12:02 PM, Chris Stinemetz wrote: > > > > It is always better to post a complete, short, working program rather > than a > > snippet. > > > > Maybe this will make it more clear as to what I am trying to > accomplish. I simply want to test to see if @hours exists a

Re: Use of uninitialized value in concatenation (.) or string

2012-03-28 Thread Алексей Мишустин
2012/3/28 Chris Stinemetz : > I simply want to test to see if @hours exists as a second > key in the hash of hashes %data. > foreach my $cell ( @wanted ) { >  print  "$cell:"; >  foreach my $hr ( @hours ) { >    if ( defined keys %{ $href->{$hr}}){ if ( defined $href->{$cell}{$hr}){ >      pri

Re: Use of uninitialized value in concatenation (.) or string

2012-03-28 Thread Chris Stinemetz
> > It is always better to post a complete, short, working program rather than a > snippet. > Maybe this will make it more clear as to what I am trying to accomplish. I simply want to test to see if @hours exists as a second key in the hash of hashes %data. If it does not print \t otherwise print

Re: Use of uninitialized value in concatenation (.) or string

2012-03-27 Thread timothy adigun
Hi Chris, Please, check my comment within your script and a "snap shot" script I wrote below if that could point you in the right direction, since we don't have access to your complete codes. On Wed, Mar 28, 2012 at 5:05 AM, Chris Stinemetz wrote: > Hello list, > > I am getting the results I

Re: Use of uninitialized value in concatenation (.) or string

2012-03-27 Thread Jim Gibson
At 11:05 PM -0500 3/27/12, Chris Stinemetz wrote: Hello list, I am getting the results I want with this iteration through the hash, but I am stump on clearing the following warnings: fyi line 12168 is the last line of the input file. Use of uninitialized value in concatenation (.) or string at

Re: Use of uninitialized value within %dict in concatenation (.) or string at

2012-02-18 Thread John W. Krahn
lina wrote: On Sun, Feb 19, 2012 at 3:34 AM, Shawn H Corey wrote: On 12-02-18 11:40 AM, lina wrote: elsif ( $xpm_file =~ /^"(\S+)[",]$/) { Are there some possibilities that something can be done for the part [",]? Make it recognize both end with " or ", elsif( $xmp_file =~ /^\"

Re: Use of uninitialized value within %dict in concatenation (.) or string at

2012-02-18 Thread lina
On Sun, Feb 19, 2012 at 3:34 AM, Shawn H Corey wrote: > On 12-02-18 11:40 AM, lina wrote: >>      elsif ( $xpm_file =~ /^"(\S+)[",]$/) { >> >> Are there some possibilities that something can be done for the part [",]? >> >> Make it recognize both end with " or ", > > >  elsif( $xmp_file

Re: Use of uninitialized value within %dict in concatenation (.) or string at

2012-02-18 Thread Shawn H Corey
On 12-02-18 11:40 AM, lina wrote: >> elsif ( $xpm_file =~ /^"(\S+)[",]$/) { Are there some possibilities that something can be done for the part [",]? Make it recognize both end with " or ", elsif( $xmp_file =~ /^\"([A-Za-z]+)\"\,?$/ ){ my $keys = $1; my @result = (); for m

Re: Use of uninitialized value within %dict in concatenation (.) or string at

2012-02-18 Thread lina
On 18 Feb, 2012, at 23:11, Shawn H Corey wrote: > On 12-02-18 09:42 AM, lina wrote: >> Hi, >> >> Sorry to open a new thread, >> >> Use of uninitialized value within %dict in concatenation (.) or string >> at ./translate.pl line 21,<$fh> line 128. >> >> Here is the whole code (based on the gui

Re: Use of uninitialized value within %dict in concatenation (.) or string at

2012-02-18 Thread Shawn H Corey
On 12-02-18 09:42 AM, lina wrote: Hi, Sorry to open a new thread, Use of uninitialized value within %dict in concatenation (.) or string at ./translate.pl line 21,<$fh> line 128. Here is the whole code (based on the guide form all of you): #!/usr/bin/perl use warnings; use strict; my $file

Re: Use of uninitialized value warnings

2011-06-06 Thread Uri Guttman
> "CN" == Chris Nehren writes: CN> On Wed, Jun 01, 2011 at 12:00:36 -0400 , Uri Guttman wrote: >> also the use of // for defined or is relatively recent in perl. be >> careful when using it as it may not work in the version you have >> installed or in production. CN> Relatively rec

Re: Use of uninitialized value warnings

2011-06-06 Thread Chris Nehren
On Wed, Jun 01, 2011 at 12:00:36 -0400 , Uri Guttman wrote: > also the use of // for defined or is relatively recent in perl. be > careful when using it as it may not work in the version you have > installed or in production. Relatively recent meaning 3.5 years old, and released in a version of pe

Re: Use of uninitialized value warnings

2011-06-01 Thread Uri Guttman
> "aa" == am0c am0c writes: aa> If you use aa> $log = $log || ''; that should be $log ||= '' ; aa> instead of aa> $log = defined $log ? $log : ''; aa> It might yield a problem because when $log is "0" it is defined but aa> false in boolean context. aa> The correct shorte

Re: Use of uninitialized value warnings

2011-06-01 Thread am0c am0c
If you use $log = $log || ''; instead of $log = defined $log ? $log : ''; It might yield a problem because when $log is "0" it is defined but false in boolean context. The correct shorter version is: $log = $log // ''; And in the line 696: > 696 my ($log, $pass) = $main::global->{login

Re: Use of uninitialized value warnings

2011-05-31 Thread sono-io
On May 31, 2011, at 9:54 AM, Jim Gibson wrote: > $log and $pass are ASSIGNED in line 696, but they are apparently being > assigned an undefined value (undef in Perl-speak). Thanks a million, Jim. You were absolutely correct. I didn't stop to think about the variable result being undefi

Re: Use of uninitialized value warnings

2011-05-31 Thread Jim Gibson
On 5/31/11 Tue May 31, 2011 9:32 AM, "sono...@fannullone.us" scribbled: > Good Morning, > > I could use some help figuring out where a warning is coming from. > > My shopping cart script has the following sub: > > 695 sub get_ud { > 696 my ($log, $pass) = $main::global->{login} ? > ($main::g

Re: Use of uninitialized value in print at...

2010-06-07 Thread Chas. Owens
On Mon, Jun 7, 2010 at 01:22, Bryan Harris wrote: snip > How do other people deal with this?  If I have a printf with seven complex > (?, like the above) variables in it and one of them is undef, aside from > breaking them all onto different print lines and re-running the script, how > else can I

Re: Use of uninitialized value in print at...

2010-06-07 Thread Bryan Harris
> On Sun, Jun 6, 2010 at 08:19, Shawn H Corey wrote: >> On 10-06-05 03:26 PM, Bryan Harris wrote: >>> >>> [console] >>> $ perl -e 'use warnings; $c=undef; printf("%s", $c->[0]{dog})' >>> Use of uninitialized value in printf at -e line 1. >>> [/console] >>> >>> Anything that can help me here?  

Re: Use of uninitialized value in print at...

2010-06-06 Thread Uri Guttman
> "SHC" == Shawn H Corey writes: SHC> On 10-06-05 03:26 PM, Bryan Harris wrote: >> [console] >> $ perl -e 'use warnings; $c=undef; printf("%s", $c->[0]{dog})' >> Use of uninitialized value in printf at -e line 1. >> [/console] >> >> Anything that can help me here? I wish it'd

Re: Use of uninitialized value in print at...

2010-06-06 Thread Chas. Owens
On Sun, Jun 6, 2010 at 10:49, Philip Potter wrote: > On 6 June 2010 14:37, Shawn H Corey wrote: >> On 10-06-06 09:06 AM, Chas. Owens wrote: >>> >>> But that is not the problem; autovivification will create the references: >>> >>> perl -MData::Dumper -le '$c->[0]{a}; print Dumper $c' >>> >> >> But

Re: Use of uninitialized value in print at...

2010-06-06 Thread Shawn H Corey
On 10-06-06 10:49 AM, Philip Potter wrote: On 6 June 2010 14:37, Shawn H Corey wrote: On 10-06-06 09:06 AM, Chas. Owens wrote: But that is not the problem; autovivification will create the references: perl -MData::Dumper -le '$c->[0]{a}; print Dumper $c' But that is the problem. Autovivi

Re: Use of uninitialized value in print at...

2010-06-06 Thread Philip Potter
On 6 June 2010 14:37, Shawn H Corey wrote: > On 10-06-06 09:06 AM, Chas. Owens wrote: >> >> But that is not the problem; autovivification will create the references: >> >> perl -MData::Dumper -le '$c->[0]{a}; print Dumper $c' >> > > But that is the problem.  Autovivification should not happen for

Re: Use of uninitialized value in print at...

2010-06-06 Thread Chas. Owens
On Sun, Jun 6, 2010 at 09:37, Shawn H Corey wrote: > On 10-06-06 09:06 AM, Chas. Owens wrote: >> >> But that is not the problem; autovivification will create the references: >> >> perl -MData::Dumper -le '$c->[0]{a}; print Dumper $c' >> > > But that is the problem.  Autovivification should not hap

Re: Use of uninitialized value in print at...

2010-06-06 Thread Shawn H Corey
On 10-06-06 09:06 AM, Chas. Owens wrote: But that is not the problem; autovivification will create the references: perl -MData::Dumper -le '$c->[0]{a}; print Dumper $c' But that is the problem. Autovivification should not happen for r-values, only l-values. -- Just my 0.0002 million

Re: Use of uninitialized value in print at...

2010-06-06 Thread Chas. Owens
On Sun, Jun 6, 2010 at 08:19, Shawn H Corey wrote: > On 10-06-05 03:26 PM, Bryan Harris wrote: >> >> [console] >> $ perl -e 'use warnings; $c=undef; printf("%s", $c->[0]{dog})' >> Use of uninitialized value in printf at -e line 1. >> [/console] >> >> Anything that can help me here?  I wish it'd sa

Re: Use of uninitialized value in print at...

2010-06-06 Thread Shawn H Corey
On 10-06-05 03:26 PM, Bryan Harris wrote: [console] $ perl -e 'use warnings; $c=undef; printf("%s", $c->[0]{dog})' Use of uninitialized value in printf at -e line 1. [/console] Anything that can help me here? I wish it'd say: Use of uninitialized value $c->[0]{dog} in printf at -e line 1.

Re: Use of uninitialized value in print at...

2010-06-06 Thread Bryan Harris
> On Thursday 03 Jun 2010 19:53:48 Bryan R Harris wrote: >> Seems like the first time I run a new script I *always* get an error >> message something like this: >> >> "Use of uninitialized value in printf at /Users/harrisb/Library/perl/matc >> line 414." >> >> The problem is usually I'm print

Re: Use of uninitialized value in print at...

2010-06-03 Thread Shlomi Fish
On Thursday 03 Jun 2010 19:53:48 Bryan R Harris wrote: > Seems like the first time I run a new script I *always* get an error > message something like this: > > "Use of uninitialized value in printf at /Users/harrisb/Library/perl/matc > line 414." > > The problem is usually I'm printing several

RE: Use of uninitialized value in concatenation (.) or string

2008-07-25 Thread Thomas Bätzler
luke devon <[EMAIL PROTECTED]> asked: > Following error i am getting while its functioning. Could you > please help me to find out what the error is ? > > Use of uninitialized value in concatenation (.) or string at > /xxx.pl line 18, line 1. > Use of uninitialized value in concatenation (.) o

Re: use of uninitialized value in subroutine entry at ~~ line 12

2008-06-26 Thread John W. Krahn
koonom wrote: #!/usr/bin/perl -w use LWP::Simple; use HTML::LinkExtor; $URL = get("http//www.nytimes.com"); #open (FILE, ">file.txt"); $LinkExtor = HTML::LinkExtor->new(\&link); Jeff already pointed out your error here^^. $LinkExtor->parse($URL); sub links { ($tag, %links) = @_;

Re: use of uninitialized value in subroutine entry at ~~ line 12

2008-06-26 Thread Jeff Peng
new(\&link); which should be: new(\&links); Please add "use strict" at the top of the script. On Thu, Jun 26, 2008 at 2:06 PM, koonom <[EMAIL PROTECTED]> wrote: > and then comes the error:use of uninitialized value in subroutine > entry at ~~ line 12 > what does it mean actually? -- Jeff Pe

Re: Use of uninitialized value in numeric ne error

2007-12-22 Thread yitzle
On 12/22/07, patmarbidon <[EMAIL PROTECTED]> wrote: > or under win32 > while ( $line eq "99\r\n" ){ I /think/, under Perl, "\n" is the system newline, regardless of the OS. Under Windows, it would still be "99\n" -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAI

Re: Use of uninitialized value in numeric ne error

2007-12-21 Thread patmarbidon
What is the origin of $line ? if you wrote $line = you should remove the "\n" and or "\r\n" at the end of $line. And if the user enter not numeric value you should always shuch an error. You should check if the value is numeric or use 'eq' instead of '!=' . If you removed the "\n" ou "\r\n"

Re: Use of uninitialized value in numeric ne error

2007-12-21 Thread Dan Klose
On 21 Dec 2007, at 10:43, lerameur wrote: Hello and cheers to all, hello I wrote a small program and it does work, but I get this error message every tim I run the script: Use of uninitialized value in numeric ne (!=) at ./reverse_string.pl line 11. basically it is a menu and when the user

Re: Use of uninitialized value in numeric ne error

2007-12-21 Thread yitzle
I'd guess $line is never set before the first time it is compared to 99. Either (1) change line 11 to: $line = 0; while ( $line != 99){ or (2) use a do-while loop. do { ... } while ( $line != 99); -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Use of uninitialized value in numeric eq (==)

2007-12-13 Thread Paul Lalli
On Dec 12, 9:45 pm, [EMAIL PROTECTED] (Dr.Ruud) wrote: > protoplasm schreef: > > > foreach (keys %opts_hash) > > { > > if ( !defined $opts_hash{$_} ) > > { > > next; > > } > > elsif ( $opts_hash{$_} == 1 ) > > { > > print "$_ = $opts_hash{$_}\n"; > > } > > } > > An alternative w

Re: Use of uninitialized value in numeric eq (==)

2007-12-12 Thread Dr.Ruud
protoplasm schreef: > foreach (keys %opts_hash) > { > if ( !defined $opts_hash{$_} ) > { > next; > } > elsif ( $opts_hash{$_} == 1 ) > { > print "$_ = $opts_hash{$_}\n"; > } > } An alternative way to write that: for (sort keys %opts_hash) { next unless defined $opts_hash

Re: Use of uninitialized value in numeric eq (==)

2007-12-12 Thread protoplasm
Thanks for the advice. After I posted I tried this and it worked too: foreach (keys %opts_hash) { # This next line of code eliminates the "Use of uninitialized value in # numeric eq (==)" error when 'use warnings;' is enabled. if ( !defined $opts_hash{$_} ) {

Re: Use of uninitialized value in numeric eq (==)

2007-12-12 Thread John W . Krahn
On Tuesday 11 December 2007 16:53, protoplasm wrote: > > I'm messing around with Getopt and have a set of arguments that can > be passed to the program. I am new to perl and am unaware of how to > resolve the error while keeping 'use warnings;' enabled. Any help > would be greatly appreciated. > >

Re: Use of uninitialized value in numeric eq (==)

2007-12-12 Thread Chas. Owens
On Dec 11, 2007 7:53 PM, protoplasm <[EMAIL PROTECTED]> wrote: snip > my $opts_hash; > my %opts_hash = (); snip You don't need $opts_hash (you aren't using it). You can get rid of the undef warnings by making sure that the keys in %opts_hash are used like this: #default values for the options my

Re: Use of uninitialized value in pattern match (m//)

2007-12-05 Thread Ankur Jain
You're right, I am passing a numeric value to the function and encountering the error. I used the function provided by you and it's working fine. Thanks Ankur Jain On Dec 4, 2007 8:27 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: > Ankur wrote: > > > > I am running the following code and receiving th

Re: Use of uninitialized value in pattern match (m//)

2007-12-04 Thread [EMAIL PROTECTED]
On Dec 4, 2:47 pm, [EMAIL PROTECTED] (Rob Dixon) wrote: > [EMAIL PROTECTED] wrote: > >my ($n,$d) = split /\./, shift, 2; > > which specifies the field count in two ways: the third parameter says > that the string should be split into (a maximum of) two parts. and even > if that wasn't there the

Re: Use of uninitialized value in pattern match (m//)

2007-12-04 Thread [EMAIL PROTECTED]
On Dec 4, 2:47 pm, [EMAIL PROTECTED] (Rob Dixon) wrote: > [EMAIL PROTECTED] wrote: > > As it happens, even if there was a '.' as the last character in your > > input string then you'd still get the same message. This is counter- > > intuitive but is documented in the documentation of the split() >

Re: Use of uninitialized value in pattern match (m//)

2007-12-04 Thread Rob Dixon
Ankur wrote: I am running the following code and receiving the warning : Use of uninitialized value in pattern match (m//) at a.pl line 15. a.pl : / **/ sub CommaFormatted{ my $delimiter = ','; # repla

Re: Use of uninitialized value in pattern match (m//)

2007-12-04 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > On Dec 4, 7:25 am, [EMAIL PROTECTED] (Ankur) wrote: I am running the following code and receiving the warning : Use of uninitialized value in pattern match (m//) at a.pl line 15. That is to be expected. a.pl : / ***

Re: Use of uninitialized value in pattern match (m//)

2007-12-04 Thread [EMAIL PROTECTED]
On Dec 4, 7:25 am, [EMAIL PROTECTED] (Ankur) wrote: > Hi > > I am running the following code and receiving the warning : > > Use of uninitialized value in pattern match (m//) at a.pl line 15. That is to be expected. > a.pl : > / > **

Re: Use of uninitialized value in substr

2007-07-06 Thread Tom Phoenix
On 7/6/07, elavazhagan perl <[EMAIL PROTECTED]> wrote: While executing the mutate.pl pgrogram,the diagnostic msg obtained as "Use of uninitialized value in substr at mutate.pl line 31, line 1." I almost defined all the variables. Would you kindly provide some remedy to this…… Define all the

Re: Use of uninitialized value in string eq

2007-01-26 Thread Rob Dixon
Jen Spinney wrote: > > I apologize in advance for not posting a complete sample script that > shows my problem, but I can't isolate it outside of my (rather large) > perl application. > > My problem is that I'm hit with a barrage of warnings that tell me I'm > using uninitialized values. The firs

Re: Use of uninitialized value in string eq

2007-01-26 Thread Jen Spinney
On 1/26/07, Adriano Ferreira <[EMAIL PROTECTED]> wrote: On 1/26/07, Jen Spinney <[EMAIL PROTECTED]> wrote: > Hello list! > > I apologize in advance for not posting a complete sample script that > shows my problem, but I can't isolate it outside of my (rather large) > perl application. > > My prob

Re: Use of uninitialized value in string eq

2007-01-26 Thread Adriano Ferreira
On 1/26/07, Jen Spinney <[EMAIL PROTECTED]> wrote: Hello list! I apologize in advance for not posting a complete sample script that shows my problem, but I can't isolate it outside of my (rather large) perl application. My problem is that I'm hit with a barrage of warnings that tell me I'm usin

Re: use of uninitialized value....

2006-01-27 Thread DBSMITH
beginners perl Subject Re: use

Re: use of uninitialized value....

2006-01-27 Thread DBSMITH
ubject Re: use of uninitialized

Re: use of uninitialized value....

2006-01-27 Thread Chas Owens
On 1/27/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: snip > Thanks Jay for the hopefully final wrap up to the uninteded long email > thread. This was a good thing however b/c > I learned something new in this wonderful thing called Perl. > I agree and it make sense to use $SIG{__DIE__} for o

Re: use of uninitialized value....

2006-01-27 Thread Jay Savage
On 1/26/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: > > The problem with defining your own versions of die, warn, croak, and > > carp is that only your code uses them. If another module croaks or > > Thats why you put it in a module and use it in all your scripts and if > it has not already bee

Re: use of uninitialized value....

2006-01-26 Thread JupiterHost.Net
Chas Owens wrote: On 1/26/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: The problem with defining your own versions of die, warn, croak, and carp is that only your code uses them. If another module croaks or Thats why you put it in a module and use it in all your scripts and if it has not

Re: use of uninitialized value....

2006-01-26 Thread Chas Owens
On 1/26/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: > > The problem with defining your own versions of die, warn, croak, and > > carp is that only your code uses them. If another module croaks or > > Thats why you put it in a module and use it in all your scripts and if > it has not already bee

Re: use of uninitialized value....

2006-01-26 Thread JupiterHost.Net
The problem with defining your own versions of die, warn, croak, and carp is that only your code uses them. If another module croaks or Thats why you put it in a module and use it in all your scripts and if it has not already been done and you can find a proper place for it to go, out it on C

Re: use of uninitialized value....

2006-01-26 Thread Chas Owens
On 1/26/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: snip > Without trying to sort out the hair ball of code might I recommend > simplifying you condition? > > > my $ftp = Net::FTP->new(...) or _my_die('Connection failed: ' . > Net:FTP->message()); > > $ftp->login($user, $pass) or _my_die('Login

Re: use of uninitialized value....

2006-01-26 Thread Chas Owens
On 1/26/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: snip > ok I read the perldoc and this seems to be the ideal way, but when any > condition fails, meaning > a connection fails, a login fails or a cwd fails I want to update the log > with the appropriate message for each failed > condition.

Re: use of uninitialized value....

2006-01-26 Thread JupiterHost.Net
My problem seems to be within the Net::FTP module. I have intentionally modified my password so that my error routines can be tested, but once the login piece fails it continues on, when I would expect that it should die at the code in red. Cool, its all blue in my mail client so the

Re: use of uninitialized value....

2006-01-26 Thread JupiterHost.Net
cc beginners@perl.org Subject 01/25/2006 12:26 Re: use of uninitialized value PM Derek, I'd like to ask again that you ***PLEASE*** remov

Re: use of uninitialized value....

2006-01-26 Thread JupiterHost.Net
No, that defines the override of the default behavior of the die() command (see perldoc -f die). The "|| do { blah };" turns into "or die 'message';" You put all of the "blah" code in the override. **

Re: use of uninitialized value....

2006-01-26 Thread DBSMITH
> > the || do lines in the ftp section > with a routine call to? : > > my $olddie = $SIG{__DIE__}; > $SIG{__DIE__} = sub { > my $error = shift; > $olddie->{$error} if ref $olddie; > mailme($error); > #other error stuff here > }; > snip No, that defines

Re: use of uninitialized value....

2006-01-26 Thread Chas Owens
On 1/26/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: snip > I appreciate the suggestion, but if there is a problem I want the progam to > email then die. So I would replace > > the || do lines in the ftp section > with a routine call to? : > > my $olddie = $SIG{__DIE__}; > $SIG{__DIE_

Re: use of uninitialized value....

2006-01-26 Thread DBSMITH
snip > my $ftp = Net::FTP->new($remotehost, Debug => 10) > || do {print FTPLOG "\nCannot connect to $remotehost: $!", > mailme(); return}; snip This is a bit off topic, but I can't look at code like this without suggesting the following alternative: near the top o

Re: use of uninitialized value....

2006-01-26 Thread Chas Owens
snip > my $ftp = Net::FTP->new($remotehost, Debug => 10) > || do {print FTPLOG "\nCannot connect to $remotehost: $!", > mailme(); return}; snip This is a bit off topic, but I can't look at code like this without suggesting the following alternative: near the top of

Re: use of uninitialized value....

2006-01-26 Thread DBSMITH
beginners@perl.org Subject 01/25/2006 12:26 Re: use of uninitialized value

Re: use of uninitialized value....

2006-01-25 Thread Tom Phoenix
On 1/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > My problem seems to be within the Net::FTP module. I have intentionally > modified my password so that my error routines can be tested, but once the > login > piece fails it continues on, when I would expect that it should die at the > c

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

2005-09-13 Thread Jeff 'japhy' Pinyan
On Sep 13, [EMAIL PROTECTED] said: do you want me to seed the entire program. it is over 700 lines? it on lines 246 for eaxmple. And anywhere I assign a variable to a q->param construct such as $which_import and $which_radio_button. What I meant was, given the code you've SHOWN us, tell u

RE: Use of uninitialized value

2005-09-13 Thread DBSMITH
Subject RE: Use of uni

RE: Use of uninitialized value

2005-09-13 Thread Charles K. Clarkson
[EMAIL PROTECTED] wrote: : do you want me to seed the entire program. it is over 700 : lines? it on lines 246 for eaxmple. And anywhere I assign a : variable to a q->param construct such as $which_import and : $which_radio_button. You could send us a working ex

RE: Use of uninitialized value

2005-09-13 Thread DBSMITH
<[EMAIL PROTECTED]>, beginners@perl.org Subject

RE: Use of uninitialized value

2005-09-12 Thread Jeff 'japhy' Pinyan
On Sep 12, [EMAIL PROTECTED] said: I have tried this and I am still getting a similiar error. Here is my perl-cgi code: WHICH line is the uninitialized value warning coming from? my $which_import = $q->param('action') || ''; foreach my $scalar (@imports) { if ($which_import eq 'Import

RE: Use of uninitialized value

2005-09-12 Thread DBSMITH
Subject RE: Use of uni

Re: Use of uninitialized value in concatenation (.) or string at txt.pl line 33, line 11

2005-09-12 Thread Jeff 'japhy' Pinyan
On Sep 12, ganesh said: This is the warning messge I am getting when I executed my script. Please find my analysis of the above warning Input: Line 1: 20(1): 125-126 Line 2: 20:125-126 Output: Line 1: 20(1): 125-126 Line 2: 20:125-126 My Code: $line=~s!(\d+)(\(\d+\))?:(\d+)-!$1$2:$3-!

Re: Use of uninitialized value

2005-09-09 Thread Beast
Charles K. Clarkson wrote: Beast wrote: : my $value = get_value_from_external_program; : : How do avoid such warning, because value is coming from : external program thus I can't make sure that it will : return a string or null. What do you want to do with $valu

RE: Use of uninitialized value

2005-09-09 Thread Charles K. Clarkson
Beast wrote: : my $value = get_value_from_external_program; : : How do avoid such warning, because value is coming from : external program thus I can't make sure that it will : return a string or null. What do you want to do with $value when the external program do

RE: Use of uninitialized value

2005-09-09 Thread Rose, Jeff
Possibly use my $value = get_value_from_external_program || "defaultvalue"; -Original Message- From: Beast [mailto:[EMAIL PROTECTED] Sent: Friday, September 09, 2005 11:28 PM To: beginners@perl.org Subject: Use of uninitialized value When using use warnings; I receive this error msg?

Re: Use of uninitialized value in string at ... ??

2005-08-18 Thread Manav Mathur
> Hello, > > I got the following function online but and receiving the error and > do not know why ? > Use of uninitialized value in string at ./sat-main.pl line 211, > line 1 > > Here is the code: > > my $input; > > $input = &user_func("Enter command "); > > sub user_func { > my $user_i

Re: Use of uninitialized value... --> quit!

2005-07-06 Thread Bryan R Harris
> Bryan R Harris wrote: > [snip] >> >> >> So if I understand right, all I need to do is put this at the top of my >> script? >> >> use warnings FATAL => 'all'; >> >> Is that doing what I want? >> >> - B >> > > You tell us, based on my understanding of it and what you want it > should, but p

Re: Use of uninitialized value... --> quit!

2005-07-01 Thread Wiggins d'Anconia
Bryan R Harris wrote: [snip] > > > So if I understand right, all I need to do is put this at the top of my > script? > > use warnings FATAL => 'all'; > > Is that doing what I want? > > - B > You tell us, based on my understanding of it and what you want it should, but personally I have never

Re: Use of uninitialized value... --> quit!

2005-06-30 Thread Bryan R Harris
> Bryan R Harris wrote: >> >>> Bryan R Harris wrote: >>> Often when debugging my scripts I get: Use of uninitialized value in print at line 52. Use of uninitialized value in print at line 52. Use of uninitialized value in print at line 52. ... -- filling

Re: Use of uninitialized value... --> quit!

2005-06-30 Thread Wiggins d'Anconia
Bryan R Harris wrote: > >>Bryan R Harris wrote: >> >>>Often when debugging my scripts I get: >>> >>>Use of uninitialized value in print at line 52. >>>Use of uninitialized value in print at line 52. >>>Use of uninitialized value in print at line 52. >>>... >>> >>>-- filling up my terminal window.

Re: Use of uninitialized value... --> quit!

2005-06-30 Thread Bryan R Harris
> Bryan R Harris wrote: >> >> Often when debugging my scripts I get: >> >> Use of uninitialized value in print at line 52. >> Use of uninitialized value in print at line 52. >> Use of uninitialized value in print at line 52. >> ... >> >> -- filling up my terminal window. Is there any way to t

  1   2   >