HDTenEightyP/NetNews huggingface dataset:
From: matthew@sunpix.East.Sun.COM (Matthew Stier - Sun NC Development Center)
Newsgroups: comp.lang.perl
Subject: Re: Help: perl on Solaris 2.1, how ?
Date: 22 Jan 1993 21:31:18 GMT
Organization: Sun Microsystems, Research Triangle Park, NC
NNTP-Posting-Host: klondike.east.sun.com

In article <C198Hr.Atv@micromuse.co.uk> peter@micromuse.co.uk writes:
}
}I remember reading about problems with perl on Solaris 2.1, but at the time
}I didn't think I would be using 2.1... sigh. I am now.
}
}Can anyone please mail me the solution to getting it going. Thanks.
}

First, Make sure you have the latest patches installed (4.035)

Second, Use the Solaris 2.x hint. ${SRC}/hints/solaris_2_0.sh



-- 
Matthew Lee Stier                          |
Sun Microsystems ---  RTP, NC  27709-3447  |     "Wisconsin   Escapee"
Email: matthew.stier@East.Sun.COM          |
Phone: (919) 469-8300 fax: (919) 460-8355  | 
Newsgroups: comp.lang.perl
From: turbo@cse.uta.edu (Chris Turbeville)
Subject: Re: $| for stdin and Ultrix
Summary: found it is not ultrix only.
Keywords: ioctl ultirx stdin
Organization: Computer Science Engineering at the University of Texas at Arlington
Date: Thu, 28 Jan 1993 02:20:06 GMT

A short follow up to that article.  It appears that this thing is eating
lines on all the machines.  It seems to be flush stdout as well as
stdin.  I would still be thankfull for any hints.
-Chris
From: mab@wdl39.wdl.loral.com (Mark A Biggar)
Newsgroups: comp.lang.perl
Subject: Re: How to convert string to hex?
Date: 27 Jan 93 00:26:50 GMT
Organization: Loral Western Development Labs

In article <C1FnMG.AMB@ibeam.intel.com> gweil@ibeam.intel.com (Garry Weil) writes:
>How do I convert "Test" to 0x54 0x65 0x73 0x74 ?
>
>Garry

foreach $x (unpack("c*", "Test")) {
	$result .= sprintf("0x%02x ", $x);
}

--
Perl's Maternal Uncle
Mark Biggar
mab@wdl1.wdl.loral.com
Newsgroups: comp.lang.perl
From: merlyn@ora.com (Randal L. Schwartz)
Subject: Re: How to convert string to hex?
Organization: Stonehenge Consulting Services; Portland, Oregon, USA
Date: Wed, 27 Jan 1993 16:02:55 GMT

>>>>> In article <C1Fs2F.BB3@ibeam.intel.com>, gweil@ibeam.intel.com (Garry Weil) writes:

Garry> The best I have come up with, so far is the following:

Garry> #!/usr/local/bin/perl
Garry> while (<>) {
Garry> 	$_ = reverse $_ ;
Garry> 	for ($i=1; $i < length($_);) {
Garry> 		$c = chop ;
Garry> 		printf "0X%x", ord $c ;
Garry> 		printf ", " unless $i == length ($_) ;
Garry> 	}
Garry> }
Garry> print "\n" ;

Garry> Is there something better?

You're not "thinking Perl" yet.  You're thinking C, and translating to
Perl.  Here's my cut at it:

#!/usr/sbin/perl :-)
while (<>) {
	$_ = unpack("H*", $_); # convert each char to 2 hex nybbles
	tr/a-z/A-Z/; # hex generates lowercase
	s/../0X$&, /g; # surround each two chars with human stuff
	s/, $/\n/; # patch up final comma
	print;
}

## a long one-liner
$_ = "0X4A, 0X75, 0X73, 0X74, 0X20, 0X61, 0X6E, 0X6F, 0X74, 0X68, 0X65, 0X72, 0X20, 0X50, 0X65, 0X72, 0X6C, 0X20, 0X68, 0X61, 0X63, 0X6B, 0X65, 0X72, 0X2C"; s/0X(..)/print pack("H*",$1)/eg;
-- 
Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
merlyn@ora.com (semi-permanent) merlyn@agora.rain.com (for newsreading only)
phrase: "Welcome to Portland, Oregon ... home of the California Raisins!"
Newsgroups: comp.lang.perl
From: turbo@cse.uta.edu (Chris Turbeville)
Subject: $| for stdin and Ultrix
Summary: Why doesn't TIOCFLUSH work in large script
Keywords: ioctl ultirx stdin
Organization: Computer Science Engineering at the University of Texas at Arlington
Date: Wed, 27 Jan 1993 06:59:45 GMT

A few months ago I asked what one would do to flush stdin like $| does
for stdout.  I got this working in test code like this.

#!/usr/local/bin/perl
#
# To see this work run it and hit keys inbetween when it says
#  Sleeping and when it says Please enter.
#
require <sys/ioctl.pl>; # Note .pl, one has to convert ioctls beforehand
		    	# see h2pl.
require <sys/file.ph>;
print "Sleeping\n";
sleep(5);
die "Can't ioctl STDIN : $!" unless ioctl(STDIN,$TIOCFLUSH,&FREAD);
print "Please enter stuff now:";
$in = <STDIN>;
print "\nI got $in";

Generating ioctl.pl is a bit of a pain but that isn't what has me
stumped.  Under Ultrix v4.0 this test program works fine but when
involved in a LARGE script it seems to eat output lines which follow
input statements preceded by this flusher! (not under SunOs it works
great and not under Dynix) So basically the prompt after the first is
eaten (not printed) if the clear cleared something.  So in the code
below (under the debugger it works fine of course) if we clear some
extraneuos input in the ioctl the print of the prompt on the next user
input request will not display but hang waiting for unannounced input. If
anyone has even the slightest idea about Ultirx' quirkieness I would be
eternalally grateful.  I hesitate to post much of the large script but
it has sig handlers and formats and many many many wonderful things.
So if this rings a bell with anyone kind enough to read I'd love
to hear where you saw it, and why it happened, if you were more fortunate
than I and found that out:).
Thanks
-Chris

... <Package decl and much setup deleted>

    do {
	print $prompt;
	# we now do the alarm here so we reset after each input -Turbo
	alarm 900;
        # we also want to flush all previous input.
	&'terminate_program unless ioctl(STDIN,$'TIOCFLUSH,$'IO_SEL);
<NOTE this program uses hardcoded values in main' to set TIOC and IO_SEL>
<not .pl and .ph files. Needless to say I have checked these values many>
<times.									>

	chop($_ = <STDIN>);
	# and turn it off
	alarm 0;

      CASE: {
	  if (/exit|quit|Exit|Quit|EXIT|QUIT/) { 
	      &'terminate_program;
	  }
	  if (/\?|help/) {
              print "$help_message\n";
	      $response = ""; 
	      last CASE; 
	  }

... <much input testing deleted>

    } until ($response ne "");
Newsgroups: comp.lang.perl
From: paul@ascent.com (Paul Foley)
Subject: Re: How to convert string to hex?
In-reply-to: gweil@ibeam.intel.com's message of Tue, 26 Jan 1993 00:59:02 GMT
Date: 26 Jan 93 14:18:47
Organization: Ascent Technology, Inc., Cambridge Massachusetts

In article <C1Fs2F.BB3@ibeam.intel.com> gweil@ibeam.intel.com (Garry Weil) writes:

   >How do I convert "Test" to 0x54 0x65 0x73 0x74 ?

   The best I have come up with, so far is the following:

   #!/usr/local/bin/perl
   while (<>) {
	   $_ = reverse $_ ;
	   for ($i=1; $i < length($_);) {
		   $c = chop ;
		   printf "0X%x", ord $c ;
		   printf ", " unless $i == length ($_) ;
	   }
   }
   print "\n" ;

   Is there something better?

How about ...

#!/usr/local/bin/perl
while (chop($line = <>)) {
  print join(', ', grep(s/(.*)/sprintf("0x%x", ord($1))/e, split(/ */, $line))), "\n";
}
--
--------------------------------------------------------------------------------
Paul Foley	                        Ascent Technology Inc.
Development Engineer	                64 Sidney St. Cambridge, MA 02139
paul@ascent.com	                        (617) 225-0850 x315
From: peter@micromuse.co.uk (Peter Galbavy)
Newsgroups: comp.lang.perl
Subject: Help: perl on Solaris 2.1, how ?
Date: 22 Jan 93 12:10:38 GMT
Reply-To: peter@micromuse.co.uk
Organization: MicroMuse Ltd, London


I remember reading about problems with perl on Solaris 2.1, but at the time
I didn't think I would be using 2.1... sigh. I am now.

Can anyone please mail me the solution to getting it going. Thanks.

PS. I tried and get the core dumps on make test.

---
Peter Galbavy
Tech Support, Micromuse Ltd
Phone: +44 71 352 7774		E-Mail: P.Galbavy@micromuse.co.uk
From: john@sekrit.WPI.EDU (John Stoffel)
Newsgroups: comp.lang.perl
Subject: Re: FAQ ? High level menus etc in perl ? Please !
Date: 28 Jan 93 21:50:52 GMT
Organization: Worcester Polytechnic Institute
NNTP-Posting-Host: sekrit.wpi.edu
In-reply-to: peter@micromuse.co.uk's message of 25 Jan 93 16:40:16 GMT

>>>>> On 25 Jan 93 16:40:16 GMT, peter@micromuse.co.uk (Peter Galbavy) said:

Peter> Are there any packages/libraries out there that implement a
Peter> high-ish level menuing ?

Steve Kunz wrote a menu package for perl, but it requires curseperl,
which shouldn't be too hard to make if you don't have it.  Mail
skunz@iastate.edu for more info on the latest version.

				John

--
Youth of today!  Join me in a mass rally for traditional mental attitudes!
-------------------------------------------------------------------------------
john@wpi.wpi.edu | Work Station Specialist | Worcester Polytechnic Institute
John Stoffel     | 508-831-5512 (work)     | Worcester, MA  01609
Newsgroups: comp.lang.perl
From: inc@tc.fluke.COM (Gary Benson)
Subject: Re: Short sample program needed
Organization: John Fluke Mfg. Co., Inc., Everett, WA
Date: Fri, 22 Jan 1993 20:15:50 GMT

In article <1993Jan21.184849.13619@tc.fluke.COM> inc@tc.fluke.COM (Gary Benson) writes:
>In article <1993Jan18.214646.2924@pacdata.uucp> jimh@pacdata.com (Jim Harkins) writes:
Given the input:

>>\section{Online documentation}
>>    \subsection{Unix rule \#1 - RTFM}
>>    \begin{itemize}
>>        \item Online manual (man) pages
>>        \item Readme files (e.g. /usr/local/gnu-src/README)
>>        \item Large manuals (e.g.
>>        /usr/local/gnu-src/g960/doc/misc/gcc/gcc-user.ms, over 200 pages of
>>        documentation on gcc.
>>        \item Look for files ending with .ms, .man, .tex.
>>    \end{itemize}
>>
>>		\subsubsection{Scooby doobie doo}
>>			.....
>>    \subsection{Man is your friend}
>>

Jim Harkins needs this output:
>>
>>Online documentation
>>	Unix rule #1 - RTFM
>>		Scooby doobie doo
>>	Man is your friend
>>


I posted a little script that worked, but I like this version better:

    #!/usr/local/perl
    while (<>) {
      if (/\\(.*)section{(.*)}/) {
          &printit();
          next;
      }
    }
    sub printit {
      ($tabs = $1) =~ s/sub/\t/g;
      ($data = $2) =~ s/\\#/#/;
      print "${tabs}${data}\n";
    }

... I'm SURE this can be done in one line, but not by me, not this week...



-- 
Gary Benson   -_-_-_-_-_-_-_-_-_-inc@sisu.fluke.com_-_-_-_-_-_-_-_-_-_-_-_-_-_-

Whoso would be man, must be a nonconformist.  -Ralph Emerson
Newsgroups: comp.lang.perl
From: "G.W.Bultman" <bultman@dgw.rws.nl>
Subject: Macintosh binhex as Perl Script?
Reply-To: bultman@dgw.rws.nl
Organization: The Internet
Date: Thu, 21 Jan 1993 07:53:54 GMT

Hi,

does anyone have an implementation in Perl (or C) of the Macintosh 
binhex 4.0 program?
P.S. I do not have a MacIntosh, but do get files in that format.
I might have a Pascal compiler, somewhere .... 

Thanks for any help, 
Gert.
 
--

    o                                                                o   
  / | \    Gert Bultman <bultman@dgw.rws.nl>   Koningskade 4       / | \  
 o--o--o   Tidal Waters Division               2596 AA The Hague  o--o--o 
  \ | /    Rijkswaterstaat                     The Netherlands     \ | /  
    o                                                                o    

Newsgroups: comp.lang.perl
From: tye@spillman.uucp (E. Tye McQueen)
Subject: Re: Leftmost longest?
Date: Wed, 27 Jan 1993 17:12:11 GMT
Organization: Spillman Data Systems

seb1005@mbfs.bio.cam.ac.uk (Steven Brenner) writes:
)
)   ($mynumber) = /R[- \n]+VALUE.*(0.\d+)/;
)
)   but where the .* in the middle matches the shortest string to make
)the whole pattern match rather than the longest.

Since the pattern after ".*" always starts with "0", you can do:

    ($mynumber) = /R[- \n]+VALUE[^0]*(0.\d+)/;

Though it won't work for  "R - VALUE 0 0.5", but I doubt that will
be a problem.  You could elaborate on this to fix it and other problems
but it probably wouldn't be worth the loss of readability/speed.
Something silly like (which probably doesn't work):

    ($mynumber) = /R[- \n]+VALUE([^0]*(0[^.]|0.\D))*(0.\d+)/;


)        if (($s) = /(R[- \n]+VALUE)/) {
)          $i = index ($_,$s);

    $i= length($`);

might be better (and may be off by one or so).

)          ($mynumber) = (substr($r3,$i) =~ /(0.\d+)/);
)        }

 tye@spillman.com                         Tye McQueen, E.
----------------------------------------------------------
 Nothing is obvious unless you are overlooking something. 
----------------------------------------------------------
Newsgroups: comp.lang.perl
From: chrise@sr.hp.com (Chris Eich)
Subject: Re: month in localtime?
Date: Thu, 21 Jan 1993 17:17:13 GMT
Organization: HP Santa Rosa Systems Div, CA
X-Newsreader: TIN [version 1.1 PL8.1]

++$mon to get the conventional month number (likewise for $yday).

Chris
Newsgroups: comp.lang.perl
From: mab@wdl39.wdl.loral.com (Mark A Biggar)
Subject: Re: problem with on-the-fly names
Organization: Loral Western Development Labs
Date: Wed, 27 Jan 1993 18:18:56 GMT

In article <Jan.26.13.13.51.1993.13626@bakerst.rutgers.edu> steiner@bakerst.rutgers.edu (Dave Steiner) writes:
>I'm using the following in a program:
>eval "\$$pname{$o} = $_";
>which works fine (I'm reading printcap-like entries and creating an
>assoc array for each printer with the various fields in the array).
>The problem is that I don't know what fields are in the array and want
>to do something like
>@o = keys eval "\%$pname";
>but the syntax for keys doesn't allow this!  Is there some other way I
>can get all the entries in the assoc array?

 Sure just move the kes inside the eval like so:

@o = eval "keys \%$pname";

--
Perl's Maternal Uncle
Mark Biggar
mab@wdl1.wdl.loral.com
From: ram@eiffel.com (Raphael Manfredi)
Newsgroups: comp.lang.perl
Subject: Re: Metaconfig
Summary: Destiny of metaconfig
Keywords: metaconfig
Date: 22 Jan 93 16:43:15 GMT
Followup-To: poster
Organization: ISE, Santa Barbara CA

Quoting graham@comp.lancs.ac.uk (Graham Dean) from comp.lang.perl:
>Please excuse this posting to comp.lang.perl.
>
>I'm looking for any references/pointers to Larry
>Wall's "Metaconfig" package.

[Please excuse the follow-up on comp.lang.perl, but I do not see any
other place, and besides it may be of general interest--RAM]

Harlan Stenn and I have been working on dist 3.0, which is the package
containing metaconfig among other tools. It is currently in early alpha
test: I have sent a release via e-mail to a dozen of people who needed
it.

If you wish to receive that early release, please drop me a note. I will
be glad to send you around 13 mails of 50K each, and including you in
my alpha-testers list to send you patches as I issue them (those will be
working patches: they may fix some things and break others -- that's why
it's still an alpha release).

By the way, Harlan and I are really busy, not to mention Larry with perl 5.
Volunteers to help the project are welcome...

If you wish to work on dist 3.0, please send a note to:

	Harlan Stenn <harlan@mumps.pfcs.com>
	Raphael Manfredi <ram@eiffel.com>

We'll see what we can do and how to coordinate the work. My goal would be
to release dist 3.0 beta in June, but given my current workload, and my
leaving the USA at the end of February (meaning finding a new job in
France, good luck they say! :-), things are getting a little hectic...
--
Raphael Manfredi <ram@eiffel.com>
Interactive Software Engineering Inc.
270 Storke Road, Suite #7                      / Tel +1 (805) 685-1006 \
Goleta, California 93117, USA                  \ Fax +1 (805) 685-6869 /
Newsgroups: comp.lang.perl
From: ckd@eff.org (Christopher Davis)
Subject: TCP/IP packet disassembly code?
Organization: Electronic Frontier Foundation Tech Central
Date: Tue, 26 Jan 1993 00:17:23 GMT

Has anyone written perl code to disassemble a TCP/IP packet?  (Assume it's
been pack()ed into a scalar already.)  Given the variable-sized headers,
you'd need to get the IP header length, use that to get the TCP header
length, then build an unpack() template based on that.  If the wheel's
already been invented, I'd rather not; if not, I'll probably do it this
week (time permitting :) and post it here for posterity or whatever.
--
 * Christopher Davis * <ckd@eff.org> * <ckd@kei.com> * [CKD1] * MIME * RIPEM *
Newsgroups: comp.lang.perl
From: jja@fnbc.com (Joseph Alotta)
Subject: month in localtime?
Keywords: time,month
Organization: First National Bank Of Chicago, Chicago IL, USA
Date: Wed, 20 Jan 93 20:54:28 GMT

greetings,

how does one get the month out in localtime?
this one's right out of the book:

#!/usr/local/bin/perl  
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
print "$sec,$min,$hour,$mday,mon=$mon,$year,$wday,$yday,$isdst\n";
exit;

amy{jja}44: headline.prl
19,52,14,20,mon=0,93,3,19,0
amy{jja}45: date
Wed Jan 20 14:52:21 CST 1993


thanks,

joe.


--
==============================================================
! joe alotta                                    jja@fnbc.com !                                               
!                                             (312) 732-3439 !
!                                                            !
! "The main thing is to keep the main thing the main thing." !
! Dr. George Sweeney                                         !
==============================================================
From: "G.W.Bultman" <bultman@dgw.rws.nl>
Subject: Multiple matches & spaces in optionstring
Reply-To: bultman@dgw.rws.nl
Organization: The Internet
Date: Fri, 22 Jan 1993 08:54:28 GMT

Hi, 

I have a simple script that extracts information from the World Factbook
(1991) as made available by project Gutenberg. 

The file is organised as follows:

::     Some tags useful for searching the factbook are as follows:
:: 
::          _@_   the first three characters in each country heading;
::                   for example, _@_Afghanistan
::                                _@_Albania
::          _*_   the first three characters in each section heading;
::                   for example, _*_Geography
::                                _*_People
::          _#_   the first three characters in each individual entry;
::                   for example, _#_Total area
::                                _#_Comparative area
::          _%_   the first three characters in the first line following
::                   the end of a country section or an appendix

I have a simple script that extract certain categories from the file
(Currency & Exchange rate). 
I would like to modify this scripts so that it takes as an option 
one or more countries to do this for and one or more categories. 
I'm thinking of an interface such as: 

worldfact -c Netherlands,Belgium,Albania -e Currency,Total area

which would give me the data on Currency and Total area for the 3 countries 
mentioned.

My first problem is that I'm not sure how to store these multiple entries 
(maybe in an array?) and how to match against them. 
My second problem is that I do not know how to handle spaces (such as in 
<Total area> when passing options to the script.

The script I use so far is included below.

:: #!/usr/local/bin/perl
:: 
:: $printing = 0;
:: 
:: while ( <> ) 
::      {
::      chop;
::      if ( /^_\@_([^\s]+)\s*$/ )
::           {
::           print $_ . "\n"; 
::           }
:: 
::      if ( /^_#_/ ) 
::           {
::           $printing = 0;
::           $printing++ if /^_#_Currency:/;
::           $printing++ if /^_#_Exchange rates:/;
::           }
::      
::      if ( $printing > 0 ) 
::           {
::           print $_ . "\n";
::           }         
::      }
     
Any & all help is appreciated,
Gert.

--

    o                                                                o   
  / | \    Gert Bultman <bultman@dgw.rws.nl>   Koningskade 4       / | \  
 o--o--o   Tidal Waters Division               2596 AA The Hague  o--o--o 
  \ | /    Rijkswaterstaat                     The Netherlands     \ | /  
    o                                                                o
Newsgroups: comp.lang.perl
Subject: Re: getting input from a tty
From: jsteiner@anwsun.phya.utoledo.edu (jason 'Think!' steiner)
Date: 22 Jan 93 20:22:06 EST
X-Newsreader: Tin 1.1 PL4

jsteiner@anwsun.phya.utoledo.edu (jason 'Think!' steiner) writes:
> ok, now i feel really stupid, but i'm really itching for an answer.

*ARRGH* and i thought i felt stupid before. it wasn't even a problem
with perl. or my program. i just had to set -1- stupid variable.

"I've only made one mistake in my life. I thought I was wrong, and I
 wasn't"

'cha right.

jason, who's never going to get anything important done at this rate.

--
`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`
`,`  If you want to smile - smile. Let people think you're nuts. We're  `,`
`,`  all a little nuts. Nuts is fun. Nuts keeps people wondering. Nuts  `,`
`,`  stay crunchy in milk!          smm@rodan.UU.NET (Steve Mansfield)  `,`
`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,` jsteiner@anwsun.phya.utoledo.edu ,`,`,`
Newsgroups: comp.lang.perl
From: gweil@ibeam.intel.com (Garry Weil)
Subject: Re: How to convert string to hex?
Organization: Multimedia Software Technology Group
Date: Tue, 26 Jan 1993 00:59:02 GMT

gweil@ibeam.intel.com (Garry Weil) writes:

>How do I convert "Test" to 0x54 0x65 0x73 0x74 ?

>Garry
The best I have come up with, so far is the following:

#!/usr/local/bin/perl
while (<>) {
	$_ = reverse $_ ;
	for ($i=1; $i < length($_);) {
		$c = chop ;
		printf "0X%x", ord $c ;
		printf ", " unless $i == length ($_) ;
	}
}
print "\n" ;

Is there something better?

BTW, I want to separate hex values with ",".

Garry
From: seb1005@mbfs.bio.cam.ac.uk (Steven Brenner)
Subject: Leftmost longest?
Organization: U. of Cambridge, England
Date: Tue, 26 Jan 1993 13:11:42 GMT

	I want to find the first number after a key word, so what I really
want to do is something like:

	($mynumber) = /R[- \n]+VALUE.*(0.\d+)/;

	but where the .* in the middle matches the shortest string to make
the whole pattern match rather than the longest.

	Is there any straightforward way of doing this?  What I've done
thus far is:


        if (($s) = /(R[- \n]+VALUE)/) {
          $i = index ($_,$s);
          ($mynumber) = (substr($r3,$i) =~ /(0.\d+)/);
        }


-- 
Steven E. Brenner               |  Internet    seb1005@mbfs.bio.cam.ac.uk
Department of Biochemistry      |  JANET       seb1005@uk.ac.cam.bio.mbfs
University of Cambridge         |  Laboratory  +44 223 333671
Tennis Court Road               |  Home        +44 223 314964
Cambridge CB2 1QW, UK           |  Lab Fax     +44 223 333345
Newsgroups: comp.lang.perl
From: ross@HQ.Ileaf.COM (Ross Knights)
Subject: Sockets on Solaris
Reply-To: ross@HQ.Ileaf.COM (Ross Knights)
Organization: Interleaf, Inc.
Date: Thu, 21 Jan 1993 20:25:43 GMT

The Berkeley IPC functions (socket(), bind(), getservbyname(), et al.)
appear to be unavailable in Perl under Solaris, which is System V.  
(I have Perl version 4.0, patch level 19.)

However, since /usr/lib/libsocket.so on Solaris provides these 
functions, is there a straightforward way to include them and enable 
IPC?

-- 
Ross Knights	Interleaf, Inc.  Waltham, Mass.  (617) 290-4990
ross@ileaf.com
From: steiner@bakerst.rutgers.edu (Dave Steiner)
Newsgroups: comp.lang.perl
Subject: problem with on-the-fly names
Date: 26 Jan 93 18:13:52 GMT
Organization: Rutgers Univ., New Brunswick, N.J.
Cc: steiner


I'm using the following in a program:

eval "\$$pname{$o} = $_";

which works fine (I'm reading printcap-like entries and creating an
assoc array for each printer with the various fields in the array).

The problem is that I don't know what fields are in the array and want
to do something like

@o = keys eval "\%$pname";

but the syntax for keys doesn't allow this!  Is there some other way I
can get all the entries in the assoc array?

ds
-- 

Dave Steiner
arpa: Steiner@BakerSt.Rutgers.Edu or Steiner@Rutgers.Edu
uucp: ...{backbone site}!rutgers!bakerst.rutgers.edu!steiner
Newsgroups: comp.lang.perl
From: Mike Stramba <stramba@zooid.guild.org>
Subject: How to do commas in sed,awk or C
Organization: ZOOiD BBS
Date: Sat, 23 Jan 1993 11:51:42 GMT

From the camel book is the commas routine:

 sub commas {
            local($_) = @_;
            1 while s/(.*\d)(\d\d\d)/$1,$2/;
	    $_;
 }

----------
How would I do this in sed, awk and C ?

For sed, I tried  

 sed 's/\(.*[0-9]\)\([0-9][0-9][0-9]\)/\1,\2/g'

which only replaced the rightmost 3 digits ... i.e.  3434343433,343.

For awk I tried using the 'sub' command with while, but didn't get too far.

For C, I'm sure the code I had was far more complicated than need be.

Mike










Newsgroups: comp.lang.perl