[12203] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5803 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 27 13:07:29 1999

Date: Thu, 27 May 99 10:00:24 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 27 May 1999     Volume: 8 Number: 5803

Today's topics:
        2 questions about installing modules and talking to MS  (Dan Fleisher)
    Re: array of hashes, removing items <jdporter@min.net>
    Re: array of hashes, removing items (Charles R. Thompson)
    Re: display status of sevices under NT <c4jgurney@my-deja.com>
    Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Pe <tchrist@mox.perl.com>
        Hash question <webmaster@loraincounty.com>
    Re: Hash question (Greg Bacon)
        Hash Table to Object?? <aef@pangea.ca>
    Re: help on openiong and manipulating files <cassell@mail.cor.epa.gov>
        How to Post Packages to the ActiveState Package Reposit <harasty@my-deja.com>
    Re: Making Perl Wait sherifhanna@my-deja.com
        Module which enables you to program Internet Service Ma (Jeroen Kustermans)
        More errors I don't understand (Bill Moseley)
    Re: My first working script; comments, hints? <jdporter@min.net>
    Re: Newbie Blat help! (J.D. Silvester)
        Obtaining file version info <stickler.ka@pg.com>
    Re: path relatively to webserver <bill@fccj.org>
    Re: Perl "constructors" (Kai Henningsen)
        Perl and Oracle help! jknoll@my-deja.com
    Re: Perl and Oracle help! <rhrh@hotmail.com>
        Perl and Verity <kevin.white@blackwell.co.uk>
        perl oracle on hp-ux B11.0 mark_f_edwards@my-deja.com
        Putting substitution commands in a seperate file. lpacania@my-deja.com
    Re: Q. about pattern matching <aqumsieh@matrox.com>
    Re: Q. about pattern matching <kevin.white@blackwell.co.uk>
    Re: Q. about pattern matching (Tad McClellan)
    Re: system command to string (DATE) <cassell@mail.cor.epa.gov>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 27 May 1999 16:53:04 GMT
From: danielfl@seas.upenn.edu (Dan Fleisher)
Subject: 2 questions about installing modules and talking to MS SQL Server
Message-Id: <374d76fd.268194843@netnews.upenn.edu>

This first question is dumb and has probably been asked before but I
spent a couple hours looking through all the modules documentation and
I couldn't find an answer anywhere.  The question is, how do you
install a module if you don't have root permissions to install it to
/usr/local/lib/perl5?  Namely, what do you have to change in
Makefile.PL and what special stuff do you have to put in your perl
scripts to tell them where to find the module?

The second question is how do you talk to a MS SQL Server on an NT box
from a Unix box (specially OSF/1)?  I found the DBD::ODBC module but
it seems like you need some additional drivers and I have no idea what
they are or where to find them.  Also I looked at FreeTDS but I'm not
sure how you would use that.  So could somebody show me what the best
way is?  Thanks.

- Dan



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

Date: Thu, 27 May 1999 15:41:40 GMT
From: John Porter <jdporter@min.net>
Subject: Re: array of hashes, removing items
Message-Id: <7ijp3j$qs1$1@nnrp1.deja.com>

In article <MPG.11b71b10909809a19896d2@news>,
  design@raincloud-studios.com (Charles R. Thompson) wrote:
> I've been dealing with Chapter 4 in Programming Perl for a few weeks
now.
> In reading FAQ 4, it is stated I shouldn't remove keys from a hash
while
> iterating over it.

Right.


> Does this include an array of hashes in a hash?

"Hashes" doesn't include "arrays", so, No.
But a different caveat applies.  See below.


> I was trying splice for some odd reason last night, but I can't seem
to
> feed it the items value as an array. I'm kinda stumped.

Where did you get the idea that that would work?
The docs for splice make it clear that the array operand is worked
on in terms of indices -- offset and length.
But changing the contents of an array with splice while iterating
over it is almost as bad as deleting elemtnts from a hash while
each'ing over it.

A better way to remove unwanted items from an array is with grep,
or an equivalent made with map.


> # remove one item while running through rows
> foreach $item ( @{$HSH{items}} ) {
>   if ( $item->{num} eq 'five' ) {
>     splice( @{$HSH{items}}, $item );
>   }
> }

my @keepers = grep {
  $_->{'num'} ne 'five' # the criterion for keeping
} @{ $HSH{'items'} };

$HSH{'items'} = \@keepers;

Or in one line:

$HSH{'items'} = [ grep { $_->{'num'} ne 'five' } @{ $HSH{'items'} } ];

--
John Porter
Put it on a plate, son.  You'll enjoy it more.


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


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

Date: Thu, 27 May 1999 16:10:11 GMT
From: design@raincloud-studios.com (Charles R. Thompson)
Subject: Re: array of hashes, removing items
Message-Id: <MPG.11b739d9ec34be469896d3@news>

In article <7ijp3j$qs1$1@nnrp1.deja.com>, John Porter says...
> > I was trying splice for some odd reason last night, but I can't seem
> to
> > feed it the items value as an array. I'm kinda stumped.
> 
> Where did you get the idea that that would work?
> The docs for splice make it clear that the array operand is worked

Heh.. some other dumb book stating splice returned *and removed* the 
array element. I was stumped at that point and playing 'Russian Codette'. 
:)

> A better way to remove unwanted items from an array is with grep,
> or an equivalent made with map.
> 
> my @keepers = grep {
>   $_->{'num'} ne 'five' # the criterion for keeping
> } @{ $HSH{'items'} };
> 
> $HSH{'items'} = \@keepers;
> 
> Or in one line:
> 
> $HSH{'items'} = [ grep { $_->{'num'} ne 'five' } @{ $HSH{'items'} } ];

I haven't used grep very much and map .. not a bit.. so that's a bit 
new... Thanks.. this will give me something new to study. 

CT


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

Date: Thu, 27 May 1999 15:08:07 GMT
From: Jeremy Gurney <c4jgurney@my-deja.com>
Subject: Re: display status of sevices under NT
Message-Id: <7ijn4l$p33$1@nnrp1.deja.com>

In article <374d4924.0@sia.uibk.ac.at>,
  csaa4635@dm.uibk.ac.at (Carsten Dieter Wolf) wrote:
> greetings ...
>
> i am looking for a tool or library (in perl language) to display and
watch
> the actual status of any running service under win-NT.

Win32::Service

Comes as part of the ActivePerl distribution.

Jeremy Gurney
SAS Programmer  |  Proteus Molecular Design Ltd.


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


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

Date: 27 May 1999 09:31:17 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Perl Y2K compliant?
Message-Id: <374d6545@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, finsol@ts.co.nz writes:
:In article <374d4028@cs.colorado.edu>,
:CGI, or Common Gateway Interface, is a programming language that allows

:CGI is the programming language that allows for accountability on the

There are idiots everywhere.   What's your point?

--tom
-- 
 "... the whole documentation is not unreasonably transportable in a
 student's briefcase." - John Lions describing UNIX 6th Edition


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

Date: Thu, 27 May 1999 11:59:11 -0400
From: "LorainCounty.com Webmaster" <webmaster@loraincounty.com>
Subject: Hash question
Message-Id: <374D6BCE.8A5B4DB8@loraincounty.com>

Hello all,

    I have the following hash table.  The left side is the title of the
section and the right side is the directory each section is in.

Here is my question:  Is there a way I can find out the which title
matches the directory.

ie: I know "new" and would like to find "What's New".

I know I could alter my hash table but in another place I now "What's
New" and need to find new.

%sections = (
'What\'s New' => 'new',
'Citizen Information' => 'citizen',
 'Business Information' => 'business',
 'Visitor Information' => 'visitor',
'Municipal Directory' => 'directory'
);

Sorry if this is a little confusing I am new to hashes and haven't found
the answer in the FAQ's.

Thanks for your help.

Mike Skimin



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

Date: 27 May 1999 16:36:48 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Hash question
Message-Id: <7ijsb0$3qd$1@info2.uah.edu>

In article <374D6BCE.8A5B4DB8@loraincounty.com>,
	"LorainCounty.com Webmaster" <webmaster@loraincounty.com> writes:
:     I have the following hash table.  The left side is the title of the
: section and the right side is the directory each section is in.
: 
: Here is my question:  Is there a way I can find out the which title
: matches the directory.

Assuming your directory names are unique (and I can't imagine why they
wouldn't be :-), you could do something like

    my %section2dir = (
        "What's New"           => "new",
        "Citizen Information"  => "citizen",
        "Business Information" => "business",
        "Visitor Information"  => "visitor",
        "Municipal Directory"  => "directory",
    );

    my %dir2section = reverse %section2dir;

The perlfunc documentation for reverse talks about this trick.

Hope this helps,
Greg
-- 
Windows was created to keep the stoopid people away from Unix, you know.
An "MS advocate" is already beneath contempt.
    -- Tom Christiansen


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

Date: Thu, 27 May 1999 10:11:28 -0500
From: "AEF" <aef@pangea.ca>
Subject: Hash Table to Object??
Message-Id: <7ijn9q$9cj$1@pumpkin.pangea.ca>

Tom's perltoot, the perlobj and Chap 7 of Adv Pearl Programming, I am still
not getting making the transition in my mind from the anonymous array or
hash to the object creation, particularly the dynamic creation.

This is NOT from lack of trying.  I've checked all the object information I
can lay my hands on.  It's a concept that I am having difficulty with as a
newbie to programming, and an old guy, also.  Now this has become a
"necessity" for me to understand...please help, (be kind to your old folks!)

use strict;
use diagnostics; # for >= 5.004
while ( <DATA> ) {
    chomp;
    create_index(split /,/, $_);

#I don't see any difference to this than a prior spilt of the data?
# then
#create_index($job_category,$equip_type,$position,$wages);
}

my %category_idx;

sub create_index {
    my($job_category, $equip_type, $position, $wages) = @_;
    #create an array for all of these use a reference
    my $rdata = [$job_category, $equip_type, $position, $wages];
    push (@{$category_idx{"$job_category"}}, $rdata);
}
# sort by the job categories first
foreach my $k ( keys %category_idx ) {
    print $k, "\n";
    # now sort by the wages field
    foreach my $cat (sort { $a->[3] <=> $b->[3] }  @{$category_idx{$k}} ) {
print "\t", map { "$cat->[$_]  " } 0,1,2,3;
print "\n";
    }
}

I can't seem to make the leap (with my total lack of formal Perl and
programming education) from the hash table for the individual $ref  to the
object creation;


sub new_record {

my $record = {  "ref"   => "1",
                          "job"   => "Major",
                          "type"   => "A320",
                          "position"  => "Captain",
                          "wage"  => 173700,
  };
bless $record;
return $record;

printf "I fly for a %s Airline, on a %s type aircraft as %s for \$ %d per
year.\n",
$record->{job}, $record->{type}, $record->{position},$record->{wage};
}

# ================================= #
#  with no clear understanding of how to properly allocate the
# data to the object with the desire to create something
# similar to the object below, in the long run

# dynamically create named objects ??? huh! maybe??

  $record = Index::new($ref, $job_category, $equip_type,
     $position, $wages, $service, $years, $location,@benefits);

package Index;

###### Object ########

sub new


 my($key, $ref, $job_category, $equip_type, $position, $wages, $service,
  $years, $location,@benefits) = @_;

 my $record= {
  "ref"   => $ref,
  "job"   => $job_category,
  "type"   => $equip_type,
  "position"  => $position,
  "wage"  => $wages,
  "service" => $service,
  "years"  => $years,
  "location" => $location,
   "benefits" =>@benefits,
 };
 bless $record, 'Index';
 return $record;  # return object
} #end new

# then to get the information out in a useful form.
####Methods ????####




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

Date: Thu, 27 May 1999 08:43:41 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: help on openiong and manipulating files
Message-Id: <374D682D.F0318649@mail.cor.epa.gov>

Scott wrote:
> 
> On Mon, 24 May 1999 21:41:01 -0700, Reese Butler <reese@value.net>
> wrote:
> 
> >Im triying to open a simple .txt file and store txt into variables
> >using code from a tutorial book that goes like so
> >
> >#!/usr/bin/perl
> >
> >print "Content-type: text/html\n\n";
> >
> >
> >
> >open(dbtest, "http://www.server.com\Hank\db.txt");
> 
>         You probably want the path to the file instead of the URL.
> I'm not sure if there is a snazzy perl module to open a file from a
> web address like this.  Would be interested if there was such a thing!

Yep.  open() handles files in a filesystem.  URLs give a
convenient file-ish gloss to the HTTP protocol, but have nothing
to do with a typical filesystem.  Common beginner's mistake.

And there *is* such a module.  More than one, in fact.  But
check out LWP::Simple.  Here's a one-liner from the LWP::Simple
docs:

perl -MLWP::Simple -e 'getprint "http://www.sn.no";'

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 27 May 1999 15:59:38 GMT
From: Dan Harasty <harasty@my-deja.com>
Subject: How to Post Packages to the ActiveState Package Repository?
Message-Id: <7ijq58$rhh$1@nnrp1.deja.com>



I'd like to know the mechanism for submitting packages to ActiveState's
package repository.

Specifically, I pulled some things down of CPAN that worked well after
doing all the "make" mumbo-jumbo; but to redistribute them *within* my
org I converted them into the format that the PPM uses to install
packages for ease of use.

Now that I've gone through the effort, and assuming others would be able
to make use of the packages, what can I do to get them "posted" in the
package repository?

I assume I need:

1) The original author's permission,
2) A few external people to test the modules as converted,
3) A mechanism for "posting" these to the package repository.

I can't find any info on #3 in the FAQs or dejanews.

And what is a practical way to do step #2?

- Dan Harasty
  dan001@penvision.com




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


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

Date: Thu, 27 May 1999 15:08:21 GMT
From: sherifhanna@my-deja.com
Subject: Re: Making Perl Wait
Message-Id: <7ijn53$p3b$1@nnrp1.deja.com>

In article <brad-2705991607040001@brad.techos.skynet.be>,
  brad@shub-internet.org (Brad Knowles) wrote:
>     How about "sleep(10)"?

Thanks. It's exactly what I wanted.

Sherif


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


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

Date: Thu, 27 May 1999 15:50:08 GMT
From: NightLight@webcity.nl.NOSPAM!!!!!! (Jeroen Kustermans)
Subject: Module which enables you to program Internet Service Manager (IIS)
Message-Id: <374e6970.157339772@news.xs4all.nl>

Hi,

I want to create a virtual directory in IIS as well as in PWS.
Does anybody know if there is a specific module or a specific registry
setting for this type of job?

Thanks!
Jeroen


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

Date: Thu, 27 May 1999 07:54:42 -0700
From: moseley@best.com (Bill Moseley)
Subject: More errors I don't understand
Message-Id: <MPG.11b6fc895de080c3989738@206.184.139.132>

(Excuse my lame mouse skills -- I posted this yesterday to clp.modules by 
mistake.)

Howdy,

I'm guessing this is more a system problem than a perl problem.  But I 
hope someone here can help figure out what's going on and help me find a 
perl solution.  I'm running on Sun Solaris.

I've got a cron job running a perl script every night at 2am.  The perl 
program copies database files to a backup directory for that day and then 
does a bunch of "nightly" processing such as purging old records, 
verifying that the database files are in sync, and sending some email 
notifications up upcoming events.

I write a log file of what happens during the program run, and I write 
all STDERR output to a different log file.

Here's what's happening:

First, the copy (backup) of the database files failed.  My log file had 
this in it:

  Maintenance run started at: Mon May 24 02:00:02 1999
  ERROR: copy (cp) returned '65535' attempting to copy 'Mon' backup

And the perl that generated this error is:

    # using a shell for globbing
    my $rc = 0xffff & system("cp *\.db Backup.$day");

    if ( $rc ) {
        print LOG "ERROR: copy (cp) returned '$rc' attempting to copy                            
          '$day' backup\n";

        $Admin_Message .= "\nError during backup: copy (cp) returned 
          '$rc' attempting to copy '$day' backup\n";

        return;
    }

    print LOG "Backed up data base to directory 'Backup.$day'\n";


Where $day is the current day (e.g. "Mon") and Backup.Mon is a writable 
directory.  Normally, the program writes fine to the Monday backup 
directory.

Now another problem: at the end of the program it checks to see if 
$Admin_Message is true, and if so e-mails me it's value.  This is to warn 
me of problems during the program.  But I didn't get email this time.  I 
received this message in my STDERR log file instead:

   open3: fork failed: Not enough space at IPWS_Access.pm line 1534

Line 1532 in IPWS_Access.pm is this:

    open3( $in, $out, $err, $params )
        or return "Failed open of sendmail:$sendmail:$!";

where $in, $out, $err are FileHandles, and 
$params = "$sendmail -t -oi -oem";

So, my GUESS is that my program didn't have enough memory fork the copy, 
or to fork sendmail.  Everything else the program did seemed to work ok 
that night.

Any suggestion on what would cause this problem to happen every once in a 
while (like once every few weeks)?  Something related to system 
resources?  And if so, any way to check for enough resources within perl 
before running?

The other problem is that the "open3: fork failed" was a fatal error and 
processing didn't continue after that error.

Any suggestions on how I can trap the "open3: fork failed" fatal error so 
I can continue processing?  I don't want the program to stop running just 
because it failed to send mail.

Any suggestions would be a big help.

Thanks

-- 
Bill Moseley mailto:moseley@best.com


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

Date: Thu, 27 May 1999 16:15:31 GMT
From: John Porter <jdporter@min.net>
Subject: Re: My first working script; comments, hints?
Message-Id: <7ijr2v$se7$1@nnrp1.deja.com>

In article <slrn7kqh3e.7c3.scarblac-spamtrap@flits104-37.flits.rug.nl>,
  scarblac-rt@pino.selwerd.cx wrote:
> After reading Learning Perl, a lot of messages in this group,
> and those parts of the docs I needed, I wrote my first "useful"
> script that was actually finished, and works.

Excellent.

> post it here to see if someone has useful hints, because I'm sure
> there's going to be a lot wrong with it still, or at least there
> will be better ways to do some things.

I'm sure there are things I've missed, but these are a start:



> #!/usr/bin/perl -w

You are right ready for 'use strict'.



> open (POST, ">$article");

You should test this open, too!


> foreach $line (@article) {
>   if ($line =~ /^&SIG(.*)$/) {
>     $SIGCOM = $1;
>   } else {
>     print POST $line;
>     if (!defined($groups) and $line =~ /^Newsgroups: (.*)$/) {

If you'd use $_ instead the explicit $line, you chould abbreviate
this kind of code significantly.


>     if (!defined($groups) and $line =~ /^Newsgroups: (.*)$/) {
>       $groups = $1;
>     }

If you like poetry, you might go for this:

	defined $groups or $line =~ /^Newsgroups: / and $groups = $';


> foreach $line (@sigindex) { chop $line; }

1. use chomp, not chop.  (Some books are little out-of-date, you know.)

2. chomp (and chop) operate on all the things given to them:

	chomp @sigindex;


>     $filenames = join(" ",glob ("$ENV{'HOME'}/.sigs/*"));
>     @files = split(/\n/,`grep -l $SIGCOM $filenames`);

Joining a list with a space, only to use it in another string?
Let the behavior of interpolating arrays into strings do the work
for you:

    @filenames = glob "$ENV{'HOME'}/.sigs/*";
    `grep -l $SIGCOM @filenames`

Or in one line:

    @files = `grep -l $SIGCOM @{[glob("$ENV{'HOME'}/.sigs/*")]}`;

Now, since you're spawning an external program, you may as well let
the shell do the globbing for you, rather than doing it as an extra
step; and also let the shell expand the HOME env var:

    @files = `grep -l $SIGCOM \$HOME/.sigs/*`;

Aahhh!


>     if (@files) {
>       $sigfile = $files[rand(@files)];

You might wish to make the int-ness of the result of rand() explicit,
since it actually returns a float:

      $sigfile = $files[int(rand(@files))];


>   $success = 0;
>   for ($i=0; $i<10 and !$success; $i++) {

Using a "loop exit condition" like this is o.k., but it's considered
more idiomatic Perl to use last with a loop tag:

GetSig:
for $i ( 0 .. 9 ) {
  ...
  $gr =~ /$regexp/ or  last GetSig;
}


> print "Sigfile: $sigfile";
>
> # If a signature was found, add it to the post.
> if ($success and defined($sigfile)) {
>   use File::stat;
>   $st = stat($sigfile) or die "Huh? Sigfile gone: $!";
>   if ($st->mode & 0111) {
>     # file executable? then call it with $article as argument.

That's a lot of trouble to go to; perl has nice wrappers for this
stuff, called file test operators:

	-r $sigfile or die "File unreadable/nonexistent";
	if ( -x _ ) { # file is executable...


>   foreach (@siglines) {
>     print POST $_;
>   }

print prints everything you give it:

	print @siglines;


Hope this helps somewhat,
--
John Porter
Put it on a plate, son.  You'll enjoy it more.


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


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

Date: 27 May 1999 15:42:36 GMT
From: jsilves@julian.uwo.ca (J.D. Silvester)
Subject: Re: Newbie Blat help!
Message-Id: <7ijp5c$auc@falcon.ccs.uwo.ca>

On Sat, 22 May 1999 06:20:58 GMT Nancy Prince (nlp@star.org) wrote:
: I am trying to use Blat by Greg Elin (2.2.97).  I need to have web
: site visitors fill out a form on the web, and I need the results
: mailed to me.  Blat is showing a confirmation page, and is sending an
: e-mail message; however, I am not able to get the variables from the
: user's input on the form into either the confirmation page or the
: e-mail.

: For instance, one form field is
: <input type="text" name="userid">

: What do I need to do to get the value of "userid" inserted into the
: e-mail message?

I am using Blat in the same manner as what you are attempting to do.
I am not sure of the version I am using but unless there have been
some radical changes to the way it works, my solution should work for
you.  I write out all my form information into a text file first, then
send it with Blat.  The version of Blat I use requires what is being
sent to be in a file....which is ok because I can style and format the
text any way I want before I send it.


Hope this gives you some ideas.  If you need to see some actuall code,
let me know and I'll send some to you.


John


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

Date: Thu, 27 May 1999 11:08:49 -0400
From: "Kurt Stickler" <stickler.ka@pg.com>
Subject: Obtaining file version info
Message-Id: <7ijn5g$b7v$1@remarQ.com>

Hello,

Does anyone know a way to retrieve the version of a file in PERL under
WindowsNT?  The stat{} function gives useful attributes such as date, time,
size... but I need to know obtain the version number for .EXE and .DLL files

Thanks for any tips,
Kurt Stickler





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

Date: Thu, 27 May 1999 11:08:41 -0400
From: "Bill Jones" <bill@fccj.org>
Subject: Re: path relatively to webserver
Message-Id: <374d5fc6.0@usenet.fccj.cc.fl.us>

In article <7iglsl$1p3$1@black.news.nacamar.net>, "Peter Kontra" 
<kontra@gmx.net> wrote:


> Hello!
> This is Peter Kontra with a small question: How should look a path
> relatively to a webserver right? For example there is
> http://www.mysite-yes.com/chat/ . So I need to know the accurate path for a
> file lying in the chat directory (for example
> http://www.mysite-yes.com/chat/chat.htm ). With what path can a point the
> webserver to this file: I guess it schould look like
> /home/www/mysite-yes/chat/chat.htm . Please answer to kontra@gmx.net . That
> would be very nice.
>
>

You cannot do what you want 'remotely' - it would defeat
what litle security there is in WWW servers.

Now, if you are root, and on the local system, where
a document is would greatly depend upon where your
DocRoot tree starts...

See the relevant docs for the WWW server you're
running and it will explain where DocRoot starts.

PS - It doesn't cover 'ln -s' type files, so ...
PPS - Post here, read here.

HTH,
-Sneex-  :]
______________________________________________________________________
Bill Jones  Data Security Specialist  http://www.fccj.org/cgi/mail?dss
______________________________________________________________________
  We are the CLPM... Lower your standards and surrender your code...
  We will add your biological and technological distinctiveness to
  our own... Your thoughts will adapt to service us...
  ...Resistance is futile...

         Jacksonville Perl Mongers
         http://jacksonville.pm.org
         jax@jacksonville.pm.org



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

Date: 27 May 1999 09:28:00 +0200
From: kaih=7HeqSvbmw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Perl "constructors"
Message-Id: <7HeqSvbmw-B@khms.westfalen.de>

zenin@bawdycaste.org  wrote on 26.05.99 in <927740249.63564@localhost>:

> John Porter <jdporter@min.net> wrote:
> : In article <927680311.575832@localhost>,
> :   zenin@bawdycaste.org wrote:
> 	>snip<
> :> In practice, this is not a problem.
> :
> : No, in practice, it is extremely much of a problem, particularly
> : for those of us who are used to using CGI::Carp.
> :
> : Hmm, I *thought* I threw Exception::Mine->new( @problems ),
> : but what I caught was:
> : [Wed May 26 09:49:26 1999] jamaica.cgi: Exception::Mine=HASH(0xc6e30) at
> : ./jamaica.cgi line 102.
>
> 	You explicitly use a module who's primary, if not single purpose for
> 	existing is to override die() and friends, and you're surprised when
> 	you find it actually does?

Besides, if you use some eval encapsulation like try, you can always  
locally reset the __DIE__ handler.

Kai
-- 
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


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

Date: Thu, 27 May 1999 14:51:59 GMT
From: jknoll@my-deja.com
Subject: Perl and Oracle help!
Message-Id: <7ijm6e$of1$1@nnrp1.deja.com>

Does perl work seemlessly with Oracle databases?  Is it decently fast
and efficient?
tia
jrk


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


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

Date: Thu, 27 May 1999 16:27:40 +0100
From: Richard H <rhrh@hotmail.com>
Subject: Re: Perl and Oracle help!
Message-Id: <374D646C.48F47701@hotmail.com>

jknoll@my-deja.com wrote:
> 
> Does perl work seemlessly with Oracle databases?  Is it decently fast
> and efficient?
> tia
> jrk

yes if your tables are set up right, no problems at all

Richard H


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

Date: Thu, 27 May 1999 17:08:15 +0100
From: Kevin White <kevin.white@blackwell.co.uk>
Subject: Perl and Verity
Message-Id: <374D6DEF.B7CD16D4@blackwell.co.uk>

Hi All,

I am looking to interface with a verity search index (not the html
search index) using Perl and was wondering if anyone has tried this...
and more particularly has succeeded!

Cheers for any help

Kevin



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

Date: Thu, 27 May 1999 15:53:56 GMT
From: mark_f_edwards@my-deja.com
Subject: perl oracle on hp-ux B11.0
Message-Id: <7ijpqj$rct$1@nnrp1.deja.com>

hello all...

I have just succeeded in getting oracle 8 to talk to perl 5-5 on the
hp-ux b.11.0 box, and wish to thank all those who helped me.

i have documented all of my steps, and anyone wanting a copy please
write me at:

mark.edwards@sunh.com or
mark_f_edwards@excite.com

a special thanks to ron reidy and carlos mejia

(those README files really work!)


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


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

Date: Thu, 27 May 1999 15:25:50 GMT
From: lpacania@my-deja.com
Subject: Putting substitution commands in a seperate file.
Message-Id: <7ijo5q$q1p$1@nnrp1.deja.com>

Hi,

I'm trying to do MASS substitutions and I want to put all the
substituion rules in a seperate file (RULE file), and then when I look
at each line in the file which I am trying to change, I loop through
all of the substitution rules in my rule file.

Normally you would do this

$line =~ s/string/string replacement/i

But I want to do this

$line =~ $rule

Where $rule has the s/string/string replacement/i
in it.

The problem is when I run the debugger and step through PERL ignores
this.  I remember in my AWK days you had to surround this variable with
something to treat it as a command.

Help?

<code snip below>

$rule = <RULEFILE>;
$line = <INFILE>;

while ($rule ne "") {
      while ($line ne "") {
      $line =~ $rule; <-- this does work.
      print OUTFILE ($line);
      $line = <INFILE>;
      }

$rule = <RULEFILE>; moves to next rule
}
print ("end of loop.\n");

CONTENT OF RULEFILE
s/auto(?!motive)/automotive/i
s/dlr/dealers/i

CONTENT OF INFILE
0047,R,Auto dlrs


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


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

Date: Thu, 27 May 1999 10:37:12 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Q. about pattern matching
Message-Id: <x3yso8iy3xj.fsf@tigre.matrox.com>


book@pc89153.cse.cuhk.edu.hk () writes:

> Hi all, there are strings with square bracket([]) needed to be matched.
> It may be as: 
> (1) "[abc [testing] ]"       or 
> (2) "[abc] testing [hello]"
> 
> What I want is the strings inside the brackets, but pair by pair(?),
> which means i want "abc [testing] " in (1) but 
> "abc" and "hello" in (2).

What you really want is to match balanced text. Have a look at what
the FAQs say about this. It's there in perlfaq6:

     Can I use Perl regular expressions to match balanced text?

HTH,
Ala



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

Date: Thu, 27 May 1999 16:52:57 +0100
From: Kevin White <kevin.white@blackwell.co.uk>
Subject: Re: Q. about pattern matching
Message-Id: <374D6A58.90AC1A72@blackwell.co.uk>


Hi,

I think I have got the jist of what you are trying to do... rather than use
regexp I have written a small function which should do what you are trying
to do. Okay so it ain't elegant but I have always prefered working to
elegant!... okay so I like tidy as well but there you go....

I would be interested to see if there is a regexp to do this though.


Kevin


sub extract
{
    my( $string ) = @_;
    my @test = ( );
    my @split = split '\[', $string;
    my $split;
    foreach $split ( @split )
    {
        if( defined $split && $split ne '' )
        {
            if( $split !~ /\]/ )
            {
                push @test, $split;
            }
            else
            {
                $split =~ m/([^\]]*)/;
                push @test, $1;
            }
        }
    }
    return @test;
}




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

Date: Thu, 27 May 1999 07:08:09 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Q. about pattern matching
Message-Id: <p29ji7.g7o.ln@magna.metronet.com>

book@pc89153.cse.cuhk.edu.hk wrote:
: Hi all, there are strings with square bracket([]) needed to be matched.
: It may be as: 
: (1) "[abc [testing] ]"       or 
: (2) "[abc] testing [hello]"


: how to do that ? 


   You do it the way the Perl FAQ, part 6 says to:

      "Can I use Perl regular expressions to match balanced text?"


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 27 May 1999 08:36:35 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: system command to string (DATE)
Message-Id: <374D6683.DC4D19CC@mail.cor.epa.gov>

Tom Vaughan wrote:
> 
> (BXTC) (bxtc@forfree.at) wrote:
> : To start let me tell you I am new to Perl.  This is what I need:
> :       I need to get the date from my system (linux) and put the output into a
> : string.
> 
> And why wouldn't you use the backticks? The one under the tilde.
> 
> $string=`date +%m/%d/%y`; or whatever options you want for date. Do a man date for info

Because using the Perl built-in functions gives you more.
They're faster, less wasteful (you're not forking off a new process
with all the associated overhead), more flexible, and a heck
of a lot more portable.  Don't try `date` on a win32 box if
you're expecting the unix date() .

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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