Re: [newbie] Perl script is not able to execute

2002-01-30 Thread Anuerin G. Diaz


the directory containing perl was in your PATH variable while the current directory is 
not (its a security measure). the '#!' on the first line simply means that the file 
contains commands to be interpreted by the interpreter following these symbols (i 
think they are called magic numbers or something).

whenever executing a script/executable in the current directory, make sure of the 
following

   * check the permissions, you should have read _and_ execute permissions.
   * if the current directory is not included in the PATH (type echo $PATH to check), 
prepend ./ to the script/executable name (e.g. ./test.pl)


hth.

On Wed, 30 Jan 2002 03:28:24 -0500
Daniel Chen [EMAIL PROTECTED] revealed these words to me:

 Hi,
 
 I am using Mandrake 8.1 with bash shell.
 Today is my first time using perl script. I read from the book said if I
 add #!/usr/bin/perl to the first line of my perl script, I can execute
 the script by just typing the name of the script into the command line.
 I have set the permission of this test.pl to 777
 
 However, when I did that, the shell gave me a error message said 
 bash: test.pl: command not found
 
 If I type
 perl test.pl
 or
 /usr/bin/perl test.pl
 then the perl script will work perfectly
 
 Please help me!
 
 Daniel
 
 
 


-- 

Programming, an artform that fights back.

=
Anuerin G. Diaz
Design Engineer
Millennium Software, Incorporated
2305 B West Tower, Philippines Stocks Exchange Center,
Exchange Road, Ortigas Center, Pasig City

Tel# 638-3070 loc. 72
Fax# 638-3079
=




Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



RE: [newbie] Perl script is not able to execute

2002-01-30 Thread FLYNN, Steve

./perl.pl

You probably don't have the current directory in your search path, so when
you issue the perl.pl command, the machine looks everywhere, apart from the
current directory.

Either get into the habit of specifying ./command or add ./ to your search
path. Be aware that many people do not advocate adding ./ to your standard
search path and would recommend you get into the habit of prepending ./ when
necessary.

-Original Message-
From:   Daniel Chen [SMTP:[EMAIL PROTECTED]]
Sent:   Wednesday, January 30, 2002 8:28 AM
To: Linux newbie
Subject:[newbie] Perl script is not able to execute

Hi,

I am using Mandrake 8.1 with bash shell.
Today is my first time using perl script. I read from the book said
if I
add #!/usr/bin/perl to the first line of my perl script, I can
execute
the script by just typing the name of the script into the command
line.
I have set the permission of this test.pl to 777

However, when I did that, the shell gave me a error message said 
bash: test.pl: command not found

If I type
perl test.pl
or
/usr/bin/perl test.pl
then the perl script will work perfectly

Please help me!

Daniel
  File: message.footer  


**
This email and any files sent with it are intended only for the named 
recipient. If you are not the named recipient please telephone/email  
the sender immediately. You should not disclose the content or
take/retain/distribute any copies.
**


Norwich Union Life  Pensions Limited
Registered Office 2 Rougier Street
York YO90 1UU
Registered in England Number 3253947
A member of the Norwich Union Marketing Group 
which is regulated by the Personal Investment Authority. 
Member of the Association of British Insurers.

For further Enquires 01603 622200 



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



Re: [newbie] Perl script is not able to execute

2002-01-30 Thread Anuerin G.Diaz

On Wed, 30 Jan 2002 04:41:04 -0500
Daniel Chen [EMAIL PROTECTED] revealed these words to me:

 Hi,
 
 Thank you for quickly answer my question, but the problem still there!
 Now, the bash shell gave me another wrong message:
 bash: /usr/bin/test.pl: no such file or directory
 
 When I put ./test.pl, it shows:
 bash: /usr/bin/test.pl: bad interpreter: no such file or directory
 
 Please help me again, thank you!
 
 
 Daniel
 

i have no knowledge of perl (although im planning to, it just keeps on getting on the 
backburner), but i think the problem is not directly perl related.

i was able to simulate your output 

[adiaz@Ronin tmp]$ ./test.pl
bash: ./test.pl: bad interpreter: No such file or directory

and test.pl contained in its first line the entry (without the quotes) 
#!/usr/bin/test.pl

but when i substitute this line #!/bin/perl

i get this one

[adiaz@Ronin tmp]$ ./test.pl 
syntax error at ./test.pl line 5, at EOF
Execution of ./test.pl aborted due to compilation errors.
[adiaz@Ronin tmp]$ 

hey, i told you i dont know perl ;-). but i think you get my point.

ciao!

-- 

Programming, an artform that fights back.

=
Anuerin G. Diaz
Design Engineer
Millennium Software, Incorporated
2305 B West Tower, Philippines Stocks Exchange Center,
Exchange Road, Ortigas Center, Pasig City

Tel# 638-3070 loc. 72
Fax# 638-3079
=




Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



Re: [newbie] Perl script is not able to execute

2002-01-30 Thread John Cichy

On Thursday 31 January 2002 09:19, Anuerin G.Diaz wrote:
[snip]
 and test.pl contained in its first line the entry (without the quotes)
 #!/usr/bin/test.pl

 but when i substitute this line #!/bin/perl

This is the correct first line of a perl script if perl resides in /bin. The 
first line of a perl script needs to contain the location of the interpreter.

 i get this one

 [adiaz@Ronin tmp]$ ./test.pl
 syntax error at ./test.pl line 5, at EOF
 Execution of ./test.pl aborted due to compilation errors.

I think you got this because there was no linefeed at the end of this first 
line.

John



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



Re: [newbie] Perl script is not able to execute

2002-01-30 Thread Anuerin G.Diaz

On Wed, 30 Jan 2002 20:39:14 -0500
John Cichy [EMAIL PROTECTED] revealed these words to me:

 On Thursday 31 January 2002 09:19, Anuerin G.Diaz wrote:
 [snip]
  and test.pl contained in its first line the entry (without the quotes)
  #!/usr/bin/test.pl
 
  but when i substitute this line #!/bin/perl
 
 This is the correct first line of a perl script if perl resides in /bin. The 
 first line of a perl script needs to contain the location of the interpreter.
 
  i get this one
 
  [adiaz@Ronin tmp]$ ./test.pl
  syntax error at ./test.pl line 5, at EOF
  Execution of ./test.pl aborted due to compilation errors.
 
 I think you got this because there was no linefeed at the end of this first 
 line.
 
 John
 

nope, i expected it not to compile because i know nothing about perl syntax. i just 
entered an echo statement (i guess perl has another syntax for echo, hehehehe)  there 
hoping to invoke the perl interpreter. since the objective was to correctly call the 
perl interpreter and simulate the error messages of the original poster, i think the 
dummy script served its purpose. *grin*

 
 

ciao!

-- 

Programming, an artform that fights back.

=
Anuerin G. Diaz
Design Engineer
Millennium Software, Incorporated
2305 B West Tower, Philippines Stocks Exchange Center,
Exchange Road, Ortigas Center, Pasig City

Tel# 638-3070 loc. 72
Fax# 638-3079
=




Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com