[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: perl question



On Sat, 19 Dec 2009, Alex Samad wrote:
> I have a set of constants setup in my script
> 
> RC_OK
> ...
> ...
> 
> I use LWP::Simple  which also uses RC_OK, and I get a main::RC_OK
> redifinition 
> 
> is there some way around this with out renaming my constants. 

You can suppress symbol importing, and then call methods the long way:

  use LWP::Simple qw();
  my $html = LWP::Simple::get("http://...";);

Or just import what you want:

  use LWP::Simple qw(get);
  my $html = get("http://...";);

See http://perldoc.perl.org/Exporter.html.

cd


Reply to: