Hi Friends,

Please suggest me some idea to write perl code to join multiple lines into
single line after a delimiter... For example i have the following code..

N22_pad_RNO : AO1
      port map(A => un1_N3, B => N2_c, C => \N22_pad_RNO_0\, Y
         => \N22_pad_RNO\);
N3_pad : INBUF
      port map(PAD => N3, Y => N3_c);

and want to modify as follows..

N22_pad_RNO : AO1 port map(A => un1_N3, B => N2_c, C =>
\N22_pad_RNO_0\, Y => \N22_pad_RNO\); (in single line)

N3_pad : INBUF port map(PAD => N3, Y => N3_c);

Thank you all in advance....




On Sat, Jun 13, 2015 at 10:33 PM, Илья Рассадин <elcaml...@gmail.com> wrote:

> Hi!
>
> You can use say instead of print (with use v5.10 as minimum) to avoid this
> strange behaviour.
>
> use v5.10;
> say %hash;
>
> but output still be ugly - all keys and values concatenates withoud
> delimeter.
>
> if you want to dump your hash for debugging purpose, module Data::Dumper
> is a great choice.
>
> use Data::Dumper;
> print Dumper \%hash;
>
> And last, you get output '2/8' because when you concatenate %hash with
> string, perl evaluates hash as scalar. More details you can find in that
> stackoverflow question
> http://stackoverflow.com/questions/7427381/what-do-you-get-if-you-evaluate-a-hash-in-scalar-context
>
> сб, 13 июня 2015 г. в 19:48, Raj Barath <barat...@live.com>:
>
>> You can go over the hash using for loop like
>>
>> for ( keys %hash ){
>>       print $_ => $hash{$_}. "\n";
>> }
>>  On Jun 13, 2015 1:40 PM, "rakesh sharma" <rakeshsharm...@hotmail.com>
>> wrote:
>>
>>> Hi
>>>
>>> I am printing a hash but I tried to concatenate the new line operator
>>> and I am getting 2/8 as output;
>>>
>>> print %hash."\n";
>>>
>>> output is 2/8. I am not able to make the output. 2 could be the items in
>>> the hash, which in my case was 2.
>>> Any inputs?
>>>
>>> thanks
>>> rakesh
>>>
>>


-- 
*Regards,*
*Sumathi G,*
*Research Scholar,*
*HBNI, IGCAR.*

Reply via email to