Solved

perl -P in 5.005

Posted on 1998-08-08
5
191 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 100 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now