than zero
(the first element) will be undef. So that statement is the same as:
$line = undef;
> print "it is $line.\n";
> }
>
> __DATA__
> Danio rerio strain Tuebingen chromosome 1 GRCz11 Primary Assembly
> Danio rerio strain Tuebingen chromosome 2 G
o you shouldn't be splitting on an array anyway. you
should be using $_ there which is assigned in the while() line.
Use of uninitialized value $line in concatenation (.) or string at
foundins.pl line 9, line 1.
it is .
Use of uninitialized value $line in concatenation (.) or string at
rio strain Tuebingen chromosome 2 GRCz11 Primary Assembly
the results is :
Use of uninitialized value $line in concatenation (.) or string at foundins.pl
line 9, line 1.
it is .
Use of uninitialized value $line in concatenation (.) or string at foundins.pl
line 9, line 2.
it is .
the aim for th
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 = $
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
I see that in the pattern matching of $j2 goes
only to 2.
So it recognizes only the "mailto:kentfred...@gmail.com]
Gesendet: Montag, 6. Juli 2015 09:35
An: Nagy Tamas (TVI-GmbH)
Cc: beginners@perl.org
Betreff: Re: Use of uninitialized value $j in numeric eq (==) at myfile line 125
On 6 July
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
:" . $j2 . "==" . length 0+@xhtmlend . "\n";
print OUTFILE "ENDFOUND";
$begintagfound = 0;
}
if($doread == 1) {
$n = read FILE, $data, 1;
$buf = $data;
if($begintagfound == 1) {
= 0) {
>
> $doread = 0;
>
> # there has to be a begin tag before the end tag
> # so we can check for begin tag first
>
> if($begintagfound == 0) {
> if($buf eq chr hex $xhtmlbegin[$j + 1]) {
> $doread = 1;
> $j = $j + 1;
> } else {
>
+ 1]) {
>
> $doread = 1;
>
> $j = $j + 1;
>
> } else {
>
> if($j == 0) {... line 125
There are not 125 lines in your entire message.
>
> …
>
>
>
> Says use of uninitialized value $j in numeric eq == at line 125
>
> Does
hex $xhtmlbegin[$j + 1]) {
$doread = 1;
$j = $j + 1;
} else {
if($j == 0) {... line 125
...
Says use of uninitialized value $j in numeric eq == at line 125
Does anyone has any idea why does it tell $j as uninitialized?
I initialized it at the first line to 0.
Tamas
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 lengt
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 uninitiali
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.pl line 21, <> l
Hello adit,
On Wed, 11 Apr 2012 20:03:28 -0700 (PDT)
adit edogawa wrote:
> hi,
> please help me ...
> I have a perl script as follows:
>
> #! / Usr / bin / perl-w
> # Use module
> use strict;
> use DBI;
>
Seems like your E-mail user-agent has seriously mangled your Perl code thinking
it is fr
',
'$ Address',
'$ Province',
'$ Kode_pos',
"$ MSISDN ',
'$ Email',
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
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-
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 =
'01' => '1',
>'02' => '1',
>'03' => '1',
> },
>
> );
>
> my $href = \%data;
> my @wanted = qw(077 078 149);
> my @hours = qw(00 01 02 03 0
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
1',
'01' => '1',
'02' => '1',
'03' => '1',
},
);
my $href = \%data;
my @wanted = qw(077 078 149);
my @hours = qw(00 01 02 03 04 05 06);
foreach
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
> ./TESTdeltaT1.pl line 54, <$SUM
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
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
./TESTdeltaT1.pl line 54, <$SUM> line 1216
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 =~ /^\"
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
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
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
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 stric
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 = "dm_proAB.xpm&quo
er loop above.
Ken
> print $MAP "$up_ac\t$kegg_map{$up_ac}\n";
#---------- line 441.
> }
> close $MAP;
> }
>
> I get the following error message:
> Use of uninitialized value in concatenation (.) or string at pipeline.pl
27;>', $kegg_tax_map_path or croak "Failed to
open for writing $kegg_tax_map_path: $!";
print $MAP "$up_ac\t$kegg_map{$up_ac}\n";
#-- line 441.
}
close $MAP;
}
I get the following error message:
Use of uninitial
Thank you,
the following worked:
{
no warnings qw(uninitialized);
...
}
- Original Message -
From: Jim Gibson
To: perl list
Cc:
Sent: Monday, January 9, 2012 1:14 PM
Subject: Re: supressing error message Use of uninitialized value in
concatenation
On 1/9/12 Mon Jan 9, 2012
On 1/9/12 Mon Jan 9, 2012 10:53 AM, "Rajeev Prasad"
scribbled:
> Hello,
>
> I have a lot of fields being concatenated to form a string and sometimes the
> values are empty, so i am getting this error:
>
> Use of uninitialized value in concatenation (.) or stri
Hello,
I have a lot of fields being concatenated to form a string and sometimes the
values are empty, so i am getting this error:
Use of uninitialized value in concatenation (.) or string at ./script.pl line
144, <$IN_FH> line 1.
how can i suppress this?
my logic flow:
$string1 = &q
> "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
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
> "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
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
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
t;{form}->{'ud'} = Encrypt($main::global->{form}->{'ud'},
> $main::global->{config}->{'cookie'});
> 699 }
>
> These warnings are showing up in the log:
>
> Use of uninitialized value $log in concatenation (.) or string at line 697
&g
>{form}->{'userpass'}) :
();
697 $main::global->{form}->{'ud'} =
"%%$main::global->{uid}%%$log%%$pass%%".time();
698 $main::global->{form}->{'ud'} = Encrypt($main::global->{form}->{'ud'},
$main::global->{config}->{&
Message-
> From: CM Analyst [mailto:cmanal...@yahoo.com]
> Sent: Thursday, January 27, 2011 6:25 PM
> To: Parag Kalra
> Cc: beginners@perl.org
> Subject: Re: Need help with Use of uninitialized value in concatenation
> (.) or string
>
> This is a sample of the data I a
-84f9e0f6609e;|]
com.raec.cq.CQCommitException: You wanted to commit a modifyCR based record,
but the record was
not found in the ClearQuest Database.
--- On Thu, 1/27/11, Parag Kalra wrote:
From: Parag Kalra
Subject: Re: Need help with Use of uninitialized value in concatenation (.) or
string
To: &qu
ull the date value each time an error
> value (hardcoded) is found in the specified log file. The script retrieves
> the error value without a problem but I cannot seem get the date value. Can
> anyone tell me what I need to do?
>
> The error message when I run the script is:
>
> Us
Can you send an example of the data in the log file?
tm
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
run the script is:
Use of uninitialized value in concatenation (.) or string at script.pl line 32
where line 32 is where I am calling this:
"print $date";
Here is the script:
use warnings;
use strict;
#Specify the path to the log file you want to read, for ex. application log#
open (
ecently I have started using [Carp::REPL][1]
to test code. Here is an example session:
cow...@amans:~$ perl -MCarp::REPL=warn g.pl
Use of uninitialized value $z in multiplication (*) at g.pl line 10.
Trace begun at g.pl line 10
re.pl(main):001:0> :l
File g.pl:
5:
6: my $x = 5;
7: my $y =
> 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
>>>>> "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.
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
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
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
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
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
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.
>> [/con
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->
> 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 4
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
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 things, so I have no idea which
variable wasn
Bob Williams wrote:
"Uri Guttman" wrote:
"BW" == Bob Williams writes:
BW> Hi Rob, Many thanks. That does what I want :) Now I need to study
BW> your code to learn why.
and you need to learn to bottom post. you wrote one line and quoted 80
lines which have already been seen by others. goo
"Uri Guttman" wrote:
>> "BW" == Bob Williams writes:
>
> BW> Hi Rob, Many thanks. That does what I want :) Now I need to study
> BW> your code to learn why.
>
> and you need to learn to bottom post. you wrote one line and quoted 80
> lines which have already been seen by others. google
> "7" == 7 <7stud.7s...@gmail.com> writes:
7> On Sat, Jan 30, 2010 at 4:27 PM, Rob Dixon wrote:
>> Why are you replying to me? My post did use the three-argument form of
>> open(). Also:
>>
>> - It is bad form to use upper case letters for lexical variables
>>
7> "Perl Best
On Sat, Jan 30, 2010 at 4:27 PM, Rob Dixon wrote:
> Why are you replying to me? My post did use the three-argument form of
> open(). Also:
>
> - It is bad form to use upper case letters for lexical variables
>
"Perl Best Practices" disagrees with you.
> - Passing / / as the first parameter of
> "BW" == Bob Williams writes:
BW> Hi Rob, Many thanks. That does what I want :) Now I need to study
BW> your code to learn why.
and you need to learn to bottom post. you wrote one line and quoted 80
lines which have already been seen by others. google for bottom posting
and learn why it
name[0];
>
>
>
> Bob Williams wrote:
>> Hi,
>>
>> I am trying to split the lines in a file into two halves (at the first
>> space) each half going into an array. The code I have written is below.
>> The print command is there to test that
[ Please do not top post. ]
7 wrote:
a)
open (BHF_FILE, "
The modern way to open a file is to:
1) Use the three argument form of open().
2) Create a variable for the file handle.
open (my $BHF_FILE, '<', '/home/bob/tmp/md4music');
You should *always* verify that the file was opened correct
Why are you replying to me? My post did use the three-argument form of
open(). Also:
- It is bad form to use upper case letters for lexical variables
- Passing / / as the first parameter of split() will split on the first
single space in the string. It is better to use ' ' instead which
dis
um, $fields[0];
>push @uktrackname, $fields[1];
> }
>
> print $ukchecksum[0];
> print $uktrackname[0];
>
>
>
> Bob Williams wrote:
>> Hi,
>>
>> I am trying to split the lines in a file into two halves (at the first
>> space) each half going
t $uktrackname[0];
Bob Williams wrote:
Hi,
I am trying to split the lines in a file into two halves (at the first
space) each half going into an array. The code I have written is below. The
print command is there to test that things worked correctly, but it only
gives an error for each instan
At 7:29 PM + 1/29/10, Bob Williams wrote:
Thanks. There's a lot in your version for a newbie to learn, but
unfortunately, it still gives the same error :(
It helps if you post the actual code generating the error. You should
also trim the accumulated text to remove non-relevant portions.
work with the data while looping
> # over it
>
> print "Checksum: $checksum\n";
> print "Rest: $song\n";
>
> # and stash it away so we can use it later
> # ...each song (key) has a checksum
>
> $music_store{ $song } = $checksu
Thomas Bätzler wrote:
> Bob Williams asked:
>> I am trying to split the lines in a file into two halves (at the first
>> space) each half going into an array. The code I have written is below.
>
>> ---Code---
>> #!/usr/bin/perl
>> use warnings;
>> #use strict;
>
> use strict; # unless you know w
e to test that things worked correctly, but it
>> only gives an error for each instance of the print command...
>>
>> Use of uninitialized value within @uktrackname in print at
>> /home/bob/Documents/scripts/perl/music_md5_compare.pl line 22
>> (#1)
&g
print command...
Use of uninitialized value within @uktrackname in print at
/home/bob/Documents/scripts/perl/music_md5_compare.pl line 22 (#1)
---Code---
#!/usr/bin/perl
use warnings;
#use strict;
You shouldn't comment out that line. Strictures can help you find
mistakes in your
Bob Williams asked:
> I am trying to split the lines in a file into two halves (at the first
> space) each half going into an array. The code I have written is below.
> ---Code---
> #!/usr/bin/perl
> use warnings;
> #use strict;
use strict; # unless you know what you're doing.
> #use diagnostic
Hi,
I am trying to split the lines in a file into two halves (at the first
space) each half going into an array. The code I have written is below. The
print command is there to test that things worked correctly, but it only
gives an error for each instance of the print command...
Use of
Just redirect in some temporary file
Like
Open STDERR,">/den/null";
That's it
-Original Message-
From: Noah Garrett Wallach [mailto:djb...@sffun.org] On Behalf Of admin2
Sent: Thursday, May 28, 2009 5:38 AM
To: Perl Beginners
Subject: suppressing Use of uninitialize
admin2 wrote:
How can I suppress the first "Use of uninitialized value in pattern
match (m//)" warning message. code and output are below.
Don't suppress a message, but fix the problem.
my @files = <*> unless /.mbox^/;
This is the only pattern match in your script
How can I suppress the first "Use of uninitialized value in pattern
match (m//)" warning message. code and output are below.
code
# cat ./fix_archive.pl
#!/usr/bin/perl
use warnings;
use strict;
my @files = <*> unless /.mbox^/;
foreach my $file (@files) {
admin2 wrote:
How can I suppress the first "Use of uninitialized value in pattern
match (m//)" warning message. code and output are below.
code
# cat ./fix_archive.pl
#!/usr/bin/perl
use warnings;
use strict;
my @files = <*> unless /.mbox^/;
That line read
How can I suppress the first "Use of uninitialized value in pattern
match (m//)" warning message. code and output are below.
code
# cat ./fix_archive.pl
#!/usr/bin/perl
use warnings;
use strict;
my @files = <*> unless /.mbox^/;
foreach my $file (@files) {
p
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 uninitialize
Dear Friends,
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 (.) or string at /xxx.pl line 21
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) = @_;
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
#!/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);
$LinkExtor->parse($URL);
sub links
{
($tag, %links) = @_;
if ($tag eq "a"){
foreach $key (keys %links){
I'm using lwp-download from the comand line to download a PDF file
from a site, and I'm receiving an error: Use of
"uninitialized value at C:\Perl\bin/lwp-download line 171."
I also receive the same message when I'm downloading a gif or jpg
Thanks,
--
To unsubscribe,
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
x27; .
If you removed the "\n" ou "\r\n"
while ( $line eq "99" ){
or
while ( $line eq "99\n" ){
or under win32
while ( $line eq "99\r\n" ){
lerameur a écrit :
Hello and cheers to all,
I wrote a small program and it does work, but I get this
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
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]
Hello and cheers to all,
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 type 99 as a choice, the
program ends
line 11 is
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
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
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 (
way that will not
autovivify all the keys is:
GetOptions( \my %opts_hash,
'allTests', 'CbcDec', 'CbcEnc', 'CfbDec', 'CfbEnc', 'CtrDec',
'CtrEnc', 'EcbDec', 'EcbEnc', 'OfbDec', 'OfbEnc',
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
each (keys %opts_hash)
{
if ( $opts_hash{$_} == 0 )
{
next;
}
elsif ( $opts_hash{$_} == 1 )
{
print "$_ = $opts_hash{$_}\n";
}
}
==========
naiad:~/workspace $ ./debug2.pl --CbcDec
Use of unini
1 - 100 of 296 matches
Mail list logo