How to get started

2004-01-21 Thread manu chao
Hi, I just wanted to get started by following the tutorial at
http://www.mactipscafe.com/tip015/
but I get the following error:
'Exec format error. Binary file not executable.'
I did the chmod step as you can see below

[:~/Desktop] xx% chmod 755 helloWorld.pl
[:~/Desktop] xx% ./helloWorld.pl
./helloWorld.pl: Exec format error. Binary file not executable.
Any help would be really appreciated.
Thanks.


Re: How to get started

2004-01-21 Thread Ray Zimmerman
Are you sure you did step 3?  It sounds like you ended up with 
something that isn't a plain text file.

On Jan 21, 2004, at 11:53 AM, manu chao wrote:

Hi, I just wanted to get started by following the tutorial at
http://www.mactipscafe.com/tip015/
but I get the following error:
'Exec format error. Binary file not executable.'
I did the chmod step as you can see below

[:~/Desktop] xx% chmod 755 helloWorld.pl
[:~/Desktop] xx% ./helloWorld.pl
./helloWorld.pl: Exec format error. Binary file not executable.
Any help would be really appreciated.
Thanks.

Ray Zimmerman
Director, Laboratory for Experimental Economics and Decision Research
428-B Phillips Hall, Cornell University, Ithaca, NY 14853
phone:  (607) 255-9645   fax: (815) 377-3932


Re: How to get started

2004-01-21 Thread Doug Leffert
On 21 Jan 2004, at 10:53 AM, manu chao wrote:

Hi, I just wanted to get started by following the tutorial at
http://www.mactipscafe.com/tip015/
but I get the following error:
'Exec format error. Binary file not executable.'
I did the chmod step as you can see below

[:~/Desktop] xx% chmod 755 helloWorld.pl
[:~/Desktop] xx% ./helloWorld.pl
./helloWorld.pl: Exec format error. Binary file not executable.
Any help would be really appreciated.
Thanks.
Did you follow step 3, Select Format-Make Plain Text, before saving?

/doug



Re: How to get started

2004-01-21 Thread Doug McNutt
At 17:53 +0100 1/21/04, manu chao wrote:
Hi, I just wanted to get started by following the tutorial at
http://www.mactipscafe.com/tip015/
but I get the following error:
'Exec format error. Binary file not executable.'

The web page seems to show a space between the exclamation point and the /.. I have 
never put one there and I'm not sure it's an error to do so.

Try, from Terminal

perl  -w  ../helloWorld.pl

The shell will ignore the shebang (#!) line and go directly to perl. The -w flag turns 
on perl's extra warnings.

Also do a ls -l after you do the chmod to be sure the permissions got changed.

It also wouldn't hurt to do cat  helloWorld.pl just to be sure what you expect is 
there. If it has improper line ends or is in RTF format you'll see it.

echo $PATH

to be sure /usr/bin/ is in your search path

which perl

to be sure perl is actually installed.

-- 
--  There are 10 kinds of people:  those who understand binary, and those who don't 
--


Re: How to get started

2004-01-21 Thread manu chao
Thanks, no it was something else, I had saved the file as Unicode-16 
(UTF-16), once I saved it in UTF-8 it worked.

It's one of those things you suspect right away but refuse to check 
because UTF 'should' always work, and if it doesn't, it's the fault of 
somebody else.

Ray Zimmerman wrote:

Are you sure you did step 3?  It sounds like you ended up with something 
that isn't a plain text file.

On Jan 21, 2004, at 11:53 AM, manu chao wrote:

Hi, I just wanted to get started by following the tutorial at
http://www.mactipscafe.com/tip015/
but I get the following error:
'Exec format error. Binary file not executable.'
I did the chmod step as you can see below

[:~/Desktop] xx% chmod 755 helloWorld.pl
[:~/Desktop] xx% ./helloWorld.pl
./helloWorld.pl: Exec format error. Binary file not executable.
Any help would be really appreciated.
Thanks.

Ray Zimmerman
Director, Laboratory for Experimental Economics and Decision Research
428-B Phillips Hall, Cornell University, Ithaca, NY 14853
phone:  (607) 255-9645   fax: (815) 377-3932





Re: How to get started

2004-01-21 Thread John Delacour
At 5:53 pm +0100 21/1/04, manu chao wrote:

Hi, I just wanted to get started by following the tutorial at
http://www.mactipscafe.com/tip015/
but I get the following error:
'Exec format error. Binary file not executable.'
I did the chmod step as you can see below

[:~/Desktop] xx% chmod 755 helloWorld.pl
[:~/Desktop] xx% ./helloWorld.pl
./helloWorld.pl: Exec format error. Binary file not executable.
Any help would be really appreciated.
1.  Your file must have the shebang #!/usr/bin/perl to be executable
2.  The shebang must be followed by a line feed, NOT a carriage return
3.  The whole file will preferably be delimited with line feeds
4.  It is not necessary to have either the shebang or exec permissions
to run the script using $  perl temp.pl
5.  To run it with ./temp.pl, the file must be executable
6.  If you create the file in a text editor, make sure it is saved as plain
text and with line feeds and not carriage returns
7.  The only place where a line feed is absolutely de rigueur is immediately
after the shebang.
Here's something you can try step by step in the Terminal:



xx:~ jd$ cd /tmp   # go to the tmp directory
xx:/tmp jd$# write a test file ...
xx:/tmp jd$ echo '#!/usr/bin/perl
 print Hello\n
 '  temp.pl
xx:/tmp jd$ cat temp.pl # check the result by reading the file...
#!/usr/bin/perl
print Hello\n
xx:/tmp jd$ perl temp.pl  # Have perl run the script
Hello
xx:/tmp jd$ ./temp.pl  # Try running the script as executable
-bash: ./temp.pl: Permission denied
xx:/tmp jd$ chmod +x temp.pl # Make it executable
xx:/tmp jd$ ./temp.pl # Try again
Hello
xx:/tmp jd$