Problem No. 1 -- you commented out 'use strict'. Problem No. 2 -- you commented out 'use warnings'.
Had then been turned on, they would have told you about your incorrect Perl syntax. As Dave Tang so correctly pointed out, Perl is NOT JavaScript..... There is a quote from M. J. Dominus floating in the back of my head .... B On Mon, Oct 5, 2009 at 8:59 PM, Dave Tang <d.t...@imb.uq.edu.au> wrote: > On Tue, 06 Oct 2009 11:57:53 +1000, Jyoti <jcutiep...@gmail.com> wrote: > >> Hello All, >> >> Can anyone please help with one small error I am getting for line 16( The >> one which is bold n italic below.) >> The error is : Can't call method "str" on an undefined value at >> firstpage.pl >> line 16. > > Just a warning, I am also a beginner Perl programmer. But your validate > subroutine looks like JavaScript* code. But I could be wrong. > > Nevertheless, hope that helps. > > Dave > > *http://en.wikipedia.org/wiki/JavaScript > >> >> >> #!/usr/bin/perl >> # standard settings plus call for CGI package >> #use strict; >> #use warnings; >> use CGI; >> use Bio::Seq; >> use Bio::SeqIO; >> use Bio::AlignIO; >> >> #subroutine >> >> &validate; >> >> sub validate() >> { >> * $q->str=document.form1.login.value; * >> if(str.length > 6) >> { >> $q->number=str.indexOf("@"); >> if(number!=-1) >> { >> $q->number=str.indexOf("."); >> if(number==-1) >> { >> $q->document.form1.login.focus(); >> alert("Please Enter a valid email id"); >> return false; >> } >> } >> else >> { >> $q->document.form1.login.focus(); >> alert("Please Enter a valid email id"); >> return false; >> } >> >> } >> else >> { >> $q->document.form1.login.focus(); >> alert("Please Enter a valid email id"); >> return false; >> } >> } > > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/