I have written below code to read the each section of .ini file and its working perfect. I have to use below subroutine in my main file, I want to call it and pass the each value in each section into the hash over there and do the database operations. below is code:[Section1] SQL1=select * from <tablename> SQL2=insert into table <table name>
When I call this subroutine from main file, I don't get any return value which I could use for further database operations ( I want those SQL queries in hash so I could pass them to insert into my database using another program)sub Read_INI_files_get_initialData { my ( %ini_file, $ini_sect ); tie %ini_file, 'IniFiles',( -file => "/home/testtool/config/Initia +lData.ini" ); for $ini_sect ( keys %ini_file ) { %$ini_sect = %{ $ini_file{$ini_sect} }; } print "$Section1{SQL1}\n"; # output prints the 1st SQL1 statement + return in .ini file. return (\%Section1); }
In reply to Re^2: Return a value
by bhushanQA
in thread Return a value
by bhushanQA
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |