SPUG: geting variables from a 'required' file

ced at carios2.ca.boeing.com ced at carios2.ca.boeing.com
Mon May 14 15:32:21 CDT 2001



>our ($var1,$var2);
>require 'vars.pl';
> print $var1, "\t", $var2, "\n";

>but not with 5.005 and if I use 'my' instead of 'our' the values of $var1
>and $var2 are NULL.  Is there a way (with 5.005) to declare the variables
>so this will work and 'use strict' won't complain?

use vars ($var1 $var2);


(I think you'll have to use globals because of scoping problems);


Hope this helps,
--
Charles DeRykus

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/





More information about the spug-list mailing list