Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

perl -P in 5.005

Posted on 1998-08-08
5
Medium Priority
?
203 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
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…
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

715 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