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
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-
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
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
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
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
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,
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 $/;
> "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
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
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
> "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
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
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
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
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
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
>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,
18 matches
Mail list logo