Perl Scripts

Joined
Jun 4, 2016
Messages
1
Reaction score
0
Points
1
i'm attempting to create perl scripts, my first hurtle, the .bashrc is not sourced when I launch the terminal. My experience years ago was to create both C-Shell and perl scripts on Sun, SGI, etc unix hardware. Now I'm having difficulity executing the simple "hello world" test. Any suggestions to get me off this hurtle. Does the first line get the "#!/usr/bin/perl" yes or no? the file is 744 so it is executable.
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
Make sure your shebang shows the proper location for perl. As I recall, you have to install xcode for perl. But, if I do a 'which perl' it shows as /usr/bin/perl

Also, OS X should use ~/.bash_profile, ~/.bash_login, and ~/.profile instead of ~/.bashrc I believe.
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
.bash_profile will read a .bashrc if it exists.
Mine has:

Code:
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
.bash_profile will read a .bashrc if it exists.
Mine has:

Code:
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
Cool! I've always used .profile on OS X because I had issues with .bashrc being sourced a long time ago
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top