in reply to Questionon foreach loop syntax
foreach (@date){
to access an array, Perl will automatically store the current value from the array in the magic variable $_, hence your assignment statement might look like:
$user_input->{start_date} = $_;
Alternatively, if you use the syntax
foreach $your_variable (@date){
the current array value is stored in $your_variable (or whatever scalar you put there). For more information, see Foreach Loops in perlsyn.
|
|---|