Re: use vars

2005-12-15 Thread Adriano Ferreira
On 12/15/05, Beast <[EMAIL PROTECTED]> wrote: > In perlmodlib : > varsPredeclare global variable names (obsolete) > If this is obselete then what is the newer version of predeclare global > variables? Replace things like use vars qw($FOO) with our $FOO; (

use vars

2005-12-15 Thread Beast
programs/modules. Any better way other than use vars? myconfig: - $input_dir = "/home/yourname/data"; $tmp_dir = "/home/yourname/tmp"; # etc... return 1; myprogram.pl #!/usr/bin/perl use strict; use warnings; use vars qw( $input_dir $tmp_dir); req

Re: What does "use vars '@ISA';@ISA = 'LWP::UserAgent';my $agent = __PACKAGE__->new;"

2005-05-02 Thread Chris Devers
On Mon, 2 May 2005, Siegfried Heintze wrote: > What the heck is going on here? I understand the "use" statements, but the > subsequent statements baffle me. It looks to me like the LWP::UserAgent module is being subclassed. The other way to do this would be to write a proper package declaration

What does "use vars '@ISA';@ISA = 'LWP::UserAgent';my $agent = __PACKAGE__->new;"

2005-05-02 Thread Siegfried Heintze
on here? I understand the "use" statements, but the subsequent statements baffle me. Thanks, Siegfried use LWP; use PromptUtil; use HTTP::Cookies; use HTML::Parser; use URI; use vars '@ISA'; @ISA = 'LWP::UserAgent'; my $agent= __PACKAGE__->new;

RE: our vs. use vars

2003-10-29 Thread Dan Muey
> Dan Muey wrote: > > > Howdy group, > > > > In developing a module and I am torn. > > > > I want to use the newer our $variable; but to make it work with pre > > 5.6 Perl (or whatever version our appeared in) I have to do the use > > vars qw($

Re: our vs. use vars

2003-10-29 Thread Darin McBride
Dan Muey wrote: > Howdy group, > > In developing a module and I am torn. > > I want to use the newer our $variable; but to make it work > with pre 5.6 Perl (or whatever version our appeared in) I > have to do the use vars qw($variable); method > > So I was wantin

RE: our vs. use vars

2003-10-28 Thread Dan Muey
> On Tue, Oct 28, 2003 at 01:44:58PM -0600, Dan Muey wrote: > >> If you don't care about older perls (and 5.005_03 is getting > >> kind of mouldy) then do something like > >> > >> use 5.006; > >> > >> use base qw(Exporter); > > > > And that brings up another issue: > > what is the differ

Re: our vs. use vars

2003-10-28 Thread Steve Grazzini
On Tue, Oct 28, 2003 at 01:44:58PM -0600, Dan Muey wrote: >> If you don't care about older perls (and 5.005_03 is getting >> kind of mouldy) then do something like >> >> use 5.006; >> >> use base qw(Exporter); > > And that brings up another issue: > what is the difference between: >

RE: our vs. use vars

2003-10-28 Thread Dan Muey
ey; > > > > use strict; > > > > if(gotperlv(5.6)) { > > our $bar > > our $foo; > > } else { > > use vars qw($bar $foo); > > } > > > > Except the ours would only apply to that black and wouldn't do too > > muc

Re: our vs. use vars

2003-10-28 Thread Steve Grazzini
> > if(gotperlv(5.6)) { > our $bar > our $foo; > } else { > use vars qw($bar $foo); > } > > Except the ours would only apply to that black and wouldn't do too > much good if I'm understanding this right. And also would it not always > do the use v

RE: our vs. use vars

2003-10-28 Thread Wiggins d Anconia
Many of your questions lately have been wrapped around scoping/packages/symbol tables, etc. have you had a read through: http://perl.plover.com/FAQs/Namespaces.html ?? I found it most informative. http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail

RE: our vs. use vars

2003-10-28 Thread Dan Muey
Hmm ok, what would be nice is to do something like this: (I have a function that returns true if the perl version is the same or higher than the specified number) package Monkey; use strict; if(gotperlv(5.6)) { our $bar our $foo; } else { use vars qw($bar $foo

RE: our vs. use vars

2003-10-28 Thread Dan Muey
> "use vars" and "our" do roughly the same thing. They both > let you use package variables under strict without fully-qualifying. > > All these code snippets pass strict, and they each set the > package variable $foo ($A::foo, $B::foo

Re: our vs. use vars

2003-10-28 Thread Steve Grazzini
On Tue, Oct 28, 2003 at 10:52:16AM -0600, Dan Muey wrote: > I want to use the newer our $variable; but to make it work > with pre 5.6 Perl (or whatever version our appeared in) I > have to do the use vars qw($variable); method > > So I was wanting some input about pros an

Re: our vs. use vars

2003-10-28 Thread Rob Dixon
Dan Muey wrote: > > Rob Dixon wrote: > > > > Dan Muey wrote: > > > > > > In developing a module and I am torn. > > > > > > I want to use the newer our $variable; but to make it work > > > with pre 5.6 Perl (or whatever version our app

RE: our vs. use vars

2003-10-28 Thread Dan Muey
> Dan Muey wrote: > > > > In developing a module and I am torn. > > > > I want to use the newer our $variable; but to make it work with pre > > 5.6 Perl (or whatever version our appeared in) I have to do the use > > vars qw($variable); method > > &

Re: our vs. use vars

2003-10-28 Thread Rob Dixon
Dan Muey wrote: > > In developing a module and I am torn. > > I want to use the newer our $variable; but to make it work > with pre 5.6 Perl (or whatever version our appeared in) I > have to do the use vars qw($variable); method > > So I was wanting some input about pros an

our vs. use vars

2003-10-28 Thread Dan Muey
Howdy group, In developing a module and I am torn. I want to use the newer our $variable; but to make it work with pre 5.6 Perl (or whatever version our appeared in) I have to do the use vars qw($variable); method So I was wanting some input about pros and cons of using either since on the

Re: our v. use vars - wasRe: use Getopt::Std; and use strict;

2002-05-11 Thread Paul Johnson
On Sat, May 11, 2002 at 08:43:13AM -0700, drieux wrote: > > On Friday, May 10, 2002, at 07:07 , Tanton Gibbs wrote: > > >Yes you can say > > > >our $opt_m; > > > >or > > > >use vars qw($opt_m); > > > >at the top of your program (de

Re: our v. use vars - wasRe: use Getopt::Std; and use strict;

2002-05-11 Thread Felix Geerinckx
on Sat, 11 May 2002 18:10:41 GMT, Jonathan e. paton wrote: > You've never seen the implementation of 'use vars' then :) The > tail end of which is: > [...] > Which I assure you has a LOT to do with importing into symbol tables. > This is the reason 'use v

Re: our v. use vars - wasRe: use Getopt::Std; and use strict;

2002-05-11 Thread Jonathan E. Paton
> > Note that 'use vars' is supposedly depreciated, so don't > > use it if your script depends on 5.6 features. Placing > > 'our' in a lexical scope probably makes it externally > > visible until you leave the scope, 'use vars&#x

Re: our v. use vars - wasRe: use Getopt::Std; and use strict;

2002-05-11 Thread Felix Geerinckx
on Sat, 11 May 2002 17:00:27 GMT, Jonathan e. paton wrote: > Note that 'use vars' is supposedly depreciated, so don't > use it if your script depends on 5.6 features. Placing > 'our' in a lexical scope probably makes it externally > visible until you leave

Re: our v. use vars - wasRe: use Getopt::Std; and use strict;

2002-05-11 Thread Jonathan E. Paton
> > Yes you can say > > > > our $opt_m; > > > > or > > > > use vars qw($opt_m); > > > > at the top of your program (depending on perl version). > > I've been preached the orthodoxy of the later - but > have never understood the

Re: our v. use vars - wasRe: use Getopt::Std; and use strict;

2002-05-11 Thread Jonathan E. Paton
> > Yes you can say > > > > our $opt_m; > > > > or > > > > use vars qw($opt_m); > > > > at the top of your program (depending on perl version). > > I've been preached the orthodoxy of the later - but > have never understood the

our v. use vars - wasRe: use Getopt::Std; and use strict;

2002-05-11 Thread drieux
On Friday, May 10, 2002, at 07:07 , Tanton Gibbs wrote: > Yes you can say > > our $opt_m; > > or > > use vars qw($opt_m); > > at the top of your program (depending on perl version). I've been preached the orthodoxy of the later - but have never understood th

Re: Global Variables: 'my' vs 'use vars'

2002-03-28 Thread Chas Owens
On Thu, 2002-03-28 at 14:55, [EMAIL PROTECTED] wrote: > Hello, All: > > I've never been very good at scoping so it it's no surprise that this > confuses me: > > When declaring variables at the beginning of a script, what is the > difference between 'm

Global Variables: 'my' vs 'use vars'

2002-03-28 Thread eric-perl
Hello, All: I've never been very good at scoping so it it's no surprise that this confuses me: When declaring variables at the beginning of a script, what is the difference between 'my' and 'use vars'? -- Eric P. Los Gatos, CA -- To unsubscribe,