<div class="gmail_quote">On Thu, Jun 24, 2010 at 11:57 AM, Dan Linder <span dir="ltr">&lt;<a href="mailto:dan@linder.org">dan@linder.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I&#39;m trying to access the Perl CGI modules self_url call in a function<br>
call.  Here&#39;s my code:<br>
<br>
=== <a href="http://test001.pl" target="_blank">test001.pl</a> ===<br>
#!/usr/bin/perl<br>
use lib &quot;.&quot;;<br>
use CGI;<br>
use MyModule;<br>
my $cgi = CGI-&gt;new();<br>
<br>
show_my_link(\$cgi);<br>
exit;<br>
=== end <a href="http://test001.pl" target="_blank">test001.pl</a> ===<br>
<br>
My module is like this:<br>
=== MyModule.pm ===<br>
package MyModule;<br>
use Exporter;<br>
@ISA = qw(Exporter);<br>
@EXPORT = qw(show_my_link);<br>
<br>
sub show_my_link {<br>
    my ($thecgi) = @_;<br>
    printf (&quot;The full URL is: %s\n&quot;, $thecgi-&gt;self_url());<br>
}<br>
1;<br>
=== end MyModule.pm ===<br>
<br>
When I run the code above, I get the error:<br>
    Can&#39;t call method &quot;self_url&quot; on unblessed reference at MyModule.pm line 8.<br>
(Line 8 is the printf...self_url line.)<br>
<br>
I think I&#39;m close, but is there something else I&#39;m missing to make this call?<br></blockquote></div><br>Best guess.<br><br>Pass the object not a reference to a scalar containing the object :)<br><br>show_my_link(\$cgi);<br>
    should be<br>show_my_link($cgi);<br><br>-- <br>Ted Katseres<br>      ||=O=||<br>