quick split function question
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 |
From: Matt <mattmora...@gmail.com>
Date: Thu, 8 Oct 2009 16:40:28 +0100
Local: Thurs, Oct 8 2009 11:40 am
Subject: quick split function question
With 0.25 we can use the split function to parse a string in to an array. In puppet how can I reference a single element of that array? $temp = "1,2,3,4" Then i'd lilke to do : $val = split($temp,',')[0] Thanks, Matt
You must Sign in before you can post messages.
You do not have the permission required to post.
|
 |
From: Trevor Vaughan <peiriann...@gmail.com>
Date: Thu, 8 Oct 2009 14:16:04 -0400
Local: Thurs, Oct 8 2009 2:16 pm
Subject: Re: [Puppet Users] quick split function question
Heh...PERL.
temp = '1,2,3,4'
val = temp.split(',')[0]
Trevor
On Thu, Oct 8, 2009 at 11:40, Matt <mattmora ...@gmail.com> wrote:
> With 0.25 we can use the split function to parse a string in to an array.
> In puppet how can I reference a single element of that array?
> $temp = "1,2,3,4"
> Then i'd lilke to do :
> $val = split($temp,',')[0]
> Thanks,
> Matt
You must Sign in before you can post messages.
You do not have the permission required to post.
|
 |
From: "R.I.Pienaar" <r...@devco.net>
Date: Thu, 8 Oct 2009 19:18:10 +0100 (BST)
Local: Thurs, Oct 8 2009 2:18 pm
Subject: Re: [Puppet Users] Re: quick split function question
hello, ----- "Trevor Vaughan" <peiriann...@gmail.com> wrote: > Heh...PERL. > temp = '1,2,3,4' > val = temp.split(',')[0]
I suspect he wants to use the new split() parser function available in manifests and not in a template. In that case, no you cannot reference a specific array member in the puppet DSL at present. > > In puppet how can I reference a single element of that array? > > $temp = "1,2,3,4" > > Then i'd lilke to do : > > $val = split($temp,',')[0]
-- R.I.Pienaar
You must Sign in before you can post messages.
You do not have the permission required to post.
|
 |
From: Trevor Vaughan <peiriann...@gmail.com>
Date: Thu, 8 Oct 2009 14:50:46 -0400
Local: Thurs, Oct 8 2009 2:50 pm
Subject: Re: [Puppet Users] Re: quick split function question
$temp = '1,2,3,4'
$val = inline_template(<%= temp.split(',')[0] %>)
Trevor
On Thu, Oct 8, 2009 at 14:18, R.I.Pienaar <r ...@devco.net> wrote:
> hello,
> ----- "Trevor Vaughan" <peiriann...@gmail.com> wrote:
>> Heh...PERL.
>> temp = '1,2,3,4'
>> val = temp.split(',')[0]
> I suspect he wants to use the new split() parser function available in manifests and not in a template.
> In that case, no you cannot reference a specific array member in the puppet DSL at present.
>> > In puppet how can I reference a single element of that array?
>> > $temp = "1,2,3,4"
>> > Then i'd lilke to do :
>> > $val = split($temp,',')[0]
> --
> R.I.Pienaar
You must Sign in before you can post messages.
You do not have the permission required to post.
|
|
|