On 17/11/2011 07:56, Stefan Wiederoder wrote:
Hello Brandon,
thanks a lot for your help - your code works like a charm, I´ve
already put in my script which is now generating puppet node/classes
definitions.
Sometimes, but very rarely, the answer to a question should include
working code. It i
Hello Brandon,
thanks a lot for your help - your code works like a charm, I´ve
already put in my script
which is now generating puppet node/classes definitions.
bye
,
Stefan
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http:/
On Tuesday, November 15, 2011 at 11:10 , Stefan Wiederoder wrote:
> Hello list,
>
> I´m using a json config file to read a file with server group
> definitions, including group of groups like
> this example:
>
> [jdoe@belbo]# cat groups.json
> {
> "G_Group_PR" : [ "serverA", "serverB" ],
> "G_G
On 11/15/11 Tue Nov 15, 2011 8:10 AM, "Stefan Wiederoder"
scribbled:
> Hello list,
>
> I´m using a json config file to read a file with server group
> definitions, including group of groups like
> this example:
>
> [jdoe@belbo]# cat groups.json
> {
> "G_Group_PR" : [ "serverA", "serve
Hello Stefan,
On Tue, Nov 15, 2011 at 08:10:12AM -0800, Stefan Wiederoder wrote:
> Hello list,
>
> I´m using a json config file to read a file with server group
> definitions, including group of groups like
> this example:
>
> [jdoe@belbo]# cat groups.json
> {
> "G_Group_PR" : [ "serverA
Hello list,
I´m using a json config file to read a file with server group
definitions, including group of groups like
this example:
[jdoe@belbo]# cat groups.json
{
"G_Group_PR" : [ "serverA", "serverB" ],
"G_Group_QS" : [ "serverC", "serverD" ],
"G_All" : [ "G_Group_PR", "
--- "J. Patrick Lanigan" <[EMAIL PROTECTED]> wrote:
> I haven't quite sorted out the more complex data structure in perl
> yet. Anyhow, I need to take the following hash of arrays...
>
> my %tracks = ();
>
> push @{$tracks{$filename}},
> $_, # tracks.fi
Thank you so much for your help Gary and Jason. I tried the following and it
works perfectly.
Patrick
#!c:/perl/bin/perl -w
use strict;
my %tracks=(); # create empty hash
$tracks{'test'}->{artist}='test_artist';
$tracks{'test'}->{title}='test_title';
$tracks{'test2'}->{artist}='test_artist2';
$
Opps, forgot to change the variable name. Ah the power of cut and paste...
for my $row ( keys %tracks ) {
$artist = $tracks{$row}->{artist};
$title = $tracks{$row}->{title};
}
> I wrote:
>
> Excellent! Thanks! So, when I need to iterate through the hash of
> hashes and
> wor
Excellent! Thanks! So, when I need to iterate through the hash of hashes and
work on the data would I do this:
for my $row ( keys %tracks ) {
$artist = $tracks{$fname}->{artist};
$title = $tracks{$fname}->{title};
}
Thanks again for the pointer,
Patrick
> Gary Stainburn wrote:
Surely, a hash of hashes would be better then.
my %tracks=(); # create empty hash
Then to populate the data you do something like:
$tracks{$fname}->{artist}=$artist;
$tracls{$fname}->{title}=$title;
Gary
On Tuesday 01 May 2001 4:08 pm, J. Patrick Lanigan wrote:
> Overall what I am trying to
Overall what I am trying to accomplish is to loop through a bunch of mp3
files and extract the ID3 Tag Info into a hash (%tracks) for which each key
references the filename, filepath, artist, album, tracknum, title, genre for
one file. Once I have %tracks populated I need to iterate through it and
J. Patrick Lanigan writes ..
>I haven't quite sorted out the more complex data structure in perl yet.
>Anyhow, I need to take the following hash of arrays...
you have some very confusing code there .. so let's do it one bit at a time
>my %tracks = ();
create a hash called tracks with zero e
I haven't quite sorted out the more complex data structure in perl yet.
Anyhow, I need to take the following hash of arrays...
my %tracks = ();
push @{$tracks{$filename}},
$_, # tracks.filename
14 matches
Mail list logo