This is another technique:
Producing:
All the strings are placed into a scalar, with the separator being a newline, then the scalar is split into the array.
Because there is some processing, you could also place quotes around the strings later, saving some keystrokes on entry. However, then you would lose the flexibility of placing any characters of your choice around the strings -- I used both single and double quotes above, for example.
It is convenient if your sentences are short. If you had long sequences, you'd need to invent a continuation character to allow lines to be joined ... cheers, drl
I have to add a variable value to an array, something like this:
......
@my_array_name = $value_of_this_variable;
This doesnt seem to work, any ideas why?
Thanks! (4 Replies)
hi every body,
i donot know how to assign a array varible with a file
see i having file
more file
property1 Name
property2 Address
the above two line are tab Space seperated between the property and its value
i want to seperate it and assign to... (1 Reply)
Hi ,
i have a text file that contain a story
How do i extract the out all the sentences that contain the word Mon. in C++
I only want to show those sentences that contain the word mon
eg.
Monkey on a tree.
Rabbit jumping around the tree.
I am very rich, I have lots of money.
Today... (1 Reply)
Hi,
I have an array with 3 words in it and i have to match all the array contents and display the exact matched sentence i.e all 3 words should match with the sentence.
Here are sentences.
$arr1="Our data suggests that epithelial shape and growth control are unequally affected depending... (5 Replies)
I have an array as follows:
Space: ABC
Name: def
Age: 22
Type: new
Name: fgh
Age: 34
Type: old
Space: XYZ
Name: pqr
Age: 44
Type: new
:
:
How can I separate the array with elements starting from Space:ABC until Space: XYZ & put them in a different array & so on... (4 Replies)
Hi All,
I'm writing a nagios check that will see if our ldap servers are in sync...
I got the status data into a nested array, I would like to search key of each array and if "OK" is NOT present, echo other key=>values in the current array to a variable
so...eg...let take the single array... (1 Reply)
I wrote a simply perl that searched a file for a particualr value and if it found it, rite it and the next three lines to a file. Now I have been asked to check those next three lines for a different value and only write those lines if it finds the second value.
I was thinking the best way to... (1 Reply)
I know that
@food = %fruit;
Works. But how do I assign %fruit and %veggies to @food ? (2 Replies)
Discussion started by: popeye
2 Replies
LEARN ABOUT SUSE
innconfval
INNCONFVAL(1) InterNetNews Documentation INNCONFVAL(1)NAME
innconfval - Get configuration parameters from inn.conf
SYNOPSIS
innconfval [-pstv] [-i file] [parameter ...]
innconfval -C [-i file]
DESCRIPTION
innconfval normally prints the values of the parameters specified on the command line. By default, it just prints the parameter values,
but if -p, -s, or -t are given, it instead prints the parameter and value in the form of a variable assignment in Perl, Bourne shell, or
Tcl respectively. If no parameters are specifically requested, innconfval prints out all parameter values (this isn't particularly useful
unless one of -p, -s, or -t were specified).
All parameters are taken from inn.conf except for version, which is always the version string of INN.
If given the -C option, innconfval instead checks inn.conf, reporting any problems found to standard error. innconfval will exit with
status 0 if no problems are found and with status 1 otherwise.
OPTIONS -C Check inn.conf rather than printing out the values of parameters.
-i file
Use file as the source configuration file rather than inn.conf. file must be a valid inn.conf file and will be parsed the same as
inn.conf would be.
-p Print out parameters as Perl assignment statements. The variable name will be the same as the inn.conf parameter, and string values
will be enclosed in single quotes with appropriate escaping. Boolean values will be mapped to the strings "true" or "false". List
values will be mapped to an array of strings. NULL values are not printed out and will therefore be "undef" in Perl.
Here is an example:
$enableoverview = 'true';
@extraoverviewadvertised = ( 'Newsgroups', 'Injection-Info' );
$organization = 'Let's try nasty "quotes"';
$maxforks = 10;
If innconfval is called via the Perl "INN::Config" module, all these variables are properly exported.
-s Print out parameters as Bourne shell assignment statements. The variable name will be the inn.conf parameter name in all capitals, and
all variables will be exported, if not NULL. String values will be enclosed in single quotes with appropriate escaping, and boolean
values will be mapped to "true" or "false". List values will be mapped to a space-separated string representing an array of strings
(as Bourne shell does not recognize arrays, contrary to several other shells, an array cannot be returned for interoperability
reasons).
Here is an example:
ENABLEOVERVIEW=true; export ENABLEOVERVIEW;
EXTRAOVERVIEWADVERTISED='"Newsgroups" "Injection-Info"'; export EXTRAOVERVIEWADVERTISED;
ORGANIZATION='Let'''s try nasty "quotes"'; export ORGANIZATION;
MAXFORKS=10; export MAXFORKS;
-t Print out parameters as Tcl assignment statements. The variable name will be the same as the inn.conf parameter name but with "inn_"
prepended, and string variables will be escaped appropriately. Boolean values will be mapped to the strings "true" or "false". List
values will be mapped to an array of strings. NULL values are not printed out.
Here is an example:
set inn_enableoverview "true"
set inn_extraoverviewadvertised { "Newsgroups" "Injection-Info" }
set inn_organization "Let's try nasty "quotes""
set inn_maxforks 10
-v Print INN's version. This is equivalent to "innconfval version".
HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews.
$Id: innconfval.pod 8919 2010-01-22 23:29:28Z iulius $
SEE ALSO inn.conf(5), INN::Config(3pm).
INN 2.5.2 2010-02-08 INNCONFVAL(1)