[email protected] wrote:
Hi,

Hello,

I'm new to perl. The following code is wrong., and I can not spot
it. Any suggestion?  Thx.

#!/usr/bin/perl -w

#!/usr/bin/perl
use warnings;
use strict;

&init_words ();

init_words();

my %word;

sub init_words{
    while ( $filename=<*.secret> ){

    while ( my $filename = <*.secret> ){

        open( WORDLIST, $filename ) ||
            die "Can not open $filename: $!";
        if ( -M WORDLIST < 7 ){
            while ( $name = <WORDLIST> ){

            while ( my $name = <WORDLIST> ){

                chmop( $name );

                chomp( $name );

                $word = <WORDLIST>;

                my $word = <WORDLIST>;

                chmop( $word );

                chomp( $word );

                $word{$name} = $word;
            }
        }
        else{
            rename( $filename, "$filename.old" ) ||
                die "Can not rename $filename to $filename.old.";
        }
        close( WORDLIST );
    }
}


John
--
Those people who think they know everything are a great
annoyance to those of us who do.        -- Isaac Asimov

--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to