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;
(
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
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
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;
> 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($
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
> 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
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:
>
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
>
> 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
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
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
> "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
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
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
> 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
> >
&
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
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
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
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
> > 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
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
> > 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
> > 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
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
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
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,
27 matches
Mail list logo