On Mar 4, 2015, at 8:15 PM, Brandon McCaig wrote:
That could matter in rare, silly cases. In most cases, it
wouldn't really matter (usually we require modules and assert
versions at the beginning of a program or module before anything
else is actually done).
That explains it.
On 5 March 2015 at 17:15, Brandon McCaig bamcc...@gmail.com wrote:
Uri means that use is
effectively requiring the module with a BEGIN block. That means
that it will execute before any other code that isn't in a BEGIN
block.
It may also be worth mentioning that BEGIN is actually a sub. A
Hi all,
I'm just curious about something. What's the difference between using
require 5.016;
or
use 5.016;
The only thing I've seen is that if 5.16 isn't installed, 'use' outputs:
Perl v5.16 required--this is only v5.10.1, stopped at shop.cgi line 26.
BEGIN failed
On 03/04/2015 09:12 PM, SSC_perl wrote:
Hi all,
I'm just curious about something. What's the difference between using
require 5.016;
or
use 5.016;
The only thing I've seen is that if 5.16 isn't installed, 'use' outputs:
Perl v5.16 required--this is only v5.10.1, stopped
On Mar 4, 2015, at 6:14 PM, Uri Guttman wrote:
it is more about when the check is done. use is done at compile time and
require is done at run time. also use effectively calls require to load the
module and then it may do importing as well. when a module is loaded it will
run any use
On 03/04/2015 11:15 PM, Brandon McCaig wrote:
I think that generally you should be using `use' unless you have a
specific need to use require directly. `use' will call require() under
the surface when needed so to you it's basically the same, but it has
added benefits that make sense generally
then and there before
any consequences can be carried out.
I think that generally you should be using `use' unless you have
a specific need to use require directly. `use' will call
require() under the surface when needed so to you it's basically
the same, but it has added benefits that make sense generally
Chas. Owens wrote:
[trim]
$string =~ s/^[ ]*(.*)[ ]*$/$1/;
That changes the string when not necessary.
I prefer this:
s/\s+$//, s/^\s+// for $string; # rtrim + ltrim
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail:
Hi Everyone,
I am could never understand the difference between use vs require? If
require is older way of including modules, why not just make it obsolete.
Thanks,
-Bandeep
Hi ben,
ben perl wrote:
Hi Everyone,
I am could never understand the difference between use vs require? If
require is older way of including modules, why not just make it obsolete.
nope there's even more than that.
use loads the source when starting the script.
require just loads it when
On Thu, Jan 22, 2009 at 17:33, ben perl ben.pe...@gmail.com wrote:
Hi Everyone,
I am could never understand the difference between use vs require? If
require is older way of including modules, why not just make it obsolete.
snip
Well, first off, because use uses require. The use looks
...@gmail.com wrote:
Hi Everyone,
I am could never understand the difference between use vs require? If
require is older way of including modules, why not just make it
obsolete.
snip
Well, first off, because use uses require. The use looks something
like this internally
BEGIN {
require
Hi Chas,
Can you give me an example when one would be used over the other? So,
is
require used more for efficiency, so we load the module only if we
need it?
Thanks,
-Ben
Bit of a conundrum there, if you don't need a module, why include it
in your program.
Anyway you might have your own
On Thu, Jan 22, 2009 at 18:01, ben perl ben.pe...@gmail.com wrote:
Hi Chas,
Can you give me an example when one would be used over the other? So, is
require used more for efficiency, so we load the module only if we need it?
Thanks,
snip
Efficiency is one reason (loading modules you won't use
On Thu, Jan 22, 2009 at 18:35, Owen rc...@pcug.org.au wrote:
Hi Chas,
Can you give me an example when one would be used over the other? So,
is
require used more for efficiency, so we load the module only if we
need it?
Thanks,
-Ben
Bit of a conundrum there, if you don't need a module,
Chas. Owens wrote:
What is so hard about
$string =~ s/^[ ]*(.*)[ ]*$/$1/;
It's not hard, it just won't strip trailing spaces because your captured string
has a greedy quantifier!
I usually use
s/^\s+//, s/\s+$// for $string;
Rob
--
To unsubscribe, e-mail:
On Thu, Jan 22, 2009 at 19:12, Rob Dixon rob.di...@gmx.com wrote:
Chas. Owens wrote:
What is so hard about
$string =~ s/^[ ]*(.*)[ ]*$/$1/;
It's not hard, it just won't strip trailing spaces because your captured
string
has a greedy quantifier!
I usually use
s/^\s+//, s/\s+$// for
2009/1/23 ben perl ben.pe...@gmail.com:
Hi Chas,
Can you give me an example when one would be used over the other? So, is
require used more for efficiency, so we load the module only if we need it?
Thanks,
-Ben
Many time we need 'require' not 'use'.
For example, given this .pm:
package
heh, that was it, thanks a bunch.
Randal L. Schwartz wrote:
Christopher == Christopher J Bottaro
[EMAIL PROTECTED] writes:
Christopher My::Utils
Christopher use Exporter;
Do you have @ISA = Exporter too? Much easier to write this as
use base 'Exporter';
This might be why
Wiggins D Anconia wrote:
Mallik wrote:
What is the difference between Use and Require.
See
perldoc -f use
perldoc -f require
Why do you ask?
/R
Wow such a civilized answer. Some would say...
S R Q I R E
This is such a nice list.
Time to revisit: http://www.catb.org/~esr/faqs/smart
Robert wrote:
Wiggins D Anconia wrote:
Mallik wrote:
What is the difference between Use and Require.
See
perldoc -f use
perldoc -f require
Why do you ask?
/R
Wow such a civilized answer. Some would say...
S R Q I R E
This is such a nice list.
Time to revisit: http://www.catb.org
On Jan 29, 2004, at 9:57 AM, Mallik wrote:
[..]
What is the difference between Use and Require.
[..]
The easiest way to think about it was that
once upon a time we wanted to have 'functions'
that would be in 'perl libraries' - so there
needed to be a directive that indicated that
the code
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Mallik) writes:
Dear Perl Gurus,
What is the difference between Use and Require.
use Foo;
is equivalent to:
BEGIN {
require Foo;
Foo-import;
}
--
Peter Scott
http://www.perldebugged.com
[.. old posts snipped ..]
One important difference between 'use' and 'require' has to do with allowing your
program to decide whether to include it or not.
You CAN put 'require' inside an if statement, and it will only be executed if the if
condition is true, allowing your program to decide
Dear Perl Gurus,
What is the difference between Use and Require.
Thanks,
Malliks
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
Mallik wrote:
What is the difference between Use and Require.
See
perldoc -f use
perldoc -f require
Why do you ask?
/R
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
Mallik wrote:
What is the difference between Use and Require.
See
perldoc -f use
perldoc -f require
Why do you ask?
/R
Wow such a civilized answer. Some would say...
S R Q I R E
This is such a nice list.
Time to revisit: http://www.catb.org/~esr/faqs/smart
Mallik wrote:
What is the difference between Use and Require.
See
perldoc -f use
perldoc -f require
Why do you ask?
/R
Wow such a civilized answer. Some would say...
S R Q I R E
Who is Senior Qire?
This is such a nice list.
Time to revisit
definitely be found there.
- Jan
Mallik wrote:
Dear Perl Gurus,
What is the difference between Use and Require.
Thanks,
Malliks
--
How many Microsoft engineers does it take to screw in a lightbulb? None. They just
redefine dark as the new standard.
--
To unsubscribe, e-mail: [EMAIL
For Quality purpouses, Mallik 's mail on Thursday 29 January 2004 18:57 may
have been monitored or recorded as:
Dear Perl Gurus,
that must be someone else
What is the difference between Use and Require.
try perldoc -f use on your box (or www.perldoc.com):
use Module VERSION LIST
Hello all,
Is there a way to 'variablize' the version for a 'use' statement. This way,
if I wanted to change version I could only change it in one place with those
changes cascading across all apps.
Usage would look something like this:
use $perl_version;
Thanks in advance,
Jason Allison
Allison, Jason (JALLISON) wrote:
Hello all,
Is there a way to 'variablize' the version for a 'use' statement.
This way, if I wanted to change version I could only change it in one
place with those changes cascading across all apps.
Where would that one place be? Wherever that is, put the
The 'use' is giving me warning's against 5.6.1 code with 5.8.0:
v-string in use/require non-portable at /PATH line #.
I will need to update all of the 'use' statements from use 5.6.1; to use
5.006_001;
My question is: How are others implementing common 'use' clauses across the
applications so
Beau E. Cox wrote:
Hi -
I thought I had a grip on this, but...
Most of my reading (Camel, perldocs, etc) suggest that
'require Foo::Bar' should be used instead of 'use Foo::Bar' within
modules. I am in the process of building a series of
modules for a project and am having problems with
Hi Rob -
-Original Message-
From: Rob Dixon [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 1:20 AM
To: [EMAIL PROTECTED]
Subject: Re: use and require
Beau E. Cox wrote:
Hi -
I thought I had a grip on this, but...
...
need it? Will I get multiple copies
Hi -
I thought I had a grip on this, but...
Most of my reading (Camel, perldocs, etc) suggest that
'require Foo::Bar' should be used instead of 'use Foo::Bar' within
modules. I am in the process of building a series of
modules for a project and am having problems with
'require'; does whoever
I'm new to perl, but have a background in C.
Can someone tell me what is the difference between 'use' and 'require'? When do you
use one and not the other? Seems they both are comparable to a C header file (.h).
Thanks in advance.
Jeff
I'm new to perl, but have a background in C.
Can someone tell me what is the difference between 'use' and 'require'? When do you
use one and not the other? Seems they both are comparable to a C header file (.h).
Thanks in advance.
use is resolved during compile time whereas require
At 01:27 PM 7/11/02 -0400, Shishir K. Singh wrote:
I'm new to perl, but have a background in C.
Can someone tell me what is the difference between 'use' and
'require'? When do you
use one and not the other? Seems they both are comparable to a C
header file (.h).
Thanks in advance
-Original Message-
From: Jeff [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 11, 2002 1:24 PM
To: [EMAIL PROTECTED]
Subject: Use vs Require
I'm new to perl, but have a background in C.
Can someone tell me what is the difference between 'use' and
'require'? When do you
On Friday, May 31, 2002, at 02:30 , Sharan Hiremath wrote:
[..]
It is not the config file which will be used via require.
I'm Gonna toss this back into the list - since this is a
'design issue' that I fear can frag other folks as well...
{ I think we all abuse the 'use', 'require' , 'do
hi dear team.
what is the difference between
use , import , require.
use HTML::Template;
import HTML::Template;
require HTML ::Template;
thx.
___
Sincerely yours Nafiseh Saberi
People will forget what you said ...
People will forget what you did
On Sun, Jan 06, 2002 at 02:17:50PM +0330, nafiseh saberi wrote:
what is the difference between
use , import , require.
See 'perldoc -q use require'. 'import' is not a perl keyword, and I'm
guessing that you got it from looking at Python source somewhere. It
does have a use in perl
hi dear team.
what is the difference between
use , import , require.
use HTML::Template;
import HTML::Template;
require HTML ::Template;
thx.
___
Sincerely yours Nafiseh Saberi
People will forget what you said ...
People will forget what you did
On Jan 5, nafiseh saberi said:
what is the difference between
use , import , require.
The code:
use Module qw( this $that );
is the same as:
# BEGIN { } happens at compile-time
BEGIN {
require Module;
Module-import(qw( this $that ));
}
Read 'perldoc -q require' for more
I 've read some doc about the difference of require and use...
but I don't know what exactly that all means ?... what is run
time and what is compile time ? all I hope to know is.
which one will be faster and cost the minium loading vs time
to the system, for a 1 time process.
-Original Message-
From: Connie Chan [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 04, 2002 8:30 AM
To: [EMAIL PROTECTED]
Subject: use or require?
I 've read some doc about the difference of require and use...
but I don't know what exactly that all means ?... what is run
On Fri, 4 Jan 2002, Connie Chan wrote:
I 've read some doc about the difference of require and use...
but I don't know what exactly that all means ?... what is run
time and what is compile time ? all I hope to know is.
which one will be faster and cost the minium loading vs time
I have a few functions that are common to many different
perl applications. All of these functions live in one
file.
I have many perl programs that run from cron that make
use of these functions. So, in each of these programs
I use require to gain access to these functions.
Example:
doit.pl
( a namespace ) of its own choosing, not
your package. Second, require happens at run-time, so
the decleration occurs to late to serve as a declaration
in the file invoking the require.
use - performs a require at compile time, then lets you import
declerations
Ok, I entirely retract my post to which this is a reply.
Hey, I've been up all night.
If the scripts are running as separate processes,
then, well, I don't know.
Does anyone know why perl behaves like this?
[see earlier posts in thread]
51 matches
Mail list logo