In your example code it is $nf that is undefined, not $pop2. Sounds
like something wrong in your code, most likely.
On 4/3/07, Michael Hearne via RT <bug-Number-Format@rt.cpan.org> wrote:
Show quoted text>
> Tue Apr 03 18:00:57 2007: Request 26079 was acted upon.
> Transaction: Ticket created by mhearne@usgs.gov
> Queue: Number-Format
> Subject: format_number() error
> Broken in: (no value)
> Severity: (no value)
> Owner: Nobody
> Requestors: mhearne@usgs.gov
> Status: new
> Ticket <URL:
>
http://rt.cpan.org/Ticket/Display.html?id=26079 >
>
>
> In certain cases, that I unfortunately cannot reproduce easily (i.e.,
> without including all of my supporting source code), I get the
> following error:
>
> Can't call method "format_number" on an undefined value at ...
>
> This occurs (in this one bit of code) even when I wrap the offending
> line with something like:
>
> if (defined($pop2)){
> $popS = $nf->format_number($pop2);
> }
>
> Number::Format info:
> Module id = Number::Format
> DESCRIPTION Package for formatting numbers for display
> CPAN_USERID WRW (William R Ward <bill@wards.net>)
> CPAN_VERSION 1.52
> CPAN_FILE W/WR/WRW/Number-Format-1.52.tar.gz
> DSLI_STATUS RdpO
> (released,developer,perl,object-oriented)
> MANPAGE Number::Format - Perl extension for formatting numbers
> INST_FILE /Library/Perl/5.8.6/Number/Format.pm
> INST_VERSION 1.52
>
> Perl info:
> This is perl, v5.8.6 built for darwin-thread-multi-2level
> (with 3 registered patches, see perl -V for more detail)
>
> Platform is Intel Mac OS X, Darwin Kernel Version 8.9.1.
>
> Thanks,
>
> Mike Hearne
>
>
>
>
>
> ----------------------------------------------------------------
> Michael Hearne
> mhearne@usgs.gov
> (303) 273-8620
> USGS National Earthquake Information Center
> 1711 Illinois St. Golden CO 80401
> Senior Software Engineer
> Synergetics, Inc.
> ----------------------------------------------------------------
>
>
>
>
>
>
> In certain cases, that I unfortunately cannot reproduce easily (i.e.,
> without including all of my supporting source code), I get the following
> error:
>
> Can't call method "format_number" on an undefined value at ...
>
> This occurs (in this one bit of code) even when I wrap the offending line
> with something like:
>
> if (defined($pop2)){
> $popS = $nf->format_number($pop2);
> }
>
> Number::Format info:
> Module id = Number::Format
> DESCRIPTION Package for formatting numbers for display
> CPAN_USERID WRW (William R Ward <bill@wards.net>)
> CPAN_VERSION 1.52
> CPAN_FILE W/WR/WRW/Number-Format-1.52.tar.gz
> DSLI_STATUS RdpO
> (released,developer,perl,object-oriented)
> MANPAGE Number::Format - Perl extension for formatting numbers
> INST_FILE /Library/Perl/5.8.6/Number/Format.pm
> INST_VERSION 1.52
>
> Perl info:
> This is perl, v5.8.6 built for darwin-thread-multi-2level
> (with 3 registered patches, see perl -V for more detail)
>
> Platform is Intel Mac OS X, Darwin Kernel Version 8.9.1.
>
> Thanks,
>
> Mike Hearne
>
>
>
>
>
> ----------------------------------------------------------------
> Michael Hearne
> mhearne@usgs.gov
> (303) 273-8620
> USGS National Earthquake Information Center
> 1711 Illinois St. Golden CO 80401
> Senior Software Engineer
> Synergetics, Inc.
> ----------------------------------------------------------------
>
>
>
>
>
>
--
Help bring back the San Jose Earthquakes -
http://www.soccersiliconvalley.com/