Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Perl / August 2003



Tip: Looking for answers? Try searching our database.

making Perl scripts run

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Charlie Root - 28 Aug 2003 00:56 GMT
mrsparkle ellem ~/code $ phonetic.pl
bash: phonetic.pl: command not found
mrsparkle ellem ~/code $ sudo chmod +x phonetic.pl
Password:
mrsparkle ellem ~/code $ phonetic.pl
bash: phonetic.pl: command not found
mrsparkle ellem ~/code $ perl phonetic.pl
Enter some letters and numbers:  ASF19
alpha
sierra
foxtrot
one
niner

mrsparkle ellem ~/code $

What am I doing wrong?  I'd like perl scripts to work without my typing
perl first.
--
Lou Moran
ellem@optonline.net
http://ellem.is-a-geek.org:5280/
http://homepage.mac.com/ellem52/
Dave Gomez - 28 Aug 2003 01:16 GMT
Lou,
   try .\phonetic.pl and also make sure the first line contains
#!/usr/bin/perl (or variants which enable strict etc).  If the first thing
works, all you need to do is add .\ into your paths within the .bashrc file.

Dave Gomez

> mrsparkle ellem ~/code $ phonetic.pl
> bash: phonetic.pl: command not found
[quoted text clipped - 19 lines]
> http://ellem.is-a-geek.org:5280/
> http://homepage.mac.com/ellem52/
Gene - 28 Aug 2003 02:21 GMT
> mrsparkle ellem ~/code $ phonetic.pl
> bash: phonetic.pl: command not found
[quoted text clipped - 12 lines]
> What am I doing wrong?  I'd like perl scripts to work without my
> typing perl first.

phonetic.pl is not in your path.  If you try:
./phonetic.pl
it should run.

If you are running the default shell, tcsh, you can add the following
line to ~/.cshrc:

setenv PATH ${PATH}:.

That way the current directory (.) is always in your path.

------------
smalltime industries
www.smalltime.com
Now in 2D!
Ken Williams - 28 Aug 2003 15:17 GMT
Hi Lou,

 1) you can run 'chmod' without being root, as long as you own the file

 2) if '.' isn't in your path, you'll have to type ./phonetic.pl

 3) the "command not found" error may indicate that the "shebang"
(#!/usr/bin/perl) line is wrong - it's good to remember that in the
future because it's a somewhat confusing error message, though
technically accurate.

 -Ken

> mrsparkle ellem ~/code $ phonetic.pl
> bash: phonetic.pl: command not found
[quoted text clipped - 19 lines]
> http://ellem.is-a-geek.org:5280/
> http://homepage.mac.com/ellem52/
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.