in reply to Array Question

perldoc -f push will show the documentation for the push function.

Here is an example of how you could save your "matching options" in an array for use in other parts of your program:
my @opts; if ($imgline =~ /\Q$search\E/i) { my ($img_name,$img_desc) = split /\|/, $imgline; + push @opts => qq{<option value="$img_name">$img_desc</option>}; } + # ... later, print out HTML select list print "<select name=foo>\n", join( "\n" => @opts ), "\n</select>";

--sacked

Replies are listed 'Best First'.
Re^2: Array Question
by lisaw (Beadle) on Jun 08, 2004 at 16:26 UTC
    Hi Sacked, That was exactly what I was looking for. Thank you for the help!