SPUG: CGI.pm popup_menu()?

Richard Wood wildwood_players at yahoo.com
Wed Oct 25 16:02:22 CDT 2000


Brian, 

I use CGI.pm quit a bit.  I believe all that you need
to do is escape the array:

\@Location:

popup_menu(-name=>'Location',-values=>\@Location);


Regards,

Rich Wood

--- "Altman, Brian" <brian.altman at attws.com> wrote:
> 	I have some experience with Perl programming but
> little with the
> CGI.pm module. What I am trying to do is create a
> dynamic HTML form. What I
> mean by dynamic is that I want a select form item to
> be created using
> option's from a .csv file. I can read the file into
> an array, but I haven't
> figured out how to store each array item into the
> value list of the
> popup_menu() function. Can anyone help me on this?
> My code so far looks
> like:
> 
> 	@Location;
> 	open(LOCATION,"< Location.csv") or die "Couldn't
> read Location.csv:
> $!\n";
> 	while(<LOCATION>) {
> 		chomp;
> 		push (@Location, $_);
> 	}
> 
> print
> popup_menu(-name=>'Location',-values=>@Location);
> #But this only
> returns the first item in the array.
> 
> 
> Thnx,
> Brian
> 
>  - - - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - - - - - - - -
>      POST TO: spug-list at pm.org       PROBLEMS:
> owner-spug-list at pm.org
>       Subscriptions; Email to majordomo at pm.org: 
> ACTION  LIST  EMAIL
>   Replace ACTION by subscribe or unsubscribe, EMAIL
> by your Email-address
>  For daily traffic, use spug-list for LIST ;  for
> weekly, spug-list-digest
>   Seattle Perl Users Group (SPUG) Home Page:
> http://www.halcyon.com/spug/
> 
> 


=====
Richard O. Wood
Wildwood IT Consultants, Inc.
wildwood_players at yahoo.com
206.605.2539
http://resumes.dice.com/richardowood

__________________________________________________
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf!  It's FREE.
http://im.yahoo.com/

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/





More information about the spug-list mailing list