I
i5513
Hi!. I don't understand ...
At a html page:
<form name="form1" method="POST" action="example.cgi" >
<textarea name="text"></textarea>
</form>
At a cgi script (example.cgi)
(After get parameters)
if ($FORM{"text"} =~ /^(\s|\n|\r)*$/)
{
print "<HTML>";
if ($FORM{"text"} =~ /\r/)
{
print "Hey! It is here! <BR> ";
}
if ($FORM{"text"} =~ /^(\s|\n)*$/)
{
print "Now it isn't here!";
}
print "</HTML>";
exit (1);
}
Well, When I execute (on Windows) this script with one simple return
on textarea. It gives me next result:
Hey! It is here!
Now it isn't here!
What does Perl do with '\r' character?
Thanks you!
At a html page:
<form name="form1" method="POST" action="example.cgi" >
<textarea name="text"></textarea>
</form>
At a cgi script (example.cgi)
(After get parameters)
if ($FORM{"text"} =~ /^(\s|\n|\r)*$/)
{
print "<HTML>";
if ($FORM{"text"} =~ /\r/)
{
print "Hey! It is here! <BR> ";
}
if ($FORM{"text"} =~ /^(\s|\n)*$/)
{
print "Now it isn't here!";
}
print "</HTML>";
exit (1);
}
Well, When I execute (on Windows) this script with one simple return
on textarea. It gives me next result:
Hey! It is here!
Now it isn't here!
What does Perl do with '\r' character?
Thanks you!