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

  1.  
  2. <HTML>
  3. <HEAD>
  4. <TITLE>vars - Perl pragma to predeclare global variable names</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> vars - Perl pragma to predeclare global variable names</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. </UL>
  26. <!-- INDEX END -->
  27.  
  28. <HR>
  29. <P>
  30. <H1><A NAME="name">NAME</A></H1>
  31. <P>vars - Perl pragma to predeclare global variable names (obsolete)</P>
  32. <P>
  33. <HR>
  34. <H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
  35. <UL>
  36. <LI>Linux</LI>
  37. <LI>Solaris</LI>
  38. <LI>Windows</LI>
  39. </UL>
  40. <HR>
  41. <H1><A NAME="synopsis">SYNOPSIS</A></H1>
  42. <PRE>
  43.     use vars qw($frob @mung %seen);</PRE>
  44. <P>
  45. <HR>
  46. <H1><A NAME="description">DESCRIPTION</A></H1>
  47. <P>NOTE: The functionality provided by this pragma has been superseded
  48. by <A HREF="../lib/Pod/perlfunc.html#item_our"><CODE>our</CODE></A> declarations, available in Perl v5.6.0 or later.  See
  49. <A HREF="../lib/Pod/perlfunc.html#our">our in the perlfunc manpage</A>.</P>
  50. <P>This will predeclare all the variables whose names are 
  51. in the list, allowing you to use them under ``use strict'', and
  52. disabling any typo warnings.</P>
  53. <P>Unlike pragmas that affect the <CODE>$^H</CODE> hints variable, the <CODE>use vars</CODE> and
  54. <CODE>use subs</CODE> declarations are not BLOCK-scoped.  They are thus effective
  55. for the entire file in which they appear.  You may not rescind such
  56. declarations with <CODE>no vars</CODE> or <CODE>no subs</CODE>.</P>
  57. <P>Packages such as the <STRONG>AutoLoader</STRONG> and <STRONG>SelfLoader</STRONG> that delay
  58. loading of subroutines within packages can create problems with
  59. package lexicals defined using <A HREF="../lib/Pod/perlfunc.html#item_my"><CODE>my()</CODE></A>. While the <STRONG>vars</STRONG> pragma
  60. cannot duplicate the effect of package lexicals (total transparency
  61. outside of the package), it can act as an acceptable substitute by
  62. pre-declaring global symbols, ensuring their availability to the
  63. later-loaded routines.</P>
  64. <P>See <A HREF="../lib/Pod/perlmodlib.html#pragmatic modules">Pragmatic Modules in the perlmodlib manpage</A>.</P>
  65. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  66. <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
  67. <STRONG><P CLASS=block> vars - Perl pragma to predeclare global variable names</P></STRONG>
  68. </TD></TR>
  69. </TABLE>
  70.  
  71. </BODY>
  72.  
  73. </HTML>
  74.