Hi All,
I am trying to pass a hash which was inside an array and modify the hash in the sub-routine. Could anyone let me know whether this is the correct syntax please?
The data structure should look like this:
[red]
[/red]
etc...
Here's the code I'm thinking might work:
[red]
[/red]
Any help is much appreciated.
Thanks,
James.
I am trying to pass a hash which was inside an array and modify the hash in the sub-routine. Could anyone let me know whether this is the correct syntax please?
The data structure should look like this:
[red]
Code:
Mails [ARRAY] {HASH} {HASH}
0 ---> To (scalar)
---> CC (scalar)
---> Subject (scalar)
---> HTML ---> file_loc
---> uri
---> content
1 ---> To (scalar)
---> CC (scalar)
---> Subject (scalar)
---> HTML ---> file_loc
---> uri
---> content
etc...
Here's the code I'm thinking might work:
[red]
Code:
#Call subroutine
#Sub routine should create 'uri' and 'content' keys
get_html ( \$mails[$i]{'html'} );
sub get_html{
#Access the hash
open ( HTML, "<$html_hash->{'file_loc'}" )
...
#Push array onto hash, creating the 'uri' key
$html_hash->{'uri'} = \@img;
#Push scalar onto hash, creating the 'content' key
$html_hash->{'content'} = $html_code;
}
Any help is much appreciated.
Thanks,
James.