Re: OO confusion

2009-01-11 Thread John W. Krahn
Dr.Ruud wrote: Jenda Krynicky wrote: my $data = do {local $/; }; is better written as my $data; { local $/; $data = }; For smallish files it doesn't matter much. Or perhaps: read DATA, my $data, -s DATA; John -- Those people who think they know everything are a great annoyance to t

external program control

2009-01-11 Thread bft
Hello all, I am trying to launch an instance if Firefox, but I do not want my Perl script to stop while Firefox is open. I have tried: print `firefox`; and print `firefox &`; Both hang my perl script until I close firefox. Any suggestions please? Eric -- To unsubscribe, e-mail: beginners-

name space and invoking code with eval

2009-01-11 Thread okey
I can run a function this way (in the main package namespace): &main::aMainFunctionName(@param); How do I run it with a namespace var? $space = 'main'; eval \&${space}::aMainFunctionName(\@); Then, when and if that is possible, can I pass namespace to another package and use functions from

Re: external program control

2009-01-11 Thread Ralf Peng
2009/1/11 bft : > Hello all, > I am trying to launch an instance if Firefox, but I do not want my Perl > script to stop while Firefox is open. > > I have tried: > print `firefox`; > > and > > print `firefox &`; > > Both hang my perl script until I close firefox. > > Any suggestions please? > mayb

Re: external program control

2009-01-11 Thread Mr. Shawn H. Corey
On Sat, 2009-01-10 at 12:06 -0700, bft wrote: > I am trying to launch an instance if Firefox, but I do not want my > Perl > script to stop while Firefox is open. > > I have tried: > print `firefox`; > > and > > print `firefox &`; > > Both hang my perl script until I close firefox. > > Any sug

Re: OO confusion

2009-01-11 Thread Mike McClain
On Sat, Jan 10, 2009 at 03:26:33PM +0100, Jenda Krynicky wrote: > The Class::Name->method(...) is a class method call. Perl will find > the method in the clas hierarchy and call the method and pass the > 'Class::Name' as the first parameter. > Thank you Jenda that's very clear. Mike -- To

help with format conversion

2009-01-11 Thread ANJAN PURKAYASTHA
hi, i have file of numbers in the format x.e+003, eg 2.133793e+001. these numbers are not recognized by the perl multiplication operator "*". any idea of how i may convert these numbers to a format the operator DOES recognize? thanks, anjan -- = anjan purkayastha,

Re: OO confusion

2009-01-11 Thread Rob Dixon
Randal L. Schwartz wrote: >> ""Dr" == "Dr Ruud" writes: > > "Dr> is better written as > > ... for varying and arguable values of "better". > > I prefer the "do" form, myself. I too much prefer the style of my $data = do { local $/; ; }; over my $data; { local $/;

Re: OO confusion

2009-01-11 Thread Randal L. Schwartz
> "Rob" == Rob Dixon writes: Rob> But the first causes Perl to keep two copies of the file data, which may be Rob> unacceptable depending on the the size of the file and the specification of the Rob> platform. Does it really? Have you tested this? I suspect it actually doesn't. -- Randa

Re: help with format conversion

2009-01-11 Thread Rob Dixon
ANJAN PURKAYASTHA wrote: > > i have file of numbers in the format x.e+003, eg 2.133793e+001. > these numbers are not recognized by the perl multiplication operator "*". > any idea of how i may convert these numbers to a format the operator DOES > recognize? > thanks, Perl is fine with values l

Re: OO confusion

2009-01-11 Thread Rob Dixon
Randal L. Schwartz wrote: >> "Rob" == Rob Dixon writes: > > Rob> But the first causes Perl to keep two copies of the file data, which may > be > Rob> unacceptable depending on the the size of the file and the specification > of the > Rob> platform. > > Does it really? Have you tested this

Re: OO confusion

2009-01-11 Thread Randal L. Schwartz
> "Rob" == Rob Dixon writes: Rob> I tested the similar Rob> my @data = do { Rob> open my $fh, '<', $file or die $!; Rob> <$fh>; Rob> }; Rob> a while ago, but not on v5.10. I will see if I can find time to try it again. Ahh, but that's very different. My suspicion is that both

Re: OO confusion

2009-01-11 Thread Rob Dixon
Randal L. Schwartz wrote: >> "Rob" == Rob Dixon writes: > > Rob> But the first causes Perl to keep two copies of the file data, which may > be > Rob> unacceptable depending on the the size of the file and the specification > of the > Rob> platform. > > Does it really? Have you tested this

Re: OO confusion

2009-01-11 Thread Rob Dixon
Randal L. Schwartz wrote: >> "Rob" == Rob Dixon writes: > > Rob> I tested the similar > > Rob> my @data = do { > Rob> open my $fh, '<', $file or die $!; > Rob> <$fh>; > Rob> }; > > Rob> a while ago, but not on v5.10. I will see if I can find time to try it > again. > > Ahh, bu

Re: help with format conversion

2009-01-11 Thread Mr. Shawn H. Corey
On Sun, 2009-01-11 at 13:41 -0500, ANJAN PURKAYASTHA wrote: > hi, > i have file of numbers in the format x.e+003, eg 2.133793e+001. > these numbers are not recognized by the perl multiplication operator > "*". > any idea of how i may convert these numbers to a format the operator > DOES > recog

Re: help with format conversion

2009-01-11 Thread ANJAN PURKAYASTHA
hi all, thanks for your helpful suggestions. code: $mean= sqrt($line[0]*$line[1]) . $line[0] and $line[1] are in the the x.xxe+002 format. turns out i was parsing the numbers incorrectly. once that was corrected the format was accepted by "*" without complaint. thanks! anjan On Sun, Jan 11, 20

Re: OO confusion

2009-01-11 Thread Dr.Ruud
Randal L. Schwartz wrote: Ruud: is better written as ... for varying and arguable values of "better". I prefer the "do" form, myself. The simple problem with the do-form is that it easily uses double the memory because it allocates two buffers (as I hinted in the part that you didn't quo

答复: OO confusion

2009-01-11 Thread Thomas Yan
>Ahh, but that's very different. My suspicion is that both the last-expr >scalar of the block and the $result scalar will share the same single >payload, similar to how: >$x = $y >doesn't actually copy the *content*... just the scalar wrapper around >the content. Does this mean that $x,