Solved

perl -P in 5.005

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
syslog unix file 20 71
Using Perl DBI to query oracle 3 41
Control Number of Log Files -Perl 7 71
how to print sub line with  sed /awk /perl in bash file 11 23
I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
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…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

805 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