You can process a config file like this, put in a function:
You have given my script proposal that certainly needs some adaption.
YOUR version would be more helpful.
But maybe you can help yourself with the following information.
Once you have defined the readconfig function in your script, and once you have the pathname of a config file in a variable, say config, then you can call the function like this
and then you have set the variables state, hostname, ip that you can echo out as $state, $hostname, $ip.
I have a process that spits out a file called sqlplus.out, here is what the result looks like:
Currently the value you see is zero, what I need to do is perform an action if that value is non-zero, so how do I check that value in an if statement? If it helps at this moment in development the... (6 Replies)
consider on day1, in PVCS repository we have java files like a.java,b.java with version revision 1.0, through ANT build script we have compiled and created an ear,named c.ear in AIX build server.we have transfered this ear from build server to portal server through FTP using KSHELL.
consider... (0 Replies)
i have a program writing in PRO C which currently running in unix version 8 tie with oracle 8i, but in the future company gonna migrate this OS to version 9.
Anything i have to prepare for my PRO C program to run in unix version 9? or anything would that impact my program couldn't run well?
what... (2 Replies)
Would like to confirm the ff. I got confused actually with the version I needed to download that will work on glassfish 3.0.1
a. Debian Squeeze (HP DL360). Need to use java version6
On Debian, I did apt-get install sun-java6-jdk. So when I check it's
java version "1.6.0_22"
Java(TM) SE... (1 Reply)
Hi, (i'm sorry for my english)
I'm a problem on boot sco unix 5.0.5 open server.
this stop at "Checking protected password and checking subsystem databases"
(See this image )
I'm try this:
1) http://www.digipedia.pl/usenet/thread/50/37093/#post37094
2) SCO: SCO Unix - Server hangs... (9 Replies)
Hi,
Below is output of lslpp command.
bash-3.00# lslpp -L | grep xlC
xlC.aix50.rte 11.1.0.1 C F XL C/C++ Runtime for AIX 5.3
xlC.cpp 9.0.0.0 C F C for AIX Preprocessor
xlC.msg.en_US.cpp 9.0.0.0 C F C for AIX... (2 Replies)
Guys,
How to find OS version and firmware version in LINUX?
Like in AIX.
uname -a will show me the version 5.3, 6.1,7.1.
lsmcode -c will show me - system firmware image as SF240_417.
What are the similar commands in Linux.
I checked uname -a and cat /etc/release.
uname... (1 Reply)
Discussion started by: ElizabethPJ
1 Replies
LEARN ABOUT DEBIAN
mojolicious::plugin::config
Mojolicious::Plugin::Config(3pm) User Contributed Perl Documentation Mojolicious::Plugin::Config(3pm)NAME
Mojolicious::Plugin::Config - Perl-ish configuration plugin
SYNOPSIS
# myapp.conf
{
foo => "bar",
music_dir => app->home->rel_dir('music')
};
# Mojolicious
my $config = $self->plugin('Config');
# Mojolicious::Lite
my $config = plugin 'Config';
# Reads "myapp.conf" by default
my $config = app->config;
# Everything can be customized with options
my $config = plugin Config => {file => '/etc/myapp.stuff'};
DESCRIPTION
Mojolicious::Plugin::Config is a Perl-ish configuration plugin.
The application object can be accessed via $app or the "app" function. You can extend the normal configuration file "myapp.conf" with
"mode" specific ones like "myapp.$mode.conf". A default configuration filename will be generated by decamelizing the application class with
"decamelize" in Mojo::Util or from the application filename.
The code of this plugin is a good example for learning to build new plugins, you're welcome to fork it.
OPTIONS
Mojolicious::Plugin::Config supports the following options.
"default"
# Mojolicious::Lite
plugin Config => {default => {foo => 'bar'}};
Default configuration, making configuration files optional.
"ext"
# Mojolicious::Lite
plugin Config => {ext => 'stuff'};
File extension for generated configuration filenames, defaults to "conf".
"file"
# Mojolicious::Lite
plugin Config => {file => 'myapp.conf'};
plugin Config => {file => '/etc/foo.stuff'};
Full path to configuration file, defaults to the value of the "MOJO_CONFIG" environment variable or "myapp.conf" in the application home
directory.
METHODS
Mojolicious::Plugin::Config inherits all methods from Mojolicious::Plugin and implements the following new ones.
"load"
$plugin->load($file, $conf, $app);
Loads configuration file and passes the content to "parse".
sub load {
my ($self, $file, $conf, $app) = @_;
...
return $self->parse($content, $file, $conf, $app);
}
"parse"
$plugin->parse($content, $file, $conf, $app);
Parse configuration file.
sub parse {
my ($self, $content, $file, $conf, $app) = @_;
...
return $hash;
}
"register"
my $config = $plugin->register($app, $conf);
Register plugin in Mojolicious application.
SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.
perl v5.14.2 2012-09-05 Mojolicious::Plugin::Config(3pm)