|
I have found peculiar things happening with perl on the AS/400. I think this is one of them. If someone knows of a more appropriate email list I should take this to please let me know. Sorry to all the people that don't care to know anything about perl. 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. Global symbol "pass" requires explicit package name at , line 14. Global symbol "domain" requires explicit package name at , line 14. Global symbol "AF_INET" requires explicit package name at , line 16. Global symbol "SOCK_STREAM" requires explicit package name at , line 17. ===> Continued with 5 more pages of the same The perl script looks like this: #!/usr/bin/perl #use strict; Commented out - AS/400 gives a ton of errors ###################################################### # -W on AS/400 gives error message on V4R4 # Can't emulate -W on #! line at # /QOpenSys/DYNDNSUPDATE.PL line 1 ###################################################### # use diagnostics on AS/400 gives error message on V4R4 # couldn''t find diagnostic data in # /QOpenSys/usr/local/lib/perl5/pod/perldiag.pod # /QOpenSys/usr/local/lib/perl5/site_perl/os400/5.003 # /QOpenSys/usr/local/lib/perl5 # /QOpenSys/usr/local/lib/perl5/site_perl/os400 # /QOpenSys/usr/local/lib/perl5/site_perl # /QOpenSys/DYNDNSUPDATE.PL at # /QOpenSys/usr/local/lib/perl5/diagnostics.pm # line 225, <POD_DIAG> chunk 507 # Begin failed--compilation aborted at # /QOpenSys/DYNDNSUPDATE.PL # line 2, <POD_DIAG> chunk 507 #use diagnostics; # ###################################################### # # Perl implementation of DYNDNS.COM's NamedControl Client. # # by Gunnar Hellekson <ghelleks@herne.drew.edu> 11/2/96 # # based (heavily) on p.342 of the 1st Camel book # ###################################################### ($ip, $user, $pass, $domain) = @ARGV; $AF_INET = 2; $SOCK_STREAM = 1; $SIG{'INT'} = 'dokill'; sub dokill { kill 9,$child if $child; } $sockaddr = "S n a4 x8"; $user = "username" unless $user; $pass = "password" unless $pass; $domain = "dyndns.com" unless $domain; $info = pack("a20", $user) . pack("a20", $pass) . pack("a16", $ip) . pack("a64", $domain); ($name, $aliases, $proto) = getprotobyname('tcp'); ($name, $aliases, $port) = getservbyname(50, 'tcp') unless $port =~ /^d+$/; ($name, $aliases, $type, $len, $thisaddr) = gethostbyname(chop($hostname = "myhostname.com")); ($name, $aliases, $type, $len, $thataddr) = gethostbyname("dyndns.com"); $this = pack($sockaddr, $AF_INET, 0, $thisaddr); $that = pack($sockaddr, $AF_INET, 50, $thataddr); socket(S, $AF_INET, $SOCK_STREAM, $proto) || die $!; bind(S, $this) || die $!; connect(S,$that) || die $!; select(S); $| = 1; select(STDOUT); if ($child = fork) { print "Waiting for routing tables to update...\n"; sleep 10; print S $info; sleep 3; do dokill(); } else { while (<S>) { printf("%s", $_); } print; } Does anyone have any idea how to get rid of these errors? I'd sure appreciate any input that even might be a possibility. Thanks a bunch ahead of time. 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 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.