Author Topic: Perl And Path  (Read 3588 times)

laur

  • Newbie
  • *
  • Posts: 41
    • View Profile
Perl And Path
« on: March 07, 2006, 12:04:53 pm »
I am starting to work with perl on my C1000 is there a way to add Perl to the Path Variable?
If So How and where do I find the file to add it and  of course what do I add?
[span style=\'font-size:8pt;line-height:100%\']Proud owner of a C1000, Cacko ROM v1.23 (Named Gimlet)
SanDisk SD 32MB
PNY CF 1GB
Mini USBHost Connector
Cables Unlimited BT Dongle
DLINK DCF 660W 802.11b
[/span]

datajerk

  • Full Member
  • ***
  • Posts: 219
    • View Profile
    • http://
Perl And Path
« Reply #1 on: March 07, 2006, 02:38:55 pm »
Edit ~/.bashrc, add export PATH=$PATH:/path_perl

laur

  • Newbie
  • *
  • Posts: 41
    • View Profile
Perl And Path
« Reply #2 on: March 07, 2006, 03:35:12 pm »
Quote
Edit ~/.bashrc, add export PATH=$PATH:/path_perl
[div align=\"right\"][a href=\"index.php?act=findpost&pid=117440\"][{POST_SNAPBACK}][/a][/div]

Alright, I am new to this, what is '~/' - is that my home directory?
I did a search for .bashrc and could not find the file - I found the .profile file and that has a Path variable in it - should I change that?

Thanks,
(I hated having to always enter the entire thing )  
« Last Edit: March 07, 2006, 04:28:12 pm by laur »
[span style=\'font-size:8pt;line-height:100%\']Proud owner of a C1000, Cacko ROM v1.23 (Named Gimlet)
SanDisk SD 32MB
PNY CF 1GB
Mini USBHost Connector
Cables Unlimited BT Dongle
DLINK DCF 660W 802.11b
[/span]

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Perl And Path
« Reply #3 on: March 07, 2006, 08:07:42 pm »
Quote
Quote
Edit ~/.bashrc, add export PATH=$PATH:/path_perl
[div align=\"right\"][a href=\"index.php?act=findpost&pid=117440\"][{POST_SNAPBACK}][/a][/div]

Alright, I am new to this, what is '~/' - is that my home directory?
I did a search for .bashrc and could not find the file - I found the .profile file and that has a Path variable in it - should I change that?

Thanks,
(I hated having to always enter the entire thing )  
[div align=\"right\"][a href=\"index.php?act=findpost&pid=117447\"][{POST_SNAPBACK}][/a][/div]

The ~ is substituted with the value of $HOME in most shells so instead of eg providing /home/zaurus all the time, you can just specify ~

Most shells have their own rc script file, but they also usually default to .profile as well if their own rc file does not exist, so in case of bash, it will look for ~/.bashrc first, then ~/.profile

As a side, why do you need to specify the path to perl? perl usually installs to /usr/bin/perl or /usr/local/bin/perl or at least is symlinked to those locations and those should be in the default path anyway. besides, don't you specify the perl header in your perl scripts? if you do that you can just execute the script directly and it will find perl by itself.

eg:
Code: [Select]
#!/usr/local/bin/perl -w
print("Hi, this is a perl script,\n");
« Last Edit: March 07, 2006, 08:09:19 pm by Meanie »
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

laur

  • Newbie
  • *
  • Posts: 41
    • View Profile
Perl And Path
« Reply #4 on: March 08, 2006, 01:16:19 pm »
Quote
The ~ is substituted with the value of $HOME in most shells so instead of eg providing /home/zaurus all the time, you can just specify ~

Most shells have their own rc script file, but they also usually default to .profile as well if their own rc file does not exist, so in case of bash, it will look for ~/.bashrc first, then ~/.profile

As a side, why do you need to specify the path to perl? perl usually installs to /usr/bin/perl or /usr/local/bin/perl or at least is symlinked to those locations and those should be in the default path anyway. besides, don't you specify the perl header in your perl scripts? if you do that you can just execute the script directly and it will find perl by itself.

eg:
Code: [Select]
#!/usr/local/bin/perl -w
print("Hi, this is a perl script,\n");
[div align=\"right\"][a href=\"index.php?act=findpost&pid=117483\"][{POST_SNAPBACK}][/a][/div]

I am new to perl too  
I am trying to learn perl (as well as the Linux/Zaurus OS) by writing a script to back up my documents directory to my CF card.
[span style=\'font-size:8pt;line-height:100%\']Proud owner of a C1000, Cacko ROM v1.23 (Named Gimlet)
SanDisk SD 32MB
PNY CF 1GB
Mini USBHost Connector
Cables Unlimited BT Dongle
DLINK DCF 660W 802.11b
[/span]