title: Bareword "ident" not allowed while "strict subs" in use at cgi-bin/test.pl
body: <p>I attempting to take two separate tables, in two separate databases, and compare the fields to each other.  I wrote the below code to demonstrate the problem I am having, since I can not copy the code I am using.  In the example below I am using one database.  Below the code example, I will provide the dump of each table.  In any case on with a better description.</p>
  
  <p>reference_table holds the records listed in original_table.  I have no control over the contents of original_table.  After obtaining these records, the person/s who edit the information in original_table can update any field, or they can downright remove the entry.</p>
  
  <p>My goal is, when going back through original_table, to update the field status to disabled where any of the fields in the original_table no longer match the record I had in reference_table. When looking at the dump you will notice a field called unique_id.  This is the id of original_table.</p>
  
  <p>The two main problems that I run into is using the ident of reference_table to update status in reference_table, and properly seeing the tables similarities. </p>
  
  <pre><code>#!/usr/bin/perl
  use strict;
  use DBI;
  use Data::Dumper;
  
  my $dbh = DBI-&gt;connect('dbi:mysql:test','user','password',
      {
              RaiseError =&gt; 1,
              AutoCommit =&gt; 0
      }
  ) || die "Database connection not made: $DBI::errstr";
  
  my $sql     = "SELECT * FROM original_table";
  my $sth     = $dbh-&gt;prepare( $sql ) or die $dbh-&gt;errstr;
                $sth-&gt;execute() or die $sth-&gt;errstr;
  
  my @original;
  while (my $data = $sth-&gt;fetchrow_hashref()){
      push(@original, $data);
  }
  
  my $sql     = "SELECT * FROM reference_table";
  my $sth     = $dbh-&gt;prepare( $sql ) or die $dbh-&gt;errstr;
                $sth-&gt;execute() or die $sth-&gt;errstr;
  
  my @reference;
  while (my $data = $sth-&gt;fetchrow_hashref()){
      push(@reference, $data);
  }
  
  foreach (sort keys @reference){
      unless (exists $original[$_]){
          my $sql     = "UPDATE reference_table SET status = 'd' WHERE ident $reference[ident]";
          my $sth     = $dbh-&gt;prepare( $sql ) or die $dbh-&gt;errstr;
                        $sth-&gt;execute() or die $sth-&gt;errstr;
  
          print "$_: not found in Remote Group\n";
          next; 
      }
      if ($reference[$_] eq $original[$_]){
          print "$_: values are equal\n"
      }else{
          print "$_: values are not equal\n";
      }
  }
  
  $dbh-&gt;disconnect();
  </code></pre>
  
  <p>The code produces the following results:</p>
  
  <pre><code>0: values are not equal
  1: values are not equal
  10: values are not equal
  11: not found in Remote Group
  2: values are not equal
  3: values are not equal
  4: values are not equal
  5: values are not equal
  6: values are not equal
  7: values are not equal
  8: values are not equal
  9: values are not equal
  </code></pre>
  
  <p>The dump of each table:</p>
  
  <p><strong>@original</strong></p>
  
  <pre><code>$VAR1 = [
            {
              'timezone' =&gt; 'tz_001',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_001',
              'ident' =&gt; '1'
            },
            {
              'timezone' =&gt; 'tz_002',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_002',
              'ident' =&gt; '2'
            },
            {
              'timezone' =&gt; 'tz_003',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_003',
              'ident' =&gt; '3'
            },
            {
              'timezone' =&gt; 'tz_004',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_004',
              'ident' =&gt; '4'
            },
            {
              'timezone' =&gt; 'tz_005',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_005',
              'ident' =&gt; '5'
            },
            {
              'timezone' =&gt; 'tz_006',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_006',
              'ident' =&gt; '6'
            },
            {
              'timezone' =&gt; 'tz_007',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_007',
              'ident' =&gt; '7'
            },
            {
              'timezone' =&gt; 'tz_008',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_008',
              'ident' =&gt; '8'
            },
            {
              'timezone' =&gt; 'tz_009',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_009',
              'ident' =&gt; '9'
            },
            {
              'timezone' =&gt; 'tz_010',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_010',
              'ident' =&gt; '10'
            },
            {
              'timezone' =&gt; 'tz_011',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_011',
              'ident' =&gt; '11'
            }
          ];
  </code></pre>
  
  <p><strong>@reference</strong></p>
  
  <pre><code>$VAR1 = [
            {
              'timezone' =&gt; 'tz_001',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_001',
              'ident' =&gt; '1',
              'unique_id' =&gt; '1'
            },
            {
              'timezone' =&gt; 'tz_002',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_002',
              'ident' =&gt; '2',
              'unique_id' =&gt; '2'
            },
            {
              'timezone' =&gt; 'tz_003',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_003',
              'ident' =&gt; '3',
              'unique_id' =&gt; '3'
            },
            {
              'timezone' =&gt; 'tz_004',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_004',
              'ident' =&gt; '4',
              'unique_id' =&gt; '4'
            },
            {
              'timezone' =&gt; 'tz_005',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_122',
              'ident' =&gt; '5',
              'unique_id' =&gt; '5'
            },
            {
              'timezone' =&gt; 'tz_006',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_006',
              'ident' =&gt; '6',
              'unique_id' =&gt; '6'
            },
            {
              'timezone' =&gt; 'tz_007',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_007',
              'ident' =&gt; '7',
              'unique_id' =&gt; '7'
            },
            {
              'timezone' =&gt; 'tz_008',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_008',
              'ident' =&gt; '8',
              'unique_id' =&gt; '8'
            },
            {
              'timezone' =&gt; 'tz_009',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_009',
              'ident' =&gt; '9',
              'unique_id' =&gt; '9'
            },
            {
              'timezone' =&gt; 'tz_010',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_010',
              'ident' =&gt; '10',
              'unique_id' =&gt; '10'
            },
            {
              'timezone' =&gt; 'tz_011',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_011',
              'ident' =&gt; '11',
              'unique_id' =&gt; '11'
            },
            {
              'timezone' =&gt; 'tz_012',
              'status' =&gt; 'a',
              'full_name' =&gt; 'name_012',
              'ident' =&gt; '12',
              'unique_id' =&gt; '12'
            }
          ];
  </code></pre>
  
  <p>Please let me know if you have additional questions.  Any help is greatly appreciated.</p>