View Single Post
  #4   Spotlight this post!  
Unread 22-08-2006, 16:35
Dave Scheck's Avatar
Dave Scheck Dave Scheck is offline
Registered User
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Feb 2003
Rookie Year: 2002
Location: Arlington Heights, IL
Posts: 574
Dave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond repute
Re: How I can execute Javascript into Perl?

Do you get an error that looks something like this?
Code:
Bareword found where operator expected at test.pl line 1, near "'"" . $me . ""?C=OFERTAS2&EMPRESA="".$empresa_param.""&NREF="".$nref.""' onMouseOver"
        (Missing operator before onMouseOver?)
Bareword found where operator expected at test.pl line 1, near """linkFTecnica"
        (Missing operator before linkFTecnica?)
String found where operator expected at test.pl line 1, near ")"""
        (Missing operator before ""?)
syntax error at test.pl line 1, near "'"" . $me . ""?C=OFERTAS2&EMPRESA="".$empresa_param.""&NREF="".$nref.""' onMouseOver"
This would be because you aren't creating your string properly. If you're trying to append a string to $dateos, you want your code to be like this
Code:
# assuming linkFTecnica is a perl function
$datos = $datos . "<a href='" . $me . "?C=OFERTAS2&EMPRESA=" . $empresa_param . "&NREF=" . $nref . "'onMouseOver=" . linkFTecnica(nref2) . ">";
-- or --
# assuming linkFTecnica is a perl function
$datos = $datos . "<a href='$me?C=OFERTAS2&EMPRESA=$empresa_param&NREF=$nref' onMouseOver=" . linkFTecnica(nref2) . ">";
-- or --
# Assuming that linkFTecnica is a JS function (which it probably is)
$datos = $datos . "<a href='$me?C=OFERTAS2&EMPRESA=$empresa_param&NREF=$nref' onMouseOver=linkFTecnica(nref2)>";
The difference between my code and yours is that you're using "" for some reason to open and close your string. Are you trying to escape them or something? If so, you want to use \" instead of ""

Also, remember that when you put a scalar variable within double quotes that it gets expanded.
Code:
$x = "test";
$y = "This is a $x";
results in $y being "This is a test". If you get into problems like this
Code:
$x = "test";
$y = "This_is_a_$x_with_underscores"
you will need to resolve it in one of the following ways
Code:
$x = "test";
$y = "This_is_a_" . $test . "_with_underscores";
$y = "This_is_a_${x}_with_underscores";
Hope that points you in the right direction.