Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Array Question

by sacked (Hermit)
on Jun 08, 2004 at 15:27 UTC ( [id://362385]=note: print w/replies, xml ) Need Help??


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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://362385]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-20 01:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found