× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: AS/400 Perl Challenges
  • From: "Gary Kuznitz " <docfxit@xxxxxxxxxxx>
  • Date: Thu, 13 Jan 2000 13:46:05 -0800

On 13 Jan 00, at 8:01, boldt@ca.ibm.com wrote:
> Gary wrote:
> >When trying to run a perl script on the 400 I'm getting the 
following
> >errors:
> >    Global symbol "ip" requires explicit package name at , line 
14.
> >    Global symbol "user" requires explicit package name at , line
> >14.
> Hi Gary!  First off, these errors are not unique to the AS/400.
> What's happening is that "use strict;" places certain restrictions 
> on the program for the purpose of weeding out common 
programming errors. 
> Using "use strict;" is considered a good thing, and forces you to 
use
> certain highly recommended things.  The one thing it requires is 
that
> all variables be declared before use. (That's the message you're
> getting over and over again.)  Declare your names using the 
function
> "my".  At the beginning, add the statement "my ($ip, $user, 
$pass);"
> and you'll eliminate the first 3 of your error messages.
> 
> Regarding -W, try coding -w instead.
> 
> (I'm not familiar with "use diagnostics", so I can't help there.)
> 
> Finally, the best place to start when debugging Perl programs
> is the documentation.  To start with, check the FAQ at
> <http://www.perl.com/pub/v/faqs/>.  When you've read everything
> and you still can't get things working, check the newsgroup
> comp.lang.perl.misc.  But I'll warn you, if they even suspect
> you haven't read the FAQ, they may not be very helpful.  You're
> expected to read the docs first before posting there.
> 
> Cheers!  Hans
> 
> Hans Boldt, ILE RPG Development, IBM Toronto Lab, 
boldt@ca.ibm.com

Thank you very much Hans.  This is just what I needed.  I'm happy 
to read the documentation now that I know where it's at.  
Boy !  I sure am glad you started me off on the right foot with the 
suggestion of adding the statement "my ($ip, $user, $pass);"
I would have never guessed that from the FAQ.  Since I ran the 
script once with the "use strict;" statement and then commented it 
out because it generated so many errors I'm guessing even though 
the program ended I would have to sign off the session for it to not 
"use strict;" while running.  Pretty strange it persists after the 
program ended. 

Thanks again,

Gary Kuznitz
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.