Re: Question about variable scope



John W. Krahn wrote:
nospam wrote:
# $nntp = Net::NNTP->new($newshost);

Here $nntp is a package variable and is visible anywhere inside the current package. Even if you had used a lexical variable it would be
visible anywhere after this point in the program.

The line of code in question is commented out. $nntp is not a variable,
but part of a comment.

The OP should read the posting guidelines for this group and try asking
the question again.
.



Relevant Pages

  • Re: Perl style examples (summary)
    ... For CGI: http://users.easystreet.com/ovid/cgi_course/ (John W. Krahn) ... "Perl Best Practices" by Damian Conway ... Janet Goldstein, Christian Winter, Adrian Howard. ...
    (comp.lang.perl.moderated)
  • Re: Comparing hash tables
    ... John W. Krahn napisal: ... certain sorts of tools at low cost and in short order. ...
    (comp.lang.perl.misc)
  • Re: Fibonacci string
    ... John W. Krahn wrote: ... Take the string '1' and replace it with '10'. ... >>> a Fibonacci sequence for each count (offset by one iteration). ...
    (comp.lang.perl.misc)
  • Re: Regexp help.
    ... John W. Krahn wrote: ... so I decided to strip them off. ... a scout around www.nslu2-linux.org - and perhaps there isn't any easier ...
    (comp.lang.perl.misc)
  • Re: Perl error
    ... John W. Krahn wrote: ... Southwest Foundation for Biomedical Research phone: ...
    (perl.beginners)