Perl script modification

2009-01-22 Thread melbourno
I have a Perl script that I run and the out come as showing below: Reading: server 1\08121100.mls Log chain 2: Reading: server 2\08120700.mls Reading: server 2\08120900.mls Reading: server 2\08121100.mls Log chain 3: Reading: server 3\08120700.mls Reading: server 3\08120900.mls

Perl change

2009-01-22 Thread melbourno
I have a Perl script that I run and the out come as showing below: Reading: server 1\08121100.mls Log chain 2: Reading: server 2\08120700.mls Reading: server 2\08120900.mls Reading: server 2\08121100.mls Log chain 3: Reading: server 3\08120700.mls Reading: server 3\08120900.mls

Re: Perl script modification

2009-01-22 Thread Owen
On Thu, 22 Jan 2009 06:21:32 -0800 (PST) melbou...@gmail.com wrote: I have a Perl script that I run and the out come as showing below: Reading: server 1\08121100.mls Log chain 2: Reading: server 2\08120700.mls Reading: server 2\08120900.mls Reading: server 2\08121100.mls Log

use vs require

2009-01-22 Thread ben perl
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

Re: use vs require

2009-01-22 Thread Sebastian Cabrera
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 it

Re: use vs require

2009-01-22 Thread Chas. Owens
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

Re: use vs require

2009-01-22 Thread ben perl
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 On Thu, Jan 22, 2009 at 2:50 PM, Chas. Owens chas.ow...@gmail.com wrote: On Thu, Jan 22, 2009 at 17:33, ben perl

Re: use vs require

2009-01-22 Thread Owen
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

Re: use vs require

2009-01-22 Thread Chas. Owens
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

Re: use vs require

2009-01-22 Thread Chas. Owens
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,

Re: use vs require

2009-01-22 Thread Rob Dixon
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:

Re: use vs require

2009-01-22 Thread Chas. Owens
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

Re: use vs require

2009-01-22 Thread Ralf Peng
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

explanation of @INC

2009-01-22 Thread Scott Haneda
Hello, total newbie here, maybe 50 lines of perl in my life. I really appreciate any pointers. I have hit a research wall on this one. I am working on trying to create a portfile for MacPorts for ASSP. MacPorts is just a package manager for OS X. There are a few things that are probably

Re: explanation of @INC

2009-01-22 Thread Raymond Wan
Hi Scott, Scott Haneda wrote: ASSP installed. I edit the ASSP source files to change the first line from: #!/usr/bin/perl -- to #!/opt/local/bin/perl -- ... run as `perl testfile.pl` it will fail, with error that it can not find email valid run as `/opt/local/bin/perl testfile.pl` it