[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: [ID 20000112.002] "Used only once" doesn't recognize arguementpassing



On Jan 12, Kenneth Kron said:

> The following code fragment incorrectly reports NPORTS only used once
> when it is passed to a subroutine

Probably because Perl expects the NPORTS filehandle to be passed as
*NPORTS or \*NPORTS, unless the GetPortList function has been prototyped
to take a glob as its first argument.

> perl -cw
> open (NPORTS, "<MS_Ports.txt") ||
>   &log("Master Pop port list not available", ":$!", $Notify) ;
> %NPops = &GetPortList(NPORTS) ;
> 
> Name "main::NPORTS" used only once: possible typo at - line 1.
> Name "main::NPops" used only once: possible typo at - line 3.
> Name "main::Notify" used only once: possible typo at - line 2.

-- 

  MIDN 4/C PINYAN, USNR, NROTCURPI     http://www.pobox.com/~japhy/
  jeff pinyan: japhy@pobox.com     perl stuff: japhy+perl@pobox.com
  "The Art of Perl"               http://www.pobox.com/~japhy/book/      
  CPAN ID: PINYAN  http://www.perl.com/CPAN/authors/id/P/PI/PINYAN/
  PerlMonth - An Online Perl Magazine     http://www.perlmonth.com/


Follow-Ups from:
Larry Wall <larry@wall.org>
References to:
Kenneth Kron <kenneth_kron@icgcomm.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]