[7693] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1319 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 14 15:37:26 1997

Date: Fri, 14 Nov 97 12:00:30 -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           Fri, 14 Nov 1997     Volume: 8 Number: 1319

Today's topics:
     Re: 'end of file' unexpected <rootbeer@teleport.com>
     Re: Bizarre glitch in Net::Whois <rootbeer@teleport.com>
     Re: Block comments in Perl? (brian d foy)
     Re: carriage returns (Faust Gertz)
     Re: Clever way to strip empties from an list? (John Moreno)
     Creating a call tree (Joel Wilf)
     Error with Net::Telnet <chris_braiotta@harvard.edu>
     Re: Extracting ASCII records from BINARY files??? <pvarn@foxinternet.net>
     Help with my free for all script! <webmaster@dmedia.net>
     Re: http password help! PLEASE!... ELABORATED (Mike Stok)
     Re: http password help! PLEASE!... ELABORATED (I R A Aggie)
     Re: http password help! PLEASE!... ELABORATED (Matthew Cravit)
     ignore test post from LB <spymaster@msn.com>
     Re: is h2xs supposed to do this? (Ilya Zakharevich)
     Matching a literal "interrobang" ?? (Pete Holsberg)
     Re: multiple files with perl compiler <igorv@styx.or.fedex.com>
     Re: Personal Web Server - Perl ? jon@digitalwizards.com.au
     Re: Ping and MacPerl Problems (Chris Nandor)
     Re: process handling <igorv@styx.or.fedex.com>
     regexp cruncher in perl. Please help. <ravi@centtech.com>
     Re: regexp cruncher in perl. Please help. (Mike Stok)
     Re: SWIG needs Perl.lib for NT - where? (Ronald L. Parker)
     Re: which Perl is for me?! can't find 5.004_04 for win9 (Ronald L. Parker)
     Re: write daemon with Perl (Matthew Cravit)
     Writing a daemon process <barnett@houston.Geco-Prakla.slb.com>
     Re: Writing a daemon process (brian d foy)
     Re: Year2000 problem with localtime(); (John Moreno)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 14 Nov 1997 09:24:15 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: David Martin <david.martin@biotek.uio.no>
Subject: Re: 'end of file' unexpected
Message-Id: <Pine.GSO.3.96.971114092123.23997G-100000@usertest.teleport.com>

On Fri, 14 Nov 1997, David Martin wrote:

> sh: Syntax error at line 1: 'end of file' unexpected

That message is coming from /bin/sh. Perl isn't even seeing that script. 

> Line 1 is the usual #!/usr/local/bin/perl -w and I have retyped it.

Maybe your system doesn't support the #! notation, or maybe those aren't
the very first characters in the file. Or, possibly, /usr/local/bin/perl
isn't perl (or a symlink leading to perl).

If everything looks right, use a command like this one to examine the very
start of the file.

    oc -xc filename | more

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: Fri, 14 Nov 1997 09:06:59 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Stunt Pope <markjr@mail.PrivateWorld.com>
Subject: Re: Bizarre glitch in Net::Whois
Message-Id: <Pine.GSO.3.96.971114090626.23997F-100000@usertest.teleport.com>

On 10 Nov 1997, Stunt Pope wrote:

> Not enough arguments for upper case at /usr/local/lib/site_perl/Net/Whois.pm \
> line 254, near "uc}"

Fixed in 5.004. Thanks!

-- 
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: Fri, 14 Nov 1997 14:07:56 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Block comments in Perl?
Message-Id: <comdog-ya02408000R1411971407560001@news.panix.com>

In article <346c1b7c.1335138@news.hamburg.netsurf.de>, frank.hoehne@hamburg.netsurf.de (Frank Hoehne) wrote:

[somewhere there is a missing reference to me]

>Since here is no assignment to a variable, so why 
>should any  memory allocation for the here-doc happen.

what makes you think that only variable assignments take up memory?

>>since perl has built in block commenting features, ugly pseudo-solutions
>>can be left at home.
>>
>your solution of using the pod-feature for commenting
>things out seems ok if you realy want to see all the stuff
>in your POD's.  But this is definetly not always the case.

perhaps you should read the docs before you try to debate with 
those of us who already have.

let's also remember to keep the proper citations in place.

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
$RTFM_post{'brian d foy'}++;


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

Date: Fri, 14 Nov 1997 18:59:03 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: carriage returns
Message-Id: <346c9c85.946083@news.wwa.com>

On Wed, 12 Nov 1997 11:32:19 -0600, Mark Chaffee
<chaffee@cpdmfg.cig.mot.com> wrote:

>I have a variable that contains a text string with carriage returns.  Is
>there a way to strip them out?
>
>$var = "This is^Ma text string^Mwith unwanted^Mcarriage returns."

Yes.

    $var =~ tr/\015\012//d;

will merely strip all carriage returns (wanted or unwanted).  It will
not replace the missing character returns with any white space.

Use

    $var=~ tr/\015\012 / /s;

if you want to remove line breaks from a string while keeping some
white space.  This will also reduce the number of consecutive spaces
in the string to one too.  Thus 

   $var = "This is^M^M^M a text^Mstring."

becomes

   $var = "This is a text string."

instead of either

   $var = "This is a textstring."

or 

   $var = "This is    a text string."


HTH

Faust Gertz
Philosopher at Large

"The suspense is killing me...I hope it lasts."
--Willy Wonka


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

Date: Fri, 14 Nov 1997 14:05:06 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Clever way to strip empties from an list?
Message-Id: <199711141304296424370N@roxboro-182.interpath.net>

Erik Y. Adams <erik@earthlink.net> wrote:

] I've got a perl script that gets passed a list.  I join the list
] elements together into a scalar and write it to a file.  The problem I
] have is some of the list's elements are empty, and I'm winding up with
] some junk. Here's a snippet that demonstrates the problem:
] 
]    @list = ("this", "that", "", "", "", "", "");

This is a bad example - only your first two element are valid the rest
are blank, if this was actually the case you'd be better off doing:
$string="$list[0]:$list[1]";

No, what you want is,

@list = ("this", "that", "", "", "then", "", "");

Which'll give you more problems to solve.

]    $string = join ':', @list;  # $string is now "this:that:::::";
] 
] What I want is is $string to equal "this:that".
] 
] I could add another line:
] 
]    $string =~ s/:*$//g;

This wouldn't work unless there is never a gap between valid elements
and blanks.
 
The line you would want is

$string =~ s/:(:+)/:/g;

Which, besides the unfortunate colon at the end is the result you are
looking for want.

] But I keep thinking that there's some function I could run against
] @list that would automagically eliminate the null values.
] 
] I know there's always another way to do something, I'd just like to
] see some examples.

TMTOWTDI (always) - in this case grep, like so:
   $string = join ( ':', grep (/./, @list) );

-- 
John Moreno


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

Date: 14 Nov 1997 17:52:00 GMT
From: jwilf@darepc.jpl.nasa.gov (Joel Wilf)
Subject: Creating a call tree
Message-Id: <slrn66p3tq.9du.jwilf@darepc.jpl.nasa.gov>

Lately I've been examining a system chock full of perl scripts: cgi,
sysadmin, libraries of subroutines, etc.

Finding all the perl scripts and the subroutines defined in them is easy
(thanks tp File::Find).  But I haven't found a good way to construct a call
tree -- a list of all the subroutines called from a main module, the
subroutines called by those subroutines, and so on.

I've looked at two approaches, so far.  The first is the brute force
approach: go through every line of the module and try to pick out all the
calls.  The problem is ensuring that all the calls are found, not just the
ones prepended with :: or &.

The second approach, which intrigues me, is using the perl debugger.  I've
played with running the program inside the debugger, using the 'c' command,
then examining the subroutines with 'S'.  However: I don't know how to do
this non-interactively (i.e., call the debugger from a script, issue the
commands, and redirect the DB:OUT output).  Also, I wonder how I can get
*all* calls, not just the ones found by executing a particular branch of the
program.

Is anyone out there building call trees for perl scripts?
And: can you use the perl debugger (in batch mode, somehow) to create one? 

Any thoughts would be appreciated.







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

Date: Fri, 14 Nov 1997 12:13:23 -0500
From: Chris Braiotta <chris_braiotta@harvard.edu>
Subject: Error with Net::Telnet
Message-Id: <346C86AA.A058C98D@harvard.edu>

I've succesfully installed Net::Telnet (or so I would think...I've got
Telnet.pm in the perl/lib/Net folder). At any rate, when I use it I get
the following error message:

    Net/Telnet.pm did not return a true value at checkAcct.pl line 3.

My code is just a test right now and looks like:


#!/usr/bin/perl

use Net::Telnet;

 $nic = new Net::Telnet
         (
         Host => "nic.harvard.edu",
                Timeout => 10,
                );
 $nic->login($login, $password);
 @lines = $mufasa->cmd("/usr/bin/who");
 print @lines;
 $nic->close;


Any ideas would be greatly appreciated.

Chris Braiotta
chris_braiotta@harvard.edu



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

Date: Thu, 13 Nov 1997 23:53:02 -0800
From: "Paul R. Varn" <pvarn@foxinternet.net>
Subject: Re: Extracting ASCII records from BINARY files???
Message-Id: <346C035C.84310703@foxinternet.net>

The translate function is Perl are very powerful and useful for this kind
of work.
The following removes everything that isn't plain text:
$string =~ y/a-zA-Z0-9" "//;

or, you can replace the garbage with space characters you can use as word
delimiters:
$string =~ y/a-zA-Z0-9" "/ /;

The following can then remove all but one space:
y/a-zA-Z/ /cs;

Dan LeGate wrote:

> Question from a new Perl programmer.  I know how to extract records
> from a file where each record is on a different line (terminated by
> \n) and all characters are standard ASCII.  But now I'm facing a
> situation where I need to extract ASCII records out of the middle of
> binary (non-standard) characters, in LONG lines of text.
>
> For example:
>
> ^@^A^EWelcome^@\241\241^@^@7^@7^@^@^^@^B^EPayments due^@\241\241^@
> ^@^A^DThursday, Feb 15. at 6:00
> pm.^@\241\241^@^@7^@7^@^@^^@^B^EGoodbye^@\241\241^@
>
> All those ^@ types of characters are actually just one character, but
> display this way in emacs.  I would need to extract "Welcome",
> "Payments Due", "Thursday, Feb 15. at 6:00 pm.", and "Goodbye" from
> this garbled mess.  Keep in mind all of this is on one line.  There
> are only a few \n line breaks in the file and then the data continues
> in a messy order like this.
>
> I've noticed that each "record" is preceded by either a ^E or a ^D and
> ends with ^@\241\241 each time.  But I'm lost as to how to tell perl
> "get the text between those delimeters only".
>
> Can anyone help me out here?
>
> Dan
>
> PS - Please CC a copy of your reply to my email address.



--
-Pv-
Paul R. Varn
Digital Music, Web Design, Online Transactions




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

Date: Fri, 14 Nov 1997 17:56:26 +0200
From: Aitor <webmaster@dmedia.net>
Subject: Help with my free for all script!
Message-Id: <346C74A7.F50E6FA7@dmedia.net>

Hi,

I've finished my free for all script and it works O.K.

http://www.dmedia.net/superlinks/


However, I want to check if the new link is added via the form available at:

http://www.dmedia.net/superlinks/newlink.html

If not, redirect to that URL.


Any idea?


Aitor.


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

Date: 14 Nov 1997 17:13:20 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: http password help! PLEASE!... ELABORATED
Message-Id: <64i0rg$epb@news-central.tiac.net>

In article <64huhu$827$1@goblin.uunet.ca>, Me <Me@home.sleeping> wrote:

>machoman:lmKBvAuvduC1Q
>
>of which lmKBvAuvduC1Q is the encoded version if village, which is generated 
>by the server itself. My question is thus this: how do I reproduce the proper 
>coding sequence in cgi-perl to generate new encoded passwords that the server 
>will understand. I know that it involves utilizing the crypt command which 
>takes on the following format:

>How do I generate a $salt sequence that will perfectly reproduce an 
>appropriately $encoded_variable? 

The salt is in the first 2 characters of the encoded password.

>I've tried the following, to seek thew proper salt sequence, but the server 
>continues to run out of memory:

> $login = "machoman";
> $encrypted1 = "lmKBvAuvduC1Q";
> $attemp = "village";                  

You only want to call srand once if you're using rand for a stream of
pseudo random numners,usually, so you'd pull the srand out of the loop if
you needed it...  But as the salt used to encrypt the password is already
in the encrypted version yopu can say something like this as crypt ignores
excess characters in the salt:

  $cleared = ($encrypted1 eq crypt ($attemp, $encrypted1)) ? "yes" : "no";

Hope this helps,

Mike

>$cleared = "no";
>while ($cleared eq "no") {
>  srand (time ^ ($$ + ($$ << 15)));
>  @alphabet = ('a' .. 'z', 'A' .. 'Z', '0' .. '9', '.', '/');
>  $number_one = $alphabet[rand(@alphabet)];
>  $number_two = $alphabet[rand(@alphabet)];
>  $salt = $number_one.$number_two;
>  $encrypted = crypt($attemp,$salt);
>  if ($encrypted eq $encrypted1) {
>        $cleared = "yes";
>  }
>}


-- 
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@colltech.com                  |            Collective Technologies (work)


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

Date: Fri, 14 Nov 1997 12:45:04 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: http password help! PLEASE!... ELABORATED
Message-Id: <-1411971245040001@aggie.coaps.fsu.edu>

In article <64huhu$827$1@goblin.uunet.ca>, Me@home.sleeping (Me) wrote:

+ How do I generate a $salt sequence that will perfectly reproduce an 
+ appropriately $encoded_variable? 

Are you atempting to salt _new_ passwords, or to check previously
_encrypted_ passwords? I'm suspecting the latter, since you have:

+   if ($encrypted eq $encrypted1) {
 
+ I've tried the following, to seek thew proper salt sequence, but the server 
+ continues to run out of memory:

+  $login = "machoman";
+  $encrypted1 = "lmKBvAuvduC1Q";
+  $attemp = "village";                  

+   $salt = $number_one.$number_two;

I'm thinking that you want to encrypt the attempt in the same manner as
the original. It seems that you've read the man page on crypt (3C), but
failed to observe this:

     The returned value points to the encrypted
     password.  The first two characters are the salt itself.

The _old_ salt! So, you probably want to say:

$salt=substr($encrypted1,0,2); # get the salt from the previous encryption

I here's a small test:

$login = "machoman";
$encrypted1 = "lmKBvAuvduC1Q";
$attemp = "village";
$salt=substr($encrypted1,0,2);
$encrypted = crypt($attemp,$salt);
print "$encrypted\t$encrypted1\n";

Results:

lmKBvAuvduC1Q   lmKBvAuvduC1Q

Is that what you seek?

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: 14 Nov 1997 10:33:33 -0800
From: mcravit@best.com (Matthew Cravit)
Subject: Re: http password help! PLEASE!... ELABORATED
Message-Id: <64i5ht$f6p$1@shell3.ba.best.com>

In article <-1411971245040001@aggie.coaps.fsu.edu>,
I R A Aggie <fl_aggie@thepentagon.com> wrote:

>     password.  The first two characters are the salt itself.
>
>The _old_ salt! So, you probably want to say:
>
>$salt=substr($encrypted1,0,2); # get the salt from the previous encryption

You actually can do it without the substr. If crypt is given a string longer
than 2 characters, it uses the first two characters and ignores the rest of 
the string. So, you can simply do something like:

    $passwd = "test";             # Plaintext password
	$encpw  = "bf9WjnrnAcGEA";    # Encrypted password

    if ((crypt $passwd, $encpw) eq $encpw) {
        print "Password is correct!\n";
    } 
    else {
        print "Password is not correct!\n";
    }

Hope this helps.

/MC

-- 
Matthew Cravit, N9VWG               | Experience is what allows you to
E-mail: mcravit@best.com (home)     | recognize a mistake the second
        mcravit@taos.com (work)     | time you make it.


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

Date: Fri, 14 Nov 1997 09:42:09 -0800
From: "spymaster" <spymaster@msn.com>
Subject: ignore test post from LB
Message-Id: <01bcf124$db2e1bc0$0c00010a@hpovnt2>

a test


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

Date: 14 Nov 1997 18:53:20 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: is h2xs supposed to do this?
Message-Id: <64i6n0$c5i$1@agate.berkeley.edu>

In article <64hrsc$m0g$1@taliesin.netcom.net.uk>,
Des Herriott <des@corp.netcom.net.uk> wrote:
> Hi,
> 
> I'm having with a play with writing some XS code, so I've started
> with a trivial one-function test library - here's the header:
> 
>   int do_foo(int x, int y);
> 
> I generate the Perl module like this:
> 
>   $ h2xs -x -n Foo /path/to/foo.h -L/path/to/lib -lfoo
>   
> This creates the .xs file OK, but it contains this declaration for do_foo:
> 
>   int
>   do_foo(arg0, arg1)
>         int x   arg0
>         int y   arg1

I repeated what you did with
	h2xs -x -n foo H:/get/perl/tmp/blah.h
and got a correct result.  5.004_01 + jumbo-re-v1 + jumbo-malloc here,
C::Scan is dated 9/26/97 (latest release by me).

Ilya


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

Date: 14 Nov 1997 18:14:25 GMT
From: pjh@mccc.edu (Pete Holsberg)
Subject: Matching a literal "interrobang" ??
Message-Id: <64i4e1$60g$1@lawrenceville.mccc.edu>

This is perl 5.004_01.

I'm trying to match the following string (for subsequent
replacement)

/cgi-bin/htgrep.cgi/file=/AA/f97/msched.html&style=pre?AC106

but I haven't been able to figure out how to make that "?"
literal. I've tried "\?" but that didn't work.

Any suggestions?

Thanks,
Pete



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

Date: Fri, 14 Nov 1997 13:27:43 -0600
From: Igor Vulfson <igorv@styx.or.fedex.com>
To: Brad Hochstetler <bhh@iti-oh.com>
Subject: Re: multiple files with perl compiler
Message-Id: <346CA62F.B85B0436@styx.or.fedex.com>

> I was wondering if anyone has compiled a perl file and a package
> into one executable with the perl compiler?
> Am I overlooking something in the documentation?  Any help would
> be appreciated.

Go to Yahoo and search for perl undump
It's no use, though...


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

Date: Fri, 14 Nov 1997 12:34:30 -0600
From: jon@digitalwizards.com.au
Subject: Re: Personal Web Server - Perl ?
Message-Id: <879351791.12408@dejanews.com>

Hi folks,

After a bit of scrounging I found this:
http://WebsUnlimited.com/mdtips.htm

It tells you exactly how to get PWS (and IIS I guess) to do proper CGI
with perl.

There is an alternative called ISAPI. Its probably superior to CGI.
Rather than loading & executing Perl.exe everytime a perl script is
called, the server calls  PerlIS.dll the first time, which stays in
memory rready for subsequent requests. (hence faster)

The only problem is that params must be passed with "POST" rather than
"GET", and CGI specific things like redirect don't work. BTW, this also
means that you can't hardcode hrefs to perl scripts with params,

eg, <a href="/cgi-bin/myscript?myparam=52">Link Label</a>

If there is a way I'd like to know!

If you want to try installing PerlIS, here's how.

Read the above article first. Either disable your support for CGI
perl.exe by removing the registry item described in the above article, or
define your ISAPI perl scripts to have a different extension. I use 
'.plx'.

get the perlIS distribution from:
http://www.ActiveState.com/software/default.htm

add the following string (in the same area as the perl.exe reg entry)

'.pl' with value 'C:\perl\bin\PerlIS.dll' (don't include the  ' s)

or

'.plx' with value 'C:\perl\bin\PerlIS.dll'

if you have perl.exe (CGI) as your default perl handler.

check that you have the path is pointing to your perl installation.
Don't forget to Stop - Start your Web Server.

Good luck.

Cheers,
Jon


In article <63gds4$1b4$1@news.vanderbilt.edu>,
  John.M.Desper@vanderbilt.edu (John Desper) wrote:
>
> In article <3458ba3f.0@news.bru.tfi.be>, yooo@geocities.com says...
> >
> >Is it possible to configure Personal Web Server (Microsoft), so I can run
> >Perl CGI-scripts on it ?
> >
> >Thx in advance
> >
> >
> I'm new at it, and I may miss a step (I tend to do things and forget what it
> was that I did that got things to work):
> (don't enter the quotes!)
> (1) Associate .pl files (or .cgi) with Perl. Try from Explorer:
> View--Options--File Types--New Type.
> Description "Perl" (or whatever...it's unimportant)
> Associated extension "pl" (or cgi)
> Content type (MIME) I haven't put anything in & it seems unimportant
> Then for Actions:
> click New; action "OPEN"; application used..."C:\perl\bin\perl.exe %1 %*"
> (If you've done this right, double-clicking on the script in Explorer will run
> the script.)
> There are some registry entries that you'll need to make for Perl but I
suspect
> you've gotten that far if you've gotten Perl to work.
> Then it's a matter of opening up the Administration feature of the Personal
Web
> Server, which is all done thru your browser. Add a directory entry for
> C:\CGI-BIN\ (or whatever) and (this is the key) give it Read and Execute
> access.
> This *ought* to work.
> Also check out:
> http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html
> There seems to be little documentation for the PWS, but seems that people try
> stuff that works for the commercial Internet Information Server, and that
seems
> to work for PWS as well.

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Fri, 14 Nov 1997 12:02:10 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Ping and MacPerl Problems
Message-Id: <pudge-ya02408000R1411971202100001@news.idt.net>

In article <879517104.29111@dejanews.com>, "Dale Thatcher"
<dt6@doc.ic.ac.uk> wrote:

# I have been confused by some results had when tring to 'ping' other
# machines from MacPerl using Net::Ping.
# 
# We have a small network with five PC's and one Mac.  I've been tring to
# 'ping' the PC's from the Mac using MacPerl.  One of the PC's is a
# dedicated NT webserver which I have no problem pinging.  I also have no
# problem 'pinging' the Mac.  But I get no joy at all from the other
# machines.  As far as I am aware the other machines are running standard
# NT4.0 and they have no trouble doing a command line ping between them.

Hm.  AFAIK, ICMP is unimplemented in MacPerl; that's the only problem I
know of with ping'ing and MacPerl.  Net::Ping uses UDP as the default
protocol; maybe those other machines do not have the ability (enabled) to
return a UDP ping?  I have several machines on my network that respond to
ICMP pings, but not UDP or TCP pings.

NOTE: Unix ping uses ICMP, I'd imagine your NT ping uses the same.

--
Chris Nandor               pudge@pobox.com           http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==                    MacPerl: Power and Ease                     ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#
Chris Nandor               pudge@pobox.com           http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==                    MacPerl: Power and Ease                     ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#


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

Date: Fri, 14 Nov 1997 13:25:11 -0600
From: Igor Vulfson <igorv@styx.or.fedex.com>
To: mathias@linux.ek79.uni-koeln.de
Subject: Re: process handling
Message-Id: <346CA597.308B7064@styx.or.fedex.com>

>   7 system("RERC m1990.dat m1990.dat $niter 8 4 1 0.0001 5 > /dev/null");
>   8 $wait    = 3*(time() - $started);

>  20    `ps>qwe`;

First of all, you have to specify -e on the ps' command line for it
to show all processes - it may not show the processes started from
forked processes, as in system();

So,

open(PS, "ps -e |")
	or die "open: $!";
@instances = grep(/ RERS$/, <PS>);
close PS;
foreach (@instances)
{
	if (/^ +([^ ]+) /)
	{
		print "pid $1\n";
	}
}
kill 9, @instances;

-- 
Senior Scientific Programmer  |  Email: mailto:ivulfson@fedex.com
Ops Research & Spatial Apps   |  URL:   http://codeflux.com/
Federal Express Corporation   |


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

Date: Fri, 14 Nov 1997 13:29:52 -0600
From: Ravi Kumar <ravi@centtech.com>
Subject: regexp cruncher in perl. Please help.
Message-Id: <346CA6B0.6B57@centtech.com>

All,

	I have a bunch of multi-thousand line files containing lines
which should be eliminated from a bunch of million line files. Obviously
cannot use anything but perl

The line format is so

blah blah <num> blah.

The num is unique. The line with the matching number in the database
needs elimination.
	What I do is very inefficient and has unpleasant side effects.
I create an associative array of all the nums in the associative array
while (<>)
{
  $num =~ /blah/;
  $numAA{$num}=1;
}

Next while processing the database
while (<>) 
{
  $num =~ /blah/;
  if ($numAA{$num}) 
    ### delete
}

This is probably inefficient. It takes an hour or more on our most
powerful machines. Is there a better way to do this? 
What I think is since the number can be a regular expression, can I
write a subroutine which creates a regular expression automatically?
I can then use it to grep out lines from the data base.

Another serious problem is that if the assoc array gets large enough
perl will hang on SunOS 5.5.1 machines.


-- 

Cheerios,
-- Ravi Kumar, Centaur Technology, 512 418 5738


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

Date: 14 Nov 1997 19:53:34 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: regexp cruncher in perl. Please help.
Message-Id: <64ia7u$md6@news-central.tiac.net>

You might want to check the information at
http://www.perl.com/CPAN-local/doc/FMTEYEWTK/regexps.html
and see how Tom Christiansen generates a routine tosee whether a string
matches one of a group of patterns not known until run time.

Hope this helps,

Mike

In article <346CA6B0.6B57@centtech.com>, Ravi Kumar  <ravi@centtech.com> wrote:
>All,
>
>	I have a bunch of multi-thousand line files containing lines
>which should be eliminated from a bunch of million line files. Obviously
>cannot use anything but perl
>
>The line format is so
>
>blah blah <num> blah.
>
>The num is unique. The line with the matching number in the database
>needs elimination.
>	What I do is very inefficient and has unpleasant side effects.
>I create an associative array of all the nums in the associative array
>while (<>)
>{
>  $num =~ /blah/;
>  $numAA{$num}=1;
>}
>
>Next while processing the database
>while (<>) 
>{
>  $num =~ /blah/;
>  if ($numAA{$num}) 
>    ### delete
>}
>
>This is probably inefficient. It takes an hour or more on our most
>powerful machines. Is there a better way to do this? 
>What I think is since the number can be a regular expression, can I
>write a subroutine which creates a regular expression automatically?
>I can then use it to grep out lines from the data base.
>
>Another serious problem is that if the assoc array gets large enough
>perl will hang on SunOS 5.5.1 machines.
>
>
>-- 
>
>Cheerios,
>-- Ravi Kumar, Centaur Technology, 512 418 5738


-- 
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@colltech.com                  |            Collective Technologies (work)


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

Date: Fri, 14 Nov 1997 14:52:39 GMT
From: ron@farmworks.com (Ronald L. Parker)
Subject: Re: SWIG needs Perl.lib for NT - where?
Message-Id: <346d6330.5438750@10.0.2.33>

On Thu, 13 Nov 1997 17:52:58 -0800, Bruce Wheeler
<nospambruce_wheeler@hp.com.nospam> wrote:

>I'm using Visual C++ 5.0 to compile a swig wrappped application.
>I'm getting BaseParser_wrap.obj : error LNK2001: unresolved external
>symbol _Perl_sv_setref_pv plus about 19 similar errors
>
>I've downloaded perl from www.activestate.com build 313 using both
>Pw32i313.exe (1,494 KB) (Perl for Win32 Intel/x86 binary) and
>Pw32s313.zip (1,882 KB) (Perl for Win32 Source Files)
>
>but don't have anything that looks like a perl.lib

These functions can be found in the perl.dll that comes with Gurusamy
Sarathy's build of Perl, available from finer CPAN sites everywhere.
Unfortunately, I don't know how to make an import library for VC5 from
an already-built DLL.  If you don't know how to do this, either, you
can always build Perl 5.004 and create the import library at build
time.  And, you have the advantage of all those bug fixes and other
improvements that aren't in ActiveState's version 5.003.



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

Date: Fri, 14 Nov 1997 14:35:48 GMT
From: ron@farmworks.com (Ronald L. Parker)
Subject: Re: which Perl is for me?! can't find 5.004_04 for win95
Message-Id: <346c6110.4894878@10.0.2.33>

On Thu, 13 Nov 1997 16:40:38 -0700, Dan Baker <dtbaker@flash.net>
wrote:

>Also, this may be a dumb question, but what do I do with the *.tar.gz
>file? My netscape doesn't recognize that extension... will winzip unzip
>it, or do I need to go get another plugin?

WinZip will indeed unzip it.  You'll find that that distribution also
contains just about every module you could ever want, already ported
to Win95 and preinstalled for your enjoyment.  



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

Date: 14 Nov 1997 09:25:22 -0800
From: mcravit@best.com (Matthew Cravit)
Subject: Re: write daemon with Perl
Message-Id: <64i1i2$h55$1@shell3.ba.best.com>

In article <346C6E1B.3331@nortel.ca>,
Wallace Cheong  <WCHEONG@nortel.ca> wrote:
>equalivant command of setsid in Perl functions.  How can I do that?  

setsid (and other similar functions) are available to you in the POSIX
module of perl. You can make setsid available to you in your code by
including the line:

    use POSIX qw(setsid);

at the top of your script.

Hope this helps.

/MC

-- 
Matthew Cravit, N9VWG               | Experience is what allows you to
E-mail: mcravit@best.com (home)     | recognize a mistake the second
        mcravit@taos.com (work)     | time you make it.


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

Date: Fri, 14 Nov 1997 11:02:02 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Writing a daemon process
Message-Id: <346C840A.31C0@houston.Geco-Prakla.slb.com>

I'm attempting to write a script that checks disk space on several of
our servers, and creates a report from the information.  I've been
requested to try to make the process a daemon process so that it is not
dependent on 'cron' kicking off the job.

I also must consider the resource requirements for running such a
process as a daemon.  It cannot be allowed to munch more and more
memory, cpu cycles, etc., as the length of time it runs increases.

My questions are:
1.  Is there some reading material on the subject?  perlfaq8 had some
    information on forking a daemon (I guess he's done  :-)  ), but I
    haven't found anything about actually writing one.  I'm fairly new
    to unix programming and Perl.
2.  What is the 'most efficient' manner to use when creating a daemon
    process?
3.  Should this daemon process be something short that calls the
    'workhorse' script at set intervals (once every 5 minutes, once
    every 4 minutes...), or should the daemon be the 'workhorse' script
    itself.
4.  While on the documentation subject:  what is the Panther book? 
    Heard it existed (vaguely), but never spotted.

Guidance greatly appreciated.  TIA.

Dave

-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

------------------------------------------------------------------------
* Dave Barnett               U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng  U.K.: barnett@gatwick.Geco-Prakla.slb.com *
------------------------------------------------------------------------


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

Date: Fri, 14 Nov 1997 14:00:21 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Writing a daemon process
Message-Id: <comdog-ya02408000R1411971400210001@news.panix.com>

In article <346C840A.31C0@houston.Geco-Prakla.slb.com>, Dave Barnett <barnett@houston.Geco-Prakla.slb.com> wrote:


>4.  While on the documentation subject:  what is the Panther book? 
>    Heard it existed (vaguely), but never spotted.

Advanced Perl Programming
Sriram Srinivasan
ISBN 1-56592-220-4
<URL:http://www.oreilly.com>

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Fri, 14 Nov 1997 14:05:11 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Year2000 problem with localtime();
Message-Id: <199711141333207465690N@roxboro-182.interpath.net>

Mr. Yen-Ming Chen <chenym@dufu.math.ncu.edu.tw> wrote:
 
]  In a DEC Alpha, the localtime can present up to year 2038, Jan. 19th,
] 11:14:07. So that means it(Unix) will have a "year 2038" problem?? :)

Yes it does.  See previous post in this, but it is being worked on even
as we speak - think we got time to get this solved before it blows up in
our face.

-- 
John Moreno


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

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 1319
**************************************

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