in reply to supress an error
Do something with $username and $admin.
Perl is warning you that you don't appear to be using those values, and that because of that something might be wrong.
Read perldoc -f our , perldoc vars and perldoc -f my to decide which one you need.
Note that the vars documentation has this note:
NOTE: The functionality provided by this pragma has been superseded by "our" declarationsThe docs are your friend.
Update: I think I missed the obvious. Shouldn't it read as follows?
Surely there is a nicer way of doing this? A small sub that returns the value you're after, perhaps?$username = $common::auth::user; $admin = $common::auth::admin;
package Foo; # Warning. Rubbish, untested code follows. sub get_admin { my $admin = "admin"; my $user = $ENV{"REMOTE_USER"}; return ($admin, $user); } package Bar; use Foo; @user_info = get_admin(); # Do stuff.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: supress an error
by nlafferty (Scribe) on May 01, 2002 at 21:24 UTC |