Sun751 has asked for the wisdom of the Perl Monks concerning the following question:
And I am suppose to do lots of coying, executing other scripts and removing files, So I am planning to achieve that using above method. So can any one suggest me If I am doing right or is there any other better way to do it, any improvement needed Please! Cheerssub initilize_config { my ($HR_config,$config_file) = @_; open (my $fr, '<', "$config_file") || die "Unable to open configur +ation file: $config_file $!"; while (my $line = <$fr>) { $line =~ tr/\r\n//d; next unless $line; if ($line =~ /^(.+?)=(.+?)$/) { $$HR_config{$1} = $2; } } } sub prn { my $HR_config = shift; system("$HR_config->{CMD_cp}"); if ( $? == -1) { print "Conmmand Failed\n"; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: executing hash element as command
by rovf (Priest) on Jul 02, 2009 at 09:33 UTC | |
Re: executing hash element as command
by Anonymous Monk on Jul 02, 2009 at 09:10 UTC | |
Re: executing hash element as command
by llancet (Friar) on Jul 02, 2009 at 08:19 UTC | |
by JavaFan (Canon) on Jul 02, 2009 at 12:10 UTC |