[rt-users] Doubt in Login.html
Trevin Beattie
tbeattie at boingo.com
Mon Aug 8 13:01:45 EDT 2005
"FORM" is an HTML tag which encloses an input form. In this case, the
login box (username and password).
"METHOD=POST" means that the form data will be passed in the HTTP
headers (as opposed to GET, where data is passed encoded in the URL).
"ACTION=" defines the URL to which the form data will be sent.
"UNIVERSAL::can" is a Perl function which determines whether the class
object ($r) has a method of the given name ('uri').
"$r" is a global request object passed from Apache which can be used to
obtain various information about the HTTP session. See
http://perl.apache.org/docs/1.0/api/Apache.html for documentation.
"$r->uri" is a method that returns the requested URI minus any query
string; in other words, it's a reference back to the login page itself.
"=~ m!.*/(.*)!" is a Perl pattern-matching operator, which in essence
looks for the last '/' character in the string and then returns all
characters that follow it. In this context with $r->uri, it takes the
URL of the login page and strips off the host and directory components,
leaving just the base name of the page.
-- Trevin Beattie
On Mon, 2005-08-08 at 11:07 -0500, Ahalya_Nathan at mudnebr.com wrote:
>
> Hi all,
> Can someone interpret this piece of code in Login.html
>
> <FORM METHOD=POST ACTION="<% (UNIVERSAL::can($r, 'uri') && ($r->uri)
> =~ m!.*/(.*)!) %>" >
>
> Regards,
> Ahalya Nathan
> Senior Programmer / Analyst
> Information Technology, Metropolitan Utilities District
More information about the rt-users
mailing list