On Fri, 2021-10-01 at 17:01 -0500, Andy Bach wrote:
> > If the signal would be caught, I could handle the error and try to
> reconnect, or, if that also fails, do something else.
>
> Oh. I was thinking you wanted it to check the connection before trying to
> print. Well, the print stmt returning u
> If the signal would be caught, I could handle the error and try to
reconnect, or, if that also fails, do something else.
Oh. I was thinking you wanted it to check the connection before trying to
print. Well, the print stmt returning undef will tell you the same thing.
Hmm, it would appear print
On Thursday, September 30, 2021 9:30:01 PM CEST Andy Bach wrote:
> > https://perldoc.perl.org/functions/print says that 'print' would return
>
> true
>
> > if successful and doesn't say what it returns otherwise. It also says
>
> that
>
> > "Printing to a closed pipe or socket will generate a
> https://perldoc.perl.org/functions/print says that 'print' would return
true
> if successful and doesn't say what it returns otherwise. It also says
that
> "Printing to a closed pipe or socket will generate a SIGPIPE signal."
Looks like print returns 1 if it succeeds, undef if not:
$ perl -wE '
Hi,
I have a program in which I'm creating an UDP socket with IO::Socket::INET to
a device on my LAN. Opening the socket yields no error. Writing to the
socket with 'print' works fine. The device sends data back, and receiving the
data works fine.
But it doesn't work when the device is offl
I don't have the time to put everything around this to do the syntax test but
what happens with this:
If ( ! chdir
"/big/dom/x$server/data/students/$progress_hash{student_id}/" ) {
$message = "Can't change directory to $progress_hash{student_id}:
$!";
report_e
On 01/19/2018 01:43 PM, Darryl Philip Baker wrote:
I don't have the time to put everything around this to do the syntax test but
what happens with this:
If ( ! chdir
"/big/dom/x$server/data/students/$progress_hash{student_id}/" ) {
$message = "Can't change directory to $
Uri,
Thank you SO much for your helpful comments! You didn’t just solve THIS
problem, you’ve helped me in my future programming!
Rick
> On Jan 19, 2018, at 11:56 AM, Uri Guttman wrote:
>
> On 01/19/2018 12:44 PM, Rick T wrote:
>> The subroutine below produces the followin
On 01/19/2018 12:44 PM, Rick T wrote:
The subroutine below produces the following syntax errors:
syntax error at /big/dom/xexploringmyself/cgi-bin/register.cgi line 71, near ""Can't
change directory to $progress_hash{student_id}: $!";"
syntax error at /big/dom
The subroutine below produces the following syntax errors:
syntax error at /big/dom/xexploringmyself/cgi-bin/register.cgi line 71, near
""Can't change directory to $progress_hash{student_id}: $!";"
syntax error at /big/dom/xexploringmyself/cgi-bin/register.cgi line
Hi Miguel,
On Wed, 25 Nov 2015 20:28:48 -0500
Miguel Rodas wrote:
> Why am I in this thread?
>
> Please remove me from it
>
You are likely subscribed to beginners@perl.org and so receive all E-mails from
all threads. For how to unsubscribe, see
http://learn.perl.org/faq/beginners.html .
Rega
Hi Jin,
some comments on your code:
On Thu, 26 Nov 2015 08:13:54 +0800
Jin Xu wrote:
> Try to use below updated ones:
>
> #!/usr/bin/perl
> use strict;
> use warnings;
> while (my $line = <>) {
You're lacking many empty lines - separating the code into paragraphs. See:
http://perl-begin.org/
4.
>> Global symbol "$line" requires explicit package name at ./prog164.pl line 5.
>> Global symbol "$line" requires explicit package name at ./prog164.pl line 8.
>> Global symbol "$result" requires explicit package name at ./prog164.pl line
>> 8.
>> Global symbol "$line" requires explicit package name at ./prog164.pl line 11.
>> Execution of ./prog164.pl aborted due to compilation errors.
>> gb@MINT ~/Perl5/perl programs $
>>
>>
>> What is this error? And what am I doing wrong.
>
bol "$line" requires explicit package name at ./prog164.pl line
> 5.
> Global symbol "$line" requires explicit package name at ./prog164.pl line
> 8.
> Global symbol "$result" requires explicit package name at ./prog164.pl
> line 8.
> Global symbol &q
64.pl
> > Global symbol "$line" requires explicit package name at ./prog164.pl
> line 4.
> > Global symbol "$line" requires explicit package name at ./prog164.pl
> line 5.
> > Global symbol "$line" requires explicit package name at ./prog164.pl
&g
/prog164.pl line 5.
> Global symbol "$line" requires explicit package name at ./prog164.pl line 8.
> Global symbol "$result" requires explicit package name at ./prog164.pl line
> 8.
> Global symbol "$line" requires explicit package name at ./prog164.pl line
>
line 8.
Global symbol "$result" requires explicit package name at ./prog164.pl line
8.
Global symbol "$line" requires explicit package name at ./prog164.pl line
11.
Execution of ./prog164.pl aborted due to compilation errors.
gb@MINT ~/Perl5/perl programs $
What is this error? And what am I doing wrong.
On 5/27/2015 7:46 AM, Lawrence Statton
wrote:
On 05/27/2015 07:33 AM, Mike Blezien wrote:
*CONNECTED(0003) --- no peer
certificate available --- No client
certificate CA names sent --- SSL handshake has re
On 05/27/2015 07:33 AM, Mike Blezien wrote:
*CONNECTED(0003) --- no peer certificate available --- No client
certificate CA names sent --- SSL handshake has read 0 bytes and written
0 bytes --- New, (NONE), Cipher is (NONE) Secure Renegotiation IS NOT
supported Compression: NONE Expansion:
On 5/25/2015 12:31 PM, Lawrence Statton
wrote:
I sent this to the list, but it seems to have gotten clogged in
the tubes ... here's another copy
Forwarded Message
Subject: Re: LWP/Protocol E
On 05/25/2015 12:02 PM, Mike Blezien wrote:
Hello
*I use same IPN script on other servers without any issues except one.
Is it possible that port 443 is being block or not open due a firewall
on the server?
Another tidbit of information that just burbled to the top of my brain.
On SOME plat
On 05/25/2015 12:02 PM, Mike Blezien wrote:
Hello,
I recently setup a Paypal IPN script which worked fine for some time now
but now all of a sudden I keep getting these error message:
*
**Can't connect to www.paypal.com:443 (certificate verify failed)**
**LWP::Protocol::https::Socket: SSL conn
On 5/25/2015 12:27 PM, Lawrence Statton
wrote:
On 05/25/2015 12:02 PM, Mike Blezien wrote:
Hello
*I use same IPN script on other servers without any issues
except one.
Is it possible that port
Hello,
I recently setup a Paypal IPN script which worked fine for some
time now but now all of a sudden I keep getting these error
message:
Can't connect to
www.paypal.com:443 (certificate verify failed)
LWP::Protocol::https::So
On Sun, 15 Mar 2015 23:26:41 +1300
Kent Fredric wrote:
> On 15 March 2015 at 21:41, Manfred Lotz wrote:
>
> > I agree but I thought that in this case I would need to know the
> > potential warning messages the :encoding(UTF-8) could issue in
> > order to take action in those particular cases.
>
On 15 March 2015 at 21:41, Manfred Lotz wrote:
> I agree but I thought that in this case I would need to know the
> potential warning messages the :encoding(UTF-8) could issue in order to
> take action in those particular cases.
>
> Using a section local
> {
>open( local *STDERR,'>', $err);
>
On Sun, 15 Mar 2015 21:11:05 +1300
Kent Fredric wrote:
> On 15 March 2015 at 20:07, Manfred Lotz wrote:
>
> > I prefer the method Charles showed. But nevertheless your method is
> > interesting as well.
> >
>
> FWIW, SIG{__WARN__} is much preferred over redirecting stderr to
> simply suppress/
On 15 March 2015 at 20:07, Manfred Lotz wrote:
> I prefer the method Charles showed. But nevertheless your method is
> interesting as well.
>
FWIW, SIG{__WARN__} is much preferred over redirecting stderr to simply
suppress/capture/filter warnings.
For instance, if somebody passes an object to w
I prefer the method Charles showed. But nevertheless your method is
interesting as well.
Thanks for sharing,
Manfred
On Sat, 14 Mar 2015 14:24:48 -0400
Brandon McCaig wrote:
> On Sat, Mar 14, 2015 at 03:20:06AM -0700, Charles DeRykus wrote:
> > open my $fh, '<:encoding ) or die ...
> >
>
On Sat, Mar 14, 2015 at 03:20:06AM -0700, Charles DeRykus wrote:
> open my $fh, '<:encoding ) or die ...
>
> { open( local *STDERR,'>',\my $err);
>my $string = <$fh>;
> if ($err =~ /does not map to Unicode/) {
> # take action.
> }
> }
Here is an alternative appro
On Sat, 14 Mar 2015 03:20:06 -0700
Charles DeRykus wrote:
> On Sat, Mar 14, 2015 at 2:38 AM, Manfred Lotz
> wrote:
> > Hi all,
> > I wanted to test what happens if Perl encounters an error when
> > reading a utf8 encoded file.
> >
> > Here a minimal example:
> >
> > #! /usr/bin/perl
> >
> > use
On Sat, 14 Mar 2015 23:18:42 +1300
Kent Fredric wrote:
> On 14 March 2015 at 22:38, Manfred Lotz wrote:
>
> > following error message which is fine.
>
>
> Sorry for being pedantic, but I think you'll find that those are what
> we call "warnings", not
On Sat, Mar 14, 2015 at 2:38 AM, Manfred Lotz wrote:
> Hi all,
> I wanted to test what happens if Perl encounters an error when reading
> a utf8 encoded file.
>
> Here a minimal example:
>
> #! /usr/bin/perl
>
> use strict;
> use warnings;
>
> my $fname = $ARGV[0];
>
> open my $fh, '<:encoding(UTF
On 14 March 2015 at 22:38, Manfred Lotz wrote:
> following error message which is fine.
Sorry for being pedantic, but I think you'll find that those are what we
call "warnings", not "errors".
Errors tend to be fatal.
However, curiously, "<:utf8"
Hi all,
I wanted to test what happens if Perl encounters an error when reading
a utf8 encoded file.
Here a minimal example:
#! /usr/bin/perl
use strict;
use warnings;
my $fname = $ARGV[0];
open my $fh, '<:encoding(UTF-8)', $fname
or die "Couldn't open file: $fname";
my $string = <$fh>;
clo
The comma was a pseudo code error. Should have read
=
print $FH "some stuff\n"; # works great.
=
I will test for undef on $thing. Thanks for looking. Pretty sure I printed
the expected result to STDOUT without error. The module call involves a
telnet across the network, maybe the open I added prov
On 15/01/2014 03:09, Matt McAdory wrote:
Is there a method for determining the currently selected filehandle?
should I always check for undef and open my filehandle before writing to it?
use strict;
use warnings;
use autodie qw (:all);
use My:CustomMod_with_FH_write;
open (my $FH, ">", "filena
On Wed, Jan 15, 2014 at 12:09 AM, Matt McAdory wrote:
> Is there a method for determining the currently selected filehandle?
> should I always check for undef and open my filehandle before writing to it?
>
> use strict;
> use warnings;
> use autodie qw (:all);
>
> use My:CustomMod_with_FH_write;
Is there a method for determining the currently selected filehandle? should
I always check for undef and open my filehandle before writing to it?
use strict;
use warnings;
use autodie qw (:all);
use My:CustomMod_with_FH_write;
open (my $FH, ">", "filename.txt");
my $var = My:CustomMod_with_FH_w
On Sat, Jun 29, 2013 at 12:26 AM, Dariusz Dolecki
wrote:
> rl10/5.18.0/lib/5.18.0/sun4-solaris-64/CORE" des.c
> "des.h", line 1: cannot find include file:
I suspect the problem is here. I don't have a solaris machine right
now, but for instance on my FreeBSD installation the most similar
thing
rl10/5.18.0/lib/5.18.0/sun4-solaris-64/CORE" des.c
"des.h", line 1: cannot find include file:
"des.h", line 3: warning: no explicit type given
"des.h", line 3: syntax error before or at: des_user_key
"des.h", line 3: warning: old-style declaration or incorrect type for:
des_user_key
"des.h", lin
Hello:
On Sun, Dec 04, 2011 at 10:22:26AM +, Huub van Niekerk wrote:
> Thank you for your response. The variable is defined as:
>
> my $ps = new PostScript::Simple(papersize => "A4",
> colour => 0,
> eps => 0,
>
;> If not so, then you can assume that, problem in that eps only.
>>
>> Regards,
>> MadYuv
>>
>>
>> On Sun, Dec 4, 2011 at 12:52 PM, Jim Gibson
>> wrote:
>>
>>> At 7:05 AM + 12/4/11, Huub van Niekerk wrote:
>>>
>&g
On Sat, 03 Dec 2011 23:22:12 -0800, Jim Gibson wrote:
> At 7:05 AM + 12/4/11, Huub van Niekerk wrote:
>>Hi,
>>
>>I'm trying to import an eps file but I get errors. Can somebody tell how
>>I can solve either of these 2 errors. BTW, I'm not using them at the
t 12:52 PM, Jim Gibson
> wrote:
>
>> At 7:05 AM + 12/4/11, Huub van Niekerk wrote:
>>
>>> Hi,
>>>
>>> I'm trying to import an eps file but I get errors. Can somebody tell
>>> how I can solve either of these 2 errors. BTW, I'm
320.6792
%%%
If not so, then you can assume that, problem in that eps only.
Regards,
MadYuv
On Sun, Dec 4, 2011 at 12:52 PM, Jim Gibson wrote:
> At 7:05 AM + 12/4/11, Huub van Niekerk wrote:
>
>> Hi,
>>
>> I'm trying to import an eps file but I get errors. C
At 7:05 AM + 12/4/11, Huub van Niekerk wrote:
Hi,
I'm trying to import an eps file but I get errors. Can somebody tell how
I can solve either of these 2 errors. BTW, I'm not using them at the same
time.
$ps->importepsfile("/mnt/Kaapstadadmin/HVW/logo-2-gemeentekleuren
Hi,
I'm trying to import an eps file but I get errors. Can somebody tell how
I can solve either of these 2 errors. BTW, I'm not using them at the same
time.
$ps->importepsfile("/mnt/Kaapstadadmin/HVW/logo-2-gemeentekleuren.eps",
0,0, 151,90);
Error with above
Hello Magnus Woldrich,
please can you send NON-ENCRYPTED messages please?
Thanks, Greetings and nice Day/Evening
Michelle Konzack
--
# Debian GNU/Linux Consultant ##
Development of Intranet and Embedded Systems with Debian GNU/Linux
itsystems@tdne
On 11-03-30 08:34 AM, Katie T wrote:
"perl -c" will check your script without executing it.
Not exactly. From `perldoc perlrun`:
-c causes Perl to check the syntax of the program and then exit without
executing it. Actually, it will execute "BEGIN", "UNITCHECK", "CHECK",
and "use" blocks,
On Tue, Mar 29, 2011 at 7:04 AM, Magnus Woldrich wrote:
>
>
"perl -c" will check your script without executing it.
Katie
--
CoderStack
http://www.coderstack.co.uk/asp-jobs
The Software Developer Job Board
2011-3-29 14:04, Magnus Woldrich:
Can't see any message body but with two attachments.
I'm using thunderbird 3.
--
terry - te...@geekmail.de
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
binuRX8OPobbD.bin
Description: application/pgp-encrypted
msg.asc
Description: Binary data
On Jan 17, 3:45 pm, dpchr...@holgerdanske.com (David Christensen)
wrote:
> Ron Bergin wrote:
> > It's interesting that you found the warning message to be meaningless,
> > but the exact same message was helpful when you told the pragma to
> > raise the level of warnings to be fatal.
> > I should ha
Ron Bergin wrote:
It's interesting that you found the warning message to be meaningless,
but the exact same message was helpful when you told the pragma to
raise the level of warnings to be fatal.
I should have said nearly the same message. Both messages told you where
the problem was located
Shawn H Corey wrote:
Have you looked at `perldoc autodie` yet? I don't know if it'll die on
warnings though.
Yes, thank you. autodie doesn't seem to be a base package (on my
platform), so I continued searching and found:
use warnings FATAL => 'all';
which is a better solution for what
Have you looked at `perldoc autodie` yet? I don't know if it'll die on
warnings though.
--
Just my 0.0002 million dollars worth,
Shawn
Confusion is the first step of understanding.
Programming is as much about organization and communication
as it is about coding.
The secret to great
>> trapped error Bad file descriptor at trap-print-errors2.pl line
>> 12.
>>
>> 2. The warnings pragmatic module has an option for turning warnings
>> into errors:
>>
>> use warnings FATAL => 'all';
>> print $s @_;
d file descriptor at trap-print-errors2.pl line 12.
>
> 2. The warnings pragmatic module has an option for turning warnings
> into errors:
>
> use warnings FATAL => 'all';
> print $s @_;
>
> This eliminates the warning message and gives me a mean
ts printed:
print() on unopened filehandle NOSUCH at trap-print-errors2.pl line 12.
And $! isn't very meaningful:
trapped error Bad file descriptor at trap-print-errors2.pl line 12.
2. The warnings pragmatic module has an option for turning warnings
into errors:
use warning
- Original Message -
From: "David Christensen"
$ cat trap-print-errors.pl
#!/usr/bin/perl
use strict;
use warnings;
$| = 1;
sub myprint($@)
{
my $s = shift;
eval {
### circumvent Can't use string ("*STDOUT") as a symbol ref...
no strict 'refs';
print $s @_;
Replace the ab
beginners:
I'm trying to catch errors when I call print() using a variable
containing a string with a bad IO handle (and/or glob?) name. eval()
doesn't seem to work:
2011-01-16 14:19:56 dpchrist@p43400e ~/sandbox
$ cat trap-print-errors.pl
#!/usr/bin/perl
use strict;
use warnin
Thanks! This workaround worked for me. :) :)
- Saqib
On Tue, Jan 11, 2011 at 8:26 AM, Bob McConnell wrote:
> From: Saqib Ali
>
> > I'm reading a large (57 MB) XML file Using XML::XPath::XMLParser()
> >
> > I keep getting this error:
> >
> > "Callback called exit at XML/XPath/Node/Element.pm
From: Saqib Ali
> I'm reading a large (57 MB) XML file Using XML::XPath::XMLParser()
>
> I keep getting this error:
>
> "Callback called exit at XML/XPath/Node/Element.pm at line 144 during
> global destruction."
>
> I'm using Windows XP. So I watched the task-management memory meter
> during t
From: Saqib Ali
> I'm reading a large (57 MB) XML file Using XML::XPath::XMLParser()
>
> I keep getting this error:
>
> "Callback called exit at XML/XPath/Node/Element.pm at line 144 during
> global destruction."
>
> I'm using Windows XP. So I watched the task-management memory meter
> during t
Hi.
I'm reading a large (57 MB) XML file Using XML::XPath::XMLParser()
I keep getting this error:
"Callback called exit at XML/XPath/Node/Element.pm at line 144 during
global destruction."
I'm using Windows XP. So I watched the task-management memory meter
during the execution of this process.
On 12/27/2010 06:11 AM, Sisyphus wrote:
>
> - Original Message - From: "Randal L. Schwartz"
>
> To:
> Sent: Monday, December 27, 2010 1:57 PM
> Subject: Re: Syntax Errors
>
>
>>>>>>> "Bill" == Bill Casey
- Original Message -
From: "Randal L. Schwartz"
To:
Sent: Monday, December 27, 2010 1:57 PM
Subject: Re: Syntax Errors
"Bill" == Bill Casey writes:
Bill> Syntax error at import_track.pl line 11, near ") {"
Bill> Syntax error at import_trac
>>>>> "Sheppy" == Sheppy R writes:
Sheppy> Strawberry Perl under Padre on a Windows system will give Syntax errors
Sheppy> (Running from both the command-line and in Padre itself). Chances are
this
Sheppy> is where Bill is getting them from, probably just one
Strawberry Perl under Padre on a Windows system will give Syntax errors
(Running from both the command-line and in Padre itself). Chances are this
is where Bill is getting them from, probably just one of the differences
between *nix and Windows.
@Bill - I'm not seeing any problems when I
>>>>> "Bill" == Bill Casey writes:
Bill> Syntax error at import_track.pl line 11, near ") {"
Bill> Syntax error at import_track.pl line 14, near "}"
Perl doesn't ever say "syntax error". So those errors are not
coming fr
On Sunday 19 December 2010 22:23:15 Bill Casey wrote:
> Hi
>
> Below is a Perl script which won't compile. My operating system is
> Windows XP Home and Perl version is 5.10.1.3.
>
This script after I placed it in a file compiles fine here:
{{{
shlomif:~$ cat test.pl
#!/usr/bin/perl
# import_tr
Hi
Below is a Perl script which won't compile. My operating system is
Windows XP Home and Perl version is 5.10.1.3.
#!/usr/bin/perl
# import_track.prl
use warnings;
use strict;
open (INFILE, "track.txt") or die $!;
open (OUTFILE, ">outtrack.plt") or die $!;
my $outstring;
while ()
{
ulti/auto/Algo
> > rithm/SVMLight/SVMLight.so: undefined symbol: set_learning_defaults
> >
> > I would appreciate is some of you could tell me what does "symbol lookup
> > error" and "undefined symbol" means, by the way, set_learning_defaults
> is
> >
On Thursday 28 October 2010 16:04:19 Pau Marc Munoz Torres wrote:
> Hi every body
>
> recently i compiled a svmlight perl module two use svmlight program with
> perl
>
> http://search.cpan.org/~kwilliams/Algorithm-SVMLight-0.09/lib/Algorithm/SVM
> Light.pm
>
> to compile a patch is needed and a
error" and "undefined symbol" means, by the way, set_learning_defaults is
> deffined at the patch
These are errors of the GNU linker. I don't know what is causing them but we
can try to investigate. Maybe the set_learn
Hi every body
recently i compiled a svmlight perl module two use svmlight program with
perl
http://search.cpan.org/~kwilliams/Algorithm-SVMLight-0.09/lib/Algorithm/SVMLight.pm
to compile a patch is needed and as i wanted to run it under linux in a 64
bits machine, i used the flag make " CFLAGS=
> "RC" == Rob Coops writes:
RC> On Tue, Apr 27, 2010 at 9:16 AM, Uri Guttman wrote:
RC> so you can't tell the difference without getting into the guts
RC> with xs or some special code. you mention a receiving program
RC> which may make a difference but again perl won't k
On Tue, Apr 27, 2010 at 9:16 AM, Uri Guttman wrote:
> > "RC" == Rob Coops writes:
>
> RC> @Uri, returning 0 or 0.00 does make a small difference in that the
> RC> receiving program likes the 0.00 better then the plain 0 don't ask
> RC> me why ask our mainframe colleagues why. I wish I cou
> "RC" == Rob Coops writes:
RC> @Uri, returning 0 or 0.00 does make a small difference in that the
RC> receiving program likes the 0.00 better then the plain 0 don't ask
RC> me why ask our mainframe colleagues why. I wish I could let perl
RC> do the work for me but it simply does not
ction system
>> is
>> outside of my control and getting a module installed can take days if not
>> longer due to processes procedures forms and so on. The country has only a
>> few days left till the end of the month by which time this should
>> absolutely
>>
On Apr 26, 2010, at 11:22 AM, Uri Guttman wrote:
>>>>>> "JWK" == John W Krahn writes:
>
> i must have not see the OP's reply yet so this is mostly for him.
>
>>> This is the routine as it looks now (I would be happy to hear about errors
&g
>>>>> "JWK" == John W Krahn writes:
i must have not see the OP's reply yet so this is mostly for him.
>> This is the routine as it looks now (I would be happy to hear about errors
>> or improvements that you might see)
>> sub round {
so on. The country has only a
few days left till the end of the month by which time this should absolutely
be working.
This is the routine as it looks now (I would be happy to hear about errors
or improvements that you might see)
sub round {
my $number = shift;
if ( $number == 0 ) { return 0
t; > > cent or even 3 cents if there are lots of elements. Going over the
> logic
> > > I ran into this problem.
> > >
> > > Cany anyone advise me how to deal with this as I need to find a way to
> > > round correctly in all cases not just in cases wher
to find a way to
> > round correctly in all cases not just in cases where Perl decides it is a
> > good idea to do so. :-)
>
> The problem is likely caused by the fact that floating-point numbers in
> most modern computers are represented by using binary digits (and binary
> fra
> Hi list,
>
> I am just wondering if I sumbled upon an error in perl an error in my
> logic
> or somehtign else see the below perl one liners
>
> $ perl -e '$n = 0.945; $r = sprintf("%.2f", $n); print "$r\n";'
> 0.94
>
> $ perl -e '$n = 0.9451; $r = sprintf("%.2f", $n); print "$r\n";'
> 0.95
>
>
Rob Coops asked:
> I am just wondering if I sumbled upon an error in perl an error in my
> logic or somehtign else see the below perl one liners
>
> $ perl -e '$n = 0.945; $r = sprintf("%.2f", $n); print "$r\n";'
> 0.94
Short answer: You shouldn't use floating point numbers for financial
calcul
ran into this
> problem.
>
> Cany anyone advise me how to deal with this as I need to find a way to
> round correctly in all cases not just in cases where Perl decides it is a
> good idea to do so. :-)
>
The problem is likely caused by the fact that floating-point numbers in
Hi list,
I am just wondering if I sumbled upon an error in perl an error in my logic
or somehtign else see the below perl one liners
$ perl -e '$n = 0.945; $r = sprintf("%.2f", $n); print "$r\n";'
0.94
$ perl -e '$n = 0.9451; $r = sprintf("%.2f", $n); print "$r\n";'
0.95
$ perl -e '$n = 0.9450;
n what are the criteria that separates the
warnings from the errors? Once you know that, you can write a filter to
remove them.
--
Just my 0.0002 million dollars worth,
Shawn
Programming is as much about organization and communication
as it is about coding.
I like Perl; it's the
Jeff Pang wrote:
> On Tue, Apr 20, 2010 at 1:28 PM, Weizhong Dai
> wrote:
> > Hi all,
> > In my script, I have a system call, and redirect the stderr to a
> file.
> > #
> > # open STDERR, ">$workpath\\error_log.txt";
> > # system "...";
> > #
> > but I only want the E
On Tue, Apr 20, 2010 at 1:28 PM, Weizhong Dai wrote:
> Hi all,
> In my script, I have a system call, and redirect the stderr to a file.
> #
> # open STDERR, ">$workpath\\error_log.txt";
> # system "...";
> #
> but I only want the ERROR messages to be logged in the file.
Hi all,
In my script, I have a system call, and redirect the stderr to a file.
#
# open STDERR, ">$workpath\\error_log.txt";
# system "...";
#
but I only want the ERROR messages to be logged in the file. Is there
any method to filter the WARNING messages generated by
"John W. Krahn" writes:
>> I'm on a single user machine at home. I'm thinking I could just write
>> to /tmp/BashHistoryDeDup.tmp with the `>' flag, overwriting on each
>> run and forget unlinking
>
> That could be a security hole. Even though you have a single user
> machine it is always best p
2009/10/19 Harry Putnam :
>
>>> use File::Copy;
>
> Dermot commented:
>> It might be best to put this at the top of your script with all the
>> other loadable modules your using.
>
> Harry asks:
> Do you think it would make a difference in how the script behaves? Or
> do you mean for the sake of g
Harry Putnam wrote:
"John W. Krahn" writes:
Harry Putnam wrote:
I'm not sure what these errors are telling me.
The script is supposed to remove dups from .bash_history
Wouldn't it be simpler to set HISTCONTROL to ignoredups:
export HISTCONTROL=ignoredups
Or:
"John W. Krahn" writes:
> Harry Putnam wrote:
>> I'm not sure what these errors are telling me.
>>
>> The script is supposed to remove dups from .bash_history
>
> Wouldn't it be simpler to set HISTCONTROL to ignoredups:
>
> export HISTCONTROL
27;t really clear what they are suggesting here:
(From perldoc File::Temp.. when the notes about OOp usage start)
[...]
Object interface:
require File::Temp;
use File::Temp ();
[...]
I even remember thinking, when I looked it up with perldoc, that I
might be get
Harry Putnam wrote:
I'm not sure what these errors are telling me.
The script is supposed to remove dups from .bash_history
Wouldn't it be simpler to set HISTCONTROL to ignoredups:
export HISTCONTROL=ignoredups
Or:
export HISTCONTROL=ignoreboth
but not operate on the las
1 - 100 of 452 matches
Mail list logo