Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > Re: Log error
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 11063 of 11509
Post > Topic >>

Re: Log error

by rob.dixon@[EMAIL PROTECTED] (Rob Dixon) May 13, 2008 at 08:42 AM

Irfan.Sayed@[EMAIL PROTECTED]
 wrote:
> 
> I have written once Perl script to perform certain task. In that script
> I have defined one function to create the log file.
> 
> The issue is that whenever I am running that script it is executing fine
> but the moment it reaches to log () function it throws me following
error.
> 
> Can't take log of 0 at /usr/tools/deployment/scripts/merge line 392,
> <STDIN> line 6

First of all, always

  use strict;
  use warnings;

at the start of your code, and declare all variables with 'my'. Many
simple
errors will be flagged straight away if you do this.

You have declared a subroutine called 'log', which clashes with the
built-in
decimal logarithm function. You could all it as main::log(), but the best
way is
to avoid the name clash and call it 'create_log' or something similar.

HTH,

Rob
 




 1 Posts in Topic:
Re: Log error
rob.dixon@[EMAIL PROTECTE  2008-05-13 08:42:10 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 23 20:59:56 CDT 2008.