# How to convert an array into a recursively calling string

**URL:** <https://www.ruby-forum.com/t/how-to-convert-an-array-into-a-recursively-calling-string/150090>\
**Category:** Ruby\
**Created:** [October 3, 2008, 5:21pm UTC](https://www.ruby-forum.com/t/how-to-convert-an-array-into-a-recursively-calling-string/150090 "2008-10-03T17:21:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wrapster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/df705f/32.png) [@wrapster](https://www.ruby-forum.com/u/wrapster)\
**Post date:** [October 3, 2008, 5:21pm UTC](https://www.ruby-forum.com/t/how-to-convert-an-array-into-a-recursively-calling-string/150090/1 "2008-10-03T17:21:14Z")

</div>

Hi all,

I am stuck with an issue of converting a set of values present in the  
yaml file that i’ve pushed into an array to a recursively calling  
command.  
I have attached the yaml file .  
This is how the o/p should be

-l vnic1 -L=active -P=L2,L4 -l vnic2 -L=active -P=L3,L4 confivnic

“similarly the process continues with initiation of another command for  
notsoconfi”

I tried with everything i knew and all i could get to do was either  
 -l vnic1 vnic2 … (notice -l missing)  
or  
 -l vnic1 -l vnic2 … (here the basic syntax turns out  
to be wrong)

I have been asking this on irb but since am new to ruby and yaml. I was  
not able to get a clear picture .  
pls help

thanks
