Hey guys I am new to perl and I am developing a CGI script which takes input from the user and assign it to the hash reference $ input...I am generating all the dates in between the range given by the user and storing it in the array...For each date stired in @date I wants to assign the value of array to the hash reference ...following is the code which I am using.....kindly let me know how to access every element of the array using foreach loop . Another Question is can I assign the user input through param in foreach loop...
foreach (@date){ # create hash reference variable for user inputs as well as every date + in array @date $user_input->{pp_branch} = param('pp_branch'); $user_input->{host_name} = param('host_name'); $user_input->{controller} = param('controller'); $user_input->{start_date} = ;#I wann assign here each element of array + unless the array gets empty; # .... some code.......... }
The doubts are silly ....but I am confused.....so wants to confirmed @ it ...After all PerlMonks is the place where we can get faithful information:-)
Thanks in advance !!!!
In reply to Questionon foreach loop syntax by siddheshsawant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |