On Fri, May 27, 2011 at 6:21 PM, Agnello George <agnello.dso...@gmail.com>wrote:

>
>
> On Fri, May 27, 2011 at 6:05 PM, Shlomi Fish <shlo...@iglu.org.il> wrote:
>
>> On Friday 27 May 2011 13:48:21 Agnello George wrote:
>> > Hi
>> >
>> > I am using TT to display my data from my db ,
>> >
>> >
>> > i insert the following  data from a  Front end using (  <textarea>  )
>>  into
>> > my database  the data is like this  in mysql :
>> >
>> >
>> ---------------------------------------------------------------------------
>> > -----------+------+---------------+-------------+-------------+ LV Name
>> >            /dev/VolGroup01/zeeweblinux1
>> >  VG Name                VolGroup01
>> >  LV UUID                iqj9g1-qzfQ-IHyc-Ebov-CKNb-NIYQ-dZKBXF
>> >  LV Write Access        read/write
>> >  LV Status              available
>> >  # open                 1
>> >  LV Size                50.00 GB
>> >  Current LE             12800
>> >  Segments               1
>> >  Allocation             inherit
>> >  Read ahead sectors     auto
>> >  - currently set to     256
>> >  Block device           253:8
>> >
>> +-----------+------+-------------------------------------------------------
>> >
>> ---------------------------------------------------------------------------
>> >
>> ---------------------------------------------------------------------------
>> >
>> ---------------------------------------------------------------------------
>> >
>> ---------------------------------------------------------------------------
>> >
>> ---------------------------------------------------------------------------
>> >
>> --------------------------------------+------+---------------+-------------
>> > +-------------+
>> >
>> > when i try to retrieve this data  using TT i to put it in a hash  , so
>> here
>> > is what my hash looks like :
>> >
>> > $VAR1 = [ { 'result' => {  'lvm' => 'LV Name /dev/VolGroup01/blinux1 VG
>> > Name VolGroup01 LV UUID iqj9g1-qzfQ-IHyc-Ebov-CKNb-NIYQ-dZKBXF LV Write
>> > Access read/write LV Status available # open 1 LV Size 50.00 GB Current
>> LE
>> > 12800 Segments 1 Allocation inherit Read ahead sectors auto - currently
>> > set to 256 Block device 253:8 ',   } } ];
>> >
>> >
>> > ultimately it it gets displayed without the new-line character :
>> >
>> > LV Name /dev/VolGroup01/blinux1 VG Name VolGroup01 LV UUID
>> > iqj9g1-qzfQ-IHyc-Ebov-CKNb-NIYQ-dZKBXF LV Write Access read/write LV
>> Status
>> > available # open 1 LV Size 50.00 GB Current LE 12800 Segments 1
>> Allocation
>> > inherit Read ahead sectors auto - currently set to 256 Block device
>> 253:8
>> >
>> >
>> > is there a way i can display  on my browser with a new-line or <br/>
>> >
>>
>> First of all, make sure you avoid HTML-injection/cross-site-scripting
>> (XSS)
>> attacks:
>>
>> http://community.livejournal.com/shlomif_tech/35301.html
>>
>> Then you can use something like:
>>
>>        $s =~ s{\n}{<br />}g;
>>
>> to put line breaks in the HTML.
>>
>> Regards,
>>
>>        Shlomi Fish
>>
>> --
>> -----------------------------------------------------------------
>> Shlomi Fish       http://www.shlomifish.org/
>> Optimising Code for Speed - http://shlom.in/optimise
>>
>> We have nothing to fear but fear itself. Fear has nothing to fear but
>> XSLT.
>>
>> Please reply to list if it's a mailing list post - http://shlom.in/reply.
>>
>
>
> awesome!! it works
>
> i had to do some thing like this !!
>
>  my $select_dom0_data = $DBH->selectall_hashref("select
> dom0_name,cpu,lvm,ram,ip,application,assigned_to from dom0_info where
> dom0_name='$dom0_server'  and rid=$rack_n",'dom0_name' );
>
>      $select_dom0_data->{$dom0_server}{lvm} =~ s{\n}{<br />}g; ;
>
>
>



the new line character substitution with  <br/>  seem to have worked , but i
also want to substitute \t+ or \t with    &nbsp;&nbsp;

$select_dom0_data->{$dom0_server}{lvm} =~ s{\n}{<br />}g;
$select_dom0_data->{$dom0_server}{lvm} =~ s{\t}{&nbsp;&nbsp;}g;

the whole formating goes for a toss and the new line substitution dont work
.

any ideas .



> --
>
Regards
Agnello D'souza

Reply via email to