MadDogSailor has asked for the wisdom of the Perl Monks concerning the following question:
and the following content of $recref:my $recref = $dbh-> selectall_hashref("SELECT * FROM DSA_RECORD WHERE file_name = '$file_name'", 'RECORD_NAME'); die unless $recref;
How can I put the contents of FIELD_DELIMITER in a scalar? So in the end I need a scalar ($fieldsep) with '<-->' as contents. My impression was :.-> HASH(0x110916be8) 'DATA' => HASH(0x110916a98) 'FIELD_DELIMITER' => '<-->' 'FILE_NAME' => 'SCRAMBLETEST2.CSV' 'RECORD_NAME' => 'DATA' 'RECORD_SELECTOR' => '^1' 'SECTION_NAME' => undef
but this results in error :$recname='DATA'; $fieldsep = $recref->{$recname}->{'FIELD_DELIMITER'};
Please can someone help me, I am getting frustrated. Thanks in advanceUse of uninitialized value in print .....
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to retrieve element in hash?
by choroba (Cardinal) on Nov 30, 2012 at 10:27 UTC | |
|
Re: How to retrieve element in hash?
by bitingduck (Deacon) on Nov 30, 2012 at 11:03 UTC | |
|
Re: How to retrieve element in hash?
by t_rex_joe (Sexton) on Nov 30, 2012 at 17:39 UTC | |
|
Re: How to retrieve element in hash?
by NetWallah (Canon) on Dec 01, 2012 at 18:14 UTC |