Using perl5 with Win95/dos command line. 
Author Message
 Using perl5 with Win95/dos command line.

Just starting out with the perl language!
With that in mind I have a question regarding some examples I am trying
to run.
The examples come from the book"Learning Perl" by Randal L. Schwartz &
Tom Christiansen.

When I run the following sub routine I get the following:


Execution of filename.pl aborted due to compilation errors.

When I place a backslash as requested  no e-mail is sent to me when the
user enters an
incorrect password.

Any thoughts would help get me back on track!

sub good_word {

        $somename =~ s/\W.*//;                         # Get rid of
everything after first word
        $somename =~ tr/A-Z/a-z/;                      # Place
everything into lowercase
        if  ($somename eq "Chris") {                   # No need to look
to hash table
                return 1;
        } elsif (($words{$somename} || "groucho") eq $someguess) {
                return 1;
        } else {


                close MAIL;
                return 0;
        }

Quote:
}

Chris Hewell
Engineering Analyst

303-245-7723
Ext. 7723


Sun, 20 May 2001 03:00:00 GMT  
 Using perl5 with Win95/dos command line.

Quote:

>Just starting out with the perl language!
>With that in mind I have a question regarding some examples I am trying
>to run.
>The examples come from the book"Learning Perl" by Randal L. Schwartz &
>Tom Christiansen.

>When I run the following sub routine I get the following:


>Execution of filename.pl aborted due to compilation errors.

Hi,

Quote:

>When I place a backslash as requested  no e-mail is sent to me when the
>user enters an incorrect password.

>Any thoughts would help get me back on track!

[snip]


>            close MAIL;

Whenever you open something like this, it's always good to
check the return value:
        open (...) or die "Can't open: $!\n"
In this case it probably would have told you that the program
'mail' doesn't exist. For Windows 95/98, one way to send mail
is by use of the Mail::Sendmail module, available from
        http://www.perl.com/CPAN/authors/id/M/MI/MIVKOVIC/
This allows one to compose a message and then forward it to
your SMTP server for delivery.

--
                Best regards,
                Randy Kobes

Physics Department              Phone:     (204) 786-9399
University of Winnipeg          Fax:       (204) 774-4134

Canada                          http://theory.uwinnipeg.ca/



Sun, 20 May 2001 03:00:00 GMT  
 Using perl5 with Win95/dos command line.

: [snip]


: >          close MAIL;

: Whenever you open something like this, it's always good to
: check the return value:
:       open (...) or die "Can't open: $!\n"
: In this case it probably would have told you that the program
: 'mail' doesn't exist.

It won't actually.  The fork is done before 'mail' is run, and the
open succeeds if the fork succeeds.



Thu, 31 May 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Win95 command line for perl5

2. perl (Win95) and DOS commands???

3. how to make win95 command line know perl wihtout .pl

4. Keeping command line window open in Win95

5. Command line instructions don't execute in Win95

6. Win95 command line, where's the ouput?

7. Perl command line processing, Windows/dos style ?

8. DOS: command line wildcards

9. Help: perl for DOS variable=something on command line

10. How do you connect to a dos command line script

11. Using perl5 on win95

12. Using PERL to execute DOS commands

 

 
Powered by phpBB® Forum Software