[9442] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3037 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 1 12:07:16 1998

Date: Wed, 1 Jul 98 09:00:28 -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           Wed, 1 Jul 1998     Volume: 8 Number: 3037

Today's topics:
        access time <pwhst+@pitt.edu>
        adduser (Thomas Frederick O'Connell)
    Re: array of objets <qdtcall@esb.ericsson.se>
    Re: array of objets (Mike Stok)
    Re: array of objets (Patrick Timmins)
    Re: Certified Perl Programmers (Jacqui Caren) (Jacqui Caren)
    Re: Dereferencing Anonymous Hash <johnc@interactive.ibm.com>
        Dereferencing Anonymous Hash? <johnc@interactive.ibm.com>
    Re: find a number with regular expression (Larry Rosler)
    Re: find a number with regular expression <bowlin@sirius.com>
    Re: find a number with regular expression (Patrick Timmins)
    Re: flame everyone on sight (was Re: Perl and Delphi) <jdporter@min.net>
    Re: flame everyone on sight (was Re: Perl and Delphi) (John Moreno)
        Formating output (Keith L. Miller)
    Re: Formating output (Matt Knecht)
    Re: Formating output (Larry Rosler)
    Re: Formating output <tchrist@mox.perl.com>
    Re: How do you do system administration with perl? (Matt Knecht)
    Re: How to in perl (Larry Rosler)
    Re: HTML Form value problem <gavery@uu.net>
    Re: Matching over multiple lines (regexp problem) <quednauf@nortel.co.uk>
    Re: Migration from Msql to Oracle (John D Groenveld)
        MULTIPART CONTENT TYPE <thijs@esense.nl>
    Re: Oracle(Solaris) <-> oraperl <-> NeXT  ? (John D Groenveld)
    Re: Q: Make write pass result to a function? <jdporter@min.net>
    Re: rename() not working ...any ideas? <rootbeer@teleport.com>
        SSL-to-HTTP Inter-to-Intranet proxy <andreas.greulich@mbox.bfi.admin.ch>
    Re: sybperl compilation - HEEELP <mpeppler@mbay.net>
    Re: system() and security again (Josh Kortbein)
        uses of require and use (Rachel J King)
    Re: Y2K Problem (Josh Kortbein)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 1 Jul 1998 11:38:33 -0400
From: Optimist Prime <pwhst+@pitt.edu>
Subject: access time
Message-Id: <Pine.GSO.3.96L.980701112711.12562A-100000@unixs-eval.cis.pitt.edu>


When using the -A filetest or the stat function to get a files last access
time, I don't get the result that I expect.  I want the number of days since
the last time that I read the file.  If I do this:


     open FH, $file or die "$!\n";
     while (<FH>)
     {
	 &do_whatever;
     }
     $accesstime  = -A $file;


$accesstime has the value of 89 point something, which happens to be the
last time that I edited $file.  

I guess my question is this:

     Is there any way to change the access time of a file, without 
     having write access to it.  This is a program that will be used 
     other users and I want to be able to tell when the last time 
     a certain file has been read so that I can abort the program 
     if accesstime is less than one day.

Thanks in advance,
Paul Hanbury





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

Date: Wed, 01 Jul 1998 10:23:23 -0500
From: tfo@telalink.net (Thomas Frederick O'Connell)
Subject: adduser
Message-Id: <tfo-0107981023230001@jesus.telalink.net>

i have been searching around for a semi-authoritative version of adduser.
there does not seem to be anything similar in the standard perl
distribution or on CPAN, and no linux vendors seem to point to a non-perl
standard.

i have seen so many mailing-list and/or newsgroup entries saying "where
can i find a [better] version of adduser, preferably in perl?" and "if you
find one, let me know because i am about to write my own". well, i fall
into both categories and was wondering if there is

1) an authoritative source for the linux adduser script

2) a supported perl version

i figured this would be something that was slightly easier to track down.
maybe i'm just not looking in the right places. if anyone knows the right
places, please let me know.

thanks.
-freddie


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

Date: 01 Jul 1998 16:00:51 +0200
From: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: array of objets
Message-Id: <isvhphekmk.fsf@godzilla.kiere.ericsson.se>

Robert Rehammar <Robert.Rehammar@emw.ericsson.se> writes:

> How do I create an array of objects ??

You take the objects (or, rather, the references to them) and stuff
them into an array. I'm not sure what you're asking, really.
-- 
		    Calle Dybedahl, UNIX Sysadmin
       qdtcall@esavionics.se  http://www.lysator.liu.se/~calle/


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

Date: 1 Jul 1998 15:25:12 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: array of objets
Message-Id: <6ndkco$l58@news-central.tiac.net>

In article <3599F4F6.9D9E52A8@emw.ericsson.se>,
Robert Rehammar  <Robert.Rehammar@emw.ericsson.se> wrote:
>How do I create an array of objects ??

In perl the handle you get for an object is a blessed reference, and this
can be stored in a regular array.  There's no special syntax for creating
an array of objects, code like this has worked for me:

  @list = ();
  for (0 .. 9) {
    push @list, $OBJ->new ();
  }

  # later...

  $result = $list[1]->method (@args);

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Wed, 01 Jul 1998 15:45:12 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: array of objets
Message-Id: <6ndli8$cqj$1@nnrp1.dejanews.com>

In article <3599F4F6.9D9E52A8@emw.ericsson.se>,
  Robert.Rehammar@emw.ericsson.se wrote:
>
> How do I create an array of objects ??
>
> \\Robert Rehammar
>

Use Jonathan Feinberg's YCJMSU.PM module. Search deja news for "Yik-Jim-Su"
for more info. Be sure to s/(CAN)'T/$1/ though.

Hope that helps.

Patrick Timmins
U. Nebraska Medical Center

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 1 Jul 1998 11:39:03 GMT
From: Jacqui.Caren@ig.co.uk (Jacqui Caren) (Jacqui Caren)
Subject: Re: Certified Perl Programmers
Message-Id: <EvEz14.3Ht@ig.co.uk>
Keywords: Flemish foggy plagiarism prize

In article <6lmpoc$ita$1@monet.op.net>, Mark-Jason Dominus <mjd@op.net> wrote:
>In article <6lk40e$55p@news-central.tiac.net>,
>Mike Stok <mike@stok.co.uk> wrote:
>>Are you willing to certify "perl engineers"?  
>
>Why not?
>
>> I've always wanted to be an engineer ;-)
>
>Now's your chance.
>
>mjd-perl-certification@plover.com

Not trying to pour too much cold water here (cos I am as irritated
by the plethora of "certifications" that seem to be the rage
these days) but is there not some EEC directive/law about
"engineers".  I *think* you cannot legally call yourself an
*engineer* n the EEC unless you meet specific criteria...

Of course, I cannot substantiate this and could be totally wrong :-)

Jacqui

I still remember my year out (during CS degree) where a consultant(*)
had to ask me for help with his Pascal - he had only had a short
intro course on the language... When I looked at his code it was
clearly FORTAN 4. The bugs he introduced because of this were hilarious.
The fact that this was a "real-time" pascal derivative and the project
was a 'live' manufacturing (quality control) system stopped me from
laughing.

Until this project I assumed you needed to be good at what you did to
get paid well. Because of this I had a long held view that
"consultant" === "moron".

Thank heavens I was there to do some 4-D thermal simulation work(+)
and was not involved in this fiasco^Wproject.

Jacqui

(*) by consultant, I mean he was paid in one week what I
    earned in six months - students get paid very little :-(

(+) on a 96K Commodore Pet - "state of the art" in those days :-)
    Ah, the "good old days" of BASIC and 6502 assembly code :-)

-- 
Email: Jacqui.Caren@ig.co.uk  http://www.ig.co.uk/
Fax  : +44 1483 419 419       http://www.perlclinic.com/
Phone: +44 1483 424 424       http://www.perl.co.uk/
Paul Ingram Group Ltd,140A High Street,Godalming GU7 1AB United Kingdom



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

Date: Wed, 01 Jul 1998 11:40:18 +0000
From: John Call <johnc@interactive.ibm.com>
Subject: Re: Dereferencing Anonymous Hash
Message-Id: <359A201B.D02A858D@interactive.ibm.com>

>@uniq = sort keys %{ { map {$_,1} @list } };

Ok. I got an answer to this which is the obvious - keys takes a hash as
an
arguement not a reference to a hash. Thanks for the answer (which I knew
but got crossed up).

What I meant to ask is why the second set of {} makes a reference to an
anonymous hash and isn't a hash itself? I don't see where this is making
a reference to a hash. Am I again missing the obvious?

Obviously not getting the obvious which is obviously obvious,

John Call



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

Date: Wed, 01 Jul 1998 11:06:52 +0000
From: John Call <johnc@interactive.ibm.com>
Subject: Dereferencing Anonymous Hash?
Message-Id: <359A1847.E7EFB960@interactive.ibm.com>

I was reading through Effective Perl Programming by Hall & Schwartz this
weekend and came to this interesting one-liner:

@uniq = sort keys %{ { map {$_,1} @list } };

This eliminates all the duplicates from a list. This is all explained
very well in the book and I can see what it does but have two questions
about things I am not quite clear on.

First:

The second set of {} "..reference to an anonymous hash intialized with
those values." The first set of {} are "The 'name' of the dereferenced
hash - suitable as an arguement for keys."

What I don't know is why the second set of {} couldn't be the arguement
for keys. Why do I have to dereference the anonymous hash?

Second:

Why does it sort? Does this destroy the duplicates? I assumed the
duplicates would be destroyed just by being assigned as keys.

Thanks,

John Call



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

Date: Wed, 1 Jul 1998 07:07:26 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: find a number with regular expression
Message-Id: <MPG.1003e278e5d3989498970a@nntp.hpl.hp.com>

In article <3599E169.DACB46B@emw.ericsson.se> on Wed, 01 Jul 1998 
08:12:41 +0100, Robert Rehammar <Robert.Rehammar@emw.ericsson.se> says...
> How do I find out if a srtring contains a number with $string[0]=~/???/.

You read perlfaq4: "How do I determine whether a scalar is a
number/whole/integer/float?"

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Wed, 01 Jul 1998 08:34:20 -0700
From: Jim Bowlin <bowlin@sirius.com>
To: Robert.Rehammar@emw.ericsson.se
Subject: Re: find a number with regular expression
Message-Id: <359A56FC.B7479EA3@sirius.com>

Robert Rehammar wrote:
> 
> How do I find out if a srtring contains a number with $string[0]=~/???/.
> 
> \\Robert Rehammar


m/^\s*[\+\-]?(\d+\.?\d*|\.\d+)(e[\+\-]?\d+)?$/i;

This should be true if and only if $_ will convert to a number successfully.

-- Jim Bowlin


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

Date: Wed, 01 Jul 1998 15:32:48 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: find a number with regular expression
Message-Id: <6ndkr1$bee$1@nnrp1.dejanews.com>

In article <3599E169.DACB46B@emw.ericsson.se>,
  Robert.Rehammar@emw.ericsson.se wrote:
>
> How do I find out if a srtring contains a number with $string[0]=~/???/.
>
> \\Robert Rehammar
>

So you mean you have an array called @string, and you want to know when any
of its elements contains a number? If so, how about something like:

@string = ('dog', 'cat', '2 mice', 'dirty rat');
$idx = 0;
foreach $string (@string) {
    ($string =~ /\d/) && print "\$string[$idx] has a number in it: $string\n";
$idx++;
}

Keep in mind, this matches whenever the element "contains" a number, not just
when it "is" a number. Do a variation of the above if you want that (eg
substitute /^\d+$/ for /\d/ in the match above).

Hope that helps.

Patrick Timmins
U. Nebraska Medical Center

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 01 Jul 1998 13:40:50 GMT
From: John Porter <jdporter@min.net>
Subject: Re: flame everyone on sight (was Re: Perl and Delphi)
Message-Id: <359A3E29.4D73@min.net>

Russell Schulz wrote:
> 
> Dan Nguyen <nguyend7@egr.msu.edu> writes:
> > Why would you want to program in Delphi?
> 
> now, was there any reason for this?  or was it just incredibly poorly
> stated?  did you mean:
> 
>   whatever you can do in Delphi you can do in Perl, and easier
> 
> or did you mean:
> 
>   I want to start an advocacy flamefest in the wrong group

A little hyper-sensitive, are we?  Hmmm?

Maybe Dan meant "educate me on the peculiar strengths of Delphi".

-- 
John Porter


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

Date: Wed, 1 Jul 1998 11:56:29 -0400
From: phenix@interpath.com (John Moreno)
Subject: Re: flame everyone on sight (was Re: Perl and Delphi)
Message-Id: <1dbhkqi.7lh0ovly1esN@roxboro0-030.dyn.interpath.net>

Russell Schulz <Russell_Schulz@locutus.ofB.ORG> wrote:

> Dan Nguyen <nguyend7@egr.msu.edu> writes:
> 
> >> Is the a library for Perl that can be run under Delphi?
> >
> > Why would you want to program in Delphi?
> 
> now, was there any reason for this?  or was it just incredibly poorly
> stated?  did you mean:
> 
>   whatever you can do in Delphi you can do in Perl, and easier
> 
> or did you mean:
> 
>   I want to start an advocacy flamefest in the wrong group

I took it to simply mean exactly what it says it is - a request for
information, asking why he wants to use Delphi for this (and possibly
any other) project.  Languages have there strengths and weaknesses (if
the question is "I've got to write a machine controller and it has to
fit in 10k, what language do I use" *I* wouldn't answer "perl").

-- 
John Moreno


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

Date: Wed, 01 Jul 1998 14:56:31 GMT
From: miller@bigsky.net (Keith L. Miller)
Subject: Formating output
Message-Id: <359a4d5b.91572210@news.bigsky.net>

Okay, because of my last post, I FIRST READ THE FAQ before this post
so PLEASE don'ttell me to go read the FAQ this time.  If the answer is
in the FAQ and I missed it then please point me to the location in the
FAQ.

Okay, here it goes.

I have a number, say:   12345.67890

I want to print it to look like:   12345.68

I have looked through the printf and sprintf man pages, but did not
understand exactly how to accomplish my goal.  Can someone please
help?

PS:  The number is a result of two other numbers being divided.  Is
there a way for me to have the number stored in the resulting variable
in this format?

Keith


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

Date: Wed, 01 Jul 1998 15:20:42 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: Formating output
Message-Id: <etsm1.10$Du.63558@news2.voicenet.com>

Keith L. Miller <miller@bigsky.net> wrote:
>Okay, because of my last post, I FIRST READ THE FAQ before this post
>so PLEASE don'ttell me to go read the FAQ this time.  If the answer is
>in the FAQ and I missed it then please point me to the location in the
>FAQ.

It's not in the FAQ... it's in the perlfunc. ;)

>I have a number, say:   12345.67890
>
>I want to print it to look like:   12345.68
>
>I have looked through the printf and sprintf man pages, but did not
>understand exactly how to accomplish my goal.  Can someone please
>help?

Reading this the first time, I could see how you might miss it.  From
'perldoc -f sprintf':

   .number "precision": digits after decimal point for floating-point,
            max length for string, minimum length for integer

Which doesn't seem to jump off the page and say you can do this:

$num = sprintf('%.2f', $num);

Which will turn 12345.67890 into 12345.68

-- 
Matt Knecht - <hex@voicenet.com>
"496620796F752063616E207265616420746869732C20796F7520686176652066
617220746F6F206D7563682074696D65206F6E20796F75722068616E6473210F"


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

Date: Wed, 1 Jul 1998 08:17:27 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Formating output
Message-Id: <MPG.1003f2e4b59d47798970b@nntp.hpl.hp.com>

In article <359a4d5b.91572210@news.bigsky.net> on Wed, 01 Jul 1998 
14:56:31 GMT, Keith L. Miller <miller@bigsky.net> says...
 ...
> I have a number, say:   12345.67890
> 
> I want to print it to look like:   12345.68
> 
> I have looked through the printf and sprintf man pages, but did not
> understand exactly how to accomplish my goal.  Can someone please
> help?

printf '%.2f', $number;
 
> PS:  The number is a result of two other numbers being divided.  Is
> there a way for me to have the number stored in the resulting variable
> in this format?

$result = sprintf '%.2f', $numer / $denom;

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 1 Jul 1998 15:33:46 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Formating output
Message-Id: <6ndksq$e6t$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    miller@bigsky.net (Keith L. Miller) writes:
:I have a number, say:   12345.67890
:I want to print it to look like:   12345.68

Use:

    printf "%.2f\n", $n;

The more you know about printf (and sprintf) the happier you'll be --
well, up to a point).  But the less you know, the less happier you'll be.
That much is certain.

Read your printf(3) manpage diligently.

--tom
-- 
    "That's okay.  Anyone whose opinion he cares about already knows that
    he doesn't care about their opinion."
    	--Larry Wall


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

Date: Wed, 01 Jul 1998 15:27:37 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: How do you do system administration with perl?
Message-Id: <Jzsm1.12$Du.63558@news2.voicenet.com>

charlesh@direct.ca <charlesh@direct.ca> wrote:
>     I'd like to read some real examples as mentioned in subject.
>Anyone can point some places or books for me?

The short answer is, you don't!  You just use Perl to help[ you get
through sticky problems.

The only book I can think of (Which is excellent) is
_Essential_System_Administration_ by AEleen Frisch pbulished by O'Reilly
(ISBN 1-56592-127-5).  It has a chapter on about automating tasks with
scripts.  Perl is one of the languages discussed.

-- 
Matt Knecht - <hex@voicenet.com>
"496620796F752063616E207265616420746869732C20796F7520686176652066
617220746F6F206D7563682074696D65206F6E20796F75722068616E6473210F"


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

Date: Wed, 1 Jul 1998 07:02:43 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How to in perl
Message-Id: <MPG.1003e161151ebeae989709@nntp.hpl.hp.com>

[This followup was posted to comp.lang.perl.misc and a copy was sent to 
the cited author.]

In article <01bda4de$fa5aedc0$47eb1bcc@XSTA71.pcr.com> on 1 Jul 1998 
11:55:56 GMT, Matt Heusser <matt@pcr7.pcr.com> says...
> lan -
> 
> how about something like this?
> 
> #---------------
> #sample.pl
> my $counter
> $counter = 1;
> while (<>) {
>   if ($counter>6) print $_;
>   $counter++;
> {
> #-------------EOF

There are two syntax errors in the above snippet.  You should either 
(preferably) cut-and-paste tested code into your submissions, or eyeball 
them *very* carefully -- several times.

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Wed, 01 Jul 1998 09:37:10 -0400
From: Gordon Avery <gavery@uu.net>
Subject: Re: HTML Form value problem
Message-Id: <359A3B86.60D2@uu.net>

Rick Delaney wrote:
> 
> Gordon Avery wrote:
> 
> Assuming:
> print <<FIRST;
> >     <input type="text" name="class" size=30 value="$data[0][1]">
> FIRST
> >
> > It seems to work if I use some other variable like
> >
> print <<SECOND;
> >     <input type="text" name="class" size=30 value="$dog">
> SECOND
> >
> > where dog has been initialized to some string.
> 
> Well, is $data[0][1] initialized also?  Are you using -w?  If you set
> $dog = $data[0][1] then both lines of output will be the same.  You are
> using Perl 5, right?

That's the problem.  I've tried setting $dog=$data[0][1] and I can print
the correct value out to the command line (i.e. $data[0][1] is
initialized and has the correct value).  The problem comes in when
setting the initial value of the form text box.  It won't accept the
variable as proper input, I guess.  Thank you, though.

Gordon Avery
gavery@uu.net


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

Date: Wed, 01 Jul 1998 14:04:29 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Matching over multiple lines (regexp problem)
Message-Id: <359A33DC.698FB268@nortel.co.uk>

Well, I got a private post which gave me the idea of matching on two \n's to
split body from header, but looking at my Netscape file it wouldn't work half of
the time, as such a thing might occur within the body of the text, or 2 separate
mails might only be separated by one \n. Shocking, and I wonder how Netscape
susses it out internally. But here, my dear people, is a code snippet that seems
to work. This code will soon be part of a subroutine which only springs to
action if a searchstring is found. I managed to find the LCD (That is, lowest
common denominator) in my brain. I just use a sort of switch which is turned on
and causes to slurp every line that comes along, until the switch is turned off
again.

I abandoned to play around with the $/, as it is another potential source of
chaos for a newbie like me. It is recommended in the perlfaq to switch the $/
variable to undef for matching over multiple lines, but there seem to be more
subtleties involved than it is apparent to a starter. Anyway, here the basic
idea:

$c = 0;
open FILE, "< /u/quednauf/temp/knowledge.net" or die "*sigh*: $!";
  IGNOREFIRST: while (<FILE>) {print, last IGNOREFIRST;}
  # just wanted to get rid of the first line; silly, I know : )
  SLURP: while (<FILE>) {
    if (/^Subject: (.*)$/) {
      $message{subject} = $1;
      print STDOUT "Hit on Subject: $message{subject}\n";
    }
    if (/^Sender: (.*)/) {
      $message{sender} = $1;
      print STDOUT "Hit on Sender: $message{sender}\n";
    }
    if (/^Date: (.*)/) {
      $message{date} = $1;
      print STDOUT "Hit on Date: $message{date}\n";
    }
    if (/^X-Mozilla-Status:/) {
      $click = 1; #switch is turned on...
    }
    if (/^From -/) {
      $click = 0; #Found beginning of next mail; turn off Switch.
      print $message{body};
      $message{body} = "";
      $c++, print "*****$c*****\n";
    }
    if ($click == 1) { $message{body} .= $_;} #eat file while the switch is on
    last SLURP if $c == 4;
  }
close FILE;

Again, all quite clumsy, but it finally works! Gotta do some un-debugging now :)

-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


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

Date: 1 Jul 1998 09:45:17 -0400
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: Migration from Msql to Oracle
Message-Id: <6ndehd$n32$1@tholian.cse.psu.edu>

In article <3599FF04.932A468@dev.bbcom.co.kr>,
Kim, Ki-Yong <scgyong@dev.bbcom.co.kr> wrote:
>I mean, "is there no problem for using query or fetchhash?"
Not a problem. The only thing you should have to modify is your
connect method.
John
groenveld@acm.org


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

Date: 1 Jul 1998 15:05:08 GMT
From: "Mathijs Oosterom" <thijs@esense.nl>
Subject: MULTIPART CONTENT TYPE
Message-Id: <01bda501$78749ae0$a44a6dc2@earl.esense.nl>

Hi all,

For several times I have tried to write a perl cgi-script that uses a
multipart content type. I would like to use it for automatically replacing
images.

I used an example of a O'Reilly book, CGI-programming on the World Wide Web
(page 140). But it doesn't work? I think there's a bug in the example
script shown on that page. On page 139 it says that a --End must be print
right after te multipart content type line, but the script doesn't do that.
I don't know if that's the problem, both possibilities don't work.

Can anybody help me? Does anybody have a script that works with multipart
content type?

Thanx a lot!

Thijs.


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

Date: 1 Jul 1998 09:50:10 -0400
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: Oracle(Solaris) <-> oraperl <-> NeXT  ?
Message-Id: <6ndeqi$n3s$1@tholian.cse.psu.edu>

Since I doubt you'll find Oracle libraries for the NeXT, try
the DBD::pNET module. Its at a CPAN mirror near you...
http://www.cpan.org/
John
groenveld@acm.org


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

Date: Wed, 01 Jul 1998 15:13:51 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Q: Make write pass result to a function?
Message-Id: <359A53F5.7948@min.net>

Russ Allbery wrote:
> 
> Brian Lavender <brian@brie.com> writes:
> 
> > I have the following chunk of code which has a format and a write
> > statement. I want the result of the write passed to the ent function so
> > it can encode the HTML entities. How do I make this work? Currently the
> > write sends it straight to STDOUT.
> 
> Unfortunately, in order to get the output from a format into a variable,
> you need to use the low-level formline interface rather than calling write
> directly.  It's a bit more complicated; see man perlfunc for details.

Personally, I like the idea of writing to a tied filehandle.

-- 
John Porter


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

Date: Wed, 01 Jul 1998 14:40:38 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: rename() not working ...any ideas?
Message-Id: <Pine.GSO.3.96.980701073910.8511D-100000@user2.teleport.com>

On Tue, 30 Jun 1998, Ronald J Kimball wrote:

> Tom Phoenix <rootbeer@teleport.com> wrote:
> 
> > Perl doesn't read your mind unless you use the DWIM module. :-)
> 
> I tried to use the DWIM module, and got this output:
> 
> Can't locate DWIM.pm in @INC at readmind line 1.

This is a known bug in current versions of DWIM.pm. In the future, it
should work whether you have it properly installed or not.

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 01 Jul 1998 16:25:51 +0200
From: Andreas Greulich <andreas.greulich@mbox.bfi.admin.ch>
To: ssl-talk@netscape.com, ssl-users@mincom.oz.au, www-security@ns2.Rutgers.EDU
Subject: SSL-to-HTTP Inter-to-Intranet proxy
Message-Id: <359A46EE.1D24F6CD@mbox.bfi.admin.ch>

Hi all!

We have an Intranet with several 100 non-SSL WWW-servers and a firewall
connection to the Internet. We have to make this pool of WWW-servers
available for external users on the Internet on a safe (ie,
authenticated) basis. They should be able to use this WWW-servers as if
they were sitting on the Intranet.

client-authenticated SSL is the way of authentication we find
appropriate for our task. Piping SSL directly to the servers (by a
TCP-forwarder) does not work though for 2 reasons:
- Intranet-WWW servers are not SSL-servers
- Firewall-critical security issues cannot be delegated to them
(authentication
  would not occur on the firewall!)

So, we have an SSL-WWW-server as Proxy (actually a Stronghold 2.3 one),
which  offers several possibilities for SSL-to-HTTP proxying.

This principially works. But an important issue is that users must be
able to use these WWW-servers "as if they were on the Intranet". This
means, selecting links on downloaded pages must work! And we have a lot
of links on our Intranet-servers taht point to other Intranet-servers,
funny links as those produced by "kidofwais", even "ftp://..." links.
They all should work.

We tried several approaches:

Approach 1: simple ProxyPass directive on WWW-server.
ProxyPass can map a virtual host (or a directory) to an Intranet server.
It works fine, but:
- It requires setup for each single Intranet server (lot of work and
always
  incomplete)
- Each URL has an Intranet- and Internet-representation that differ, so
  links don't work unless they are relative

Approach 2: setting up a real proxy
This is probably the cleanest  solution. Drawbacks there:
- Browsers require manual setup and it's a pain to explain potentially
  thousands of users how to correct their Proxy Javascript and mix
  it with already existing ones (do not forget an external user might
  need access to several different Intranets, and no single one can
supply
  him with "his" full Proxy Javascript).
- As Internet-Links are of "http" protocol type, the browser will not
make
  SSL-connections, not even to the proxy. How can a browser be told
  to build up an SSL-connection to its proxy in order to request
  "http://..."? or "ftp://..."?
In short, browsers are not flexible enough for this approach.

Approach 3: Combining Approach 1 with URL-Rewriting
We are using this for some time and it works fine. Pricipially, the
WWW-server uses a ProxyPass to forward the request to a WWW-server that
actually just is a middle-tier (C++ program) software; latter makes the
connection to the real Intranet server, intercepts the HTML file and
changes all URLs in it to their external representation. It works, but
has the following drawbacks:
- Each Intranet WWW-server requires an own VirtualHost in Stronghold
  plus an instance of the middle-tier program to do the rewriting
- an FTP-frontend needs to be done explicitely in the middle-tier

Apporoach 4: URL-Rewriting with single VirtualHost
This seems to be the most promising way right now. It works by setting
up just one VirtualHost in Stronghold, like:
  Listen 2000
  <VirtualHost *:2000>
  SSLFlag on
  SSLVerifyClient 2
  ProxyPass / http://localhost:1200/
  TransferLog             /usr/local/WWW/logs-SSL/access_log_testproxy
  </VirtualHost>
And then run a server process on port 1200 (for above setting) that
rewrites URLs like:
  "xxx/yyy" remain unchanged (relative)
  "/xxx/yyy" are extended to "http://host/xxx/yyy" and trated like them
  "http://host/xxx/yyy" change to "/http/host/xxx/yyy"
  "ftp://host/xxx/yyy" change to "/ftp/host/xxx/yyy"
Any path extensions ("...?...") remain. This way, all URLs in the
retruned HTML data are relative or absolute, but no full hostnames are
given, so if the original access was, say, to
"https://firewall:2000/http/host/xxx/yyy.html", it remains an SSL link.
Thsi way, it is possible to make all Intranet WWW-servers available with
just one single VirtualHost and proxy process. We implemented a program
that can deal as server for port 1200 above, and you can download this
as
  http://www.admin.ch/~t7e2q/rewriter.pl
It is a Perl-script as prototype and uses the HTML::Filter module. Even
FTP downloads work more or less. The main drawback is the performance.
What I wonder is if anybody did something similar, maybe found other
approaches or maybe already wrote such a rewriter in a more efficient
langiage (C?). The nicest thing, of course, would be to have it in the
WWW-server as its own module.

                                    Andy

--

*********************************************************************
Andreas Greulich, Swiss Federal Office of Information Technology and
Systems (BFI), Tel +41 31 325 8086, Fax +41 31 325 9030
E-mail:andreas.greulich@mbox.bfi.admin.ch
WWW:   http://www.imsv.unibe.ch/~greulich
*********************************************************************




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

Date: Wed, 01 Jul 1998 08:04:10 -0700
From: Michael Peppler <mpeppler@mbay.net>
Subject: Re: sybperl compilation - HEEELP
Message-Id: <359A4FEA.9A768E1E@mbay.net>

Artur Czechowski wrote:
> 
> Hello
> I try to compile sybperl 2.07 from CPAN. And I still got the same error:
> 
> gcc -L/usr/local/lib -rdynamic -o perl -O2 ./perlmain.o  /usr/lib/perl5/i586-linux/5.00404/CORE/libperl.a /usr/lib/perl5/i586-linux/5.00404/auto/DynaLoader/DynaLoader.a /home/arturcz/SQL/sybperl-2.07/blib/arch/auto/Sybase/CTlib/CTlib.a `cat ./blib/arch/auto/Sybase/extralibs.all` -lndbm -lgdbm -ldb -ldl -lm -lc
> gcc: Internal compiler error: program ld got fatal signal 11
> 

This looks like a compiler problem. I seem to remember others having the
same 
problem in the past (but not recently). Maybe you should try to get the
latest
versions of gcc (and assorted tools).

Also you should probably get sybperl 2.09_05, and the new-ish CTlib
libraries
that are available on my web page.

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@datamig.com    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com


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

Date: 1 Jul 1998 15:46:25 GMT
From: kortbein@iastate.edu (Josh Kortbein)
Subject: Re: system() and security again
Message-Id: <6ndlkh$467$2@news.iastate.edu>

Larry Rosler (lr@hpl.hp.com) wrote:
: In article <m37m264dqk.fsf@windlord.Stanford.EDU>, Russ Allbery 
: <rra@stanford.edu> says...
: > Larry Rosler <lr@hpl.hp.com> writes:
: > > Tom Christiansen <tchrist@mox.perl.com> says...
: > >> In comp.lang.perl.misc, lr@hpl.hp.com (Larry Rosler) writes:
: > 
: > >>> It looks like 'system BLOCK LIST' 
: > 
: > >> As is documented in perlfunc; at least, in my version. :-)
: > 
: > [...]
: > 
: > > I have been trying to cool down for an hour, waiting for someone else to
: > > intervene in this "discussion".  Now, *you* have defined your
: > > participation here as "fun".  It is clear that "fun" for you includes
: > > supercilious sarcastic SADISM.
: > 
: > Um, Larry, it's quite clearly documented in the perlfunc man page in
: > 5.004_04 under exec, and the documentation of system in the same man page
: > clearly states that system functions the same as exec except that it
: > returns to your program, sets $?, etc.
: > 
: > Calm down a little, maybe?

: It has taken me six hours to calm down, about the same time that it took 
: someone *finally* to point to this documentation at the end of 'exec' in 
: perlfunc (and, now that you point to it, under 'exec' in the Blue Camel, 
: p. 164 top).  Note that neither 'system' nor 'exec' has a synopsis '... 
: BLOCK LIST' (compare with grep/map/sort, which I referred to in my 
: original question to Tom C).  So, via one indirection, through an 
: undocumented syntax, to the end of the description of a different 
: function than the one I asked about.

: This is "fun" indeed.

Wow, maybe you should take usenet a little less seriously.



Josh

_________________________________________________________
I do not trust your bitch.
	- Frederich Nietzche, in _Also Sprach Zarathustra_



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

Date: 1 Jul 1998 14:32:32 GMT
From: rjking@blue.seas.upenn.edu (Rachel J King)
Subject: uses of require and use
Message-Id: <6ndha0$d18$1@netnews.upenn.edu>

I've got a quick question (at least I hope it's quick) regarding how and 
when to use require and use.  I've got a piece of code that I want to use 
in lots of scripts so I put it in its own file.  The catch is that I need 
to be able to pass a variable to the code in order for it to function 
properly.  Can I pass a variable with 'require'?  Or, should I be using 
'use' with the code as a subroutine?  Any help would be greatly 
appreciated!  And I apologize if this is a repeated question, I was 
having trouble sorting through all the posts.

Thanks a bunch,
Rachel

--
Rachel Jamie King                  *     University of Pennsylvania
rjking@eniac.seas.upenn.edu        *     Engineering and Applied Science
http://www.seas.upenn.edu/~rjking  *     Computer Science and Engineering


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

Date: 1 Jul 1998 15:28:35 GMT
From: kortbein@iastate.edu (Josh Kortbein)
Subject: Re: Y2K Problem
Message-Id: <6ndkj3$467$1@news.iastate.edu>

Carl Tipton (carltipton@mail.kmsp.com) wrote:
: I have noticed a great number of unqualified opinions and
: recommendations  on the Y2K issue. As an IT professional, I am aware of 
: the effect this issue has on my client.However, there are other issues 
: which I may not have yet encountered that others such as I have been 
: addressing.I am interested in what other professional IT manager's are 
: saying about this issue. Can someone direct me to resources that address 
: this issue from an IT professional's perspective?  With only 554 days 
: remaining, I would like to be tuned in to the various forums and 
: discussion lists which address this issue from the IT manager's 
: perspective.

As an IT professional, shouldn't you be able to hit the "search"
button on your web browser?


Josh

--

_________________________________________________________
I do not trust your bitch.
	- Frederich Nietzche, in _Also Sprach Zarathustra_



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

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


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 3037
**************************************

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