Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

perl -P in 5.005

Posted on 1998-08-08
5
Medium Priority
?
204 Views
Last Modified: 2010-03-05
I'm trying to use the -P switch with Perl 5.005 on Win95 to get it to do a C preprocessor pass before compiling.  The command 'perl -P test.pl' generates the following error:

  Can't open perl script "test.pl":  Bad file descriptor

I do have Visual C++ on the same machine.  Do I need to specify the location of the C preprocessor somewhere? If so, how do I do this?

Thanks,
Brian
0
Comment
Question by:moquin
  • 3
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
b2pi earned 300 total points
ID: 1209162
Rather than use perl -P (which is problematic, as you've discovered, on Win32), try the following near the top of your program

use strict;
use Filter::cpp ;


You might have to reverse the order of those two.  If perl complains that it can't find Filter/cpp.pm you'll need to download it from CPAN and install.
0
 
LVL 1

Author Comment

by:moquin
ID: 1209163
Sorry for the delay.  I downloaded the relevant modules as you suggest, but it appears that they are designed to work only with gpp; I get a "Parse Exception" when I use MSVC++ as the preprocessor.  Suggestions?

b

0
 
LVL 5

Expert Comment

by:b2pi
ID: 1209164
Sorry, I never saw this.... that message is generally an indicator
that you've got conflicting versions of perl, or conflicting versions
of the compiler setup.

Did you download a binary distribution of perl?  If so, you're
probably best off downloading the source code, and then compiling everything
0
 
LVL 1

Author Comment

by:moquin
ID: 1209165
Source isn't available for ActiveState 5.005 for Win32.

Thanks anyway.  I'll find another way around it.
0
 
LVL 5

Expert Comment

by:b2pi
ID: 1209166
Hey, wait a minute.  You said you were using perl 5.005, I didn't
think ActiveState was up that high yet (I'm not fond of the
ActiveState port, and generally advise against people using it unless
there's a good reason to, i.e. you really need perlscript).

You'll find a pre-compiled version of Filter at the activestate web
site.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question