The point of this function is to right-align numbers in table-data cells and
keep everything else left-aligned. Note that this is what Excel does by
default (if you type in a number in Excel, it aligns to the right; if you
type in a string, it aligns to the left).

Technically, it should be use in the context of an arrayref that you are
transforming into an HTML table, e.g.:

use CGI qw(:all);
$_ = ['1','abc','2.34'];
print join "", map(/^[\.\d]+$/ ? td({-align=>'right'}, $_) : td($_), @$_);

A useful and clever piece of code, that. But the author probably should have
commented it. :)

cheers,
Ed


-----Original Message-----
From: bari [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 07, 2000 12:47 PM
To: [EMAIL PROTECTED]
Subject: Help needed with MAP expression


Hi there,
Can any one help me what this MAP function does...

 map(/^[\.\d]+$/ ? td({-align=>'right'}, $_) : td($_), @$_)

I am really confused by this one... your help would be appreciated..

                                                Thank You,

- Bari

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to