f



custom perl interpreter?

I have a script that works fine that you give a specification
file to on the command line.

$ script.pl -f specfile

What I want to do is turn the command line around, but what
do I put as the magic in the specfile? What I'm trying to
do is this:

$ specfile

where the magic in specfile is:

#!/opt/local/bin/script.pl -f

Any ideas?

Mike
0
Mike
4/5/2004 12:30:31 PM
comp.lang.perl.misc 33233 articles. 2 followers. brian (1246) is leader. Post Follow

6 Replies
504 Views

Similar Articles

[PageSpeed] 37

*** post for FREE via your newsreader at post.newsfeed.com ***

>>>>> "Mike" == Mike  <mikee@mikee.ath.cx> writes:

Mike> #!/opt/local/bin/script.pl -f

Mike> Any ideas?

The "interpreter" in #! must be an actual binary, not a script.
But you can turn a script into a binary (at some loss in speed)
with PAR.  See PAR in the CPAN.

print "Just another Perl hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


 -----= Posted via Newsfeed.Com, Uncensored Usenet News =-----
http://www.newsfeed.com - The #1 Newsgroup Service in the World!
-----== 100,000 Groups! - 19 Servers! - Unlimited Download! =-----
                  
0
merlyn
4/5/2004 12:35:40 PM
Mike wrote:
> I have a script that works fine that you give a specification
> file to on the command line.
> 
> $ script.pl -f specfile
> 
> What I want to do is turn the command line around, but what
> do I put as the magic in the specfile? What I'm trying to
> do is this:
> 
> $ specfile
> 
> where the magic in specfile is:
> 
> #!/opt/local/bin/script.pl -f
> 
> Any ideas?
> 
> Mike

I think that the best you will get is

#!/usr/bin/perl /opt/local/bin/script.pl -f

and the rest of the file is the contents of specfile. At least thats the 
way I got it to work for me.
0
Peter
4/5/2004 1:03:17 PM
Also sprach Randal L. Schwartz:

>>>>>> "Mike" == Mike  <mikee@mikee.ath.cx> writes:
> 
>Mike> #!/opt/local/bin/script.pl -f
> 
>Mike> Any ideas?
> 
> The "interpreter" in #! must be an actual binary, not a script.
> But you can turn a script into a binary (at some loss in speed)
> with PAR.  See PAR in the CPAN.

I don't know how portable this is, but for me (on Linux) this works:

    #!/usr/bin/perl script.pl
    
Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
0
Tassilo
4/5/2004 1:03:41 PM
*** post for FREE via your newsreader at post.newsfeed.com ***

>>>>> "Peter" == Peter Hickman <peter@semantico.com> writes:

Peter> I think that the best you will get is

Peter> #!/usr/bin/perl /opt/local/bin/script.pl -f

Peter> and the rest of the file is the contents of specfile. At least thats
Peter> the way I got it to work for me.

But that doesn't work everywhere #! works.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


 -----= Posted via Newsfeed.Com, Uncensored Usenet News =-----
http://www.newsfeed.com - The #1 Newsgroup Service in the World!
-----== 100,000 Groups! - 19 Servers! - Unlimited Download! =-----
                  
0
merlyn
4/5/2004 1:57:29 PM
Randal L. Schwartz wrote:
> But that doesn't work everywhere #! works.

This is true, but sometimes getting something to work at all is important.
0
Peter
4/5/2004 2:52:37 PM
Peter Hickman <peter@semantico.com> wrote:

> I think that the best you will get is
> 
> #!/usr/bin/perl /opt/local/bin/script.pl -f
> 
> and the rest of the file is the contents of specfile. At least
> thats the way I got it to work for me.

AFAIK, that only works on Solaris.  Other Unices will complain
about not finding "/opt/local/bin/script.pl -f".

Peter

-- 
#!/local/bin/perl5 -wp -*- mode: cperl; coding: iso-8859-1; -*-
# matlab comment stripper (strips comments from Matlab m-files)
s/^((?:(?:[])}\w.]'+|[^'%])+|'[^'\n]*(?:''[^'\n]*)*')*).*/$1/x;
0
pjacklam
4/5/2004 4:53:33 PM
Reply:

Similar Artilces:

deisng perl perl programmibng langs in perl
then liberate big war zones with notes on their download pages. -r www.thevoid1.net/ ...

US-CA: Beverly Hills-Perl Developer - Perl Programmer - Perl Engineer
************************************************************** JobCircle.com is the largest regional job board in the Mid-Atlantic region, with tens of thousands of job offerings in PA, NJ, DE, MD, NY, and Washington D.C. To learn more, visit http://www.jobcircle.com?source=ng ************************************************************** Job Title: Perl Developer - Perl Programmer - Perl Engineer - Perl... Job Location: CA: Beverly Hills Pay Rate: competitive Job Length: full time Start Date: 2010-11-19 Company Name: Cybercoders Contact: Shea Stone ...

Compiling perl? perl??
I suspect this has been discussed in the past before, and so I searched around the web and virtually everything I found out there says perlcc is buggy and not to use it, especially in production, so my question is are there any reliable alternatives? Or is there some magic incantation to get perlcc to build without segment faulting as that's what it's doing to me? The problem I'm interesting is solving is getting something to run on a system that doesn't have perl installed. I know there are also those who want to compile as a way of hiding source, but I don't car...

Perl vs. perl
this is for T. do you know the difference between Perl (the language) and perl (the program)? let's hear you explain the difference. uri On 08/13/2015 08:07 PM, Uri Guttman wrote: > > this is for T. do you know the difference between Perl (the language) > and perl (the program)? let's hear you explain the difference. > > uri > Hi Uri, Homework! Homework! Why! Why! Why! K-I-D-S T-H-E-S-E D-A-Y-S! Wait! This is a test! Test! Test! I didn't know there was going to be a test! I over slept! My dog ate my paper! I went to Publik ...

How to find out the location of the perl interpreter? First line always #!/usr/bin/perl?
I can run perl scripts on certain computers with this first line: #!/usr/bin/perl However on other computers this does not work. AFAIK this line represent the location of the perl interpreter. How can I find out the correct path to the perl interpreter resp. which path I have to enter in the first line ? Mark On 2007-11-17, Mark Richards <markmark@lycos.com> wrote: > I can run perl scripts on certain computers with this first line: > > #!/usr/bin/perl > > However on other computers this does not work. > > AFAIK this line represent the location of the perl inte...

Perl Help
Hello, I have two different scripts that do pretty much the same thing. The main perl script is on Windows. It runs and in the middle of it, it then calls out another perl script that then should run on a Unix box I have. Both scripts run ok, except for the part when Windows try's to call out the Unix script. I have it set up where the Unix is mapped through a drive letter and can drop stuff into the Unix box. It is going through another server to do that. So I can see the script and drop files into the Unix box but just can't figure out why perl will not call out the script. When I c...

FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? #16
This is an excerpt from the latest version perlfaq1.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 1.4: What are Perl 4, Perl 5, or Perl 6? (contributed by brian d foy) In short, Perl 4 is the past, Perl 5 is the present, and Perl 6 is the future. The number after perl (i.e. the 5 after Perl 5) is the m...

FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? #9
This is an excerpt from the latest version perlfaq1.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 1.4: What are Perl 4, Perl 5, or Perl 6? (contributed by brian d foy) In short, Perl 4 is the past, Perl 5 is the present, and Perl 6 is the future. The number after perl (i.e. the 5 after Perl 5) is the m...

FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? #11
This is an excerpt from the latest version perlfaq1.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 1.4: What are Perl 4, Perl 5, or Perl 6? (contributed by brian d foy) In short, Perl 4 is the past, Perl 5 is the present, and Perl 6 is the future. The number after perl (i.e. the 5 after Perl 5) is the m...

FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? #18
This is an excerpt from the latest version perlfaq1.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 1.4: What are Perl 4, Perl 5, or Perl 6? (contributed by brian d foy) In short, Perl 4 is the past, Perl 5 is the present, and Perl 6 is the future. The number after perl (i.e. the 5 after Perl 5) is the m...

FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? #10
This is an excerpt from the latest version perlfaq1.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 1.4: What are Perl 4, Perl 5, or Perl 6? (contributed by brian d foy) In short, Perl 4 is the past, Perl 5 is the present, and Perl 6 is the future. The number after perl (i.e. the 5 after Perl 5) is the m...

FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? #17
This is an excerpt from the latest version perlfaq1.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 1.4: What are Perl 4, Perl 5, or Perl 6? (contributed by brian d foy) In short, Perl 4 is the past, Perl 5 is the present, and Perl 6 is the future. The number after perl (i.e. the 5 after Perl 5) is the m...

FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? 283187
This is an excerpt from the latest version perlfaq1.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 1.4: What are Perl 4, Perl 5, or Perl 6? (contributed by brian d foy) In short, Perl 4 is the past, Perl 5 is the present, and Perl 6 is the future. The number after perl (i.e. the 5 after P...

FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? 434527
This is an excerpt from the latest version perlfaq1.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 1.4: What are Perl 4, Perl 5, or Perl 6? (contributed by brian d foy) In short, Perl 4 is the past, Perl 5 is the present, and Perl 6 is the future. The number after perl (i.e. the 5 after P...

Web resources about - custom perl interpreter? - comp.lang.perl.misc

The Interpreter - Wikipedia, the free encyclopedia
The Interpreter is a 2005 political thriller film starring Nicole Kidman , Sean Penn , and Catherine Keener . It was the final film to be directed ...

The Interpreter (@Interpreter_Mag) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Contract Interpreter Information Center
... contractors across the nation who represent the backbone of the Language Services Industry. Popular Welcome to the official Contract Interpreter ...

Travel Interpreter - Multilingual Phrasebook on the App Store on iTunes
Get Travel Interpreter - Multilingual Phrasebook on the App Store. See screenshots and ratings, and read customer reviews.

Mandela's sign language interpreter's return to fame: Livelens - YouTube
Meet the infamous sign language interpreter at Nelson Mandela's memorial in his first commercial for the livelens app. Make your first live video ...

Swedish sign-language interpreter steals the show from Eurovision hopefuls
A Swedish sign-language interpreter whose emotional and at times salacious interpretation of a pop performance has stolen the show at the Scandinavian ...

Killing sparks fears for safety of 600 Afghan interpreters
An Afghan interpreter who worked for the Australian army in Afghanistan has been killed in a suspected Taliban revenge attack while he waited ...

All signs suggest Obama's interpreter for the deaf was fake
The international deaf community is up in arms as claims emerged the signed-language interpreter on stage at Nelson Mandela's memorial service ...

Eurovision 2015: Interpreter Tommy Krangh steals spotlight in hilarious fashion
If Guy Sebastian was facing this guy at Eurovision in Vienna in May, we'd be saying, sorry Guy, but don't even bother getting on the plane.

All signs suggest Obama's interpreter for the deaf was fake
The international deaf community is up in arms as claims emerged the signed-language interpreter on stage at Nelson Mandela's memorial service ...

Resources last updated: 1/24/2016 12:59:16 PM