On 6/1/09 Mon  Jun 1, 2009  1:40 PM, "Ravi Malghan" <rmalg...@yahoo.com>
scribbled:

> 
> Hi: I have web page built using perl cgi. Generated page has the following
> element
> 
> <div id="userName" style="display: none;" name="userName"> admin </div>
> 
> Within the perl script is there a way to access the value of the element
> userName and assign it to a variable?
> Something along the lines
> $currentUser = <get value of the the #userName element>;

Perl will interpolate variables in a "double-quote" context. Thus, if you
have the string 'userName' assigned to a scalar variable $x, you can
generate a string containing the value of this variable and assign it to
another variable as follows:

    $currentUser = "get value of the $x element";

(it is not clear if the characters < # > ; should be part of the generated
string, so I left them out.)

 



-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to