I'm wondering how do you get part of the field of an array for a variable. I've finally got a perl book book but this is still way over my head looking forward to really study during the winter holidays.
for example in $category_name it has several fields when fully viewed.
ice cream/cream/chocolate/rocky road
or
ice cream/ice milk/mixed/neopolitan
How do I get just one part of this variable???? for example just the 3rd variable (chocolate or mixed) .
I've found code that lets you split the variable down to first place value but don't know have to change it
CATEGORY: foreach $cat (sort keys %category) {
next unless ($cat =~ m,^([^/]*)$,);
$title = &build_unlinked_title ($cat);
@categorylist = split (/\//, $cat);
$output .= qq~<option value="$cat">$title</option>~;
}
actually this comes from the search_box mod and it works for drop down categories but I was wondering if this can be used to do what I was asking about. the split perl function is still beyond what I've been studied so far. (still too advanced for me)
what did frost say
"But I have perl to study, And miles of perl to go before I sleep, And miles of perl to go before I sleep."
I'd really appreciate any help. thanks
for example in $category_name it has several fields when fully viewed.
ice cream/cream/chocolate/rocky road
or
ice cream/ice milk/mixed/neopolitan
How do I get just one part of this variable???? for example just the 3rd variable (chocolate or mixed) .
I've found code that lets you split the variable down to first place value but don't know have to change it
CATEGORY: foreach $cat (sort keys %category) {
next unless ($cat =~ m,^([^/]*)$,);
$title = &build_unlinked_title ($cat);
@categorylist = split (/\//, $cat);
$output .= qq~<option value="$cat">$title</option>~;
}
actually this comes from the search_box mod and it works for drop down categories but I was wondering if this can be used to do what I was asking about. the split perl function is still beyond what I've been studied so far. (still too advanced for me)
what did frost say
"But I have perl to study, And miles of perl to go before I sleep, And miles of perl to go before I sleep."
I'd really appreciate any help. thanks