Re: WhiteSpace - Map, search replace, split

2005-04-21 Thread Offer Kaye
On 4/21/05, FreeFall wrote: > Sure I did with Paul's example data : > $date = 'one | two |three |'; > And I tried to change the regx /\s*\|\s*/ to /s*\|?\s*/ and it worked. What > do you think? I think that's very strange. Here is my version: > perl -MData::Dumper -we'use strict; my $

Re: WhiteSpace - Map, search replace, split

2005-04-21 Thread FreeFall
On Thu, 21 Apr 2005 10:06:24 +0300 Offer Kaye <[EMAIL PROTECTED]> wrote: > On 4/21/05, FreeFall wrote: > > Sure I did with Paul's example data : > > $date = 'one | two |three |'; > > And I tried to change the regx /\s*\|\s*/ to /s*\|?\s*/ and it worked. What > > do you think? > > I t

RE: GetOpt::Long

2005-04-21 Thread Olivier, Wim W
Hi Bob, (Offer Kaye, thanks for the reply as well!) I used the method below (local @ARGV = @_;) to get the values of @_ into @ARGV for the use of Getopt::Long. It appears to be working fine like that. I now have another problem with, it appears, syntax. The IF statement is part of a block in the

Re: Need help match feet and inches

2005-04-21 Thread Keith Worthington
On Wed, 20 Apr 2005 15:19:28 -0700, John W. Krahn wrote > Keith Worthington wrote: > > Hi All, > > Hello, > > > Here is my code so far. I am really getting frustrated with my > > inability to get this right. > > > > I didn't understand Chris' earlier suggestion about using > > defined but I tri

RE: GetOpt::Long

2005-04-21 Thread Bob Showalter
Olivier, Wim W wrote: > Hi Bob, Hi. Don't top-post please. > If > I comment out this if statement, I don't get the error anymore. An > clues as > to the correct syntax??? > > I run the subroutine as follows: > > if ($conf{'pnl_check_for_analytics_email'} =~ 'ON') >{ notify_email -r [EMAI

Require / Use

2005-04-21 Thread Paul Kraus
Why would one use Require instead of Use? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Require / Use

2005-04-21 Thread Offer Kaye
On 4/21/05, Paul Kraus wrote: > Why would one use Require instead of Use? > Because you want the action at run-time (require) vs. compile time (use), is the usual reason, I would guess. -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED

How to set system limit through perl

2005-04-21 Thread Ankur Gupta
Hi, I can set limit on coredumpsize, stacksize, etc. using the limit command. limit coredumpsize 2048 But how can I do the same thing from a perl script? I tried Shell::Source but I guess its only for inherting environment. TIA. --Ankur -- To unsubscribe, e-mail: [EMAIL PROTECTED] For a

RE: Require / Use

2005-04-21 Thread Manav Mathur
Additionally, the import method defined in a package(or inhertied by it) is not called when you 'require' a module. So, even @EXPORT symbols in the 'require'd module (which are by default imported in the current namespace when you 'use' it) are not imported. See perldoc perlmod for more on this.

RE: GetOpt::Long

2005-04-21 Thread Olivier, Wim W
Hi Bob, You gave me the following answer earlier: sub foo { local @ARGV = @_; GetOptions(...blah...); ... } If I run it as a seperate script, commenting out the (local @ARGV = @_;) line, then it works. But it does not work when called as a subroutine from within the ma

Re: Require / Use

2005-04-21 Thread Paul Kraus
> Because you want the action at run-time (require) vs. compile time > (use), is the usual reason, I would guess. Not to sound daft but why would you want to do that? What would be gained or lossed. What would be an advantage of using require? Paul -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: How to set system limit through perl

2005-04-21 Thread Paul Johnson
On Thu, Apr 21, 2005 at 06:36:26PM +0530, Ankur Gupta wrote: > I can set limit on coredumpsize, stacksize, etc. using the limit command. > > limit coredumpsize 2048 > > But how can I do the same thing from a perl script? > > I tried Shell::Source but I guess its only for inherting environment.

Re: Require / Use

2005-04-21 Thread Chris Devers
On Thu, 21 Apr 2005, Paul Kraus wrote: > Not to sound daft but why would you want to do that? What would be > gained or lossed. What would be an advantage of using require? Normally, you wouldn't. Think of 'require' as a vestigal organ from Perl4 that has little or no purpose today with Perl5.

Re: Holidays

2005-04-21 Thread Peter Scott
On Wed, 20 Apr 2005 11:11:00 -0400, Robert wrote: > I need to populate a Pg database with holidays (US, Federal, Christian, > Islamic, and Jewish). I didn't find anything on CPAN (but you have to know > what to search for). The Islamic and Jewish ones are a little problematic > because they can

Re: Require / Use

2005-04-21 Thread Paul Kraus
> Think of 'require' as a vestigal organ from Perl4 that has little or no > purpose today with Perl5. > > For the most part, it's safe to pretend that 'require' doesn't exist. Perfect. Just wanted to make sure I wasn't missing something. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additiona

Re: Require / Use

2005-04-21 Thread Peter Scott
On Thu, 21 Apr 2005 09:39:03 -0400, Chris Devers wrote: > On Thu, 21 Apr 2005, Paul Kraus wrote: > >> Not to sound daft but why would you want to do that? What would be >> gained or lossed. What would be an advantage of using require? > > Normally, you wouldn't. > > Think of 'require' as a ves

RE: Require / Use

2005-04-21 Thread Manav Mathur
perldoc perlmod also goes to say An exception would be if two modules each tried to "use" each other, and each also called a function from that other module. In that case, it's easy to use "require"s instead. anyone knows how/why require is useful in this case ?? |-Original Message- |F

Re: Require / Use

2005-04-21 Thread Chris Devers
On Thu, 21 Apr 2005, Peter Scott wrote: > Ahem. It is most useful when I want to determine the module to load > dynamically, or when I want to load a module only if necessary to save > the time spent compiling it in the cases when it is not needed. :-) I think that counts as an esoteric-enoug

Feed Net::FTP an in-memory file

2005-04-21 Thread Peter Rabbitson
Hello everyone, Very simple: I need to generate a file and upload it to ftp. Currently I am wrapping the file together, writing it out to a temp file on disk, calling $ftp->put($tmp_file) on it, and unlinking it. Is there a way to skip the write to disk? The put() method seems to expect a path

Re: copy and change extension

2005-04-21 Thread Jay Savage
On 4/20/05, Brian Milbrandt <[EMAIL PROTECTED]> wrote: > I am trying to get a script to copy and change the extension for files with > a non-zero file size. I have tried everything I can think of but I can't > seem to get the copy files part right. All I get is the output 0 files > copied. Here

Re: Feed Net::FTP an in-memory file

2005-04-21 Thread mgoland
- Original Message - From: Peter Rabbitson <[EMAIL PROTECTED]> Date: Thursday, April 21, 2005 10:42 am Subject: Feed Net::FTP an in-memory file > Hello everyone, > > Very simple: I need to generate a file and upload it to ftp. > Currently I am > wrapping the file together, writing it

RE: Require / Use

2005-04-21 Thread Charles K. Clarkson
Chris Devers wrote: : : Ahem. It is most useful when I want to determine the module to load : : dynamically, or when I want to load a module only if necessary to : : save the time spent compiling it in the cases when it is not needed. : : :-) : : I think that counts a

Re: Require / Use

2005-04-21 Thread Randal L. Schwartz
> "Paul" == Paul Kraus <[EMAIL PROTECTED]> writes: >> Because you want the action at run-time (require) vs. compile time >> (use), is the usual reason, I would guess. Paul> Not to sound daft but why would you want to do that? What would be Paul> gained or lossed. What would be an advantage of

Re: Feed Net::FTP an in-memory file

2005-04-21 Thread JupiterHost.Net
Peter Rabbitson wrote: Hello everyone, Hello, Very simple: I need to generate a file and upload it to ftp. Currently I am wrapping the file together, writing it out to a temp file on disk, calling $ftp->put($tmp_file) on it, and unlinking it. Is there a way to skip the write to disk? The put()

Re: Require / Use

2005-04-21 Thread mgoland
- Original Message - From: merlyn@stonehenge.com (Randal L. Schwartz) Date: Thursday, April 21, 2005 11:39 am Subject: Re: Require / Use > > "Paul" == Paul Kraus <[EMAIL PROTECTED]> writes: > > >> Because you want the action at run-time (require) vs. compile time > >> (use), is the

Re: Require / Use

2005-04-21 Thread Randal L. Schwartz
> "mgoland" == mgoland <[EMAIL PROTECTED]> writes: mgoland> if ($certain_condition) { mgoland> require Expensive::Module; mgoland> my $object = Expensive::Module->new(blah); mgoland> ... mgoland> } mgoland> and This require happens only when we reach that line of c

Re: Require / Use

2005-04-21 Thread mgoland
- Original Message - From: merlyn@stonehenge.com (Randal L. Schwartz) Date: Thursday, April 21, 2005 12:10 pm Subject: Re: Require / Use > > "mgoland" == mgoland <[EMAIL PROTECTED]> writes: > > mgoland> if ($certain_condition) { > mgoland> require Expensive::Module; > mgola

Re: Feed Net::FTP an in-memory file

2005-04-21 Thread Peter Rabbitson
On Thu, Apr 21, 2005 at 10:56:16AM -0500, JupiterHost.Net wrote: > > > Peter Rabbitson wrote: > > >Hello everyone, > > Hello, > > >Very simple: I need to generate a file and upload it to ftp. Currently I > >am wrapping the file together, writing it out to a temp file on disk, > >calling $ft

Re: Feed Net::FTP an in-memory file

2005-04-21 Thread John W. Krahn
Peter Rabbitson wrote: Hello everyone, Hello, Very simple: I need to generate a file and upload it to ftp. Currently I am wrapping the file together, writing it out to a temp file on disk, calling $ftp->put($tmp_file) on it, and unlinking it. Is there a way to skip the write to disk? FTP is the

Passing username and password to a Windows .exe

2005-04-21 Thread Steve . E . Pittman
I have a Windows application that needs to run 365/24/7.. the application requires a username and password.. is it possible to pass the username and pass to the application? if possible, I would like to launch the .exe from a perl script and monitor the PID. Any help is appreciated... Steve

Re: Script that spans multiple files

2005-04-21 Thread Daniel Kasak
Charles K. Clarkson wrote: >Daniel Kasak wrote: >: >: I have a large script ( 6000 lines ) that I'd like to break into >: logical units. Is there a way I can tell perl to 'append' a list >: of files into 1 script so that I can call subs from any of the >: files and have

Re: Require / Use

2005-04-21 Thread Wijaya Edward
This is the reading suggested when I asked the same questions some time ago . http://perldoc.perl.org/perlfaq8.html#What-s-the-difference-between-require-and-use- --- Regards, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTE

RE: Script that spans multiple files

2005-04-21 Thread Charles K. Clarkson
Daniel Kasak wrote: : Charles K. Clarkson wrote: : Managability. I can put all related stuff in 1 file. Then I'll : have main application logic in one main file, and other subs in : other files. It reduces clutter. Yes I realise that what I'm : asking for would have no