Home  |  Linux  | Mysql  | PHP  | XML
From:Rob Dixon Date:Tue May 13 01:42:10 2008
Subject:Re: Log error
Irfan.Sayed@t-systems.com 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

Navigate in group perl.beginners at sever nntp.perl.org
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by PHP Developer
Powered By PHP Consultants