--- "Sayed, Irfan (Irfan)" <[EMAIL PROTECTED]> wrote:
> 
> My query is that can i store the output of this for loop in
> variable or
> list. so that if i print the content of that variable or array then
> it
> should print as
>  
> dadsad
> assasd
>  

You can add a "\n" (or "\r\n" on windows,etc) at the end of each
element in the array,like,

push @new,$_."\n" for @old;

now print @new will get what you wanted.

but I just think it's really not needed to modify the array by adding
"\n" for format output. Your for loop is good. Also you can use a
map:

$ perl -e '@x=(1,2,3);print map { $_."\n"} @x'
1
2
3

HTH.

Best Regards,
Jeff (joy) Peng


      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to