srikrishnan has asked for the wisdom of the Perl Monks concerning the following question:

Hi All,

I am using "POSIX" package in my perl script for round out the decimal numbers. It works fine. But when I add GUI using perl TK package. I got the following error, when I run my perl script

Constant subroutine main::NULL redefined at C:/Perl/lib/Exporter.pm line 66. at F:\ADVENT\APP\3B2_PERL_Samples\WebImageConversion\NatureWebImageConversion\NatureWebImageConvers ion.pl line 10

Prototype mismatch: sub main::NULL () vs none at C:/Perl/lib/Exporter.pm line 66. at F:\ADVENT\APP\3B2_PERL_Samples\WebImageConversion\NatureWebImageConversion\NatureWebImageConvers ion.pl line 10

Can anybody help me to identify this problem?

Thanks

R. Srikrishnan

Replies are listed 'Best First'.
Re: POSIX crashes
by ikegami (Patriarch) on Jan 15, 2010 at 08:03 UTC
    Apparently, POSIX has a function called NULL, and you imported it implicitly or explicitly from POSIX. It is conflicting with an existing sub named NULL in the importing package. The solution is simple: Stop importing NULL from POSIX.
    use POSIX qw( names of functions you want to import from POSIX here );

      Thanks it works fine

      Thanks

      Srikrishnan