[12734] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 144 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 14 17:07:15 1999

Date: Wed, 14 Jul 1999 14:05:14 -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           Wed, 14 Jul 1999     Volume: 9 Number: 144

Today's topics:
        # of days between 2 dates (again) skyfaye@my-deja.com
    Re: # of days between 2 dates (again) <dot@dotat.at>
    Re: ADO and OLE, does anyone know how to make this work (Jan Dubois)
    Re: Anybody know how to to this? <mitsura.nospam@village.uunet.be>
        Can I do this? <richj@home.com>
        can't match $ <mgraham@gwemail.ryerson.ca>
    Re: can't match $ (Mike Bristow)
    Re: can't match $ <aperrin@mcmahon.qal.berkeley.edu>
    Re: can't match $ <mgraham@gwemail.ryerson.ca>
    Re: can't match $ (Jason Stapels)
        crypt returns different values since ISP upgrade. <rob@webteacher.com>
    Re: Database Question <mwkohout@csbsju.edu>
        file test for existence of path? (Vladimir Gabrielescu)
    Re: file test for existence of path? (Vladimir Gabrielescu)
    Re: FLOCK: How can I do exclusive read??? <mdz4c@node10.unix.Virginia.EDU>
    Re: Garbage Collection Performance <tobez@plab.ku.dk>
    Re: Generating Passwords <swiftkid@bigfoot.com>
        getting modify times with perl&unix (Jason Stapels)
    Re: getting modify times with perl&unix (Matthew Bafford)
        hash assignments <nead@neadwerx.com>
        Help with a simple socket question... scott@sboss.net
        Help with cgi cookie rn7532@bris.ac.uk
    Re: Help with cgi cookie <tim@r5i.com>
    Re: Help with cgi cookie <latsharj@my-deja.com>
        learning perl <messmer@sirius.com>
        Looking for script: Story posting (Ataraxia)
        Newbie needs help:  Environment variables <pmarek@stargate-systems.com>
    Re: Password Entry <RaikovR@HotMail.com>
    Re: PERL in C++ (Jan Dubois)
    Re: perl script in browser? (Jason Stapels)
    Re: Rebol and Perl (John Klassa)
        Search array <ski@northwood.edu>
        Sugges script for story posting??? (Ataraxia)
    Re: Using variable to modify regexp <stampes@xilinx.com>
    Re: VBScript to PerlScript (Jan Dubois)
        what's the deal with kill?? amidalla@my-deja.com
        Win32::OLE and Connection Points <tbrown@softbook.com>
    Re: Win32::OLE and Connection Points (Jan Dubois)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Wed, 14 Jul 1999 20:14:46 GMT
From: skyfaye@my-deja.com
Subject: # of days between 2 dates (again)
Message-Id: <7mir39$r1a$1@nnrp1.deja.com>

I'm new to this list.  I've been unsuccessful at posting.  Why does it
log me out every time I click on the button to post my message?  I
apologize in advance if my previous post got through.  Here's my
question:

$old_mon = 6; $old_day = 22; $old_year = 1994; #June 22, 1994
$new_mon = 7; $new_day = 14; $new_year = 1999; #July 14, 1999

How do I find out the number of days between the 2 dates ?

Thanks,
Hung


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


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

Date: Wed, 14 Jul 1999 20:56:57 GMT
From: Tony Finch <dot@dotat.at>
Subject: Re: # of days between 2 dates (again)
Message-Id: <931985817.23202.0.nnrp-01.c30b3753@news.demon.co.uk>

skyfaye@my-deja.com wrote:
>
>$old_mon = 6; $old_day = 22; $old_year = 1994; #June 22, 1994
>$new_mon = 7; $new_day = 14; $new_year = 1999; #July 14, 1999
>
>How do I find out the number of days between the 2 dates ?

use Time::Local;

# t1 and t2 are seconds since the start of 1970, UTC
$t1 = timegm(0,0,0, $old_day, $old_mon - 1, $old_year - 1900);
$t2 = timegm(0,0,0, $new_day, $new_mon - 1, $new_year - 1900);

# 86400 seconds in a day.
print ($t2 - $t1) / 86400, "\n";

Tony.
-- 
f.a.n.finch   dot@dotat.at   fanf@demon.net
Winner, International Obfuscated C Code Competition 1998


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

Date: Wed, 14 Jul 1999 21:39:42 +0200
From: jan.dubois@ibm.net (Jan Dubois)
Subject: Re: ADO and OLE, does anyone know how to make this work?
Message-Id: <37a1e6d7.8793053@news3.ibm.net>

[mailed & posted]

Joe Devine <joe@roofdogsmedia.com> wrote:

>Can anyone give me a working example using ADODB.Conn, ADODB.Recordset,
>and OLE?  Any help would be greatly appreciated -- I'm stumped.

Sure:


use strict;
use Win32::OLE qw(in);

my $Conn = Win32::OLE->new("ADODB.Connection");
$Conn->Open("AdvWorks");
my $RS = $Conn->Execute("SELECT * FROM Orders");

until ($RS->EOF) {
    print join("\n", map "$_->{Name}: $_->{Value}", in $RS->Fields), "\n\n";
    $RS->MoveNext;
}
$RS->Close;
$Conn->Close;


-Jan


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

Date: Wed, 14 Jul 1999 22:08:01 +0200
From: mitsura <mitsura.nospam@village.uunet.be>
Subject: Re: Anybody know how to to this?
Message-Id: <378CEE21.D0AAB86E@village.uunet.be>

I've tried this but it only changes the \n after the last line in the variable

Faisal Nasim wrote:

> : So what I want to do is to replace all the separator (newline, carriage
> : return or whatever) in the variable by <BR> using regular expressions.
> :
> : Here the problem arises:
> : - what is that separator? When I use print to display the variable in UX
> : shell, everything is fine, so there must be a sort of a separator at the
> : end of each line
>
> Yes, thats \n
>
> : - How do I replace this separator with <BR> ?
>
> If thats a scalar:
> $mystring =~ s/\n/<br>\n/g;
>
> If thats an array:
> print join "\n" , @array;



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

Date: Wed, 14 Jul 1999 20:49:10 GMT
From: Joan Richards <richj@home.com>
Subject: Can I do this?
Message-Id: <378CF771.78A34F03@home.com>

I'm writing a perl script that will among other things, run a command
similar to 'df' on your standard *nix box.  Currently I'm working on a
linux box (RH 6.0).  What I need to do is implement something similar to
'df' or even 'netstat'.  I've got the source for 'df', and I guess I
either need to implement my own 'df' or simply access the data that 'df'
keeps.

My question is how do I get the information that 'df' prints out from
the kernel?

I know some of you might be saying "Why the hell would you want to
implement 'df' etc.?"  Trust me I understand what you are saying,
however, I don't make the rules a lot of the time.

So, in a nutshell, how can I access (through perl) the data structures
or whatever that keeps the information for the 'df' command and use them
in my own proggie?

-J



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

Date: Wed, 14 Jul 1999 14:29:43 -0400
From: Michael Graham <mgraham@gwemail.ryerson.ca>
Subject: can't match $
Message-Id: <378CD717.E2B88C3E@gwemail.ryerson.ca>

i'd like to match a dollar sign, however using the following expression
    m/[$]/
i get error
    /[5.00502/: unmatched [] in regexp at format1.pl line 19,
    <TEXTFILE> chunk 8.

i've also tried to match $ by its ascii number
    m/[\036]/
this produces no errors but doesn't match anything

there must be a way to match the $ symbol with a regular expression -
please enlighten me,

mike_g



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

Date: Wed, 14 Jul 1999 19:05:31 GMT
From: mike@fat.dotat.at (Mike Bristow)
Subject: Re: can't match $
Message-Id: <slrn7opnrr.s3.mike@lindt.fat.dotat.at>

On Wed, 14 Jul 1999 14:29:43 -0400, Michael Graham <mgraham@gwemail.ryerson.ca> wrote:
>i'd like to match a dollar sign, however using the following expression
[snip]

mike@lindt:~$ cat > foo.pl 
#!/usr/bin/perl -w
use strict;
while (<>) {
        print "Contains a \$\n" if /\$/;
}
^D
mike@lindt:~$ chmod +x ./foo.pl 
mike@lindt:~$ ./foo.pl 
this doesn't have a dollar sign.
This does $
Contains a $
This doesn't.
^D
mike@lindt:~$

Perl regex's are `tricky'.  Go buy the O'Reily mastering regular
expresions book if the documentation that comes with perl doesn't go
into enough detail for you.  ``perldoc perlre'' is probably the
command you want.


-- 
Mike Bristow, Geek-At-Large.                GK/RM0501
one tequila - two tequila - three tequila - FLOOR !!!



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

Date: Wed, 14 Jul 1999 12:01:33 -0700
From: Andrew J Perrin <aperrin@mcmahon.qal.berkeley.edu>
Subject: Re: can't match $
Message-Id: <378CDE8D.68188B97@mcmahon.qal.berkeley.edu>

Backslash it.

m/\$/

(no need for the [] either, since it's just one character)

Michael Graham wrote:

> i'd like to match a dollar sign,...

>

-------------------------------------------------------------
Andrew Perrin - NT/Unix/Access Consulting -
aperrin@mcmahon.qal.berkeley.edu
            I'M LOOKING FOR ANOTHER EXPERIENCED ACCESS
               DEVELOPER - CONTACT ME IF INTERESTED.
        http://www.geocities.com/SiliconValley/Grid/7544/
-------------------------------------------------------------




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

Date: Wed, 14 Jul 1999 15:21:52 -0400
From: Michael Graham <mgraham@gwemail.ryerson.ca>
Subject: Re: can't match $
Message-Id: <378CE350.C1E0F276@gwemail.ryerson.ca>

"you need to escape $ to match a literal dollar sign"
    - perl in a nutshell

m/[\$]/




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

Date: 14 Jul 1999 19:41:08 GMT
From: jmstapel_n0spam@mtu.edu (Jason Stapels)
Subject: Re: can't match $
Message-Id: <7mip4k$n5j$2@campus1.mtu.edu>

I believe what you want to do is use \$ to match a $.
For example...

#! /usr/bin/perl
$blah = 'this is $a test$';
$blah =~ /\$(.*?)\$/;
print $1, "\n";

will output...

a test


 .jason.


Michael Graham (mgraham@gwemail.ryerson.ca) wrote:
: i'd like to match a dollar sign, however using the following expression
:     m/[$]/
: i get error
:     /[5.00502/: unmatched [] in regexp at format1.pl line 19,
:     <TEXTFILE> chunk 8.

: i've also tried to match $ by its ascii number
:     m/[\036]/
: this produces no errors but doesn't match anything

: there must be a way to match the $ symbol with a regular expression -
: please enlighten me,

: mike_g



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

Date: Wed, 14 Jul 1999 20:38:42 GMT
From: robyoung <rob@webteacher.com>
Subject: crypt returns different values since ISP upgrade.
Message-Id: <378CE13A.81316151@webteacher.com>

I created a log file of usernames and passwords using Perl's crypt()
function for one of my scripts.
Recently, the ISP upgraded their machines.  Shortly thereafter, my users
started calling to tell me they could not log in.

Upon investigation, I found that the encrypted password values in the
members log file was not the same as what Perl was now generating .  The

encryption algorythm has not changed.  As you know, an encrypted
password routine must reproduce the same values every time to be
effective.

I believe that some change in the server has caused the following
oddity:

PRIOR TO APX. 2 WEEKS AGO:
 crypt('4runner',7)  =  77I.AFt67zwM.

NOW
  crypt('4runner',7) =  773n1Jm9L2/m.


Does anyone have any idea what could cause such a change, and is there
anything I can do about it?
Any information about variances in the crypt() algorythm would be
appreciated.

Thanks,

Rob



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

Date: Wed, 14 Jul 1999 14:14:46 -0500
From: mwkohout <mwkohout@csbsju.edu>
Subject: Re: Database Question
Message-Id: <378CE1A6.28C4F080@csbsju.edu>

Jeremy wrote:
> 
> Hello, All
> 
> Could someone please tell me if and how it is possible to access a secured
> Access database (via a workgroup information file, system.mdw) with
> Perl/CGI?  This will need to be a DSN-less connection.  Thanks!
> 
> Jeremy
yeah..I think you want from cpan Bundle::DBI and then the access dbd
module....but I don't know more than that.


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

Date: 14 Jul 1999 14:49:31 -0400
From: vgabriel@lochaber.rutgers.edu (Vladimir Gabrielescu)
Subject: file test for existence of path?
Message-Id: <7mim3r$fef$1@lochaber.rutgers.edu>

Hi all.

I just relized that there is no easy way to check if a path 
exits. For example, I wish to know if "/foo/bar" exits, regardless
of what file type it is. I was sort of wished that "-e" did the 
right thing, unfortunatly "-e" follows links. That way if "/foo/bar"
is a link to "/foo/baz" and "/foo/baz" does not exist, then 
(-e "/foo/bar") would be false. 

Am I missing some file test option? Any way I can do this without 
multiple or's ?

Vlad


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

Date: 14 Jul 1999 16:30:55 -0400
From: vgabriel@lochaber.rutgers.edu (Vladimir Gabrielescu)
Subject: Re: file test for existence of path?
Message-Id: <7mis1v$fka$1@lochaber.rutgers.edu>

In <7mim3r$fef$1@lochaber.rutgers.edu> vgabriel@lochaber.rutgers.edu (Vladimir Gabrielescu) writes:

>I just relized that there is no easy way to check if a path 
>exits. For example, I wish to know if "/foo/bar" exits, regardless
>of what file type it is. I was sort of wished that "-e" did the 
>right thing, unfortunatly "-e" follows links. That way if "/foo/bar"
>is a link to "/foo/baz" and "/foo/baz" does not exist, then 
>(-e "/foo/bar") would be false. 

Interestingly enough, "-e" seems to identify the existence of any
file type except dangling links. I assume this is because of a 
stat versus lstat issue. Is this intentional or a bug? I can't
seem to find this behavior documented anywhere.

Vlad


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

Date: Wed, 14 Jul 1999 16:07:36 -0400
From: Matthew Zimmerman <mdz4c@node10.unix.Virginia.EDU>
Subject: Re: FLOCK: How can I do exclusive read???
Message-Id: <Pine.A41.4.05.9907141604290.32928-100000@node10.unix.Virginia.EDU>

On Wed, 14 Jul 1999, CL wrote:

> What is the correct FLOCK combination for doing exclusive read???
> THANK YOU!!!

That's mentioned directly in the documentation.

perldoc -f flock
http://www.perl.com/CPAN-local/doc/manual/html/pod/perlfunc/flock.html

It would probably be a good idea if you looked there before posting here.

HTH Matt
--
Matthew Zimmerman            http://www.people.virginia.edu/~mdz4c
Interdisciplinary Biophysics Program        University of Virginia
------------------------------------------------------------------
"You got to be very careful if you don't know where you're going,
because you might not get there."                    -- Yogi Berra



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

Date: Wed, 14 Jul 1999 21:23:08 +0200
From: Anton Berezin <tobez@plab.ku.dk>
Subject: Re: Garbage Collection Performance
Message-Id: <19990714212308.A708@lion.plab.ku.dk>

On Tue, Jul 13, 1999 at 04:46:10PM +0000, Jeremy Purdy wrote:
> I have a data-intensive application that I am writing in PERL.  It
> uses a LARGE amount of memory while processing, but runs fairly
> efficiently.

Define ``LARGE''.

> I just noticed, however, that at the end of the process, after the
> last line of the program, there is a pause of approx. 10 min where the
> program is waiting.

I doubt very much it has anything to do with garbage collection.  It
should not be *that* slow.

-- 
Anton Berezin <tobez@plab.ku.dk>
The Protein Laboratory, University of Copenhagen


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

Date: Thu, 15 Jul 1999 00:46:45 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: Generating Passwords
Message-Id: <7mjsqf$2a010@news.cyber.net.pk>

: {
:   ( $_ = chr rand 123 and /[A-Z0-9]/i && $pass !~ $_ and $pass .= $_ ) ||
: redo
:     for 1 .. 8
: }
:

I came up with:

local $_ = chr rand 123 and ( /[A-Z0-9]/i && $pass !~ $_ and $pass .= $_ )
while length $pass < 8;

after posting.

any better ideas?




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

Date: 14 Jul 1999 19:21:00 GMT
From: jmstapel_n0spam@mtu.edu (Jason Stapels)
Subject: getting modify times with perl&unix
Message-Id: <7minus$n5j$1@campus1.mtu.edu>


I was wondering if someone could help me out. I need to grab the modify time
from another file using perl. The problem is that I can't use the stat
command because the file is on a remote machine. The best method I could
come up with was doing something like...

@ret = `remsh $hostname "ls -l $file"`;

and then parsing the output. I was kind of hoping there would be an
easier way. Any suggestions?

Jason



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

Date: Wed, 14 Jul 1999 20:08:43 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: getting modify times with perl&unix
Message-Id: <slrn7opq3a.4jl.*@dragons.duesouth.net>

Once upon a time (14 Jul 1999 19:21:00 GMT), Jason Stapels) was
attempting to figure out Ilya's new Perl regex features, and accidently
sent the following to comp.lang.perl.misc: 
: 
: I was wondering if someone could help me out. I need to grab the modify time
: from another file using perl. The problem is that I can't use the stat
: command because the file is on a remote machine. The best method I could
: come up with was doing something like...
: 
: @ret = `remsh $hostname "ls -l $file"`;

$mtime = qx!remsh $hostname "perl -e 'print modtime'"!;
 
: and then parsing the output. I was kind of hoping there would be an
: easier way. Any suggestions?

HTH,

: Jason

--Matthew


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

Date: 14 Jul 1999 18:23:33 GMT
From: "Nick Downey" <nead@neadwerx.com>
Subject: hash assignments
Message-Id: <01bece26$1a90aa00$53343d80@r52h83>

ok, here we have a loop. This loop basically does some processing and
constructs a hash. The hash "%printlist" is assigned value "$lineone[0]" by
key of "$state".

1: foreach $state (sort @files) {
2: 	<snip>
3:    if( $lineone[1] != 0 ) {
4:         $state =~ s/.dat//;
5:         $printlist{$state} = $lineone[0];
6:     }
7: }

Notice that the regex is before the actual assignment into the hash. (line
4)

If I were to modify line 5 to look like

5: $printlist{ ($state =~ s/.dat//) } = $lineone[0];

Then when the loop finishes, I would only have one (key-value) pair. The
last one that the loop processed.

I don't mind doing it the way that works, but I was wondering if anyone
knew why that was ?

Thanks


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

Date: Wed, 14 Jul 1999 20:19:15 GMT
From: scott@sboss.net
Subject: Help with a simple socket question...
Message-Id: <7mirbk$r5e$1@nnrp1.deja.com>

Hello,

I have been looking the Programming Perl, Adv. Programming Perl, & Perl
Cookbook, and did not find my answer.  I want to write a simple deamon
that starts up, opens a unix socket, as it runs, writes to the socket.
I do not want to wait for a connection to that socket to start writing
to it.  I want to start processing the data and write to it immediately.
 Meanwhile I will have multiple other programs at time connecting to
that socket to read what is comming across it.  If you could point me in
the right direction, or some code, it would be great.

Thanks
Scott

PS>  Here is the description of what I am trying to do.

Server A             Server A              Client B         Client A

PollingD             InfoD                 ClientT          ClientU

pings servers        reads from            connects to      same as
& writes output      UNIX socket           TCP socket       Client B
to UNIX Socket       whenever a            on Server A      except it
                     client connects       to read data     reads the
                     to it.                from it to       data from a
                                           parse.           local UNIX
                                                            socket.

Later I will be writing other deamons to read the data from that socket
(either UNXI or TCP) to act on the data.  The PollingD will be expanded
to do more than just ping the box also (next revision or so).

--
Scott Boss
Atlanta Perl Mongers Fearless Leader
website:   http://atlanta.pm.org
community: http://www.dejanews.com/~apm


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


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

Date: Wed, 14 Jul 1999 19:03:45 GMT
From: rn7532@bris.ac.uk
Subject: Help with cgi cookie
Message-Id: <7mimu8$p31$1@nnrp1.deja.com>

Is there away of using a cgi to remember the details a person enters in a
form (name, address, etc) so that when they return at a later date this
info will automatically be filled in? Is there a java script that would
better handle this? I am fairly new to back end programming. Any help and
ideas are greatly appreciated.

Ron


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


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

Date: Wed, 14 Jul 1999 15:16:37 -0500
From: Tim Larson <tim@r5i.com>
Subject: Re: Help with cgi cookie
Message-Id: <378CF025.35D76155@r5i.com>

Sure, you could do it either with CGI or JavaScript.  With CGI you just
write the HTML back with some values set in the form elements.  With
JavaScript it would probably be better to use the onload event to trigger
the cookie read and value setting.
Either way, you need to read up on how cookies work before you dive in.

Tim

rn7532@bris.ac.uk wrote:
> 
> Is there away of using a cgi to remember the details a person enters in a
> form (name, address, etc) so that when they return at a later date this
> info will automatically be filled in? Is there a java script that would
> better handle this? I am fairly new to back end programming. Any help and
> ideas are greatly appreciated.
> 
> Ron
> 
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

-- 
Tim Larson  -  web programming guru
Red 5 Interactive, Inc.  -  www.r5i.com
4549 Fleur Dr.  Des Moines, IA  50321


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

Date: Wed, 14 Jul 1999 20:24:56 GMT
From: Dick Latshaw <latsharj@my-deja.com>
Subject: Re: Help with cgi cookie
Message-Id: <7mirm7$r9r$1@nnrp1.deja.com>

In article <7mimu8$p31$1@nnrp1.deja.com>,
  rn7532@bris.ac.uk wrote:
> Is there away of using a cgi to remember the details a person enters
<snip>

And your perl question was???

You will probably have better luck in
comp.infosystems.www.authoring.cgi.

--
Regards,
Dick


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


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

Date: Wed, 14 Jul 1999 11:46:03 -0700
From: messmer <messmer@sirius.com>
Subject: learning perl
Message-Id: <Pine.LNX.4.10.9907141128020.18000-100000@lynyrd_skynyrd.org>

I recently quit my job as a social worker and am now driving a taxicab by
night, learning perl by day. (I include this for entertainment value
only.) In working through Learning Perl, the llama book, Im having trouble
with exersize one in chapter 5. The answer given in the back of the book
seems neither to work, or to make any sense whatsoever.  Am I missing
something, or what? I think I understand how to assign hash element, but
this one has me banging my head against my stupid monitor and gnashing my
teeth, whatever that means. 
thanks 
tom



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

Date: Wed, 14 Jul 1999 18:57:36 GMT
From: ataraxia@nospam.excite.com (Ataraxia)
Subject: Looking for script: Story posting
Message-Id: <378ddd6b.70914649@news.mindspring.com>

Can anyone suggest a CGI script (.e.g PERL) that will enable _trusted_
authors to paste  text files (e.g. stories) into a form on my web site
and then generate preformated pages for each and a "Table of Contents"
for all of them?

 (Assume  Linux/Apache/Perl 5 environment)

Criteria:

1. Authors have passworded access to add/delete their own files.
"Modify" is not necessary.  I issue a different password to each
author. Master admin password can access any account to add/delete any
file.

2. Fields: title (short title)
               decription (1-2 lines max)
               text  (full story--pasted in. No html allowed)

3. All filed data inserted into a pre-formatted page utilizing tables
(to control left & rioght margins) and SSI calls to insert header  &
footer files.

4. All Titles, Decriptions  & Author names automatically indexed to a
"Master" Table of Contents HTML page with most recent first and
hyperlinked to each respective story file. 

5. Nice but not required:
   --- send me email when any author adds or deletes a file from his
"library"
    -- "Hit counter"_summary_ report for all story pages.  


Thanks

Reply to ataraxia @ excite.com (remove spaces)


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

Date: Wed, 14 Jul 1999 13:06:07 -0400
From: Peter Marek <pmarek@stargate-systems.com>
Subject: Newbie needs help:  Environment variables
Message-Id: <378CC37E.394D2E7C@stargate-systems.com>

Hi all,

I'm running Perl verion 5 and need to execute a bourne shell script that
exports some environment variables.  These variables need to be visible
to the caller which is the Perl script.  Sounds simple enough but can't
seem to get it to work.  I've tried system(), ``, qx, fork/exec,
everything I could think of.

Can anyone shed some light on this?

Thanks in advance,

Peter Marek
pmarek@stargate-systems.com



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

Date: Wed, 14 Jul 1999 18:59:22 +0000
From: Rosen Raikov <RaikovR@HotMail.com>
Subject: Re: Password Entry
Message-Id: <378CDE0A.72980573@HotMail.com>

Hi,

Look at  Term::ReadKey

Rosen Raikov

"Vipul M. Shah" wrote:

>  I suppose this is a FAQ, but how does one prevent the password text
> from being echoed on the screen in Perl?
> -----------------------------------------------------------------------
> Vipul M. Shah
> If a parsley farmer is sued, can they garnish his wages?



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

Date: Wed, 14 Jul 1999 22:21:27 +0200
From: jan.dubois@ibm.net (Jan Dubois)
Subject: Re: PERL in C++
Message-Id: <37a6ee1d.10655862@news3.ibm.net>

[mailed & posted]

"Dennis Janssen" <dennis.janssen@capgemini.nl> wrote:

>Can anyone give me a pointer to an URL where i can download a package with
>
>perl.h
>perl.lib
>perl.dll
>
>I want to be able to call perl from a c/c++-program.

Since you are asking for *.dll/*.lib files I'm assuming you want to embed an
existing binary on Win32, most likely the ActivePerl distribution.  I would
recommend to look into the PerlEz documentation (under ActivePerl components
in the help tree).  It provides a simplified API to call Perl from C/C++.
The normal embedding instruction unfortunately won't work with ActivePerl.
This is subject to change as far as I know.

BTW, the PerlEz.h/PerlEz.lib files should be in the /Perl/lib/CORE
directory.

-Jan


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

Date: 14 Jul 1999 18:07:10 GMT
From: jmstapel_n0spam@mtu.edu (Jason Stapels)
Subject: Re: perl script in browser?
Message-Id: <7mijke$cum$1@campus1.mtu.edu>

I think you need to add a ...

print OUT_PIPE_YOUR_USING "Content-type: text/html\n\n";

Tan Keok San (ccetks@leonis.nus.edu.sg) wrote:
: Got some .pl scripts with HTML tags.  Problem: code compiles ok but shows
: up in browser as statements from script with a mix of the HTML
: tags...appreciate any help as to what's going on?  Thanks.



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

Date: 14 Jul 1999 19:22:37 GMT
From: klassa@aur.alcatel.com (John Klassa)
Subject: Re: Rebol and Perl
Message-Id: <7mio1t$dd0$1@aurwww.aur.alcatel.com>

On Wed, 14 Jul 1999 08:38:35 -0800, Ashish Kadakia wrote:
  > Hi, I just want to know if anyone has studied Rebol
  > language and done any programming which enhances the
  > programming in Perl?

Check out:

http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1998-10/msg01851.html

for Larry's views.

-- 
John Klassa / Alcatel USA / Raleigh, NC, USA


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

Date: Wed, 14 Jul 1999 16:35:24 -0400
From: "Mark Wisniewski" <ski@northwood.edu>
Subject: Search array
Message-Id: <378cf37e.0@hawkmoon.northwood.edu>

I'm am just starting to play with perl. I have always used Korn shell
programming in the past.

How do I search the /etc/passwd file for a unique uid and exit the script if
the user exist or continue on if the user doesn't exist.

I'm trying this right now:

# Check to see if user Number exist in user database
# If not Display message and exit script.
print "Enter new Student Number or Employee Number: ";
$newuid = <STDIN>;
chop($newuid);
(system "cat /etc/passwd | grep $newuid") && die ("Student or Employee
Number already exists!\n");

# If not, go ahead and add the user
system "/usr/sbin/useradd -u $newuid -d /export/home/$newname -s /bin/ksh
newname";




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

Date: Wed, 14 Jul 1999 18:59:11 GMT
From: ataraxia@nospam.excite.com (Ataraxia)
Subject: Sugges script for story posting???
Message-Id: <378edde6.71037706@news.mindspring.com>

Can anyone suggest a CGI script (.e.g PERL) that will enable _trusted_
authors to paste  text files (e.g. stories) into a form on my web site
and then generate preformated pages for each and a "Table of Contents"
for all of them?

 (Assume  Linux/Apache/Perl 5 environment)

Criteria:

1. Authors have passworded access to add/delete their own files.
"Modify" is not necessary.  I issue a different password to each
author. Master admin password can access any account to add/delete any
file.

2. Fields: title (short title)
               decription (1-2 lines max)
               text  (full story--pasted in. No html allowed)

3. All filed data inserted into a pre-formatted page utilizing tables
(to control left & rioght margins) and SSI calls to insert header  &
footer files.

4. All Titles, Decriptions  & Author names automatically indexed to a
"Master" Table of Contents HTML page with most recent first and
hyperlinked to each respective story file. 

5. Nice but not required:
   --- send me email when any author adds or deletes a file from his
"library"
    -- "Hit counter"_summary_ report for all story pages.  


Thanks

Reply to ataraxia @ excite.com (remove spaces)


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

Date: 14 Jul 1999 18:11:16 GMT
From: Jeff Stampes <stampes@xilinx.com>
Subject: Re: Using variable to modify regexp
Message-Id: <7mijs4$9q2@courier.xilinx.com>

Bill Snow <snow@flinet.com> wrote:
: Is it possible to use a variable to modify a regexp?  I'm able to use a
: variable ok between the slashes but if I try to use one at the end. It
: does not work.  I've tried various combinations and looked at FAQ
: without finding anything.

If you have 5.005:


  DB<1> $foo = 'i'

  DB<2> $bar = 'MiXedCasE'

  DB<3> print 'Match!' if ($bar =~ /(?$foo)mixedcase/)
Match!
  DB<4> 


-- 
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.com


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

Date: Wed, 14 Jul 1999 21:39:37 +0200
From: jan.dubois@ibm.net (Jan Dubois)
Subject: Re: VBScript to PerlScript
Message-Id: <3793e106.7304603@news3.ibm.net>

[mailed & posted]

"Tomas R." <lambax@polbox.com> wrote:

>How to translate this VBScript to PerlScript??
>(my communication with MS Index Server not working :((
>
>Please help :)
>
>VBScript
>---------------------- cut here --------------------------
>sCommand = "SELECT DocTitle, Path, DocAppName, HitCount FROM SCOPE('
>""/directory"" ') WHERE CONTAINS(' ""words"" ')>0 ORDER BY
>HitCount DESC"
>-------------------------- cut here ----------------------------
>
>
>Not working PerlScript
>---------------------- cut here  --------------------------
>$sql = "SELECT DocTitle, Path, DocAppName, HitCount FROM SCOPE('
>\"\"/directory\"\" ') WHERE CONTAINS(' \"\"worlds\"\" ')>0
>ORDER BY HitCount DESC";
>-------------------- cut here -----------------------

I would assume that the double quotes: "" in VB are just an escape to
include a single quote in the string.  In this case you don't want to double
the quotes in your Perl code: \"\" should then become \"

Just a guess.

-Jan


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

Date: Wed, 14 Jul 1999 20:05:49 GMT
From: amidalla@my-deja.com
Subject: what's the deal with kill??
Message-Id: <7miqii$qq5$1@nnrp1.deja.com>

When I start the "loop.exe" process in the following way, the kill
function does not kill the process.

Win32::Spawn("loop.exe", " -URTS_DEBUG=q", $pID);
sleep 5;
kill ($pID);

in fact I can't seem to be able to kill any process successfully on NT.
Why??

I have had success using the $process->Kill() function with the
Win32::Process module but the Create function is not allowing me to
redirect the output from the created process into a log file. Ideally I
would like to simply use a piped "open" call followed by a kill
function.

open(CHILD, "loop.exe -URTS_DEBUG=quit 2> output.log |");
# somehow get the process ID
sleep 5;
kill $pID;

thanks for any help..


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


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

Date: Wed, 14 Jul 1999 11:23:11 -0700
From: "Thomas W. Brown" <tbrown@softbook.com>
Subject: Win32::OLE and Connection Points
Message-Id: <378CD58F.A46CBC34@softbook.com>

Is there anyway in ActivePerl to deal with connection points in an
ActiveX object being created?  I.e., how would one enumerate the
connection point interfaces in the object?  How would one implement the
connection point sink? Etc.

-- Thomas W. Brown
   tbrown@softbook.com


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

Date: Wed, 14 Jul 1999 21:39:40 +0200
From: jan.dubois@ibm.net (Jan Dubois)
Subject: Re: Win32::OLE and Connection Points
Message-Id: <379ee6a3.8741189@news3.ibm.net>

[mailed & posted]

"Thomas W. Brown" <tbrown@softbook.com> wrote:

>Is there anyway in ActivePerl to deal with connection points in an
>ActiveX object being created?  I.e., how would one enumerate the
>connection point interfaces in the object?  How would one implement the
>connection point sink? Etc.

There is only experimental support in Win32::OLE for connection points.  You
can take a look at my OLE Events article in the recent issue of PerlMonth:
http://www.PerlMonth.com  Let me know if you have ideas how the support can
be improved.  Did I say that it is just experimental yet? :-)

-Jan


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

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". 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 V9 Issue 144
*************************************


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