From: "Mr. Shawn H. Corey" <[EMAIL PROTECTED]> > Yes, you have to do it after-the-fact, so to speak. > > #!/usr/bin/perl > > use strict; > use warnings; > use utf8; > > use Data::Dumper; > $Data::Dumper::Sortkeys = 1; > $Data::Dumper::Indent = 1; > $Data::Dumper::Maxdepth = 0; > > my %_HASH; > %_HASH = ( > typeOne => { > root => '/path/to/typeOne', > }, > typeTwo => { > root => '/path/to/typeTwo', > } > ); > $_HASH{typeOne}{logfile} = $_HASH{typeOne}{root} . '/logone.log'; > $_HASH{typeTwo}{logfile} = $_HASH{typeTwo}{root} . '/logtwo.log';
If the list is longer and/or the statement more complex you may use something like this: foreach ( [typeOne => 'logone'], [typeTwo => 'logtwo'], ) { $_HASH{$_->[0]}{logfile} = $_HASH{$_->[0]}{root} . '/'.$_- >[1].'.log'; } or $_HASH{$_->[0]}{logfile} = $_HASH{$_->[0]}{root} . '/'.$_->[1].'.log' foreach ( [typeOne => 'logone'], [typeTwo => 'logtwo'], ); Jenda ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/