CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
reCapctha.pm file generating an indent before the reCaptcha box

 



venture89
New User

Sep 17, 2011, 9:04 AM

Post #1 of 1 (529 views)
reCapctha.pm file generating an indent before the reCaptcha box Can't Post

I have the following code in my reCapctha.pm file and it is resulting in an indent of the capctha box to the left. I have double checked by html files more than 10 time and there is no reason for the indent there. So I am assuming following code is responsible specially the <<EOP part.

I am not very good with perl can some one please help me get rid of this indent/space? It really looks unprofessional for a landing page the way it is. Thanks in advance for your help.

Code
sub _html { shift->{_html} ||= HTML::Tiny->new } 

sub get_options_setter {
my $self = shift;
my $options = shift || return '';

croak "The argument to get_options_setter must be a hashref"
unless 'HASH' eq ref $options;

my $h = $self->_html;

return $h->script(
{ type => 'text/javascript' },
"\n//<![CDATA[\n"
. "var RecaptchaOptions = "
. $h->json_encode( $options )
. ";\n//]]>\n"
) . "\n";
}

sub get_html
{
my ($self,$pubkey) = @_;
my $html = <<EOP
<script type="text/javascript">
var RecaptchaOptions = {theme: 'red'};
</script>
<script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=$pubkey"></script>
EOP
;
}


Sorry if this is a dumb question I am very new to perl. ThanksSmile

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives