Try while (my $test=<TEXT>) { commands ... }
Best Regards, "Quem nunca pirateou que atire o 1º disco, que eu atiro uma cópia" =================== Sp0oKeR - NsC Analista Linux / Security [EMAIL PROTECTED] ==================== ----- Original Message ----- From: Kyle Babich <[EMAIL PROTECTED]> To: beginners-cgi <[EMAIL PROTECTED]> Sent: Monday, July 01, 2002 1:36 PM Subject: Re: What's wrong with this? > Quer ter seu próprio endereço na Internet? > Garanta já o seu e ainda ganhe cinco e-mails personalizados. > DomíniosBOL - http://dominios.bol.com.br > > Ok, thank you, but now I'm having another problem with this: > > open(TEXT,"text.txt") or die ("error: text.txt failed\n"); > while (<TEXT>) { > my $text = <TEXT>; > } > close(TEXT) or die("error: close text.txt failed\n"); > > print <<"EndOfHTML"; > > $text > > EndOfHTML > > It tells me $text requires explicit package name but I do give it 'my' > so why is it still giving me that error? And once that error is fixed > will the document be put into $text and then print properly even after > I closed text.txt? > > Thank you again. I don't know what I would do without this list. :) > > On 1 Jul 2002 15:36:19 -0000, "Felix Geerinckx" > <[EMAIL PROTECTED]> said: > > on Mon, 01 Jul 2002 15:22:00 GMT, [EMAIL PROTECTED] (Kyle Babich) wrote: > > > > > open(text,"text.txt") or die ("error: text.txt failed\n"); > > > [...] > > > bash-2.05$ perl -Tcw index.pl > > > Unquoted string "text" may clash with future reserved word at > > > index.pl line 17. > > > [..] > > > How do I fix it? > > > > From perldoc perldiag: > > > > Unquoted string ""%s"" may clash with future reserved word > > (W reserved) You used a bareword that might someday be > > claimed as a reserved word. It's best to put such a > > word in quotes, or capitalize it somehow, or insert an > > underbar into it. You might also declare it as a > > subroutine. > > -- > > felix > > > > -- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]