Tilde is a feature of the shell which Perl is probably not able to expand for you. You can substitute it with something like this:
use lib "$ENV{HOME}/public_html/PERL_TEST";
There's also no guarantee that you're going to have a HOME environment variable either.

A more reliable method might be something like this:
BEGIN { my $home = (getpwuid($<))[7]; # Current user use lib "$home/public_html/PERL_TEST"; }
Update:
The above was merely given as an example of how you can replace tilde for the current user, figuring it was fairly obvious how to retool it to be more generic. What I probably should've put was something like this:
BEGIN { my $user = 'someuser'; my ($home) = (getpwnam($user))[7]; # Specific user die "Can't find user $user home directory\n" unless($home); use lib "$home/bin"; print $home; }
While having a hard-coded path is one way to ensure that the application will work, having an application use libraries from the home directory of a particular user isn't all that unusual, although it can be confusing if not documented clearly.

In reply to Re: use lib connundrum by tadman
in thread use lib connundrum by Angel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.