title: why is the hash value missing in the below code
body: <p>I wanted to do a POST request to jira and jfrog. while I try to get the values of the hash within the loop am not able to get the value the second time. I try to read the variable(API token instead of password) from env, if not set it will pass the username and password.</p>
  <pre><code>my %urls = (
      'jira' =&gt; {
          'url' =&gt; 'https://jira.com:123/rest/api/2/issue/', 
          'token' =&gt; 'JIRA_TOKEN'
      },
      'jfrog' =&gt; {
          'url' =&gt; 'https://jfrog.com/artifactory/api/storage/path/to/artifacts',
          'token' =&gt; 'JFROG_TOKEN'
      }
  );
  
  my $jira_ua = Mojo::UserAgent-&gt;new();
  for my $outer_elem ( keys %urls ) {
      for my $inner_elem ( keys %{$urls{$outer_elem}} ) {
          # print $inner_elem;
          if ( !$ENV{$urls{$outer_elem}{'token'}} ) {
              print &quot;Enter username : \n&quot;;
              my $username = &lt;STDIN&gt;;
              chomp($username);
              my $passwd = read_password(&quot;Enter Password: &quot;);
              $url = Mojo::URL-&gt;new($urls{$outer_elem}-&gt;{'url'})
              -&gt;userinfo($username.':'.$passwd);
          }
          else {
              if ( $inner_elem eq &quot;jira&quot; ) {
                  $tx-&gt;req-&gt;headers-&gt;authorization (
            &quot;Bearer $ENV{$urls{$outer_elem}-&gt;{'token'}}&quot;
                 );
                  $url = Mojo::URL-&gt;new($urls{$outer_elem}-&gt;{'url'})
              }
          }
          print $outer_elem . &quot;\n&quot;;
          print &quot;logging in to $urls{$outer_elem}-&gt;{'url'}\n&quot;;
          $tx = my $ua-&gt;get($url); # &lt;--- line 170
          my $res = $tx-&gt;res-&gt;code;
          print $res;
          last;
      }
  }
  </code></pre>
  <p>I get below output</p>
  <pre><code>D:\scripts&gt;perl emtf.pl
  jira
  Can't call method &quot;get&quot; on an undefined value at emtf.pl line 170.
  </code></pre>