0

Not sure how to word my question but I am trying to create an array or photo captions that is being posted to my script.

 my $q = CGI->new();
 my $name = $q->param('name');
 my @photoCaptions = $q->param('photos[]');

if I dump $q here is the part of where photos is

'photos[][caption]' => [ 'cap1', 'cap2', 'cap3', 'cap4', 'cap5' ] 

but when I dump @photoCaptions, I get nothing.. why is that and how do I fix it?

1
  • The name of the parameter is photos[][caption] but you use photos[] in your call to param(). Commented Jan 17, 2014 at 20:56

1 Answer 1

3

It appears that your key is 'photos[][caption]'.

So you will have to call my @photoCaptions = $q->param('photos[][caption]');

Sign up to request clarification or add additional context in comments.

2 Comments

I seem to be lost in my own insanity because I thought I tried that and it didnt change anything. But sure enough I try it now and it works like a charm! Thanks!
Oh I know but there is a 10 min window where you cant accept answers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.