title: Undefined subroutine &main using graph package
body: <p>I'm using add_edge function in the <a href="https://metacpan.org/dist/Graph/view/lib/Graph.pod" rel="nofollow noreferrer">graph package</a>. I want to use a for loop to add edges, but the program returns the message <strong>Undefined subroutine &amp;main::add_edge called at perl.pl line 14</strong>. Printing the vertices within the for loop works. I thought I might need the <code>Use Graph;</code> line within the for loop, since that appears to be what some previous answers here suggest, but this doesn't prevent the error.</p>
  <p>Here is the full code:</p>
  <pre><code>#!/usr/bin/perl
  use strict;
  use warnings;
  use Graph;
  
  my $graph = Graph-&gt;new;
  $graph-&gt;add_edges(qw(a b c d));
  
  foreach($graph-&gt;vertices()){
    add_edge(&quot;$_&quot;, &quot;v&quot;);
  }
  </code></pre>