http://qs1969.pair.com?node_id=649650

zer has asked for the wisdom of the Perl Monks concerning the following question:

Good Evening,
The code i wrote here isn't the best. Please bear with me.

When it executes it spews out a bunch of mechanize warnings which i am not sure what it means. Execution is by command line

filename.pl user@email.com whateverpassword

This looks at a certain website and grabs all your friends and messages a happy b-day greeting if their b-day is today.

#!/usr/bin/perl -w use strict; my $MONTH=qr/(January|February|March|April|May|June|July|August|Septem +ber|October|November|December)(?=[^a-zA-Z])/; my @abbr = qw(January February March April May June July August Septem +ber October November December); use WWW::Mechanize; my $url = "http://www.facebook.com"; my $m = WWW::Mechanize->new(); $m->get($url); $m->submit_form(form_name=>"loginform", fields=>{email=>$ARGV[0], pass +=>$ARGV[1]}); $m->get("/bdaycal.php"); my $b= $m->content(); $b=~/.... Birthdays(.*?)Facebook /g; $b=$1; $b=~s|(http://\w+\.facebook.com/profile\.php\?id=\d+)| > $1_<|g; $b=~s/<[^>]*>//g; $b=~s/Give a Birthday Gift \| Post a Birthday Flyer//g; $b=~s/&nbsp;//g; my @C = split /$MONTH/,$b; shift @C; my %B=@C; my $count=0; my %O; for (keys %B){ while ($B{$_}=~s/^(\d\d)-(.*?)(\d\d-.*)$/$3/){ my $day = $1*1; my @T=split ",",$2; my @S; foreach my $t(0..$#T){ my ($id,$age,$name); $id=($T[$t]=~s/([^_]+)_//)?$1:""; $age=($T[$t]=~s/\(age (\d\d)\)//)?$1:""; $name=$T[$t]; $O{$_}->{$day}->[$t]= {id=>$id, age=>$age, name=>$name }; $count++; } } }; my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time +); $mon=$abbr[$mon]; for (@{$O{$mon}->{$mday}}){ $m->get($_->{id}); print $_->{name}; my $Form=0; for ($m->forms){ $Form++; last if $_->find_input ("wall_text"); } print ((($m->submit_form(form_number=>$Form, fields=>{wall_text=>" +Happy Birthday!"}))?" - Success":" - Failed"),"\n"); }

The Errors that it produces:

Unknown input type 'search' at /usr/local/share/perl/5.8.8/WWW/Mechani +ze.pm line 2055 Use of uninitialized value in substitution iterator at /usr/share/perl +5/URI/_query.pm line 16. Unknown input type 'search' at /usr/local/share/perl/5.8.8/WWW/Mechani +ze.pm line 2055 Unknown input type 'search' at /usr/local/share/perl/5.8.8/WWW/Mechani +ze.pm line 2055 Unknown input type 'search' at /usr/local/share/perl/5.8.8/WWW/Mechani +ze.pm line 2055

The warnings seem to come only after get() requests. Any guidance would help. As well this is WWW::Mechanize ver 1.32. This is also likely something that I should have noticed.