On 9/24/09 Thu  Sep 24, 2009  5:23 PM, "Noah" <noah-l...@enabled.com>
scribbled:

> Hi there,
> 
> How do I use the glob command to handle "~"?
> 
> I am getting file not found for something like ~/cvs/blah.pl
> so this command dies with "file not found:"
> 
>      open BBOUTPUT, "<$output_file" or die $!;

Converting the tilde character to a user's home directory is something done
by a shell. Perl will not automatically do the conversion.

See the advice given in the Perl FAQ Section 5:

perldoc -q tilde

or

<http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlfaq5/How_can_I_translate_til
des_(~)_in_a_file.html>

The method uses the 8th element of the array returned by getpwnam,
$ENV{HOME}, or $ENV{LOGDIR}.



-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to