>>>>> "RN" == Ranga Nathan <[EMAIL PROTECTED]> writes:
RN> I keep getting bogus messages like:
RN> Name "ams::uscs_trailer_out" used only once: possible typo at
RN> /local/bax/test/uscs_client.pl line 137.
RN> Name "ams::uscs_header_out" used only once: possible typo at
RN> /local/bax/test/uscs_client.pl line 137.
as others have said, it really does mean what it says. double check your
spelling of all those variables. using fully qualified names will bypass
strict and so you could have typos and not see them.
RN> even though I have:
RN> package ams;
RN> ......
RN> our $SOH = chr(0x01);
RN> our $STX = chr(0x02);
RN> our $ETX = chr(0x03);
RN> ......
RN> our $uscs_header_out =
RN> "\r\n".$SOH."WASUCCR"."\r\n.".$ams::orig_code."\r\n".$STX;
RN> our $uscs_trailer_out = "\r\n".$ETX;
RN> ...
RN> In the script using the package.....
RN> my $message = $ams::uscs_header_out.$in_data.$ams::uscs_trailer_out;
RN> #warning
when i created this setup i get no warnings:
in file ranga.pm:
use strict ;
use warnings ;
package ams;
our $SOH = chr(0x01);
our $STX = chr(0x02);
our $ETX = chr(0x03);
our $orig_code = '' ;
our $uscs_header_out =
"\r\n".$SOH."WASUCCR"."\r\n.".$ams::orig_code."\r\n".$STX;
our $uscs_trailer_out = "\r\n".$ETX;
in file ranga2:
#!/usr/local/bin/perl
use strict ;
use warnings ;
use ranga ;
package ams2 ;
my $in_data = '' ;
my $message = $ams::uscs_header_out.$in_data.$ams::uscs_trailer_out;
i see no warnings or errors when i run this. perhaps you have typos in
your code but not in what is in the email?
i would suggest you use studly caps for package names as all lower
case names are reserved for pragmas.
and i prefer to use interpolation over . (they get compiled to the same
code). most people think it is easier to read:
package AMS;
our $SOH = "\x01";
our $STX = "\x02";
our $ETX = "\x03";
our $orig_code = '' ;
our $uscs_header_out = "\r\n${SOH}WASUCCR\r\n$orig_code\r\n$STX";
the $ams isn't needed before $orig_code since it is declare with our in
the same lexical scope
our $uscs_trailer_out = "\r\n$ETX";
my $message = $AMS::uscs_header_out.$in_data.$AMS::uscs_trailer_out;
uri
--
Uri Guttman ------ [EMAIL PROTECTED] -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm