home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / Chip_2000-05_cd1.bin / zkuste / Perl / ActivePerl-5.6.0.613.msi / 䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥 / _ea1618444cfb1823bf08d70de2a49090 < prev    next >
Text File  |  2000-03-23  |  4KB  |  108 lines

  1.  
  2. <HTML>
  3. <HEAD>
  4. <TITLE>FindBin - Locate directory of original perl script</TITLE>
  5. <LINK REL="stylesheet" HREF="../Active.css" TYPE="text/css">
  6. <LINK REV="made" HREF="mailto:">
  7. </HEAD>
  8.  
  9. <BODY>
  10. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  11. <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
  12. <STRONG><P CLASS=block> FindBin - Locate directory of original perl script</P></STRONG>
  13. </TD></TR>
  14. </TABLE>
  15.  
  16. <A NAME="__index__"></A>
  17. <!-- INDEX BEGIN -->
  18.  
  19. <UL>
  20.  
  21.     <LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
  22.  
  23.     <LI><A HREF="#synopsis">SYNOPSIS</A></LI>
  24.     <LI><A HREF="#description">DESCRIPTION</A></LI>
  25.     <LI><A HREF="#exportable variables">EXPORTABLE VARIABLES</A></LI>
  26.     <LI><A HREF="#known bugs">KNOWN BUGS</A></LI>
  27.     <LI><A HREF="#authors">AUTHORS</A></LI>
  28.     <LI><A HREF="#copyright">COPYRIGHT</A></LI>
  29. </UL>
  30. <!-- INDEX END -->
  31.  
  32. <HR>
  33. <P>
  34. <H1><A NAME="name">NAME</A></H1>
  35. <P>FindBin - Locate directory of original perl script</P>
  36. <P>
  37. <HR>
  38. <H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
  39. <UL>
  40. <LI>Linux</LI>
  41. <LI>Solaris</LI>
  42. <LI>Windows</LI>
  43. </UL>
  44. <HR>
  45. <H1><A NAME="synopsis">SYNOPSIS</A></H1>
  46. <PRE>
  47.  use FindBin;
  48.  use lib "$FindBin::Bin/../lib";</PRE>
  49. <PRE>
  50.  or</PRE>
  51. <PRE>
  52.  use FindBin qw($Bin);
  53.  use lib "$Bin/../lib";</PRE>
  54. <P>
  55. <HR>
  56. <H1><A NAME="description">DESCRIPTION</A></H1>
  57. <P>Locates the full path to the script bin directory to allow the use
  58. of paths relative to the bin directory.</P>
  59. <P>This allows a user to setup a directory tree for some software with
  60. directories <root>/bin and <root>/lib and then the above example will allow
  61. the use of modules in the lib directory without knowing where the software
  62. tree is installed.</P>
  63. <P>If perl is invoked using the <STRONG>-e</STRONG> option or the perl script is read from
  64. <CODE>STDIN</CODE> then FindBin sets both <CODE>$Bin</CODE> and <CODE>$RealBin</CODE> to the current
  65. directory.</P>
  66. <P>
  67. <HR>
  68. <H1><A NAME="exportable variables">EXPORTABLE VARIABLES</A></H1>
  69. <PRE>
  70.  $Bin         - path to bin directory from where script was invoked
  71.  $Script      - basename of script from which perl was invoked
  72.  $RealBin     - $Bin with all links resolved
  73.  $RealScript  - $Script with all links resolved</PRE>
  74. <P>
  75. <HR>
  76. <H1><A NAME="known bugs">KNOWN BUGS</A></H1>
  77. <P>if perl is invoked as</P>
  78. <PRE>
  79.    perl filename</PRE>
  80. <P>and <EM>filename</EM> does not have executable rights and a program called <EM>filename</EM>
  81. exists in the users <CODE>$ENV{PATH}</CODE> which satisfies both <STRONG>-x</STRONG> and <STRONG>-T</STRONG> then FindBin
  82. assumes that it was invoked via the <CODE>$ENV{PATH}</CODE>.</P>
  83. <P>Workaround is to invoke perl as</P>
  84. <PRE>
  85.  perl ./filename</PRE>
  86. <P>
  87. <HR>
  88. <H1><A NAME="authors">AUTHORS</A></H1>
  89. <P>FindBin is supported as part of the core perl distribution. Please send bug
  90. reports to <<EM><A HREF="mailto:perlbug@perl.org">perlbug@perl.org</A></EM>> using the perlbug program included with perl.</P>
  91. <P>Graham Barr <<EM><A HREF="mailto:gbarr@pobox.com">gbarr@pobox.com</A></EM>>
  92. Nick Ing-Simmons <<EM><A HREF="mailto:nik@tiuk.ti.com">nik@tiuk.ti.com</A></EM>></P>
  93. <P>
  94. <HR>
  95. <H1><A NAME="copyright">COPYRIGHT</A></H1>
  96. <P>Copyright (c) 1995 Graham Barr & Nick Ing-Simmons. All rights reserved.
  97. This program is free software; you can redistribute it and/or modify it
  98. under the same terms as Perl itself.</P>
  99. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  100. <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
  101. <STRONG><P CLASS=block> FindBin - Locate directory of original perl script</P></STRONG>
  102. </TD></TR>
  103. </TABLE>
  104.  
  105. </BODY>
  106.  
  107. </HTML>
  108.