Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Difference between solaris and linux

Reply
Thread Tools

Difference between solaris and linux

 
 
James
Guest
Posts: n/a
 
      12-30-2010
Perl scripts with the following first line works in Solaris but fails
in Linux. Is there a way to make it work in Linux?

#!/bin/env perl -w
or
#!/bin/env perl # comment

James
 
Reply With Quote
 
 
 
 
Randal L. Schwartz
Guest
Posts: n/a
 
      12-30-2010
>>>>> "James" == James <(E-Mail Removed)> writes:

James> Perl scripts with the following first line works in Solaris but fails
James> in Linux. Is there a way to make it work in Linux?

James> #!/bin/env perl -w
James> or
James> #!/bin/env perl # comment

I'm surprised either of those work, actually.

The original shebang permitted only one argument after the command name
(in this case, the "perl" after "/bin/env"), and everything else was
either illegal or ignored.

In general, using /bin/env is wrong anyway. Put the right path and
you'll be happier.

print "Just another Perl hacker,"; # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<(E-Mail Removed)> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion
 
Reply With Quote
 
 
 
 
sln@netherlands.com
Guest
Posts: n/a
 
      12-30-2010
On Thu, 30 Dec 2010 15:31:14 -0800, http://www.velocityreviews.com/forums/(E-Mail Removed) (Randal L. Schwartz) wrote:

>>>>>> "James" == James <(E-Mail Removed)> writes:

>
>James> Perl scripts with the following first line works in Solaris but fails
>James> in Linux. Is there a way to make it work in Linux?
>
>James> #!/bin/env perl -w
>James> or
>James> #!/bin/env perl # comment
>
>I'm surprised either of those work, actually.
>
>The original shebang permitted only one argument after the command name
>(in this case, the "perl" after "/bin/env"), and everything else was
>either illegal or ignored.
>
>In general, using /bin/env is wrong anyway. Put the right path and
>you'll be happier.
>
>print "Just another Perl hacker,"; # the original


Hey Randal, an aside, when you gonna teach me about regex, I need
lessons.

-sln
 
Reply With Quote
 
sln@netherlands.com
Guest
Posts: n/a
 
      12-31-2010
On Thu, 30 Dec 2010 15:49:40 -0800, (E-Mail Removed) wrote:

>On Thu, 30 Dec 2010 15:31:14 -0800, (E-Mail Removed) (Randal L. Schwartz) wrote:
>
>>>>>>> "James" == James <(E-Mail Removed)> writes:

>>
>>James> Perl scripts with the following first line works in Solaris but fails
>>James> in Linux. Is there a way to make it work in Linux?
>>
>>James> #!/bin/env perl -w
>>James> or
>>James> #!/bin/env perl # comment
>>
>>I'm surprised either of those work, actually.
>>
>>The original shebang permitted only one argument after the command name
>>(in this case, the "perl" after "/bin/env"), and everything else was
>>either illegal or ignored.
>>
>>In general, using /bin/env is wrong anyway. Put the right path and
>>you'll be happier.
>>
>>print "Just another Perl hacker,"; # the original

>
>Hey Randal, an aside, when you gonna teach me about regex, I need
>lessons.
>


Don't get me wrong, I've seen at least 1 big regex you did in some
module, but I can remember. I do remember this simple little
regex you posted on this bb some time ago.
(expanded)
" (?: \\. | [^\\"]+ )* "

Wasn't ever sure of why the order of +* until i forced a left to
right discipline in my thought. I hope this is how you wrote it
because its done from memory. Extrordinary unique..

-sln
 
Reply With Quote
 
Justin C
Guest
Posts: n/a
 
      12-31-2010
On 2010-12-30, James <(E-Mail Removed)> wrote:
> Perl scripts with the following first line works in Solaris but fails
> in Linux. Is there a way to make it work in Linux?
>
> #!/bin/env perl -w
> or
> #!/bin/env perl # comment


Sure, move perl to /bin/env - what might be a little easier is building
perl on Linux with /bin/env as the target destination, then you can be
sure that everything is in the right place.

Good luck.

Justin.

--
Justin C, by the sea.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ 7.17 What's the difference between dynamic and lexical (static) scoping? Between local() and my()? PerlFAQ Server Perl Misc 0 04-15-2011 04:00 AM
FAQ 7.17 What's the difference between dynamic and lexical (static) scoping? Between local() and my()? PerlFAQ Server Perl Misc 0 01-06-2011 05:00 PM
Solaris : Difference in g++ and CC compiler for variable length array declaration amjain.gzb@gmail.com C++ 8 01-26-2006 08:37 AM
Difference between bin and obj directories and difference between project references and dll references jakk ASP .Net 4 03-22-2005 09:23 PM
Exact difference between 'const char *' and 'char *', also diff between 'const' and 'static' Santa C Programming 1 07-17-2003 02:10 PM



Advertisments