[6394] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 19 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 26 18:29:37 1997

Date: Wed, 26 Feb 97 15:00:20 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 26 Feb 1997     Volume: 8 Number: 19

Today's topics:
     Re: [Q] Two pipes (Mike Stok)
     Re: assigning ascii character to a variable (Mike Stok)
     Counting lines of Perl code (Leonhard Brenner {13031} 7149 [    ])
     Re: Counting values within a file <jander@ml.com>
     Re: cp, copy, sysread/write (The next Pele)
     Re: cp, copy, sysread/write (Nathan V. Patwardhan)
     Re: dbm problem (Mike Heins)
     Re: Determine perl program memory usage (Steve Kay)
     Re: fflush() in Perl? <jander@ml.com>
     Re: Forms AHHHH...Help !!! <rsweeney@anet-stl.com>
     Re: help: date to time conversion (Mike Stok)
     Re: how long before I can put down the books? (Neil S. Briscoe)
     Re: Is numeric or alphabetic??? (Nathan V. Patwardhan)
     ISO Perl Soundex function (Kenneth Walters)
     libgd.c cannot find malloc.h <tom.gebhardt@hboc.com>
     Re: macperl help (2nd post) (Chris Nandor)
     New Module List Posted (Andreas Koenig)
     Re: newbie question:manipulating strings <fawcett@nynexst.com>
     Re: Perl & Ingress ? (Bruce W. Hoylman)
     Re: Perl History Help (Chris Nandor)
     Re: Perl Script for DNS? (Doug Wegscheid)
     Problem with function gethostbyname <ping0621@ping.be>
     Re: shuffle an array (Mike Stok)
     XS and C++(g++) <tk29@cornell.edu>
     Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 26 Feb 1997 20:50:57 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: [Q] Two pipes
Message-Id: <5f27nh$964@news-central.tiac.net>

In article <33144E52.491F@knoll.hibu.no>,
Vegard Bakke  <vegardb@knoll.hibu.no> wrote:
>I would like to have two sockets. And I don't know which one
>is the next to ask me something.
>
>How do I do that?

One way to do it is to use the 4 argument variant of select.  This allows
you to tell whether one or more file descriptors can be read without
blocking (but you can only guarantee that there's one byte there, so you
might have to loop using sysread to grab a byte at a time)

Check out the C library man page for select as well as the on-line per
documentation and the Camel book (if it's available.)

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


------------------------------

Date: 26 Feb 1997 21:00:40 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: assigning ascii character to a variable
Message-Id: <5f289o$9qf@news-central.tiac.net>

In article <856976213.7493@dejanews.com>,  <dh@rutile.iucr.ac.uk> wrote:
>How do you assign a character to a variable using just its ascii
>number.

>octal value for ascii 'A' is 101
>
>so I can
>
>print "\101";

The double quote interpolation translates \101 into the character whose
ord is 65 (decimal)

>and it prints A, but how to i do this
>
>$a=101;
>$b="\$a";

This sets $a to decimal 101, you might want to do something like

  $a = 101;
  $b = chr oct $a;

in perl 5, or

  $b = sprintf ('%c', oct ($a));

in older perls.

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


------------------------------

Date: 26 Feb 1997 15:35:35 -0500
From: lab@slpabu.msd.ray.com (Leonhard Brenner {13031} 7149 [    ])
Subject: Counting lines of Perl code
Message-Id: <uqd7mjvnw4o.fsf@slpabu.msd.ray.com>

Has someone written a utility to count the lines of code
in a perl script. It should deal with for loops (3 ;).
Multiple code lines per line. And other goodies.
Yes I know this is a stupid metric but, WCID?

Thank you for any help
Lenny Brenner<lab@caesun.msd.ray.com>


------------------------------

Date: 26 Feb 1997 15:54:29 -0500
From: Jim Anderson <jander@ml.com>
Subject: Re: Counting values within a file
Message-Id: <wkbbu97s2yi.fsf@swapsdvlp15.i-did-not-set--mail-host-address--so-shoot-me>

ken@forum.swarthmore.edu (Ken Williams) writes:

> In article <3302DB18.426B@eznet.com>, Darryl Caldwell <darrylc@eznet.com> wrote:
> 
> > I would like to learn how to count multiple occurences of 
> > text within a
> > file.
> > 
> > If a file contains:
> > 
> > 
> > camel
> > iguana
> > penguin
> > cat
> > penguin
> > cheetah
> > camel
> > 
> > I would like to append text underneath this that says:
> > 
> > Total
> > =============
> > camel           2
> > iguana          1
> > penguin         2
> > cat             1
> > cheetah         1
> 
> Hi-
> 
> This isn't a Perl solution, but this has always been one of my favorite
> tricks in Unix:
> 
> cat filename | sort | uniq -c
> 
> That will do what you need, I think, and faster than the Perl equivalent.
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Surely you jest!!!

=========================================
#!/usr/bin/perl -w

chomp, $rec{$_}++ while <DATA>;

foreach (sort keys %rec) {
  print "$_\t$rec{$_}\n";
}

__DATA__
cat
dog
penguin
snake
dog
bug
worm
dog
cat
bird
=========================================

-- 
Jim Anderson			jander@ml.com
Consultant-at-large		jander@jander.com
				(212) 449-1598


------------------------------

Date: 26 Feb 1997 20:42:05 GMT
From: gt1535b@acmey.gatech.edu (The next Pele)
Subject: Re: cp, copy, sysread/write
Message-Id: <5f276t$bjn@catapult.gatech.edu>

I R A Aggie (fl_aggie@hotmail.com) wrote:
: In article <5f249n$au7@catapult.gatech.edu>, gt1535b@acmey.gatech.edu (The
: next Pele) wrote:

: [about system-independent emulation of the unix cp command]

: + Neither has worked.  Any suggestions?

:      NAME
:           File::Copy - Copy files or filehandles

:      SYNOPSIS
:                   use File::Copy;

:                   copy("file1","file2");
:                   copy("Copy.pm",\*STDOUT);'

:                   use POSIX;
:                   use File::Copy cp;

:                   $n=FileHandle->new("/dev/null","r");
:                   cp($n,"x");'

: Check it out.
where did you find this?  did it come with the distribution?  I can't find
the module anywhere.  I don't see it in the book either.


--
<>< Daryl Bowen	<><
Georgia Institute of Technology
Internet: gt1535b@prism.gatech.edu
Siemens Stromberg-Carlson Co-op


------------------------------

Date: 26 Feb 1997 20:52:53 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: cp, copy, sysread/write
Message-Id: <5f27r5$6at@fridge-nf0.shore.net>

The next Pele (gt1535b@acmey.gatech.edu) wrote:
: :                   use POSIX;
: :                   use File::Copy cp;

: where did you find this?  did it come with the distribution?  I can't find
: the module anywhere.  I don't see it in the book either.

It came with both ports of Perl that I'm using (Perl 5.003 for FreeBSD-2.1.5
and NTPerl 5.003_07 from http://www.activeware.com).

--
Nathan V. Patwardhan
nvp@shore.net
"What is the wind speed of a sparrow?"


------------------------------

Date: 26 Feb 1997 22:10:54 GMT
From: mheins@prairienet.org (Mike Heins)
Subject: Re: dbm problem
Message-Id: <5f2cde$dnj@vixen.cso.uiuc.edu>

Marko Vasiljevic (markov@nortel.ca) wrote:
: HI!
: 
: I'm working in Perl 4.0 and I encountered an interesting problem.
: Since I have to do a search on a keyword I decided to use a dbm file
: to store key/value pairs for easy access. When I run my script which
: looks through gobs of HTML files, takes the titles and indexes them an
: error occurs after about 40 files saying something like this:
: 
: dbm store returned -1, errno 28, key "Vector" at indexsite.pl line 51,
: <file> line 3.
: 
: I am pretty sure that this is due to the limited number of values per
: key per dbm file and I'm looking for suggestions on how to solve this 
: problem.
: 

Only one way I know of -- update to Perl 5 and use DB_File or GDBM_File.
Error number 28 is "ENOSPC" and is due to exceeding 1024 or 4096
bytes per key-value pair.

I guess there is another way -- it is theoretically possible to recompile
SDBM for Perl 4, but that would be hard compared to using Perl 5.

-- 
Regards,                                                      ___       ___
Mike Heins     [mailed and posted]  http://www.iac.net/~mikeh|_ _|____ |_ _|
                                    Internet Robotics         | ||  _ \ | |
This post reflects the              Oxford, OH  45056         | || |_) || | 
opinion of my employer.             <mikeh@iac.net>          |___|  _ <|___|
                                    513.523.7621 FAX 7501        |_| \_\   


------------------------------

Date: Wed, 26 Feb 97 21:09:09 GMT
From: Steve@starbug1.demon.co.uk (Steve Kay)
Subject: Re: Determine perl program memory usage
Message-Id: <856991349snz@starbug1.demon.co.uk>

In article <5f1tle$sqb$1@csnews.cs.colorado.edu>
           tchrist@mox.perl.com "Tom Christiansen" writes:
> :I think the Solaris equivalent is "ps -l -p $$".
> 
> Solaris is idiotic.  There was no need to break ps.
> Linux proves that you can support both argument forms.

But if you're using Solaris 2.[5|5.1], then you can get
memory usage in glorious detail by using something 
along the lines of :-

/usr/proc/bin/pmap $$

-- 
Steve Kay



------------------------------

Date: 26 Feb 1997 15:58:30 -0500
From: Jim Anderson <jander@ml.com>
Subject: Re: fflush() in Perl?
Message-Id: <wkb914bs2rt.fsf@swapsdvlp15.i-did-not-set--mail-host-address--so-shoot-me>

Henry Wu <henryw@seasick.sps.mot.com> writes:

> I have a simple question.  Is there a function in Perl corresponding to
> the C fflush() function?  I used mutiple "print" statements in a Perl
> script, but the results didn't show on STDOUT instantly until the end of
> the program.  So I want to flush the STDOUT after each "print"
> statement.  Can anyone out there give me a clue?  Thanks.
> 
> -Henry

RTFM, specifically, 'select' and '$|'

-- 
Jim Anderson			jander@ml.com
Consultant-at-large		jander@jander.com
				(212) 449-1598


------------------------------

Date: Wed, 26 Feb 1997 13:42:16 -0600
From: Robert Sweeney <rsweeney@anet-stl.com>
Subject: Re: Forms AHHHH...Help !!!
Message-Id: <33149218.3929@anet-stl.com>

Mark R Arnold wrote:
> 
> This is rather sad, i need desperate help with creating html forms. I
> can create the front end (ie. the actual bit where the user types in
> the info.) but i can't get it to process and e-mail the info to the
> address that i give it.
> 
> Anybody help!
> Thanks Mark


You want formmail.pl (I think this is from Matt's Script Archive.)

here's the code:
-----------------------------------------------------

#!/usr/bin/perl

#----------------------------------------------------------------------
# Form-mail.pl, by Reuven M. Lerner (reuven@the-tech.mit.edu).
# This package is Copyright 1994 by The Tech.
# Packaged Modified to mail any form to you by Matt Wright
(mattw@xtc.net)
   
# FormMail is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any
# later version.
   
# FormMail is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.

# Write the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,
USA.
# If you would like to obtain a copy of the GNU GPL.
# ------------------------------------------------------------

####################################################
# FormMail
# Created by Matt Wright (mattw@alpha.pr1.k12.co.us)
# Created 6/9/95                Last Modified 9/23/95
# Version 1.2

# Define Variables
$mailprog = '/usr/lib/sendmail';
$date = `/usr/bin/date`; chop($date);

# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
 
# Split the name-value pairs
@pairs = split(/&/, $buffer);

foreach $pair (@pairs){
   ($name, $value) = split(/=/, $pair);

   $value =~ tr/+/ /;
   $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
   $name =~ tr/+/ /;
   $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
          
   $FORM{$name} = $value;
}

if ($FORM{'redirect'}) {
   print "Location: $FORM{'redirect'}\n\n";
}
else {
   # Print Return HTML
   print "Content-type: text/html\n\n";
   print "<html><head><title>Thanks You</title></head>\n";
   print "<body><h1>Thank You For Filling Out This Form</h1>\n";
   print "Thank you for taking the time to fill out my feedback form. ";
   print "Below is what you submitted to $FORM{'recipient'} on ";
   print "$date<hr>\n";
}

# Open The Mail
open(MAIL, "|$mailprog -t") || die "Can't open $mailprog!\n";
print MAIL "To: $FORM{'recipient'}\n";
print MAIL "From: $FORM{'email'} ($FORM{'realname'})\n";
if ($FORM{'subject'}) {
   print MAIL "Subject: $FORM{'subject'}\n\n";
}
else {
   print MAIL "Subject: WWW Form Submission\n\n";
}
print MAIL "Below is the result of your feedback form.  It was\n";
print MAIL "submitted by $FORM{'realname'} ($FORM{'email'}) on $date\n";
print MAIL
"---------------------------------------------------------\n";

foreach $pair (@pairs) {
   ($name, $value) = split(/=/, $pair);
 
   $value =~ tr/+/ /;
   $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
   $name =~ tr/+/ /;
   $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

   $FORM{$name} = $value;
   unless ($name eq 'recipient' || $name eq 'subject' || $name eq
'email' || $name eq 'realname' || $name eq 'redirect') {
      # Print the MAIL for each name value pair
      if ($value ne "") {
         print MAIL "$name:  $value\n";
         print MAIL "____________________________________________\n\n";
      }

      unless ($FORM{'redirect'}) {
         if ($value ne "") {
            print "$name = $value<hr>\n";
         }
      }
   }
}
close (MAIL);

unless ($FORM{'redirect'}) {
   print "</body></html>";
}


------------------------------

Date: 26 Feb 1997 20:20:03 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: help: date to time conversion
Message-Id: <5f25tj$6nb@news-central.tiac.net>

In article <E67pCD.GIH@comp.lancs.ac.uk>,
Paul Rayson <paul@comp.lancs.ac.uk> wrote:
>
>I want to convert a string 'Wed Feb 26 13:17:09 GMT 1997' to a time
>stamp (number of seconds since 1970) in order to compare dates. I've
>looked at localtime and timelocal and so on, but I think I need the
>reverse of ctime. Has this already been done anywhere?

If you're using perl 5 then you can probably use Graham Barr's Date::Parse
which is in his TimeDate package on CPAN:

$ perl -de 1
Stack dump during die enabled outside of evals.

Loading DB routines from perl5db.pl patch level 0.9905
Emacs support available.

Enter h or `h h' for help.

main::(-e:1):   1
  DB<1> use Date::Parse

  DB<2> $time = str2time 'Wed Feb 26 13:17:09 GMT 1997'

  DB<3> X time
$time = 856963029
  DB<4> print scalar gmtime $time
Wed Feb 26 13:17:09 1997

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


------------------------------

Date: 26 Feb 1997 22:05:53 GMT
From: neilb@zetnet.co.uk (Neil S. Briscoe)
Subject: Re: how long before I can put down the books?
Message-Id: <memo.970226220428.4311E@zetnet.co.uk>

In article <5eq682$4dt@nr1.toronto.istar.net>, qnc496@joanrich.kite.ml.org
(Richard Morin) wrote:

> Hi folks, Sorry for the non-specific question, but I'm kinda
> curious about something.  How long before most folks felt even
> slightly proficient and could take the llama and camel books
> off the desk beside them?  I feel kinda lame havin' to go back
> to them all the time.  Does everyone do this?

I'm still bedding in the new book.  When I bought it I gave my old one to
someone who'd dabbled in Perl but wasn't proficient.  The handed over copy
was well dog eared, and, by current events, the new one will be, if only I
ever get the time to stop providing solutions and find the answers to
solutions yet to face me.

I bought the book because I wanted to learn how to interface C and Perl,
how to write modules, and similar things - the new Camel tells you - but
have I even got that far yet?  Hell no.
 
Still, I do now know a hell of a lot more about how the regex engine works
than I did before Sunday.  I can think of about 300 scripts that could
probably be sped up considerably ... if only I had the time.

Currently, I only have one copy of the Camel, and it is currently on the
bookshelf here at home (ready for when I need it).  The other day, I
finally persuaded "Mr. Manager" to let me write the Perl script from home.
I really should invest in another copy for the office.  Every so often, it
gets transported from one to the other.  I only live 7 minutes from the
office (by foot).

You might wonder why I buy the books rather than letting the company buy
them for me.  Well, its simple.  If I ever move jobs, the books go with
me.  I have the DNS and Bind, the Sendmail, and a raft of other
O'Reilleys, they're all currently at the office.  If I move, they get put
in the carrier bag on the way out the door.

Regards
Neil



------------------------------

Date: 26 Feb 1997 20:15:03 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Is numeric or alphabetic???
Message-Id: <5f25k7$403@fridge-nf0.shore.net>

Daniel Fournier (Daniel.Fournier@courrier.usherb.ca) wrote:

: (sorry this might belong in comp.lang.perl but it is not yet added
: to our news server...)

I thought comp.lang.perl was a goner?

: Is there any way to test if the value of a variable is purely numeric, 
: alphabetic, or alphanumeric?  How is it done for each? 

Ahh, you need the FAQ.  :-)  There are tests such as \d \D, etc, that
are covered in this document.  If you are a webber, you can download
the FAQ from: http://www.perl.com/CPAN/doc/FAQs/FAQ/html-faq.tar.gz

Hope this helps!

--
Nathan V. Patwardhan
nvp@shore.net
"What is the wind speed of a sparrow?"


------------------------------

Date: Wed, 26 Feb 1997 16:11:48 -0500
From: kwalters@pbs.org (Kenneth Walters)
Subject: ISO Perl Soundex function
Message-Id: <kwalters-2602971611480001@kwpmac.pbs.org>

I am looking for a soundex routine written in Perl. A soundex routine is a
program that, when passed a string(usually a name or title), returns a
four character code that is the same as the code returned for most other
strings that sound like it. They are not perfect routines, but they get
the job done. I have C and Fortran soundex routines, but I need one in
Perl. Unfortunately, I know next to nothing about programming in Perl. I
would like to call the routine from  a UNIX command line or shell script.
If you have such a Perl script, and would be willing to share it, I would
be most appreciative.
Thanks

The following algorithm, or a close approximation, is usually used in a
soundex routine:

1 Remove all sequential duplicates (for example "bb" or "oo") from the
input string.

2 Eliminate blanks.

3 Retain first letter, whatever it is, and remove any letters in the set
[A,E,I,O,U,H,W,Y]

4 Assign following number to the second, third and fourth letters:
 B,F,P,V = 1
 C,G,J,K,Q,S,X,Z = 2
 D,T = 3
 L = 4
 M,N = 5
 R = 6

5 Coerce return string into the form "letter,digit,digit,digit".  The
returned string should be padded with '0's if it is
less than four characters long.

Ken Walters
Public Broadcasting Service
kwalters@pbs.org


------------------------------

Date: 26 Feb 1997 20:31:07 GMT
From: "Tom Gebhardt" <tom.gebhardt@hboc.com>
Subject: libgd.c cannot find malloc.h
Message-Id: <01bc2422$0f0fc130$387c1595@tom_ge>

I'm having a problem getting gd to make using the following command:

gcc -c   -O     -DVERSION=\"0.10\"  -DXS_VERSION=\"0.10\" 
-I/usr/local/lib/perl5/i386-bsdos/5.003/CORE  libgd.c
libgd.c:1: malloc.h: No such file or directory

This is on a bsdi/os (386) 2.1 system with perl5.003.

Any suggestions?


------------------------------

Date: Wed, 26 Feb 1997 16:22:11 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: macperl help (2nd post)
Message-Id: <pudge-ya02408000R2602971622110001@news.idt.net>

In article <33144D57.59E2@ibmoto.com>, Jerry Monsen <jerrym@ibmoto.com> wrote:

#JALOTTA wrote:
#
#> how can I run macperl with a command line interface using the mpw shell?
#Can't help there...
#> 
#> after creating a droplet, where do I look for the dropped file?  I look in
#> $ARGV[0] but it's not there.
#
#Hmm. That's where I find it.. If I drop a selection of multiple
#files on the droplet, @ARGV contains the list in the order I selected
#them.
#> 
#> why didn't this post the first time?
#> 
#Not much help there either.

Try the MacPerl mailing list.

mail Majordomo@iis.ee.ethz.ch, with body: "info mac-perl"


#================================================================
Winny would spend all of his time practicing limbo.  He got
pretty good.  He could go under a rug.

   --Steven Wright

Chris Nandor                                      pudge@pobox.com
PGP Key 1024/B76E72AD                           http://pudge.net/
Keyfingerprint = 08 24 09 0B CE 73 CA 10  1F F7 7F 13 81 80 B6 B6


------------------------------

Date: 26 Feb 1997 21:28:49 GMT
From: andreas.koenig@franz.ww.tu-berlin.de (Andreas Koenig)
Subject: New Module List Posted
Message-Id: <5f29uh$96r$1@brachio.zrz.TU-Berlin.DE>
Keywords: FAQ, Perl, Module, Software, Reuse, Development, Free


Today I posted a new revision (2.38) of the Perl 5 Module List to
comp.lang.perl.modules. See the header of this posting for a
reference. The HTML version is uploaded to CPAN as
modules/00modlist.long.html Try
    <URL:http://www.perl.com/CPAN/modules/00modlist.long.html>
or your nearest CPAN site.

This version contains several editorial changes in the intro and to
section 2 which are not listed here. Please check the text and also
check for modules you know about. Please also check if your own
modules are listed correctly. If there are no entries for them or if
the entries need some cleenup, send us a note!

Send corrections and suggestions for supplements to
modules@franz.ww.tu-berlin.de (preferred) or modules@perl.com.

Thank you,
andreas

Recent changes in the modules database
--------------------------------------

3) Development Support
----------------------
ExtUtils::
::F77          cdpo  Facilitate use of FORTRAN from Perl/XS code  KGB +


4) Operating System Interfaces
 ------------------------------
Mac::Apps::
::MacPGP       RdpO  Interface to MacPGP 2.6.3 with AppleEvents   CNANDOR +


7) Database Interfaces (see also Data Types)
--------------------------------------------
Sprite         RdpO  Limited SQL interface to flat file databases SHGUN +


8) User Interfaces (Character and Graphical)
--------------------------------------------
Term::ReadLine::
::Gnu          adcO  GNU Readline XS library wrapper              HAYASHI +

X11::
::Fvwm         i     interface to the FVWM window manager API     RJRAY +


10) File Names, File Systems and File Locking (see also File Handles)
---------------------------------------------------------------------
File::
::Sync         bdcf  POSIX/*nix fsync() and sync()                CEVANS +


13) Internationalization and Locale
-----------------------------------
No::
::Dato         adpf  Norwegian stuff                              GAAS +
::KontoNr      adpf  Norwegian stuff                              GAAS +
::PersonNr     adpf  Norwegian stuff                              GAAS +
::Sort         adpf  Norwegian stuff                              GAAS +
::Telenor      adpf  Norwegian stuff                              GAAS +

Unicode::
::CType        i     Classification of Unicode chars              GAAS +
::UCS2         adpO  Unicode UCS-2 encoded strings                GAAS +
::UCS4         i     Unicode UCS-4 encoded strings                GAAS +


15) World Wide Web, HTML, HTTP, CGI, MIME etc (see Text Processing)
-------------------------------------------------------------------
CGI_Lite       MnpO  Light-weight interface for fast apps         SHGUN !

WWW::
::Robot        adpO  Web traversal engine for robots & agents     NEILB +


18) Images, Pixmap and Bitmap Manipulation, Drawing and Graphing
----------------------------------------------------------------
GIFgraph       ad    Package to generate GIF graphs, uses GD.pm   MVERB +


21) File Handle and Input/Output Stream Utilities
-------------------------------------------------
IO::
::Format       i     (Description missing)                        SBECK +


Recent Changes in the users database
------------------------------------

+  BMORGAN  Bruce Morgan <morgan@networks.curtin.edu.au>
!  BRADAPP  Brad Appleton <bradapp@enteract.com>
+  CEVANS   Carey Evans <c.evans@clear.net.nz>
!  GBARR    Graham Barr <gbarr@ti.com>
+  JANPAZ   Jan Pazdziora <adelton@fi.muni.cz>
+  JROWE    Jeff Rowe <j.p.rowe@larc.nasa.gov>
+  MIKEDLR  Michael De La Rue <miked@ed.ac.uk>
+  MVERB    Martien Verbruggen <mgjv@comdyn.com.au>
!  P5P      The Perl5 Porters Mailing List
!           Mail to perl5-porters-REQUEST@nicoh.com with body
!           Mail to perl5-porters-REQUEST@perl.org with body
!           "subscribe"
+  SREZIC   Slaven Rezic <eserte@cs.tu-berlin.de>
+  TBOUTELL Thomas Boutell <boutell@boutell.com>


------------------------------

Date: 26 Feb 1997 15:43:48 -0500
From: Tom Fawcett <fawcett@nynexst.com>
Subject: Re: newbie question:manipulating strings
Message-Id: <8ju3mzpabf.fsf@nynexst.com>

"jfreed" <jfreed@sigma6.com> writes:
> having some problems getting up to speed with perl syntax, 
> be great if someone could help me out.
> 
> I want to take a very long one line string and break it up into lines of
> 20 characters each.  I've been able to do it using a very long and
> complicated looping process, but I'm sure there is a more efficient way.
> 
> any input would be appreciated.

$line = "I want to take a very long one line string and break it up into lines of 20 characters each.  I've been able to do it using a very long and complicated looping process, but I'm sure there is a more efficient way.";
while ($line =~ /(.{1,20})/gs) {
   print "$1\n";
}

If you don't want to break words:
	$line =~ /(.{1,20})(?=\s)/gs


-Tom


------------------------------

Date: 26 Feb 1997 22:01:21 +0000
From: bhoylma@uswest.com (Bruce W. Hoylman)
Subject: Re: Perl & Ingress ?
Message-Id: <yz2pvxn2pn2.fsf@dazzle.advtech.uswest.com>

### "SHILUV" == SHILUV Gil Hirsch 5810 <gilh@sysdep.elex.co.il> writes:
SHILUV> 
SHILUV> Hi,
SHILUV> I'm currently working on an interface to the local Ingress DataBase, and
SHILUV> I thought it would be much easier to accomplish using perl in
SHILUV> conjunction with an SQL/Ingress module. A colleague of mine remembers
SHILUV> something called ingperl, which he claims is the answer to what I'm
SHILUV> looking for, but unfortunately, I wasn't able to locate it, or any other
SHILUV> SQL/Ingress module, in the CPAN list of modules.
SHILUV> 

The "ingperl" module is Perl4-ish.  I used it extensively when I used
Perl 4.X.  The Perl5 equivelant just came out.  See DBD-Ingres-0.04 from
CPAN.

It's brand new and is working for me, although I'm not implementing an
entire DBMS interface with it (yet).

YMMV.

SHILUV> To make a long story short - I NEED an SQL/INGRESS MODULE (or anything
SHILUV> else that would provide me with an easy interface to Ingress).
SHILUV> 
SHILUV> Thanx in advance, 
SHILUV> 	Gil Hirsch, aka gilh@sysdep.elex.co.il.
SHILUV> 

Peace.

-- 
  Bruce W. Hoylman (303-541-6557) -- bhoylma@advtech.USWest.COM ._ 0  
   -     __0    Speaking for myself...        /\/\    /\       /  //\.
-  - - _-\<,_   "Please saw my legs off".    /~/~~\/\/~~\     '  \>> |
 -  __(_)/_(_)_____________________________/\ /    \ \/\ \________\\ `_


------------------------------

Date: Wed, 26 Feb 1997 16:21:59 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Perl History Help
Message-Id: <pudge-ya02408000R2602971621590001@news.idt.net>

In article <856970475.2908@dejanews.com>, skindig@coe.edu wrote:

#Are there any ancestors or descendants of the perl language?
#
#Has perl made any contributions to the body of programming
#language?
#
#What were the major changes that came with each new
#version of perl?
#
#Any help is sincerely appreciated.
#Thank you Sherry

http://www.perl.com./perl/
http://www.perl.org/

Do your own research, fer cryin' out loud.  It's not hard to get these sources.

#================================================================
I will not expose the ignorance of the faculty.

   --Bart Simpson

Chris Nandor                                      pudge@pobox.com
PGP Key 1024/B76E72AD                           http://pudge.net/
Keyfingerprint = 08 24 09 0B CE 73 CA 10  1F F7 7F 13 81 80 B6 B6


------------------------------

Date: Wed, 26 Feb 1997 21:00:18 GMT
From: wegscd@whirlpool.com (Doug Wegscheid)
Subject: Re: Perl Script for DNS?
Message-Id: <3314a3c5.6443117@ghost.whirlpool.com>

On 25 Feb 1997 09:59:47 -0500, Jim Anderson <jander@ml.com> wrote:

>Jonathan Quist <jquist@slip.net> writes:
>
>> I'm looking for a script to help maintain my DNS database. Any
>> recommendations?
>
>
>Check out CPAN. There's a DNS module in beta. I think you can still
>find it in the "RECENT" category.

my DNS guy just handed me a CGI script called WebDNS (written in Perl
4) that will let you maintain the databases from a WWW browser. It's
from MIT, I can't find any more information on it.


--
Doug Wegscheid
wegscd@whirlpool.com

Q. How many bassists does it take to screw in a light bulb?
A. None, the keyboardists left hand does it for them.


------------------------------

Date: Wed, 26 Feb 1997 21:56:48 -0800
From: Bart Haezeleer <ping0621@ping.be>
Subject: Problem with function gethostbyname
Message-Id: <33152220.5D3B@ping.be>

Platform : Linux slackware 2.0.7.
PERL     : 5.001

#!/usr/bin/perl
require 5.0;    
no strict "refs";
use Socket;

if ( $] < 5.002 ) { use Sys::Hostname; }

print ((gethostbyname(hostname()))[0], "\n");
# output : linux.home.be
print ((gethostbyname(hostname()))[1], "\n");
# output :  linux
print ((gethostbyname(hostname()))[2], "\n");
# output :  2
print ((gethostbyname(hostname()))[3], "\n");
# output :  4
print ((gethostbyname(hostname()))[4], "\n");
# output :  A"

How can get the TCP/IP address via gethostbyname ?
Who do I have to manipulate the last output to get the IP ?

Please reply via e-mail : ping0621@ping.be


------------------------------

Date: 26 Feb 1997 22:14:04 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: shuffle an array
Message-Id: <5f2cjc$eua@news-central.tiac.net>

In article <5f21ue$7ck@nntp1.u.washington.edu>,
Darwin O.V. Alonso <dalonso@u.washington.edu> wrote:
>Is there a perl function that returns a shuffled array.
>e.g: @shuffledarray = shuffle(@old);
>
>I tried "values" and "keys" for associative arrays, but those
>don't actually return random values.

No, but you might try something like:

#!/usr/local/bin/perl -w

sub shuffle {
  my @list = @_;
  my @result;

  push @result, splice (@list, rand (@list), 1) while @list;

  @result;
}

srand (time ^ ($$ + $$ << 15));
print join (', ', shuffle 1 .. 10), "\n";

__END__

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


------------------------------

Date: Wed, 26 Feb 1997 14:12:40 -0500
From: Takahiko Koyama <tk29@cornell.edu>
Subject: XS and C++(g++)
Message-Id: <33148B28.29ABD459@cornell.edu>

-- 
Hello,

I am new to XS and have a question between compatibilities between XS 
and C++.  Whenever I put a line

#include <iostream.h>

I will receive strange errors.

/usr/include/g++/iostream.h:95: `ostream::operator <<(char)' is already 
defined in class ostream
/usr/include/g++/iostream.h:211: `istream::operator >>(char &)' is 
already defined in the class istream

I am using perl5.003_23 with gcc2.7.2.1

Thanks,

Takahiko Koyama


------------------------------

Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Jan 97)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 19
************************************

home help back first fref pref prev next nref lref last post