I typed which perl at the command prompt and got /usr/opt/bin/perl.
I changed the first line of my script to #!/usr/opt/bin/perl -w and tried running it again. I got the same error message:
Can't locate LWP/UserAgent.pm in @INC (@INC contains: /usr/local/lib/perl5/5.8.0/sun4-solaris-thread-multi /usr/local/lib/perl5/5.8.0 /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris-thread-multi /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl .) at weather.pl line 9. BEGIN failed--compilation aborted at weather.pl line 9.