amearse has asked for the wisdom of the Perl Monks concerning the following question:
There are ten warnings, and likewise, there are ten messages that I'm sorting through. Here is the output. If you know the problem, can you advise? Rock 'n..C:\grappa>grappa1-0.pl Use of uninitialized value in print at C:\grappa\grappa1-0.pl line 49. Use of uninitialized value in print at C:\grappa\grappa1-0.pl line 49. Use of uninitialized value in print at C:\grappa\grappa1-0.pl line 49. Use of uninitialized value in print at C:\grappa\grappa1-0.pl line 49. Use of uninitialized value in print at C:\grappa\grappa1-0.pl line 49. Use of uninitialized value in print at C:\grappa\grappa1-0.pl line 49. Use of uninitialized value in print at C:\grappa\grappa1-0.pl line 49. Use of uninitialized value in print at C:\grappa\grappa1-0.pl line 49. Use of uninitialized value in print at C:\grappa\grappa1-0.pl line 49. Use of uninitialized value in print at C:\grappa\grappa1-0.pl line 49.
Saturday, December 01, 2001 06:03 PM Linda Lutnam http://dt.com/link/click?lid=310058 <46434979-220011153023294428@eiiance.com> Times Ten.
#!/usr/bin/perl/ -w ### Grappa ### use warnings; use strict; #use DBI(); my $flag = 0; my $list = shift || 'c:\grappa\lists\list.txt'; my $output0 = shift || 'c:\grappa\output\output0.txt'; my $date = 'Date: '; my $id = 'Message-Id: '; my $ID = 'Message-ID: '; my $subj = 'Spamvertised website: '; my $from = 'From: '; my @data = ""; open (LIST, "$list") || die "Can't Open $list"; my @list=<LIST>; close(LIST); foreach (@list){ if(s/.*$date//){ $data[0] = $_; $flag =0; } if(s/.*$from//){ $data[1] = $_; $flag =0; } if(s/.*$subj//){ $data[2] = $_; $flag =0; } if(s/.*$id//){ $data[3] = $_; $flag =0; } if(s/.*$ID//){ $data[4] = $_; $flag =0; open STDOUT,">>$output0"; print STDOUT @data; # This is line 49 close STDOUT; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Uninitialized Value
by mortis (Pilgrim) on Dec 15, 2001 at 00:00 UTC | |
by Fastolfe (Vicar) on Dec 15, 2001 at 00:23 UTC | |
|
Re: Uninitialized Value
by petral (Curate) on Dec 15, 2001 at 00:39 UTC | |
|
Re: Uninitialized Value
by kwoff (Friar) on Dec 14, 2001 at 23:58 UTC |