I am curious about how to do something in perl
I have an array
my
@values;
(it contains multiple values - see below)
<value>value1</value>
<value>value2</value>
<value>value3</value>
Therefore...
my $x = 0;
for ($x..$#values)
{
my $value =
@values[$x];
print $value;
$x++;
}
This code will print all the values in the array.
What I would like to do is add a tag, say <hello> to the front of the array, and add a closing tag </hello> to the end of the array.
The resulting output would look like...
<hello><value>value1</value><value>value2</value><value> value3</value></hello>
I cannot seem to figure out how to achieve this without having the output read...
<hello><value>value1</value></hello><hello><value>value2</value></hello<hello><value>value3</value></hello>
Any help would be well received, thanks!
Lucas Cochrane
lcochrane@dc.com