Noah wrote:
> 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 $!;

A non-direct route that may not be portable:

#!/usr/bin/perl

use strict;
use warnings;

my $homedir = $ENV{HOME};

my $file = "$homedir/output.txt";

open my $fh, '<', $file or die "can't open the damned $file file!: $!";

while ( my $line = <$fh> ) {
    print "$line\n";
}
__END__

Steve

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to