http://www.perlmonks.org?node_id=991725


in reply to problems passing variables between subroutines

You completely ignored the last round of advice I gave you so I'd be dumb to offer you more advice wouldn't I? Hey ho, so be it, I'm dumb.

Your actual code shows exactly the problems my previous sample was designed to avoid.

  1. retrieve_ESLIM_codes uses the global variable $dbh
  2. retrieve_ESLIM_codes returns @sorted_parameters_A but the return result is not used
  3. look_through_file uses and updates $continue_tag, but the result is not used
  4. look_through_file populates a local @array_of_lines, but the result is not used
  5. look_through_file sets a local $entry_no_new, but the result is not used
  6. create_output is passed parameters that have no value

and so on, and so on. On top of that:

my $dbh; my $sth_A = $dbh->prepare($sql_command_D) ...

is never going to give a happy result! You have a lot of work to do before your code has any chance of working.

True laziness is hard work