[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl-Forum] Newbie Macperl debugger/html help please



Hi
Sorry if this is the incorrect target for these questions.

When I run a variant of the following code (with many more html table entries) I
get a set of uninitialised value warnings from the subroutine. Perl warns of
uninitialised values in the shifted value in the subroutine.


I have the following questions:
1)  
    Presumably nothing  is being matched in the problem cases in map (line
    6) and sent via $1 or $2 to the subroutine?
2)
    How would I use the debugger to check the values being passed to the
    subroutine?. 
    I have switched on 'Perl Debugger' in the MacPerl menu. I can
    step but not print out any values. Help please!

    main::htmlparse( File parse tv.pl:16):
    16:     $inner =~ s/<[^>|B]+>//gi;
    
3)  
    I need some html help (as is probably obvious). Can anyone recommend
    a mac|perl related mailing list or newsgroup?
    
4)  Is there a module I should be using?


##### UNDO an HTML table and DO it up again #######

1   : #!perl -w
2   : 
3   : $in = q<TR><TD VALIGN="TOP" NOWRAP><FONT FACE="Ariel,Helvetica"
SIZE=2><B>7.00 AM&nbsp;&nbsp;</B></FONT></TD><TD><FONT FACE="Ariel,Helvetica"
SIZE=2><B>Children's BBC Breakfast Show</B>&nbsp;&nbsp;</FONT></TD></TR><TR><TD
VALIGN="TOP" NOWRAP><FONT FACE="Ariel,Helvetica"
SIZE=2><B>&nbsp;&nbsp;</B></FONT></TD><TD><FONT FACE="Ariel,Helvetica"
SIZE=2><B>Polka Dot Shorts.</B>&nbsp;&nbsp;Dotty fun in the Land of Roo with
Polkaroo and friends.</FONT></TD></TR><TR><TD VALIGN="TOP" NOWRAP><FONT
FACE="Ariel,Helvetica" SIZE=2><B>7.10 AM&nbsp;&nbsp;</B></FONT></TD><TD><FONT
FACE="Ariel,Helvetica" SIZE=2><B>Playdays.</B>&nbsp;&nbsp;Mr Jolly and the gang
visit the Roundabout Stop.</FONT></TD></TR><TR><TD VALIGN="TOP" NOWRAP><FONT
FACE="Ariel,Helvetica" SIZE=2><B>7.30 AM&nbsp;&nbsp;</B></FONT></TD><TD><FONT
FACE="Ariel,Helvetica" SIZE=2><B>Puppy's Further
Adventures.</B>&nbsp;&nbsp;Capers with the cuddly canines.</FONT></TD></TR>;
4   : 
5   : @rows = split /<\/TR>/, $in;
6   : @nums = map { /(.*)<TD>(.*)/; [htmlparse($1), htmlparse($2)] } @rows;
7   : 
8   : foreach $out (@nums) {
9   :   print "$out->[0] \t $out->[1] </TD>\n" if defined $out->[0] and
$out->[1];
10  : }
11  : 
12  : 
13  : sub htmlparse {
14  :   my $inner = shift;
15  :   $inner =~ s/&nbsp;//g;
16  :   $inner =~ s/<[^>|B]+>//gi;
17  :   return $inner;
18  : } 
__END__
Compiler warnings:
File parse tv.pl; Line 15: Use of uninitialized value.
File parse tv.pl; Line 16: Use of uninitialized value.
(repeated several times)
--
Rory Campbell-Lange     			            Campbell-Lange Workshop
--



==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-forum-request@macperl.org