[26725] in Perl-Users-Digest
Perl-Users Digest, Issue: 8818 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 2 11:05:30 2006
Date: Mon, 2 Jan 2006 08:05:05 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 2 Jan 2006 Volume: 10 Number: 8818
Today's topics:
Re: Increment Numbers <tadmc@augustmail.com>
Re: Shebang not working <issakov@t-online.de>
Re: Shebang not working <noreply@gunnar.cc>
Re: Shebang not working <josef.moellers@fujitsu-siemens.com>
Re: Shebang not working <bob@dont.spam.me>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 2 Jan 2006 08:02:52 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Increment Numbers
Message-Id: <slrndrickc.qlq.tadmc@magna.augustmail.com>
Chris Ellison <cjellison@ucdavis.edu> wrote:
> rename 's/(\d{3})/something/' *
> but I don't know how to do operations within a regular expression.
That's OK because you don't want to do an operation within
a regular expression, you want to do an operation within
the REPLACEMENT part of the s/// operator (which is (by default)
a string, not a regex).
> Any suggestions?
Read the entry for s/// in perlop.pod, until you get to this part:
e Evaluate the right side as an expression.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 02 Jan 2006 12:14:03 +0100
From: Mihail <issakov@t-online.de>
Subject: Re: Shebang not working
Message-Id: <dpb1tr$642$01$1@news.t-online.com>
I can reproduce your problem with DOS-edited file.
The character at the end of the string confuse the
interpreter.
Regards,
Mihail
Sam CARMALT wrote:
> I'm having trouble launching a Perl script with the shebang operator.
> OS is SuSE 9.2 Professional. So far, I haven't had any helpful
> insights at comp.os.linux.suse, and hope this isn't too far from Perl
> to post here.
>
> Complete Perl script:
>
> #! /usr/bin/perl
>
> print "Hello, World\n";
>
> This is contained in a file of 3 lines, left-justified, created with
> vi. It is saved with a directory entry of
>
> -rwxrwxrwx 1 root root 44 Dec 31 15:32 hworld.pl
>
> In the /usr/bin directory, I find the following entry
>
> -rwxr-wr-w 3 root root 1160321 Oct 2 2004 perl
>
> which leads me to believe that permissions are OK.
>
> Now, here is how things work:
>
> #perl hworld.pl
> Hello, World
> #hworld.pl
> bash: hworld.pl: command not found
> #./hworld.pl
> bash: ./hworld.pl: /usr/bin/perl: bad interpreter: Permission denied
> # ./hworld.pl
> bash: ./hworld.pl: /usr/bin/perl: bad interpreter: Permission denied
> #. hworld
> bash: hworld: No such file or directory
> #. hworld.pl
> bash: print: command not found
> #
>
> From these I conclude that there is something going wrong with the
> shebang line and getting started. Any pointers as to what I need to
> change will be appreciated. (Obviously, I need to fix this in order
> to use Perl in a CGI environment :)].
>
> Thanks and regards,
> Sam
>
>
------------------------------
Date: Mon, 02 Jan 2006 12:53:47 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Shebang not working
Message-Id: <41siehF1g5npuU1@individual.net>
Sam CARMALT wrote:
> I'm having trouble launching a Perl script with the shebang operator.
> OS is SuSE 9.2 Professional. So far, I haven't had any helpful
> insights at comp.os.linux.suse, and hope this isn't too far from Perl
> to post here.
>
> Complete Perl script:
>
> #! /usr/bin/perl
>
> print "Hello, World\n";
>
> This is contained in a file of 3 lines, left-justified, created with
> vi. It is saved with a directory entry of
>
> -rwxrwxrwx 1 root root 44 Dec 31 15:32 hworld.pl
----------^
World writable? Why? Change that to the 'standard'
-rwxr-xr-x
> In the /usr/bin directory, I find the following entry
>
> -rwxr-wr-w 3 root root 1160321 Oct 2 2004 perl
--------^--^
Typos? Should better be:
-rwxr-xr-x
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Mon, 02 Jan 2006 13:10:45 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: Shebang not working
Message-Id: <dpb513$gg7$1@nntp.fujitsu-siemens.com>
Mihail wrote:
> I can reproduce your problem with DOS-edited file.
> The character at the end of the string confuse the
> interpreter.
No, you most likely can't. The error message in your case is very cryptic=
:
josef@bounty:~> ./test.pl
: bad interpreter: No such file or directory
josef@bounty:~> perl test.pl
Hello, world
The CR ath the end of the shebang line will cause the error message to=20
get scrambled. You can see it, if you run the program using script:
^[]2;josef@bounty:~^G^[]1;bounty^Gjosef@bounty:~> ./test.pl^M
bash: ./test.pl: /usr/bin/perl^M: bad interpreter: No such file or=20
directory^M
> Sam CARMALT wrote:
>> #perl hworld.pl
>> Hello, World
>> #hworld.pl
>> bash: hworld.pl: command not found
>> #./hworld.pl
>> bash: ./hworld.pl: /usr/bin/perl: bad interpreter: Permission denied
>> # ./hworld.pl
>> bash: ./hworld.pl: /usr/bin/perl: bad interpreter: Permission denied
>> #. hworld
>> bash: hworld: No such file or directory
>> #. hworld.pl
>> bash: print: command not found
What about "perl hworld.pl"?
--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
------------------------------
Date: Mon, 02 Jan 2006 12:46:35 GMT
From: Bob <bob@dont.spam.me>
Subject: Re: Shebang not working
Message-Id: <pan.2006.01.02.12.46.35.7504@dont.spam.me>
On Mon, 02 Jan 2006 11:06:28 +0100, Sam CARMALT wrote:
> I'm having trouble launching a Perl script with the shebang operator. OS
> is SuSE 9.2 Professional. So far, I haven't had any helpful insights at
> comp.os.linux.suse, and hope this isn't too far from Perl to post here.
>
> Complete Perl script:
>
> #! /usr/bin/perl
>
> print "Hello, World\n";
>
> This is contained in a file of 3 lines, left-justified, created with vi.
> It is saved with a directory entry of
>
> -rwxrwxrwx 1 root root 44 Dec 31 15:32 hworld.pl
>
> In the /usr/bin directory, I find the following entry
>
> -rwxr-wr-w 3 root root 1160321 Oct 2 2004 perl
There is something wrong here. There is no such set of permissions as
"-rwxr-wr-w". They *should* be "-rwxr-xr-x". If that's what they really
are and you just wrote them down wrong when posting here I can't explain
your problem.
If they are actually "-rwxrw-rw-" the perhaps you aren't running the
script as root. (I know the part of your message that I clipped shows that
you *are* running as root, but if you got those permissions wrong perhaps
you got that wrong as well.)
Bob
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 8818
***************************************