[13310] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 720 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 5 23:22:51 1999

Date: Sun, 5 Sep 1999 20:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 5 Sep 1999     Volume: 9 Number: 720

Today's topics:
    Re: A concatenation problem... (Ayman Haidar)
        aaa Script for extracting usenet binaries? <jason.paxton@tesco.net>
        ANN: variable interpolation within strings help page (elephant)
        Broadcasting to DCC CHAT objects in Net::IRC <harald-usenet@paulsen.no>
    Re: Checking number of messages <harald-usenet@paulsen.no>
    Re: darndest regex thing (elephant)
    Re: Diffs between scalar and hash variables? <ltl@rgsun40.viasystems.com>
    Re: Diffs between scalar and hash variables? (Jeffrey Epstein)
    Re: Diffs between scalar and hash variables? <ltl@rgsun40.viasystems.com>
    Re: Diffs between scalar and hash variables? <nguyend7@msu.edu>
        displaying lines with a specific number of lines on eac (Burt lewis)
    Re: Encryption <blazer@mail.nevalink.ru>
    Re: fork? <mpersico@erols.com>
    Re: fork? (Gyepi SAM)
    Re: Looking for tools. <todd.rovito@stargate-tech.com>
    Re: Looking for tools. <bradleyb@megsinet.net>
    Re: msdos console window under windows 95 (elephant)
    Re: multitasking in win32 (aka fork())? <blazer@mail.nevalink.ru>
        Newbie <axiomwest@home.com>
    Re: Newbie (Burt lewis)
    Re: Newbie: Perl DOS Window Runs Too Fast (David Efflandt)
    Re: perl mail filter? <nguyend7@msu.edu>
    Re: Platform (David Efflandt)
    Re: Question about installing modules (elephant)
    Re: Routine for normalising file paths <agray@infoscience.otago.ac.nz>
    Re: Subscribing to p5p (brian d foy)
    Re: User Id <jleffler@earthlink.net>
    Re: Wow! Praises from a Newbie <ptimmins@itd.sterling.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Sun, 05 Sep 1999 22:39:27 GMT
From: haidar@master.mynet.net (Ayman Haidar)
Subject: Re: A concatenation problem...
Message-Id: <slrn7t5sk1.t72.haidar@master.mynet.net>

On Thu, 02 Sep 1999 14:35:17 GMT, William <willmurat@my-deja.com> wrote:
>
>
>Hi All,
>
>
>I'm a newbie... I just only want to add "<" and ">" in the beginning and
>in the end of a string. But, for some reason, just don't works... Look
>this code piece:
>
>$a = "\<$_[0]\>";
>
>or
>
>$a = "\x3c$_[0]\x3e";
>
>or
>
>$a = "\<" . $_[0] . "\>";
>

I had a similar problem, and finally I found out that $_[0] (or other
value) has a "\n" at the end, so all I had to do is chop($_[0]) and
concatation worked.

this might be your problem


-- 
 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
|		Ayman Haidar						|
|		haidar@usol.com						|
|		just another linux and vim lover.			|
 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-



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

Date: Sun, 5 Sep 1999 23:52:53 +0100
From: "jason paxton" <jason.paxton@tesco.net>
Subject: aaa Script for extracting usenet binaries?
Message-Id: <7qusm4$98j$1@epos.tesco.net>

Has anyone got a script for extracting usenet binaries or can you point me
to a site that might have one.

Regards.

Jason

jason.paxton@tesco.net





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

Date: Mon, 6 Sep 1999 12:46:13 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: ANN: variable interpolation within strings help page
Message-Id: <MPG.123dd5fc6b0e5c20989cb3@news-server>

stemming from a recent thread in this newsgroup I have put together a 
few observations on how Perl 5.005_03 does interpolation within strings

the topic seems lightly dealt with by the standard documentation .. so 
it is a potential source of confusion .. hopefully this will help

at the very least it will give the proficient perlers somewhere to point 
the confused when they ask questions on this topic in this or any other 
forum

  http://www.squirrelgroup.com/perl/interpolation.html

-- 
 jason - elephant@squirrelgroup.com -


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

Date: Mon, 6 Sep 1999 04:08:24 +0200
From: "Harald Paulsen" <harald-usenet@paulsen.no>
Subject: Broadcasting to DCC CHAT objects in Net::IRC
Message-Id: <7qv7f6$3ru$1@troll.powertech.no>

How can I send a msg to all DCC CHAT connections?
(for instance, if I want a privmsg echo'ed to all "connected" users,
or want have a simple dcc chat partyline)


--
Harald





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

Date: Mon, 6 Sep 1999 04:22:35 +0200
From: "Harald Paulsen" <harald-usenet@paulsen.no>
Subject: Re: Checking number of messages
Message-Id: <7qv89p$44o$1@troll.powertech.no>

WL skrev i meldingen <7qs57k$j99$1@uranium.btinternet.com>...
>I want to do something very simple: have a perl script that will log into
my
>mail account (on same server - usr/home/myname), check how many messages
>there are, and email another account.
>
>What code would do this?


I wrote a script a while ago, that does that, shows you how to log in
to a pop3 server and get the status for your mailbox. The comments
are in norwegian, but I'm sure you can figure it out anyway.

The script is at http://www.paulsen.no/perlsockets/pop3check.txt


--
Harald





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

Date: Mon, 6 Sep 1999 11:13:45 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: darndest regex thing
Message-Id: <MPG.123dc056427209f989cb1@news-server>

lt lindley writes ..
>elephant <elephant@squirrelgroup.com> wrote:
>:>lt lindley writes ..
>:>>This regexp does much of what you want, but neither your solution
>:>>nor mine are really very good.
>:>>
>:>>  @a=m/((?<=").+?(?=")|[^" ]+)/g;
>
>:>especially not really good for
>
>:>  $_ = q(first second "the third token" fourth fifth "sixth token");
>
>:>try it .. blergh
>
>Ouch.  I left the quotes around for the next (and previous) matches
>since they were zero width assertions.
>
>This seems to dump them.  Not that I'm claiming it as the right way
>to go about solving the problem.  Just regexp fun.

understood

>@a=m/((?<=")\b.+?\b(?=")|\b[^" ]+?\b)/g;

it appears to work .. quicker than my original solution also (I am 
always amazed at how little overhead the lookaheads and lookbehinds add)

-- 
 jason - elephant@squirrelgroup.com -


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

Date: 5 Sep 1999 23:38:18 GMT
From: lt lindley <ltl@rgsun40.viasystems.com>
Subject: Re: Diffs between scalar and hash variables?
Message-Id: <7quuta$k4b$1@rguxd.viasystems.com>

Jeffrey Epstein <epsteinj@equity.wharton.upenn.edu> wrote:
[snip]

:>What must be done to store FILE_POINTER into a hash variable and 
:>then use it later?  Why does it work when putting it into the 

Copy it to a scalar, then use it.

:>scalar variable?  It seems like it should behave exactly the 
:>same...

Tom already gave you an obtuse hint in another thread.  He said that
people seem to expect that it will work the same but he doesn't know
why they think that [paraphrased from memory].  It was a clue to read
the documentation.  He could have been a little more specific, but
then he would have embarrased you.

[snip]

:>  $filePointer = \*FILE_POINTER;
:>  print $filePointer "Printing from scalar...\n";

:>  $my_hash->{"filePointer"} = \*FILE_POINTER;
:>#  print $my_hash->{"filePointer"} "Printing from hash...\n";
:>---------------------------------------------------------------

perldoc -f print

The explanation is on the first screen.  

In fairness your assumption is pretty normal.  There seems to be
sometimes counterintuitive magic involved with Perl file handles.
(Or maybe it is magic that tries to make file handles intuitive but
only partially succeeds.)  It isn't magic, but it is often obscure.
Luckily it is documented.

-- 
// Lee.Lindley   /// Programmer shortage?  What programmer shortage?
// @bigfoot.com  ///  Only *cheap* programmers are in short supply.
////////////////////    50 cent beers are in short supply too.


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

Date: 6 Sep 1999 00:01:07 GMT
From: epsteinj@equity.wharton.upenn.edu (Jeffrey Epstein)
Subject: Re: Diffs between scalar and hash variables?
Message-Id: <7qv083$8ci$1@netnews.upenn.edu>

Thank you thank you thank you.

I am a beginner, but I have been reading Perl in 21 Days as much
as I can, and I haven't found anything regarding this.  Of course, 
I didn't know what I was looking for.  I was actually thinking 
there was something special about FILE HANDLES, and didn't think 
about hashes.

I can't seem to access perldoc on my machine, I'll have to ask
on Tuesday where it is located.

lt lindley (ltl@rgsun40.viasystems.com) wrote:
: Jeffrey Epstein <epsteinj@equity.wharton.upenn.edu> wrote:
: [snip]

: :>What must be done to store FILE_POINTER into a hash variable and 
: :>then use it later?  Why does it work when putting it into the 

: Copy it to a scalar, then use it.

: :>scalar variable?  It seems like it should behave exactly the 
: :>same...

: Tom already gave you an obtuse hint in another thread.  He said that
: people seem to expect that it will work the same but he doesn't know
: why they think that [paraphrased from memory].  It was a clue to read
: the documentation.  He could have been a little more specific, but
: then he would have embarrased you.

: [snip]

: :>  $filePointer = \*FILE_POINTER;
: :>  print $filePointer "Printing from scalar...\n";

: :>  $my_hash->{"filePointer"} = \*FILE_POINTER;
: :>#  print $my_hash->{"filePointer"} "Printing from hash...\n";
: :>---------------------------------------------------------------

: perldoc -f print

: The explanation is on the first screen.  

: In fairness your assumption is pretty normal.  There seems to be
: sometimes counterintuitive magic involved with Perl file handles.
: (Or maybe it is magic that tries to make file handles intuitive but
: only partially succeeds.)  It isn't magic, but it is often obscure.
: Luckily it is documented.

: -- 
: // Lee.Lindley   /// Programmer shortage?  What programmer shortage?
: // @bigfoot.com  ///  Only *cheap* programmers are in short supply.
: ////////////////////    50 cent beers are in short supply too.

--
Jeff
jeffy@wharton.upenn.edu
http://equity.wharton.upenn.edu/~epsteinj

Programmer Analyst
Wharton School
University of Pennsylvania



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

Date: 5 Sep 1999 23:42:50 GMT
From: lt lindley <ltl@rgsun40.viasystems.com>
Subject: Re: Diffs between scalar and hash variables?
Message-Id: <7quv5q$k4b$2@rguxd.viasystems.com>

lt lindley <ltl@rgsun40.viasystems.com> wrote:
:>Jeffrey Epstein <epsteinj@equity.wharton.upenn.edu> wrote:
:>[snip]

:>Tom already gave you an obtuse hint in another thread.  He said that
:>people seem to expect that it will work the same but he doesn't know
:>why they think that [paraphrased from memory].  It was a clue to read
:>the documentation.  He could have been a little more specific, but
:>then he would have embarrased you.

Ooops.  You just asked a question on that thread and were not the
original poster.  But it was the same problem.  And same answer.

-- 
// Lee.Lindley   /// Programmer shortage?  What programmer shortage?
// @bigfoot.com  ///  Only *cheap* programmers are in short supply.
////////////////////    50 cent beers are in short supply too.


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

Date: 6 Sep 1999 00:32:03 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: Diffs between scalar and hash variables?
Message-Id: <7qv223$lvd$1@msunews.cl.msu.edu>

Jeffrey Epstein <epsteinj@equity.wharton.upenn.edu> wrote:
: #!/bin/perl

:   $my_hash={};
Why a hash reference?  Why not %my_hash=();

:   $my_hash->{"my_string"} = "value_of_my_string";
:   print $my_hash->{"my_string"}."\n";

You won't need '->'.

:    open(FILE_POINTER, ">>test.log")  || 
: die("Parameters valid, but the file was not found, or could 
: not be opened.");

They really aren't known as FILE_POINTERS rather FILE_HANDLES.

:   $my_hash->{"filePointer"} = \*FILE_POINTER;
    $filePointer = $my_hash->{"filePointer"};

Why are you using a hash reference?    
    
: #  print $my_hash->{"filePointer"} "Printing from hash...\n";
  print $filePointer "Printing from hash\n";

-- 
       Dan Nguyen          | It is with true love as it is with ghosts;
    nguyend7@msu.edu       | everyone talks of it, but few have seen it.
     dnn@debian.org        |               -Maxime De La Rochefoucauld
            25 2F 99 19 6C C9 19 D6  1B 9F F1 E0 E9 10 4C 16


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

Date: Mon, 06 Sep 1999 02:22:26 GMT
From: burt@ici.net (Burt lewis)
Subject: displaying lines with a specific number of lines on each page
Message-Id: <CzFA3.168$9b.25281@news.goodnet.com>

Hi,

Rather than starting from scratch, I was wondering if there is a standard 
routine that will group resulted lines  (@results) per page by a specific 
number.

It's the kind of thing you see on all the search engines.

Appreciate any ideas on this.





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

Date: Mon, 06 Sep 1999 03:39:13 +0400
From: Mike Blazer <blazer@mail.nevalink.ru>
To: Bill Miles <igloo@wecandoit.com>
Subject: Re: Encryption
Message-Id: <37D2FF21.63646880@mail.nevalink.ru>

Bill Miles wrote:
> 
> Yes ... this is the problem. I'll need ports for both Unix and Win NT. Most
> of the CPAN modules I have seen so far rely on native code calls. As Perl is
> the greatest language on the face of the planet, I never learned how to deal
> with C or C++ or Win nmake (I don't even own a C/C++ compiler for Win) ...
> you can do everything in Perl. I did see a Web page out of the UK called
> something like "crypt - o - sig" which had a pure Perl five line encryption
> script (the 3 line relied on a unix module, I believe), but that seems to
> have disappeared. Any suggestions? (short of learning C/C++)

Those few-liners are damn slow because there are in pure-perl(without XS).
Take a look at Crypt:: modules - pretty lots of them - Crypt::IDEA, Crypt::DES, Crypt::GOST, Crypt::CBC (chaining block cipher that uses Crypt::IDEA and Crypt::DES). There was also TripleDES if I remember and the whole Cryptix library, but don't make a mess - modules from Cryptix lib have same names as CPAN modules but they are totally incompartible.

HTH
-- 
==================================
Mike Blazer
blazer@mail.nevalink.ru
http://www.dux.ru/guest/fno/perl/
==================================


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

Date: Sun, 05 Sep 1999 20:09:08 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: fork?
Message-Id: <37D30624.25CCAD05@erols.com>

GiN wrote:
> 
> thanks for your reply!
> but how can i modify the source to let the child print "blah2"?

You have to set the PARENT to blah2 before forking. Fork works like this:

1) You have a process. It has code and data stored in some block of memory.
In that memory you have set $chick = "blah1".
2) You fork. This is the equivilent of DUPING EVERY BIT in memory space of
your program in another block of memory, creating another entry in the
process table and starting execution at the statement right after the fork.
You have now TWO, count 'em TWO distinct processes.
3) When you fork again, the first process begets a third one. Anything you
do in the second process is in complete isolation from the first and third.

HTH
-- 
Matthew O. Persico
    
You'll have to pry my Emacs from my cold dead oversized
   control-pressing left pinky finger. -- Randal L. Schwartz


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

Date: Sun, 5 Sep 1999 20:20:02 -0400
From: gyepi@magnetic.praxis-sw.com (Gyepi SAM)
Subject: Re: fork?
Message-Id: <slrn7t62d7.a7l.gyepi@magnetic.praxis-sw.com>

On Sun, 05 Sep 1999 13:28:53 +0200, GiN <wablief@freemail.nl> wrote:
>meow wrote:
>> GiN <wablief@freemail.nl> wrote:
>> Nothing, except expecting that forking will do what threads do.
>> Fork() preserves a copy of the state of the parent process' state in
>> the child, but it's just that, a copy.  As soon as parent or child
>> changes a variable, they are different and stay that way.
>
>thanks for your reply!
>but how can i modify the source to let the child print "blah2"?

Sounds like your parent-child processes need to talk to one another.
I suggest you look at pipes, named or otherwise, or some other IPC
mechanism.

man perlipc

-- 
  Gyepi Sam  --+--  Designer/Programmer  --+--  Network/System Administrator   
  gyepi@praxis-sw.com         --+--          http://www.praxis-sw.com/gyepi

  What we do not understand we do not possess. -- Goethe



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

Date: Sun, 05 Sep 1999 22:11:27 -0400
From: "Todd V.Rovito" <todd.rovito@stargate-tech.com>
Subject: Re: Looking for tools.
Message-Id: <37D322CF.2A388DA8@stargate-tech.com>

I agree with you.  The command line tools and VI are all that is needed to write
god PERL programs.  I tried the perl builder and I had some bad experiences with
it.  It certainly did not make me more productive.

Shawn & Jocelin Borisow wrote:

> Why does noone like to use a standard text editor..... Comes with most OS...
> Am I the only cheap mug around any longer.... LOL .... I tried perl builder
> but I didn't like it...... I just prefer command line and a text editor
> though....



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

Date: Sun, 5 Sep 1999 21:51:39 -0500
From: "Bradley Bell" <bradleyb@megsinet.net>
Subject: Re: Looking for tools.
Message-Id: <rYFA3.309$BF4.44627@news.corecomm.net>

Under NT, our place tried PerlBuilder which is a little flakey at times esp.
debugging database programs.  I am currently trying out a freeware program
called Code Magic.

You can find it at http://www.petes-place.com

bradley

Sidney Orret <orret@wmn.net> wrote in message
news:7qohbu$grj$1@madmax.keyway.net...
> Hello
>
> What are the best enviroment and tools for PERL's
programming??????????????
>
> Currently I am using Viotix PERLPad 3.5, and the Programmer's File Editor
> 1.01, but I am looking for something with more facilities as sintax
highligt
> for example. Also I am looking for a shareware, and better for a freeware.
>
> Good luck
>
>       Sidney
>
> --
> +++
> ************************************************************************
> Sidney  Orret
> Addr:    1444 Via Zurita.
>               Claremont. CA. 91711-2743.
> Phone:1-909-625 8510
> Email:  orret@wmn.net
> ************************************************************************
>
>




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

Date: Mon, 6 Sep 1999 11:49:59 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: msdos console window under windows 95
Message-Id: <MPG.123dc8d2b5de7da0989cb2@news-server>

bigdreamer@prodigy.net writes ..
>i'm running active perl on windows 95... just working with some simple perl
>development.  anyway, i need to know how to keep the console window open
>after the app completes execution and the window it was running in is no
>longer active.  right now it just exits and closes the window all in the
>blink of an eye.  a stupid little wait for keypress at the end of my app
>solves this but i figured there's got to be a better way to keep the window
>showing.  i thought i would try this group first.  thanks a bunch to all.

open the command prompt window first .. THEN run the perl script by 
typing on the keyboard .. DO NOT double-click the .pl file

-- 
 jason - elephant@squirrelgroup.com -


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

Date: Mon, 06 Sep 1999 04:30:05 +0400
From: Mike Blazer <blazer@mail.nevalink.ru>
To: "[L] Vicious!" <baal@c2i.net>
Subject: Re: multitasking in win32 (aka fork())?
Message-Id: <37D30B0D.579A0D23@mail.nevalink.ru>

[L] Vicious! wrote:
> 
> I have built a perl program using Tk (Win GUI), and my program has some
> long-running sub-functions. I run Win98 & Activestate perl, is there any way
> to obtain some kind of multitasking (aka fork()). This will allow me to make
> some progress indicators, and still update the mainloop (avoid a "dead"
> interface). I've tried the Win32::Process, but I couldn't find a way to
> execute my functions. I might be wrong, but the Win32::Process is used to
> run external aplications and not functions inside my program.
> 
> I couldn't find it in the docs, but if there are a section refering to my
> problem, don't hesitate to tell me. :O)

fork() is promissed in Perl 5.006 for Win32 also. Generally yes, you are right - Win32::Process starts another program or script. But there are some ways...

unless (@ARGV) {
  Win32::Process::Create($ProcessObj, $^X, "$^X $0 1", 0, 0, '.') or die;
} else {
  ... here we have a child ...
}

-- 
==================================
Mike Blazer
blazer@mail.nevalink.ru
http://www.dux.ru/guest/fno/perl/
==================================


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

Date: Mon, 06 Sep 1999 01:32:00 GMT
From: "JT" <axiomwest@home.com>
Subject: Newbie
Message-Id: <kQEA3.16792$3%1.5436@news.rdc1.az.home.com>

I was wondering if i can get some hints or a Faq or something when working
with Perl ?




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

Date: Mon, 06 Sep 1999 02:18:07 GMT
From: burt@ici.net (Burt lewis)
Subject: Re: Newbie
Message-Id: <zvFA3.167$9b.25281@news.goodnet.com>

In article <kQEA3.16792$3%1.5436@news.rdc1.az.home.com>, axiomwest@home.com 
says...
>
>I was wondering if i can get some hints or a Faq or something when working
>with Perl ?
>
>

Easy. Just do a search on Perl, there's a gizillion links on it.

Also, start buying books. Aside from the O'rielly ones, I've gotten a lot of 
help from "Perl for Dummies".



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

Date: 6 Sep 1999 00:09:23 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Newbie: Perl DOS Window Runs Too Fast
Message-Id: <slrn7t61ps.op.efflandt@efflandt.xnet.com>

On Sun, 05 Sep 1999 12:00:17 +0000, David <hansi@lancnews.infi.net> wrote:
>I just bought a "Perl 5 How To" book with a CD-ROM.  It says I have to
>have access to a server with Perl on it, but I want to run it on my
>Windows 98 machine first.  The problem I'm running into is that there is
>a version of Perl32.exe on my PC on which I am running the book's
>scripts, BUT the trouble is that a MS-DOS window opens up to run the
>script and then closes so quickly that I can't see what the script
>does.  When I eventually tailor one of these scripts or write my own, I
>want to test it on my PC before uploading it to the cgi-bin on the
>server.
>
>What am I doing wrong, and what should I be doing?
>
>Thanks in advance.

Just put this at the end of the script.  Then you can simply double click
on a .pl script in Explorer and it will pause after running until you hit
enter.  On a webserver, it will automatically skip this last step:

unless ($ENV{SCRIPT_NAME}) {
    <STDIN>;
}

If SCRIPT_NAME is not a universal webserver variable, then try something
else like SERVER_NAME.

But if your web host uses the apache webserver, it is much easier in the
long run to install Linux on your PC with apache, so you can test
everything exactly like it will run on the web.

If you have any future questions as you develop your CGI scripts, please
post them to a .cgi newsgroup, since they have faqs that can answer many
of your questions.

-- 
David Efflandt   efflandt@xnet.com   http://www.xnet.com/~efflandt/
http://www.de-srv.com/   http://cgi-help.virtualave.net/
http://thunder.prohosting.com/~cv-elgin/


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

Date: 6 Sep 1999 00:36:27 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: perl mail filter?
Message-Id: <7qv2ab$o0n$1@msunews.cl.msu.edu>

revjack <revjack@radix.net> wrote:
: Just curious, has anyone here ever written their own procmail-style 
: e-mail filter using perl? I keep getting these suicidal impulses to 
: do this every six months or so, and I was wondering if anyone had any 
: success/failure stories or advice.

Is there any point?  You'll probably end up using procmail to pipe it
to your perl script anyway.  


-- 
       Dan Nguyen          | It is with true love as it is with ghosts;
    nguyend7@msu.edu       | everyone talks of it, but few have seen it.
     dnn@debian.org        |               -Maxime De La Rochefoucauld
            25 2F 99 19 6C C9 19 D6  1B 9F F1 E0 E9 10 4C 16


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

Date: 6 Sep 1999 00:24:19 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Platform
Message-Id: <slrn7t62lu.op.efflandt@efflandt.xnet.com>

On Sun, 05 Sep 1999 13:51:04 -0700, Mukund M Chandak
<mukundmc@hotmail.com> wrote:
>
>I wanted to know if there is a way to find the platform on which a user
>is working on, like win32, sun sparcstation and so on. Is there any
>command or function available for this.
>
>thanks
>
>Mukund

man perlvar
$^O (as in OS not zero).

-- 
David Efflandt   efflandt@xnet.com   http://www.xnet.com/~efflandt/
http://www.de-srv.com/   http://cgi-help.virtualave.net/
http://thunder.prohosting.com/~cv-elgin/


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

Date: Mon, 6 Sep 1999 10:49:17 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: Question about installing modules
Message-Id: <MPG.1239f3c3b55dd5c1989cb0@news-server>

Dennis Wilson writes ..
>I have a question about using ppm. I am not sure if this is the right forum,
>or should I be asking the question of activestate.
>
>I used ppm to install Mail::POP3Client. It seemed like everything went
>alright until I tried to run the perl script I had written. I got the
>following message:
>Can't locate MD5.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .)
>at C
>:/Perl/site/lib/Mail/POP3Client.pm line 357. <GEN0> chunk 1.
>
>I obviously did not either run ppm correctly or I don't understand what
>other things I need to install to get this to work.

if you're loggin into an PO3 Server that uses APOP then POP3Client 
requires the MD5 module (which you can also get using ppm)

if you're actually interested in learning then read on .. otherwise just 
type

  ppm install MD5

at the command prompt and be on your way

ok .. I just wanted to tell you how I worked this out (not complicated 
really) .. this might help you help yourself next time

you see the error message say "Can't locate MD5.pm in @INC (@INC 
contains: C:/Perl/lib C:/Perl/site/lib .) at 
C:/Perl/site/lib/Mail/POP3Client.pm line 357. <GEN0> chunk 1."

so .. you should go to your POP3Client.pm file and look at or near line 
357 .. in my POP3Client.pm I see the line

  require MD5;

and it's in the procedure Login_APOP() .. and the comment directly above 
that is "login to the POP server using APOP (md5) authentication" .. so 
I'm guessing that POP3Client is clever enough to know if it's an APOP 
server and if it is then it does a require() on the MD5 module .. so 
obviously you'll have to install that before you can login to an MD5 
server

-- 
 jason - elephant@squirrelgroup.com -


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

Date: 06 Sep 1999 13:00:42 +1200
From: Andrew Gray <agray@infoscience.otago.ac.nz>
Subject: Re: Routine for normalising file paths
Message-Id: <uaer0rgzp.fsf@infoscience.otago.ac.nz>

Neale Morison <nmorison@ozemail.com.au> writes:
> I have in my confused way been attempting to write a subroutine meant to
> take a path such as  ../mary/alice/george/../fred/../../ralph/ted and
> convert it to ../mary/ralph/ted

So you want to recursively remove any occurences of m!/\w*/\.\.!.

> It strips trailing separators.
> If the directory path is absolute (has a leading /), it does not allow a
> path higher than the top level and returns an error.
> I am faintly hoping there is some obvious way to do this in a few lines,
> or perhaps someone could suggest a module that does it.

The below script seems to work for me.  It does assume that the path
is correctly formed and non-null (the null path will return root).
The leading ./ is added at the start to make the recursion easier (for
me).  You could strip that out at the end, but there are already too
many clauses there for my liking.  There are probably far more elegant
ways to do this and I'm not recommending the script, just the idea of
recursively removing the above pattern.

#!usr/bin/perl -w

use strict;

sub normalise {
    my $path = shift;
    $path='./'.$path if $path=~m/^\w/;   # in case it didn't already start with
                                         #  a / or . or ..
    $path=~s!/$!!;                       # remove 'trailing' /
    print "Cleaned path: $path\n";
    while ($path=~s!/\w*/\.\.!!) {       
	print "Working: $path\n";
    }
    $path='/' if !$path;                 # in case nothing was left
    $path="Error" if $path=~m!^/.*\.\.!; # error if start with / and still
                                         #   have a ..
    return $path; 
}

# Test your case
my $path = '../mary/alice/george/../fred/../../ralph/ted';
print "Start with: $path\n";
$path = normalise($path);
print "End with: $path\n\n";

Cheers,
Andrew
















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

Date: Sun, 05 Sep 1999 22:49:06 -0400
From: brian@pm.org (brian d foy)
Subject: Re: Subscribing to p5p
Message-Id: <brian-0509992249060001@130.new-york-11-12rs.ny.dial-access.att.net>

In article <m3iu5pbk1o.fsf@enterprise.newedgeconcept>, Jean-Louis Leroy <jll@enterprise.newedgeconcept> wrote:

>How can I subscribe to the perl5-porters mailing list? I've been on
>that list several times before, but right now I can't find the right
>incantation for subscribing, they used to be on the old www.perl.org,
>but not anymore it seems. And the old summons I found in my files
>don't seem to work anymore...

this information will be back on www.perl.org as soon as i can get
all together.  we're hosting a bunch of lists and still have some 
things to straighten out after moving the lists to faster machines.
sory for the inconvenience - it's only temporary.

btw, you can get to the old Perl Institute site by visiting
tpi.perl.org.

-- 
brian d foy


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

Date: Sun, 05 Sep 1999 15:01:31 -0700
From: Jonathan Leffler <jleffler@earthlink.net>
Subject: Re: User Id
Message-Id: <37D2E73B.64B6@earthlink.net>

mr_potato_head@my-deja.com wrote:
> I wrote a perl script that changes the user id and group id to a
> different user to unload, delete, and upload new tables into my
> informix database.  I'm not really sure why, but I can use the
> script with no issues, but when another user uses it, it fails on
> the delete table procedure.  The script is owned by root and the
> permissions are set to "-rwsr-xr-x  root  other".  The permissions
> on the database are set to grant connect to public and the user id
> the script whiches to is set to grant dba to xxxx.  I don't think
> the changing of the user id is really working, but when I unload
> files from the database, it shows that its owned by the user id I
> switched to.  I changed the user id and group id like:
> 
> $< = 190;
> $> = 190;
> $( = datagroup;
> $) = datagroup;
> 
> Any help would be appreciated.  Thanks in advance...

For hysterical raisins, Informix always uses the real UID and not
the effective UID to identify the user who is connecting to the
database.  Since you are likely to be setting just the effective
UID, that would be why the files are owned by the new user, but
why the database connection fails -- only root processes can set
the real UID to an arbitrary value.

-- 
Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN
#include <disclaimer.h>



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

Date: Mon, 06 Sep 1999 02:47:32 GMT
From: Patrick Timmins <ptimmins@itd.sterling.com>
Subject: Re: Wow! Praises from a Newbie
Message-Id: <7qva01$s2s$1@nnrp1.deja.com>

In article <37D1C7EF.6EE99548@erols.com>,
  "Matthew O. Persico" <mpersico@erols.com> wrote:

> robert_kolker@hotmail.com wrote:
> >
> > After nibbling around the edges of PERL for several months I have
> > finally gotten down to doing some substantial programming in the
> > language.
> >
> > Even though I am a rank Newbie, I have been able to write some
> > "quick and dirty" utilities in under 5 minutes that would have taken
> > an hour to write in a programn language such as C, C++ or Java.
[snip]
> Yep, that's exactly the same feeling I got on the day that I finally
> grokked $,@,%. I call it the Epiphany Effect. Wait until you start

Honestly, although I've never really thought about it before, this
*is* a real thing, at least for me. Only I've sort of referred to
it in my own mind as the 'Oh Sh--!' Effect, because this is
generally what I verbalize, either internally or out loud, when it
hits me.

It usually happens upon re-visiting something I've previously
brushed over in one of tom c's FMTEYEWTK, or Sriram Srinivasan's
'Advanced Perl Programming', or an article in TPJ.

Building up complex data structures on the fly did it for me. Later
on, realizing I can, at will, turn chunks of a really complex
data structure into self contained objects, which can be stored away
or passed around, did it for me again. Finding that perfect little
Perl module (most recently, Graham Barr's LDAP module) that already
has everything I need, will often set off a string of serial
'Oh Sh--!' stammerings over the course of an evening, as I play
with the methods and work through the documentation.

'Oh Sh--!' may not be terribly articulate, but I can assure you,
it is sincere. In fact in Nebraska, people will routinely hear their
neighbor down the road shout 'Oh Sh--!' and they'll start talking
back and forth amongst themselves:

Bill: 'Sounds like Bob is having an epiphany again.'
Tom : 'Yep ... sure does.'
    (long Nebraska lull in the "conversation")
Tom: 'You had an epiphany lately?'
    (another lull)
Bill: 'I ... a ... did get my Perl scripts that read in my GPS data
       and use my fixed Nitrogen levels working with the GD module.'
Tom:  'Oh Sh--! So you can automatically plot all that out now!'
Bill: 'Yep. And build a gif-loop to watch the changes over time.'
Tom:  'Oh Sh--!'
Bill: 'Yep.'


$monger{Omaha}[0]
Patrick Timmins
ptimmins@itd.sterling.com


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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 V9 Issue 720
*************************************


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