[7479] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1105 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 30 14:17:17 1997

Date: Tue, 30 Sep 97 11:00:32 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 30 Sep 1997     Volume: 8 Number: 1105

Today's topics:
     change to perldoc <seay@absyss.fr>
     Re: chopping second to last char? (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
     Re: connect() <seay@absyss.fr>
     Re: connect() <tekman@aimnet.com>
     Core dump in perlembed example (Leonhard Brenner {13031} 7149 [    ])
     Re: counting string occurences <rootbeer@teleport.com>
     Executing an outside program <lightspd@indy.net>
     Re: Generating bit patterns "00000000" .. "11111111" (Steffen Beyer)
     Re: Generating bit patterns "00000000" .. "11111111" (Mick Farmer)
     Re: Hash of subroutine calls (Daveotlc)
     Re: Help Req'd <rootbeer@teleport.com>
     Re: How to change date with perl? (Steffen Beyer)
     Re: How to run Perl? <rootbeer@teleport.com>
     Mysql in Perl <thomas@shurflo.com>
     Re: New Perl syntax idea <usenet-tag@qz.little-neck.ny.us>
     Re: New Perl syntax idea <seay@absyss.fr>
     Re: new@cgi <rootbeer@teleport.com>
     Re: Newbie ques: How to concatenate two strings? (Joseph)
     Re: Newbie ques: How to concatenate two strings? (Joseph)
     Re: PERL and serial port <rootbeer@teleport.com>
     Re: perl script don't execute (I R A Aggie)
     Re: Perl Venery (Jeremy Brinkley)
     Re: Perl Venery (John L. Allen)
     Perl WIN32 functions <Roger_Criddle@ccm.fm.intel.com>
     Q: Working with semaphores (Joey Mukherjee)
     Re: syntax (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
     Webpage checksum <gemal@dk.net>
     Re: WHILE LOOP LOGIC <Mazda.Hewitt@bbsrc.ac.uk>
     Re: WHILE LOOP LOGIC <Mazda.Hewitt@bbsrc.ac.uk>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 30 Sep 1997 18:41:31 +0200
From: Doug Seay <seay@absyss.fr>
Subject: change to perldoc
Message-Id: <34312BBB.70271999@absyss.fr>

[posted and CC'd to perl5-porters-request]

I've frequently found myself typing

	perldoc ipc

instead of

	perldoc perlipc

so I modified perldoc to prepend "perl" and look again if it didn't find
anything using the regular rules.  I think that this could be mildly
useful, but others could disagree.  I'd like to get other's opinions and
see if this should be made standard.  This is a quick and dirty change,
and just tested on my Linux box, so it could have problems, especially
with VMS, NT and other 'exotic' platforms.

I'm using the perldoc that comes with 5.004 (patch 0), here is the diff

~/bin> diff -b perldoc /usr/bin
206,211d205
<                       @files = searchfor(0, 'perl'.$_, @searchdirs)
<                               unless ( substr($_,0,4) eq 'perl' or
$opt_m );
<                       if ( @files ) {
<                               print STDERR "Found with 'perl' prefix
@files\n"
<                                               if ( $opt_v );
<                       } else {
213d206
<                       }
~/bin>

and here is a cut-n-paste of the whole region 

      # no match, try recursive search

      @searchdirs = grep(!/^\.$/,@INC);

      @files= searchfor(1,$_,@searchdirs);
      if( @files ) {
              print STDERR "Loosely found as @files\n" if $opt_v;
      } else {
### changes start here
              @files = searchfor(0, 'perl'.$_, @searchdirs)
                      unless ( substr($_,0,4) eq 'perl' or $opt_m );
              if ( @files ) {
                      print STDERR "Found with 'perl' prefix @files\n"
                                      if ( $opt_v );
              } else {
              print STDERR "No documentation found for '$_'\n";
              }
### changes end here 
      }


- doug


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

Date: Tue, 30 Sep 97 12:57:05 -0400
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: chopping second to last char?
Message-Id: <3431300f$2$ofn$mr2ice@speaker>

In <34305876.414F9593@students.wisc.edu>, on 09/29/97 at 08,
   Joshua Udall <jaudall@students.wisc.edu> said:
+-----
| In other words, DOS has (^J) and (^M) at the end of each line?
+--->8

Other way around, actually, as you noticed.  "s/\015\012/\012/" will do it,
although in practice "s/\015//" is good enough for most purposes (i.e.
non-badly-formed lines).

-- 
brandon s. allbery              [Team OS/2][Linux]          bsa@void.apk.net
cleveland, ohio              mr/2 ice's "rfc guru" :-)                 KF8NH
Warpstock '97:  OS/2 for the rest of us!  http://www.warpstock.org
Memo to MLS:  End The Burn Scam --- Doug Logan MUST GO!  FORZA CREW!



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

Date: Tue, 30 Sep 1997 15:31:30 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: connect()
Message-Id: <3430FF32.2E4DF5CC@absyss.fr>

Khayman wrote:
> 
> Doug Seay wrote:
> >
> > Khayman wrote:
> > >
> > > Hey there, I'm working on an IRC Bot in Perl, had one previously but my
> > > isp got hacked and all my coding was lost.  I can't get my connection
> > > routine working again and it's terribly frustrating.  If someone could
> > > please drop me an email to tekman@aimnet.com with some help, or even a
> > > complete connection routine I would be most thankful :-)
> >
> > perldoc IO::Socket should do the trick
> 
>         It's being stubborn, won't compile on my system.  I'm not advers to
> setting up my socket the hard way, I just can't remember how to do it
> again ;-)  And my lil Camel book ain't helping for once.

What do you mean IO::Socket won't compile?  It comes with the standard
distribution, so you're saying that your copy of perl 5.004 isn't
properly installed?  If so, talk to your SysAdmin and reinstall Perl.

Here is some code that I have to open a UDP connection.

	my $socket = IO::Socket::INET->new(
                Listen          => 5,
                LocalAddr       => "glorantha",
                LocalPort       => "doug_server",
                Reuse           => 1,
                Proto           => "udp",
                Type            => SOCK_DGRAM
                );

	die "cannot make socket: $!\n" unless ( $socket );

- doug


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

Date: Tue, 30 Sep 1997 09:30:26 -0700
From: Khayman <tekman@aimnet.com>
Subject: Re: connect()
Message-Id: <34312922.432E@aimnet.com>

# cut from shell prompt
tekman: perl -v

This is perl, version 5.003 with EMBED
        built under solaris at Nov 14 1996 21:38:09
        + suidperl security patch

# end cut

I'll harass my SysAdmin about updating Perl, thank you for the code
sample, I'll see what I can do :-)

	Khayman


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

Date: 30 Sep 1997 10:40:48 -0400
From: lab@slpabu.msd.ray.com (Leonhard Brenner {13031} 7149 [    ])
Subject: Core dump in perlembed example
Message-Id: <uqdk9fyzwy7.fsf@slpabu.msd.ray.com>


This example is causing a segmentation fault:

"Performing Perl pattern matches and substitutions from your C program"

After cutting and pasting it into a matches.c
I compiled it like this:
	gcc -o match match.c `perl -MExtUtils::Embed -e ccopts -e ldopts`
Then I run it:
	lab@slpabu<perl,12>match
	match: Text contains the word 'quarter'.

	match: Text doesn't contain the word 'eighth'.

	matches: m/(wi..)/g found 2 matches...
	match: will
	match: with

	Segmentation fault (core dumped)
I will place the core file at:
	http://lbrenner.ne.mediaone.net/~brenner/core

Don't be fooled that webserver is linux but the core was from
a Sun Ultra1. I did not look into this problem much but expected
it to run out of the box as an example. The problem seem to be in
substitute. I think I gave everything needed to find error. Please
email brenner@ed.ray.com and brenner@lbrenner.ne.mediaone.net

                                                 __  _-==-=_,-.
Leonhard Brenner                                /--`' \_@~@.--<
Thinking People Inc.                            `--'\ \  <___>.
E-mail: brenner@lbrenner.ne.mediaone.net             \ \\   " /     
Phone: (508)-647-4074                                 >=\\_/`< 
                                                     /= |__\_/
                                                  



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

Date: Tue, 30 Sep 1997 08:10:11 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Kenneth Blinco <n1868683@droid.student.fit.qut.edu.au>
Subject: Re: counting string occurences
Message-Id: <Pine.GSO.3.96.970930080523.16316N-100000@usertest.teleport.com>

On 30 Sep 1997, Kenneth Blinco wrote:

> would anyone be able to let me know of a good way to count the occurence
> of a particular string pattern in a file? 

I'd use perl, probably with the -n command-line option, a pattern match
using the /g modifier, and an END block. If you have trouble getting this
to work after reading the Perl docs and FAQs, please post again and tell
us where you got stuck. Good luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Tue, 30 Sep 1997 09:55:09 -0500
From: lightspd <lightspd@indy.net>
Subject: Executing an outside program
Message-Id: <343112CD.AB5@indy.net>

I am trying to start a program such as notepad without waiting
for it to exit continue on and at some point terminate it myself.
right now I am using
open NOTEPAD, "start c:\\windows\\notepad.exe |";
to open it but I have no idea how to kill it.  
Any help is appreciated,
Thanx
   Chad
   presslcm@nlci.com


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

Date: 30 Sep 1997 13:27:08 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: Generating bit patterns "00000000" .. "11111111"
Message-Id: <60qunc$ken$2@en1.engelschall.com>

Ricky Roque <ricky.roque@bigfoot.com> wrote:

> I'm trying to generate pattern like the following
>   "00000000"
>   "00000001"
>   "00000010"
>         :
>         :
>  "11111110"
>  "11111111"
> with the following scripts.

> > #!/usr/local/bin/perl
> > $start = pack('B8','00000000');
> > $end   = pack('B8','11111111');
> >
> >  for($start..$end)
> > { for($i=0;$i<16;$i++)
> >   {  unshift @vector, vec($_,$i,1); }
> >   print  @vector,"\n";
> >   $#vector = -1; print ;
> > }

> It stops at $start and doesn't increment upto $end.
> Why? Please help.

> Any other method of doing the task?

Yes!

-------------------- cut here -------------------- cut here --------------------
#!/usr/local/bin/perl

use Bit::Vector;

$vector = Bit::Vector->new(16);

# do something with $vector == 0x0000

while (! $vector->increment())
{
    # do something with $vector between 0x0001 and 0xFFFF
}
-------------------- cut here -------------------- cut here --------------------

The module "Bit::Vector" is available from any CPAN ftp server or from my
web site at:

http://www.engelschall.com/u/sb/download/

> Thanks.

You're welcome. :-)

Hope this helps.

Yours,
-- 
    Steffen Beyer <sb@sdm.de> http://www.engelschall.com/u/sb/
     "There is enough for the need of everyone in this world,
      but not for the greed of everyone." - Mahatma Gandhi
   >> Unsolicited commercial email goes directly to /dev/null <<


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

Date: Tue, 30 Sep 1997 12:33:12 GMT
From: mick@picus.dcs.bbk.ac.uk (Mick Farmer)
Subject: Re: Generating bit patterns "00000000" .. "11111111"
Message-Id: <EHBMvC.5HJ@mail2.ccs.bbk.ac.uk>

Dear Ricky,

Here's a short script that does what you want.

for ($i = 0; $i < 256; $i++) {
	for ($b = 0200; $b > 0; $b >>= 1) {
		print $i&$b ? 1 : 0;
	}
	print "\n";
}

Regards,

Mick


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

Date: 30 Sep 1997 17:33:25 GMT
From: daveotlc@aol.com (Daveotlc)
Subject: Re: Hash of subroutine calls
Message-Id: <19970930173301.NAA23453@ladder01.news.aol.com>

Thanks to Doug, Greg, and Andrew.  I now have several workable ways to handle
 my plug-in routines and can proceed.  I also appreciate the tips on
 maintainability and notation.

   I do have to use the older notation, though.  I'm in a Win95 environment and
 don't yet have the binary load for perl 5.004.

                     Enjoy,
                     Dave Olson
                     daveotlc@aol.com


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

Date: Tue, 30 Sep 1997 07:55:27 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Neil Trenholm <webmaster@createyourweb.com>
Subject: Re: Help Req'd
Message-Id: <Pine.GSO.3.96.970930075409.16316J-100000@usertest.teleport.com>

On Tue, 30 Sep 1997, Neil Trenholm wrote:

> Subject: Help Req'd

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

    http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

> Also, since POST used STDIN - could this be where the permission problem
> lurks ?

Anything is possible. :-)

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to
solving such problems. It's available on the perl.com web pages. Hope
this helps!

   http://www.perl.com/perl/
   http://www.perl.com/perl/faq/
   http://www.perl.com/perl/faq/idiots-guide.html

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 30 Sep 1997 13:17:48 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: How to change date with perl?
Message-Id: <60qu5s$ken$1@en1.engelschall.com>

David <mysun@mbox2.singnet.com.sg> wrote:

> I use function localtime to get current local date&time. But I do not know
> use which function to add a few days to this date? 

> For instance, today is 9-29-1997, if I add 7days to it, how do I do?

You could use the module "Date::DateCalc", for instance, which has been
written specifically for this kind of task, among other things.

It's available from any CPAN ftp server or from my web site at:

http://www.engelschall.com/u/sb/download/

> Is there a simple way other than programming a logic procedure?

No, there's no simple way. One has to program it and even has to take care
to do so efficiently enough...

> I use perl for win32 under windows 95.

There are supposed to be Perl versions for Win NT + 95 around which support
Perl modules - I hope you have one.

> Thanks in a advance.

You're welcome. :-)

Hope this helps.

Yours,
-- 
    Steffen Beyer <sb@sdm.de> http://www.engelschall.com/u/sb/
     "There is enough for the need of everyone in this world,
      but not for the greed of everyone." - Mahatma Gandhi
   >> Unsolicited commercial email goes directly to /dev/null <<


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

Date: Tue, 30 Sep 1997 08:01:54 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Bernhard K|gle <Bernhard.Kuegle@lottery.co.at>
Subject: Re: How to run Perl?
Message-Id: <Pine.GSO.3.96.970930080138.16316M-100000@usertest.teleport.com>

On Tue, 30 Sep 1997, Bernhard K=FCgle wrote:

> When I run a Perl script on the command line it works fine. But when I
> try to run it from my browser (Explorer, Netscape) it doesn=B4t work.=20

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to
solving such problems. It's available on the perl.com web pages. Hope
this helps!

   http://www.perl.com/perl/
   http://www.perl.com/perl/faq/
   http://www.perl.com/perl/faq/idiots-guide.html

--=20
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Tue, 30 Sep 1997 18:48:12 +0100
From: Thomas Beardshear <thomas@shurflo.com>
Subject: Mysql in Perl
Message-Id: <34313B5C.5091@shurflo.com>

Any one know how to get mysql to return data to a browser?

I can't get the following to return the user list to the browser.
It works fine from a shell.

--------------------------------------------------------
#!/bin/bash

echo "Content-Type: text/html"
echo ""
echo "Hello"
mysql -e 'select user from user' mysql
echo "there"
--------------------------------------------------------
-- 

  +=============================================================+
     Tombstone:

     I read this book. It said that a lot of people when they die
     they see this light. Like in a tunnel. They say it's a light
     leadin' you to heaven. Really? Well what about hell? They got
     a sign there or what?
 
     The management accepts no responsibility whatsoever  
     for the ramblings of the particular individual       
     writing this email response/inquiry. I don't Either. 
                                                        
     Thomas Beardshear, PC Lan Administrator, thomas@shurflo.com
     Shurflo Pump Manufacturing Company, Inc. - A Wicor Company
  +=============================================================+


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

Date: 30 Sep 1997 16:13:48 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: New Perl syntax idea
Message-Id: <eli$9709301158@qz.little-neck.ny.us>

Chris Schoenfeld  <chris@ixlabs.com> wrote:
> References: <342FE73B.41C2@ixlabs.com> <60orlp$lj3$3@info.uah.edu>
>	<60ov8l$afi$1@news.cs.tu-berlin.de>

That References header is wrong. It places your article after 
Martin Schwartz's article, while brian's post had message-ID
<comdog-ya02408000R2909971638170001@news.panix.com>. Sure makes it
confusing for me to follow the thread.

> On Monday, September 29, 1997 1:38 PM, brian d foy
> [SMTP:comdog@computerdog.com] wrote:
> > maybe there should be comp.lang.perl.babble for people who don't
> > think before they speak?
> I'll just ignore this ;)

(Where'd that comp.lang.perl.* reorg go anyway?)

> > >How about aliasing 'method' to 'sub' and passing the object reference
> > >through a magic variable when 'method' is used?
> > and what happens if i have more than one object of the same class?
> Well, $objref->Method() passes the object reference as the first
> parameter automatically.
> I'm just trying to propose a more *perlish* solution where trivial
> repetitive assignments such as
> my $self = shift;
> Are instrinsically taken care of for you.

I'd still like to see a better argument than getting rid of trivial
repetitive assignments, but that's me.

Elijah
------
#!/usr/bin/perl -- -*- my ny.pm sig -*-
$_=$^ ;s;s;sss;;s^.^ju^&&s&P&,\n&&&(s(_..)(ers)||s|^|^^|)&&s(T)(q(st%eg))eg;
s<.(o).><$& new 1$$>i+s+\dst.+$a--||reverse(q(rep k))+ge;s*%.+u* so+*i;s=\++
="me"=mex&&s%ege%l$"hke%;$a||s/^\S+ /\/\//;s;\d+;yor;;s[KE]<ac$&>i;print $_;


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

Date: Tue, 30 Sep 1997 16:41:07 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: New Perl syntax idea
Message-Id: <34310F83.7EF4FD85@absyss.fr>

Gary Howland wrote:

	<big snip>

> Well, he's not alone in thinking that "$self = shift" at the start of
> every method is needless fluff.  (After all - Perl is happy to define $a
> and $b for sort - why not $self for methods?)

$a and $b are ugly.  They are only done for speed reasons (they're
aliases to the real data, not actual variables).  That is a sacrifice at
the altar of performance.

As someone else asked, what will $self be.  Will it be the same as "my
$self = shift;" or "$My::Package::self".  Perhaps it should be "local
$self = shift;"?  I can see reasons for all three, although I would hope
that the 'my' solution would win, althought $My"::Package::self seems
more consistant (ie AUTOLOAD).  But what is really gained?  I agree that
methods that don't take any parameters look dumb starting with "my
($self) = @_;", but most of my methods take a parameter or two, so mine
usually look like "my ($self, $arg1, @arg2) = @_;", so the extra bit for
$self is trivial.


> In addition to a 'method'
> definition, a 'constructor' definition may also be useful to save all
> that repetitive "my $class = shift; $self = {}; bless $self, $class".
> And then we should start thinking about replacing $x->{'y'} with $x->y
> or something a little more typable.

I' might be able to buy this one, but would it be specific to hash
references?  For a list could I do $list->3 to get the third item?  What
if $x is an object based off of a hash.  I'd expect it to work (the
basic object is a hash), but if there is a conventional "y" method, it
should be used first.  But of course that is hard to detect due to the
wonders of AUTOLOAD.

The savings would be just 2 characters because I would write that
$x->{y} because bare words are OK inside a hash access.


> But of course all this is heresy to
> the perl community, who get very pissed off with these sort of
> recommendations.  I remember when Java first got released, I got heavily
> flamed for suggesting that it would be nice if perl could produce Java
> byte codes.  But now, two years later, my wish may have come true.  I
> wonder how long it will be before they acknowledge method declarations
> might be a useful addition after all? (along with fixing die/eval
> exceptions, adding threads, and restoring the dbm interface due to the
> tied interface eating all my memory)

Threads are on the way.  I thought the problem there was hobbling
something together that uses any thread base (Sun, POSIX, Win32).  What
is your problem with die/eval?

- doug


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

Date: Tue, 30 Sep 1997 07:58:49 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Victoria Hawkins <vcamille@u.washington.edu>
Subject: Re: new@cgi
Message-Id: <Pine.GSO.3.96.970930075728.16316K-100000@usertest.teleport.com>

On Tue, 30 Sep 1997, Victoria Hawkins wrote:

> If I execute the script at the unix prompt, SEQUENCE appears in the
> directory, and inside is the sequence. If I use the browser to execute
> the program, then SEQUENCE doesn't get created. 

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to
solving such problems. It's available on the perl.com web pages. 

   http://www.perl.com/perl/
   http://www.perl.com/perl/faq/
   http://www.perl.com/perl/faq/idiots-guide.html

> open(OUT, ">SEQUENCE"); # open SEQUENCE file for writing

Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check of the return value after opening a
file.

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Tue, 30 Sep 1997 16:44:36 GMT
From: jglosz@san.rr.com (Joseph)
Subject: Re: Newbie ques: How to concatenate two strings?
Message-Id: <34312c3f.1117651@news-server>

I was only reacting to her assumption that I was using a unix box. 

Over-reacting, apparently, judging by others' response here. 

I'm sorry I offended anyone.


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

Date: Tue, 30 Sep 1997 16:52:42 GMT
From: jglosz@san.rr.com (Joseph)
Subject: Re: Newbie ques: How to concatenate two strings?
Message-Id: <34322c7d.1179196@news-server>

On Tue, 30 Sep 1997 12:25:18 +0200, Doug Seay <seay@absyss.fr> wrote:

>Actually, she wasn't all that nasty.  I've seen worse.  And since it was
>fairly funny, it was better than most flames on USENET.  Try to
>appreciate the situation and roll with the punches.

I've seen worse too. Far, far worse. I guess I overreacted. Maybe it
was a bad day, I don't know. Everyone else here seems to think I
overreacted, so maybe I did.

It was just her un-helpful post and attitude I guess....


>It was wrong of her to assume that you are using Unix.  Did you
>understand that she used "Unix-ese" to says
>
>	look in "perlop" for "concatenate"
>
>If you prefer to fire up some sort GUI application for this, knock
>yourself out.  Most of us prefer the speed and versitility of the
>commandline, but to each his own.

Yes, I understood. But I didn't mean to say I'm running X windows or
some other GUI on a unix box. I'm not running unix at all! My ISP has
a unix server, so it runs perl-based CGIs. But I'm on Win95 and WinNT
machines.

>
>But also please remember that starting things off with "I know this has
>GOT to be the ultimate newbie question, but I don't
>know perl" leaves the impression that not only do you not know Perl, you
>don't don't even feel like learning it. 

That may have been the impression, but it's not true. In fact, I did
(and have) started to learn it. But I couldn't find this answer in the
mishmash of online docs and the one book I have. Basically, I just
didn't have the right docs.

In fact, I found the "join" function on my own, but another poster
here pointed out the dot operator, which works quite well.

>If you want to learn Perl, we'll all be glad to help you.  We'll point
>you in the right direction and help you over the bumpy parts, but you
>have to be the one to do the work.  We aren't paid to do your job. 
>Hell, I don't know any of us who are paid to answer questions on USENET
>(if so, are there any openings there :-).
>

Agreed. Sorry if I offended anyone. (That goes to you too, Abigail)


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

Date: Tue, 30 Sep 1997 08:31:06 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Vincent RABAH <vincent.rabah@hol.fr>
Subject: Re: PERL and serial port
Message-Id: <Pine.GSO.3.96.970930082755.16316Q-100000@usertest.teleport.com>

On Tue, 30 Sep 1997, Vincent RABAH wrote:

> Does anybody knows how to get data from a serail port ?

Well, the people who have read section 8 of the Perl FAQ have more
information than those who haven't. :-)  

    http://www.perl.com/CPAN/doc/FAQs/FAQ/html/perlfaq.html

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Tue, 30 Sep 1997 13:24:37 -0400
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: perl script don't execute
Message-Id: <-3009971324370001@aggie.coaps.fsu.edu>

In article <3430C763.9D492D65@hotmail.com>, lafor <lafor@hotmail.com> wrote:

[posted && cc'd]

+    Name: cmd-cgi-perl
+    #!/usr/bin/perl

+ More: perl (I think) is correctly installed and /bin/perl is ok. BUT I

If /bin/perl is ok, why do you have /usr/bin/perl in your script??

+ can't execute a perl script
+ directly. See:

+    root> ./cmd-cgi-perl
+    Error: Command not found.
+ I suposse this is the problem.

You would be right. Try a 'which perl' to find out the correct
path, or just use /bin/perl if you know it is OK.

James

-- 
Consulting Minister for Consultants, DNRC
Support the anti-Spam amendment <url:http://www.cauce.org/>
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>


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

Date: 30 Sep 1997 15:52:40 GMT
From: jeremy@wishbone.stanford.edu (Jeremy Brinkley)
Subject: Re: Perl Venery
Message-Id: <60r788$lla$1@nntp.Stanford.EDU>

On Mon, 29 Sep 1997 19:49:10 -0600, Andrew Johnson (ajohnson@gpu.srv.ualberta.ca) put forth:
> brian d foy wrote:
> > 
> > have recently replied to a posting about LWP and using the phrase
> > "family of modules", i thought that there must be better collective
> > nouns for Perl thingy.

> I take it you don't like the somewhat mundane 'bundle of modules'?
> 
> perhaps the obvious choice is 'pod' (already in use for some

A murder of modules?  (murder of crows)

-- 
  Jeremy Brinkley                      jeremy@wishbone.stanford.edu
  System Administrator                 finger for PGP key (2.6.2) or
  Stanford Blood Center                http://wishbone.stanford.edu/~jeremy


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

Date: 30 Sep 1997 13:49:59 -0400
From: allen@gateway.grumman.com (John L. Allen)
Subject: Re: Perl Venery
Message-Id: <60re47$diu@gateway.grumman.com>

In article <comdog-ya02408000R2909971711010001@news.panix.com>,
brian d foy <comdog@computerdog.com> wrote:
>
>have recently replied to a posting about LWP and using the phrase
>"family of modules", i thought that there must be better collective
>nouns for Perl thingy.
>
>some of the obvious ones that don't necessarily deal with Perl:
>
>   a namespace of variables
>   a package of methods
>
>and so on.  surely the liguistically-leaning Perl types can come
>up with more aesthetic ones :)

Just to get the ball rolling

	a FAQ of newbies
	a JAPH of gurus

John.






-- 
_/JohnL\_allen@gateway.grumman.com <Sun>: 9.5 billion pounds per sec to energy
~\Allen/~Fax: 516-575-7428    <Universe>: 1e22 stars = 22 solar masses per sec


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

Date: Tue, 30 Sep 1997 10:05:09 -0700
From: Roger Criddle <Roger_Criddle@ccm.fm.intel.com>
Subject: Perl WIN32 functions
Message-Id: <34313145.6475@ccm.fm.intel.com>

Does anyone know of a way to acknowledge a popup window from Perl?  For
example, if I run an application from within Perl, the application then
pops up a window asking for a yes or no answer.  Is there a WIN32
function or some way of responding to the request for input?  Thanks in
advance for the help.


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

Date: 30 Sep 1997 15:27:44 GMT
From: joey@swri.edu (Joey Mukherjee)
Subject: Q: Working with semaphores
Message-Id: <60r5pg$t24$1@coqui.ccf.swri.edu>

Hello!

I have checked www.perl.com for some help and have come up with nothing
so I thought I might try here for some help.

Here is what I am trying to do:  I have a process A which takes a long time
to run and I need to run it several times.  When the run is finished, the 
process does some stuff on the files it has generated (Call it Process B).  
I do this process through several iterations.  What I thought I might do 
is run A multiple times at once and then do process B once.

I figure the best solution for this a semaphore.  I will decrement the
semaphore once when I start process A and raise it when A finishes.  I want
my overall program to sleep until the semaphore is zero.  When the semaphore
is zero, process B will do its thing.

Sound good?  If you know of another alternative, let me know.  

My main problem with that approach is that I can't get semaphores to work.
If someone has an example program which uses semaphores, I would greatly
appreciate it.  I'm using Sun Solaris if it makes a difference.

Thanks in advance!
Joey

P.S.  Please CC me/reply by email if possible.  My news feed isn't so good.

-- 

+-------------------------+------------------------------------------------+
+ Joey Mukherjee          | Southwest Research Institute                   +
+ joey@swri.org           | http://espsun.space.swri.edu/~joey/            +
+                         |                                                +
+-------------------------+------------------------------------------------+



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

Date: Tue, 30 Sep 97 13:05:22 -0400
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: syntax
Message-Id: <343132ab$3$ofn$mr2ice@speaker>

In <34304766.D02FEE34@inf.ethz.ch>, on 09/29/97 at 05,
   Per Kistler <kistler@inf.ethz.ch> said:
+-----
| Where does the unless go:
| $a = 'foo' unless $b;
| when I write it like:
| $a = <<EOF;
+--->8

"<<bareword" tells Perl to expect the next few lines of the script to be data
instead of program; as a syntactical construct, it acts as if it were a
constant at the spot where it's found:

    $a = <<EOF unless $b;
    data to assign to \$a
    more data
    EOF

A slightly more complex example:

    $a = <<EOF unless $b eq <<FOE;
    data to assign to \$a
    EOF
    data to compare to \$b
    FOE

-- 
brandon s. allbery              [Team OS/2][Linux]          bsa@void.apk.net
cleveland, ohio              mr/2 ice's "rfc guru" :-)                 KF8NH
Warpstock '97:  OS/2 for the rest of us!  http://www.warpstock.org
Memo to MLS:  End The Burn Scam --- Doug Logan MUST GO!  FORZA CREW!



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

Date: Tue, 30 Sep 1997 19:44:27 +0200
From: Henrik Gemal <gemal@dk.net>
Subject: Webpage checksum
Message-Id: <34313A7B.7418D8FD@dk.net>

Is there a perl program (module) out there that generates a checksum for
a remote webpage?

-- 
Henrik Gemal, gemal@dk.net
Tele Danmark Internet


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

Date: Tue, 30 Sep 1997 16:56:49 +0100
From: Mazda Hewitt <Mazda.Hewitt@bbsrc.ac.uk>
To: Authorized User <matthew.kravitz@systecinc.com>
Subject: Re: WHILE LOOP LOGIC
Message-Id: <34312141.D8658D7E@bbsrc.ac.uk>



Authorized User wrote:

> hola-
> i am writing a simple 'while loop' script.  i need to read in a string from
> an external file and take that array and split it into seperate variables.
> for example:
>
> external file contains:
> line1   xxxxx   yyyyy
> line2   vvvvvvv ccccc
>
> my Perl script :
>
> open(LISTFILE,<external_file_name>);
> while ($LISTVAR=<LISTFILE>) {
>         if ($LISTVAR=~ /line/ ) {
>         ###HOW DO I INITIALIZE THE INDIVIDUAL VARIABLES
>         ###LIKE LINE1, xxxxx, and yyyyy ?
> ...
>
> thanks for the help...
>
> matthew kravitz

  open(LISTFILE,<external_file_name>);
  while ($LISTVAR=<LISTFILE>) {
        if ($LISTVAR=~ /line/ ) {
($linename)  = $LISTVAR =~ /(line\d)/;
($x) = $LISTVAR =~ /line\d\s+(\w+)\s+/;
($y) = $LISTVAR =~ /\w+\s+\w+\s+(\w+)/;
print ("line = $linename \nx = $x \ny = $y \n");
}


or

open(LISTFILE,<external_file_name>);
  while ($LISTVAR=<LISTFILE>) {
        if ($LISTVAR=~ /line/ ) {
$LISTVAR =~ /(\w+)\s+(\w+)\s+(\w+)/;
$linename = $1;
$x = $2;
$y = $3;
print ("line = $linename \nx = $x \ny = $y \n");
}

Mazda





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

Date: Tue, 30 Sep 1997 16:58:05 +0100
From: Mazda Hewitt <Mazda.Hewitt@bbsrc.ac.uk>
Subject: Re: WHILE LOOP LOGIC
Message-Id: <3431218D.3124641E@bbsrc.ac.uk>



Authorized User wrote:

> hola-
> i am writing a simple 'while loop' script.  i need to read in a string from
> an external file and take that array and split it into seperate variables.
> for example:
>
> external file contains:
> line1   xxxxx   yyyyy
> line2   vvvvvvv ccccc
>
> my Perl script :
>
> open(LISTFILE,<external_file_name>);
> while ($LISTVAR=<LISTFILE>) {
>         if ($LISTVAR=~ /line/ ) {
>         ###HOW DO I INITIALIZE THE INDIVIDUAL VARIABLES
>         ###LIKE LINE1, xxxxx, and yyyyy ?
> ...
>
> thanks for the help...
>
> matthew kravitz

  open(LISTFILE,<external_file_name>);
  while ($LISTVAR=<LISTFILE>) {
        if ($LISTVAR=~ /line/ ) {
($linename)  = $LISTVAR =~ /(line\d)/;
($x) = $LISTVAR =~ /line\d\s+(\w+)\s+/;
($y) = $LISTVAR =~ /\w+\s+\w+\s+(\w+)/;
print ("line = $linename \nx = $x \ny = $y \n");
}


or

open(LISTFILE,<external_file_name>);
  while ($LISTVAR=<LISTFILE>) {
        if ($LISTVAR=~ /line/ ) {
$LISTVAR =~ /(\w+)\s+(\w+)\s+(\w+)/;
$linename = $1;
$x = $2;
$y = $3;
print ("line = $linename \nx = $x \ny = $y \n");
}

Mazda





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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 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.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed 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 1105
**************************************

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