develooper Front page | perl.perl5.porters | Postings from July 2001

Re: [PATCH perl@11059] UCD.pm: if at first you don't succeed, croak?

Thread Previous | Thread Next
From:
Jarkko Hietaniemi
Date:
July 3, 2001 14:41
Subject:
Re: [PATCH perl@11059] UCD.pm: if at first you don't succeed, croak?
Message ID:
20010703164110.R19034@chaos.wustl.edu
On Tue, Jul 03, 2001 at 08:56:23PM +0000, Ton Hospel wrote:
> In article <20010703152920.Q19034@chaos.wustl.edu>,
> 	Jarkko Hietaniemi <jhi@iki.fi> writes:
> > Hmmm.  Let's croak only if nothing worked.
> > 
> >     unless (defined $$rfh) {
> >         for my $d (@INC) {
> >             use File::Spec;
> >             $f = File::Spec->catfile($d, "unicode", @path);
> >             last if open($$rfh, $f);
> >         }
> >         croak __PACKAGE__, ": failed to find ",join("/",@path)," in @INC\n"
> >             unless defined $rfh;
> >     }
> > 
> shouldn't that be unless defined $$rfh ?

Neither works like I intended... now it's brutally

    unless (defined $$rfh) {
        for my $d (@INC) {
            use File::Spec;
            $f = File::Spec->catfile($d, "unicode", @path);
            last if open($$rfh, $f);
            undef $f;
        }
        croak __PACKAGE__, ": failed to find ",
              File::Spec->catfile(@path), " in @INC"
            unless defined $f;
    }

and while I was at it, I added charscript() to get the UTR #24
script names, too.

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About