wolis has asked for the wisdom of the Perl Monks concerning the following question:
I want to check the length of a file to determing the value of a variable for later use.
This gets a warning Use of uninitialized value in numeric gt (>) so systematically I try defining each of the 3 elements:my $offline = 1 if (-s 'online.flg' gt 0);
my $flag_size = -s 'online.flg'; my $offline = 1 if ($flag_size > 0);
I even tried re-aranging my if statement:my $flag_size = -s 'online.flg'; my $zero_value = 0; my $offline = 1 if ($flag_size > $zero_value);
All of them get the same warning.. can anyone shed any light on this?my $zero_value = 0; my $flag_size = -s 'online.flg'; my $offline = 0; if($flag_size > $zero_value){ $offline = 1; }
Thanks,
___ /\__\ "What is the world coming to?" \/__/ www.wolispace.com
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Use of uninitialized value in numeric gt (>)
by Aristotle (Chancellor) on Aug 12, 2004 at 02:23 UTC | |
by hv (Prior) on Aug 12, 2004 at 11:49 UTC | |
|
Re: Use of uninitialized value in numeric gt (>)
by Zaxo (Archbishop) on Aug 12, 2004 at 02:19 UTC | |
|
Re: Use of uninitialized value in numeric gt (>)
by YuckFoo (Abbot) on Aug 12, 2004 at 22:54 UTC | |
by wolis (Scribe) on Aug 13, 2004 at 07:19 UTC |