![]() |
Creating and filling an array with 3 fields per record
Hi Guys
Excuse the database type language of my array description, I don't know waht else to call it/them. 2 part question Assuming it is possible for a checkbox on a form to have 3 values to it (thats the 2nd question) how would I a) create the array to hold those values b) get the information from the form after submission into the array c) access the information for e.g. emailing. I know how to create an array to hold the split name / value pair and access that info but that is about all. I'm learning as I go from examples and alterations. My 2nd question, which is not Perl related but, :D is relavant the first question. Using normal HTML on a form is it possible for a checkbox (or anything else for that matter) to have more than a 'name' and 'value'. Ideally I would like to have three values (to fill the above array). If it is possible, would it be 3 'names' with 3 'values' or 1 'name' with 3 'values' or what? Just thought of this as well. I need to split up a string of characters say thedir/thefile.ext ($file). I know that ($ext) = $file =~ m,\.([^\.]*)$,; will give ext and ($flnm) = $file =~ m,\/([^\/]*)$,; will give thefile.ext but how would I get thedir/? Any info would be great, what would be better, please please please, would be example code so I can undersatnd it and find out how it works. Thanks :thumbsup: |
Sorry, I don't really understand your checkbox question but a simple way to split your example string would be:
$str = "thedir/thefile.ext"; @s = split(/\W/, $str); Results in @s: thedir thefile ext Hope this helps. |
| All times are GMT +1. The time now is 02:58 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.