Perl

Menu

Homework 5
Frequently Asked Questions

  1. When I try to install LWP::Simple, it goes through many many other modules, and finally says it failed.
    CPAN is installing the dependencies for you before attempting to install the actual LWP::Simple module. But then when it gets to LWP::Simple, it doesn't know where all those dependencies went. You can tell it where they went by setting the PERL5LIB environment variable. Before starting the CPAN shell, type:
    export PERL5LIB=$HOME/lib/perl5/site_perl
  2. Should numbers inside tags (such as <h2> or <font size="34">) be replaced by Roman Numerals?
    Yes. All numbers should be replaced. Please see the <h1> tag in the sample output.
  3. When I try to commit my CPAN.pm changes, I get an error message: Couldn't open >~/.cpan/CPAN/MyConfig.pm: No such file or directory.
    For reasons I have not yet been able to fully diagnose, it would seem some people need to run simply o conf commit rather than o conf commit ~/.cpan/CPAN/MyConfig.pm. If one doesn't work for you, try the other. If you still get errors, exit the CPAN shell and enter it again, then run o conf to see if your changes have been committed, regardless of the errors received. Thus far, everyone has fallen into one of these three categories.
  4. How do we validate the email address?
    First, allow me to point out that there is no requirement to do this. Do not waste time validating an email address. You will get no points for doing it, nor lose points for not doing it.
    Secondly, "validating" an address as I did to produce the sample output does not mean to make sure that "joe@example.com" actually exists. It simply means that "joe@example.com" looks like a valid email address. For this, there are several modules on CPAN that could help you out - IF AND ONLY IF you choose to do it.
    See also: perldoc -q address
Perl Quotes
Perl Quotes