MacPerl-Digest Thursday, April 8 1999 Volume 01 : Number 035 RE: [MacPerl] Subject lines [MacPerl] EBCDIC in, ASCII out? Re: [MacPerl] EBCDIC in, ASCII out? Re: [MacPerl] EBCDIC in, ASCII out? [MacPerl] MacPerl and IO::Socket::peeraddr() Re: [MacPerl] EBCDIC in, ASCII out? Re: [MacPerl] Q on Toolbox access from Perl Re: [MacPerl] EBCDIC in, ASCII out? [MacPerl] macperl with First Class Re: [MacPerl] macperl with First Class ---------------------------------------------------------------------- Date: Tue, 06 Apr 1999 16:40:42 -0400 From: "Hoffman, Glenn W" <glenn.w.hoffman@lmco.com> Subject: RE: [MacPerl] Subject lines Rich Morin wrote: > Please try to use descriptive Subject lines for your postings. > Starting (or continuing) a thread with an inappropriate Subject > line makes it harder for everyone on the list to figure out > whether the topic is of interest. > And, if I may, I would request that posters not alter the Subject line in any way (unless the Subject is inappropriate, as Rich discussed above). I am forced to use an email client in which the only threading available is by Subject line. I have seen Subject lines acquire extra (doubled) spaces in them, become truncated, or simply misspelled (a typo). All this breaks the limited threading I have available. Thanks, Glenn ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ Date: Tue, 6 Apr 1999 16:27:13 -0500 From: John Gilmore-Baldwin <john@dwx.com> Subject: [MacPerl] EBCDIC in, ASCII out? That's what I need to do, take an EBCDIC file, and translate it to ASCII. While the task isn't that difficult, if somebody has already written an elegant solution, I feel no need to do it too. So, if anybody know of a solution for this conversion that's already done, please let me know. Thanks, John ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ Date: Tue, 6 Apr 1999 16:54:22 -0500 From: Jim Miner <jfm@winternet.com> Subject: Re: [MacPerl] EBCDIC in, ASCII out? John, There's a module in CPAN, Convert::Translit, which converts to and from a very large number of characcter encodings. It's in pure Perl, so it probably will work on the Mac, though I haven't actually used it. Please let us know if it works for you. <http://www.cpan.org/modules/by-module/Convert/Convert-Translit-1.03.tar.gz> Jim At 4:27 PM -0500 4/6/99, John Gilmore-Baldwin wrote: >That's what I need to do, take an EBCDIC file, and translate it to ASCII. > >While the task isn't that difficult, if somebody has already written an >elegant solution, I feel no need to do it too. So, if anybody know of a >solution for this conversion that's already done, please let me know. > - -- Jim Miner jfm@winternet.com ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ Date: Tue, 6 Apr 99 15:26:38 PDT From: pvhp@forte.com (Peter Prymmer) Subject: Re: [MacPerl] EBCDIC in, ASCII out? John Gilmore-Baldwin wrote: > That's what I need to do, take an EBCDIC file, and translate it to ASCII. > > While the task isn't that difficult, if somebody has already written an > elegant solution, I feel no need to do it too. So, if anybody know of a > solution for this conversion that's already done, please let me know. There are a number of modules on CPAN that handle this. Many are simply implemented using perl arrays and the tr// operator - hence they involve no XS coding at all. Some allow for choosing and/or setting various codepages. For example: http://www.cpan.org/authors/id/CXL/ http://www.cpan.org/authors/id/CXL/Convert-EBCDIC-0.06.tar.gz Geoffrey Rommel has recently posted a couple of Convert::IBM390 modules to the CPAN. Convert-IBM390-0.01 is an xs based module (fast) and Convert-IBM390p-0.01 is a pure perl module (may be slower but easier to install, particularly on platforms without C compilers). I've not yet had a chance to try them out but folks are certainly welcome to do so. See: http://www.cpan.org/authors/id/G/GR/GROMMEL/ http://www.cpan.org/authors/id/G/GR/GROMMEL/Convert-IBM390-0_01_tar.gz See also: http://www.cpan.org/authors/Genji_Schmeder/ http://www.cpan.org/authors/Genji_Schmeder/Convert-Translit-1.03.tar.gz which was developed on a Mac (I do not know what EBCDIC codepages are mentioned in RFC 1345 unfortunately). Peter Prymmer ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ Date: Tue, 6 Apr 1999 18:25:44 -0400 From: "Paul L. Suh" <psuh@apple.com> Subject: [MacPerl] MacPerl and IO::Socket::peeraddr() - -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm new to the list, although not particularly to MacPerl. I have a problem with one of the examples from the documentation, in the perlipc.pod file. In the section on using IO::Socket, there is an example of creating a server using ->new() and then ->accept() and then getting a client socket back. However, the call $client->peeraddr; fails with an error that the field is empty. No matter what I try, I cannot get data on the address of the client who has accessed my server. Has anyone encountered this before? How can I locate the address of the client who is hitting my server? I'd like to keep it OO using IO::Socket if I can. - - --Paul - -----BEGIN PGP SIGNATURE----- Version: PGP 6.0.2 iQA/AwUBNwqJ5G9ORSfn1gnaEQJJiACaAuMakzjsO2GgpBebDsoIQaS+S3EAoMdv AxNT1LS1RyvjgpS2ltIWHUpU =iq8l - -----END PGP SIGNATURE----- ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ Date: Tue, 06 Apr 1999 16:30:25 -0700 From: Irv Rabin <irabin@us.oracle.com> Subject: Re: [MacPerl] EBCDIC in, ASCII out? This is a multi-part message in MIME format. - --------------39731A7F227ED56501CE581F Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Here are plain C solutions to translate from ISO1047 to ISO8859-1 and vice versa. Simply compile and link under OS/390 Unix System services, no subroutines are needed. Peter Prymmer wrote: > John Gilmore-Baldwin wrote: > > > That's what I need to do, take an EBCDIC file, and translate it to ASCII. > > > > While the task isn't that difficult, if somebody has already written an > > elegant solution, I feel no need to do it too. So, if anybody know of a > > solution for this conversion that's already done, please let me know. > > There are a number of modules on CPAN that handle this. Many are simply > implemented using perl arrays and the tr// operator - hence they involve > no XS coding at all. Some allow for choosing and/or setting various > codepages. For example: > > http://www.cpan.org/authors/id/CXL/ > http://www.cpan.org/authors/id/CXL/Convert-EBCDIC-0.06.tar.gz > > Geoffrey Rommel has recently posted a couple of Convert::IBM390 > modules to the CPAN. Convert-IBM390-0.01 is an xs based module > (fast) and Convert-IBM390p-0.01 is a pure perl module (may be slower > but easier to install, particularly on platforms without C compilers). > I've not yet had a chance to try them out but folks are certainly welcome > to do so. See: > > http://www.cpan.org/authors/id/G/GR/GROMMEL/ > http://www.cpan.org/authors/id/G/GR/GROMMEL/Convert-IBM390-0_01_tar.gz > > See also: > > http://www.cpan.org/authors/Genji_Schmeder/ > http://www.cpan.org/authors/Genji_Schmeder/Convert-Translit-1.03.tar.gz > > which was developed on a Mac (I do not know what EBCDIC codepages are > mentioned in RFC 1345 unfortunately). > > Peter Prymmer - --------------39731A7F227ED56501CE581F Content-Type: image/x-xbitmap; name="a2E.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="a2E.c" #define _XOPEN_SOURCE_EXTENDED 1 #include "stdio.h" #include "string.h" #include <sys/stat.h> static unsigned char trans_table[256] = { 0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, /* 00-07 */ 0x16, 0x05, 0x15, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 08-0f */ 0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, /* 10-17 */ 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f, /* 18-1f */ 0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, /* 20-27 */ 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61, /* 28-2f */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 30-37 */ 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f, /* 38-3f */ 0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 40-47 */ 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, /* 48-4f */ 0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, /* 50-57 */ 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d, /* 58-5f */ 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 60-67 */ 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, /* 68-6f */ 0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, /* 70-77 */ 0xa7, 0xa8, 0xa9, 0xc0, 0x4f, 0xd0, 0xa1, 0x07, /* 78-7f */ 0x20, 0x36, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, /* 80-87 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x38, 0x0a, 0x1b, /* 88-8f */ 0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x09, 0x08, /* 90-97 */ 0x21, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xff, /* 98-9f */ 0x41, 0xaa, 0x4a, 0xb1, 0x9f, 0xb2, 0x6a, 0xb5, /* a0-a7 */ 0xbb, 0xb4, 0x9a, 0x8a, 0xb0, 0xca, 0xaf, 0xbc, /* a8-af */ 0x90, 0x8f, 0xea, 0xfa, 0xbe, 0xa0, 0xb6, 0xb3, /* b0-b7 */ 0x9d, 0xda, 0x9b, 0x8b, 0xb7, 0xb8, 0xb9, 0xab, /* b8-bf */ 0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9e, 0x68, /* c0-c7 */ 0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77, /* c8-cf */ 0xac, 0x69, 0xed, 0xee, 0xeb, 0xef, 0xec, 0xbf, /* d0-d7 */ 0x80, 0xfd, 0xfe, 0xfb, 0xfc, 0xba, 0xae, 0x59, /* d8-df */ 0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9c, 0x48, /* e0-e7 */ 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57, /* e8-ef */ 0x8c, 0x49, 0xcd, 0xce, 0xcb, 0xcf, 0xcc, 0xe1, /* f0-f7 */ 0x70, 0xdd, 0xde, 0xdb, 0xdc, 0x8d, 0x8e, 0xdf /* f8-ff */ }; main(int argc, char**argv) { void print_help(); int ind; FILE *the_file; unsigned char *the_data; int the_len; unsigned short *flags; struct stat stats; int file_writeable = 0; int found = 0; int update = 0; if ( (argc > 1) && (strcmp(argv[1],"-h")==0) ) { print_help(); return; } if ( argc!=2 ) { /* check if we got all args */ print_help(); return; } if (lstat(argv[1], &stats)==0) { /* check the file */ if (S_ISREG(stats.st_mode)) { the_len = stats.st_size; } else { printf("a2E: file %s is not regular\n", argv[1]); return; } } else { printf("a2E: file %s not found\n", argv[1]); return; } the_data = (unsigned char *)malloc(the_len); /* storage for file */ if (the_file=fopen(argv[1],"rb+")) file_writeable = 1; else the_file=fopen(argv[1],"r"); if (the_file) { fread(the_data,1,the_len,the_file); fclose(the_file); for (ind=0; (ind < the_len); ind++) { the_data[ind] = trans_table[the_data[ind]]; } fwrite(the_data,1,the_len,stdout); } else { printf("a2E: cannot open file %s to read\n", argv[1]); } free(the_data); } void print_help() { printf("\na2E: translate the ascii file into EBCDIC\n\n"); printf("Format:\n\n"); printf(" a2E <source> > <destination>\n"); return; } - --------------39731A7F227ED56501CE581F Content-Type: image/x-xbitmap; name="E2a.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="E2a.c" #define _XOPEN_SOURCE_EXTENDED 1 #include "stdio.h" #include "string.h" #include <sys/stat.h> static unsigned char trans_table[256] = { 0x00, 0x01, 0x02, 0x03, 0x9c, 0x09, 0x86, 0x7f, /* 00-07 */ 0x97, 0x96, 0x8e, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 08-0f */ 0x10, 0x11, 0x12, 0x13, 0x9d, 0x0a, 0x08, 0x87, /* 10-17 */ 0x18, 0x19, 0x92, 0x8f, 0x1c, 0x1d, 0x1e, 0x1f, /* 18-1f */ 0x80, 0x98, 0x82, 0x83, 0x84, 0x0a, 0x17, 0x1b, /* 20-27 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07, /* 28-2f */ 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x81, 0x04, /* 30-37 */ 0x8d, 0x99, 0x9a, 0x9b, 0x14, 0x15, 0x9e, 0x1a, /* 38-3f */ 0x20, 0xa0, 0xe2, 0xe4, 0xe0, 0xe1, 0xe3, 0xe5, /* 40-47 */ 0xe7, 0xf1, 0xa2, 0x2e, 0x3c, 0x28, 0x2b, 0x7c, /* 48-4f */ 0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef, /* 50-57 */ 0xec, 0xdf, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0x5e, /* 58-5f */ 0x2d, 0x2f, 0xc2, 0xc4, 0xc0, 0xc1, 0xc3, 0xc5, /* 60-67 */ 0xc7, 0xd1, 0xa6, 0x2c, 0x25, 0x5f, 0x3e, 0x3f, /* 68-6f */ 0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf, /* 70-77 */ 0xcc, 0x60, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22, /* 78-7f */ 0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 80-87 */ 0x68, 0x69, 0xab, 0xbb, 0xf0, 0xfd, 0xfe, 0xb1, /* 88-8f */ 0xb0, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, /* 90-97 */ 0x71, 0x72, 0xaa, 0xba, 0xe6, 0xb8, 0xc6, 0xa4, /* 98-9f */ 0xb5, 0x7e, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, /* a0-a7 */ 0x79, 0x7a, 0xa1, 0xbf, 0xd0, 0x5b, 0xde, 0xae, /* a8-af */ 0xac, 0xa3, 0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc, /* b0-b7 */ 0xbd, 0xbe, 0xdd, 0xa8, 0xaf, 0x5d, 0xb4, 0xd7, /* b8-bf */ 0x7b, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* c0-c7 */ 0x48, 0x49, 0xad, 0xf4, 0xf6, 0xf2, 0xf3, 0xf5, /* c8-cf */ 0x7d, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, /* d0-d7 */ 0x51, 0x52, 0xb9, 0xfb, 0xfc, 0xf9, 0xfa, 0xff, /* d8-df */ 0x5c, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, /* e0-e7 */ 0x59, 0x5a, 0xb2, 0xd4, 0xd6, 0xd2, 0xd3, 0xd5, /* e8-ef */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* f0-f7 */ 0x38, 0x39, 0xb3, 0xdb, 0xdc, 0xd9, 0xda, 0x9f /* f8-ff */ }; main(int argc, char**argv) { void print_help(); int ind; FILE *the_file; unsigned char *the_data; int the_len; unsigned short *flags; struct stat stats; int file_writeable = 0; int found = 0; int update = 0; if ( (argc > 1) && (strcmp(argv[1],"-h")==0) ) { print_help(); return; } if ( argc!=2 ) { /* check if we got all args */ print_help(); return; } if (lstat(argv[1], &stats)==0) { /* check the file */ if (S_ISREG(stats.st_mode)) { the_len = stats.st_size; } else { printf("E2a: file %s is not regular\n", argv[1]); return; } } else { printf("E2a: file %s not found\n", argv[1]); return; } the_data = (unsigned char *)malloc(the_len); /* storage for file */ if (the_file=fopen(argv[1],"rb+")) file_writeable = 1; else the_file=fopen(argv[1],"r"); if (the_file) { fread(the_data,1,the_len,the_file); fclose(the_file); for (ind=0; (ind < the_len); ind++) { the_data[ind] = trans_table[the_data[ind]]; } fwrite(the_data,1,the_len,stdout); } else { printf("E2a: cannot open file %s to read\n", argv[1]); } free(the_data); } void print_help() { printf("\nE2a: translate the EBCDIC file into ascii\n\n"); printf("Format:\n\n"); printf(" E2a <source> > <destination>\n"); return; } - --------------39731A7F227ED56501CE581F-- ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ Date: Tue, 06 Apr 1999 20:44:14 -0100 From: David Turley <dturley@binary.net> Subject: Re: [MacPerl] Q on Toolbox access from Perl At 03:11 PM 7/24/99 -0500, Walter Torres sent a message: ^^^^^^^? X-From_: neeri@iis.ee.ethz.ch Wed Feb 24 15:16:21 1999 X-Authentication-Warning: zinal.ee.ethz.ch: majordom set sender to owner-mac-perl@iis.ee.ethz.ch using -f Reply-To: <walter@tscinternet.com> From: "Walter Torres" <walter@tscinternet.com> To: "MacPerl" <mac-perl@iis.ee.ethz.ch> Subject: [MacPerl] Q on Toolbox access from Perl Date: Sat, 24 Jul 1999 15:11:21 -0500 ^^^^^^^^^^^ Now I need *that* module! :-) use TIME::Travel; - -- David Turley dturley@pobox.com http://www.binary.net/dturley ICQ: 29435332 ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ Date: Tue, 6 Apr 1999 21:09:49 -0500 From: John Gilmore-Baldwin <john@dwx.com> Subject: Re: [MacPerl] EBCDIC in, ASCII out? Thanks all. I grabbed the Convert::EBCDIC module, and it works fine on the Mac. I haven't finished looking at all of the solutions I got, but I will. And I really appreciate the help. Thanks again, John >That's what I need to do, take an EBCDIC file, and translate it to ASCII. > >While the task isn't that difficult, if somebody has already written an >elegant solution, I feel no need to do it too. So, if anybody know of a >solution for this conversion that's already done, please let me know. > >Thanks, >John > > > >===== Want to unsubscribe from this list? >===== Send mail with body "unsubscribe" to macperl-request@macperl.org ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ Date: Wed, 7 Apr 1999 10:02:57 +0100 From: james@djassociates.com (James Fox) Subject: [MacPerl] macperl with First Class Hi, Does anyone use MacPerl with Soft Arc's First Class Intranet Server? I am having problems running scripts with my server, I keep getting an 'Internal Error 500'. I put my scripts in the CGI-BIN directory in First Class and saved them as cgi scripts, however, I still get the error message. Any help would be appreciated. regards James ~ James Fox ~ james@djassociates.com ~ +44 (0) 114 2210525 ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ Date: Wed, 7 Apr 1999 10:41:55 -0400 (EDT) From: rjk@linguist.dartmouth.edu (Ronald J. Kimball) Subject: Re: [MacPerl] macperl with First Class James Fox wrote: > > Hi, > > Does anyone use MacPerl with Soft Arc's First Class Intranet > Server? > I am having problems running scripts with my server, I keep getting > an 'Internal Error 500'. I put my scripts in the CGI-BIN directory in > First Class and saved them as cgi scripts, however, I still get the > error message. > Any help would be appreciated. Did you check the error logs? Ronald ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org ------------------------------ End of MacPerl-Digest V1 #35 **************************** ==== Want to unsubscribe from this list? ==== Send mail with body "unsubscribe" to ==== macperl-digest-request@macperl.org