passing an array from a function?

97 views
Skip to first unread message

Dan Bode

unread,
Feb 6, 2009, 9:12:28 AM2/6/09
to puppet...@googlegroups.com
Is it possible for a custom function to return an array?

I am trying to have a function return an array that then can be used as an array to create types.

IE:
get_array() -> ["1", "2", "3"]

array = get_array()
file{array:}


thanks (as always),

Dan

Steve Feehan

unread,
Feb 6, 2009, 1:19:15 PM2/6/09
to puppet...@googlegroups.com


Yes, you can return an array from a function. There is one odd case
where you must assign the array to a variable first -- ie. you can't do
something like:

file { get_array(): .... }

See http://projects.reductivelabs.com/issues/1652

Steve

Reply all
Reply to author
Forward
0 new messages