[12598] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 16 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 2 20:57:26 1999

Date: Fri, 2 Jul 1999 17:56:18 -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           Fri, 2 Jul 1999     Volume: 9 Number: 16

Today's topics:
        running perl script gqc2017@is.nyu.edu
    Re: running perl script <cassell@mail.cor.epa.gov>
    Re: running perl script (Benjamin Franz)
    Re: Send HTML command to a browser, easy but problems!! <td90537@hotmail.com>
    Re: Send HTML command to a browser, easy but problems!! mikael_brandt@my-deja.com
        Sending Emails but not using Sendmail etc etc <lgcl01@es.co.nz>
    Re: Sending Emails but not using Sendmail etc etc <gellyfish@gellyfish.com>
        sending mail from perl <td90537@hotmail.com>
    Re: sending mail from perl (Michael Budash)
    Re: sending mail from perl <swiftkid@bigfoot.com>
        Sending mail with MAPI <gj_at_work@my-deja.com>
    Re: Sending mail with MAPI (Greg Bacon)
    Re: Sending mail with MAPI <cassell@mail.cor.epa.gov>
    Re: Sending mail with MAPI <rervadodkarmove@siebel.com>
        simple math problem <adams1015@worldnet.att.net>
    Re: simple math problem (William Herrera)
        Socket w/o Library <alex@exbook.com>
    Re: Socket w/o Library (Alastair)
    Re: sorting info from Hashes (Tad McClellan)
    Re: SQL statement in Perl tonysl@my-deja.com
        SUID perl on RH6 with ps (Danny Aldham)
        switching uids <info@zoomnet.net>
    Re: switching uids (Andrew Allen)
        Sybperl documentation / using stored procedures <mboertien@my-deja.com>
    Re: Sybperl documentation / using stored procedures <mpeppler@peppler.org>
        system call <guapo@postnet.com>
    Re: text editing question???? <mjcarman@zeus.ia.net>
    Re: text editing question???? (M.J.T. Guy)
    Re: Tied hash not scaling - advice? (Benjamin Franz)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Fri, 02 Jul 1999 14:50:59 GMT
From: gqc2017@is.nyu.edu
Subject: running perl script
Message-Id: <7lijke$dld$1@nnrp1.deja.com>

 When I try to run a perl script on Windows NT's iis server, I
encounter
this error message "HTTP/1.1 500 Server Error".  So how do I fix this
problem?



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


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

Date: Fri, 02 Jul 1999 13:45:09 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: running perl script
Message-Id: <377D24D5.7692F577@mail.cor.epa.gov>

gqc2017@is.nyu.edu wrote:
> 
>  When I try to run a perl script on Windows NT's iis server, I
> encounter
> this error message "HTTP/1.1 500 Server Error".  So how do I fix this
> problem?

Actually, you'll probably be doing it outside of Perl.  This
is covered in the FAQ, so all you have to do is look it up,
either by reading through the docs, or by using perldoc.  But let
me help a bit, since this is off-topic for this newsgroup
and you'll want to find out where to go.  Here's an excerpt
from that FAQ answer:

"If you can demonstrate that you've read the following
 FAQs and that your problem isn't something simple that
 can be easily answered, you'll probably receive a
 courteous and useful reply to your question if you post
 it on comp.infosystems.www.authoring.cgi (if it's
 something to do with HTTP, HTML, or the CGI protocols).
 Questions that appear to be Perl questions but are
 really CGI ones that are posted to comp.lang.perl.misc
 may not be so well received."

After that comes a series of URLs to helpful FAQs and
documents.  Good luck.

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


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

Date: Fri, 02 Jul 1999 21:06:55 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: running perl script
Message-Id: <PR9f3.1420$FE6.39633@typhoon-sf.snfc21.pbi.net>

In article <7lijke$dld$1@nnrp1.deja.com>,  <gqc2017@is.nyu.edu> wrote:
> When I try to run a perl script on Windows NT's iis server, I
>encounter this error message "HTTP/1.1 500 Server Error".  So how do I fix this
>problem?

My sympathy level just took a nose dive. This person sent *the exact
same message* in email to me last night, to which I replied a few minutes
later with:

     I would start here:

     http://www.activestate.com/activeperl/docs/perl-win32/perlwin32faq.html

Their response indicated they don't even know where their error log is and
wanted me to help them find it. That was last night. Today they are starting
the cycle over - this time on Usenet.

I'm sorry. But if you can't even _read the documentation_ for your own 
webserver - call Microsoft Technical Support or go *hire* someone who can. 
Neither I nor comp.lang.perl.misc are a free tech support line for Microsoft 
NT or IIS products. 

-- 
Benjamin Franz


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

Date: Fri, 02 Jul 1999 07:43:48 +0200
From: distler <td90537@hotmail.com>
Subject: Re: Send HTML command to a browser, easy but problems!!!
Message-Id: <377C5194.A1556143@hotmail.com>

write this
print '<img src="../images/hello.gif">';

or this
print "<img src=\"../images/hello.gif\">";

it should do your job.

dtillaud@hotmail.com wrote:

> hi,
>
> From my PERL program, I send some HTML to generate a webpage. The
> problem is that, I want to use this symbol: "
> And I have some problems. Indeed, I write in PERL:
> print "<HTML>HI<Body><HI>HELLO</HI></BODY></HTML>";  #No problem
>
> But I'd like add :
>   <img src="../images/hello.gif">
> so:
> print "<img src="../images/hello.gif">";
> It does'nt work because there are some " and even if I
> write "" like in C or pascal, there is a problem.
> HOW CAN I DO, PLEASE????????
>
> David
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.



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

Date: Fri, 02 Jul 1999 05:55:14 GMT
From: mikael_brandt@my-deja.com
Subject: Re: Send HTML command to a browser, easy but problems!!!
Message-Id: <7lhk7v$30c$1@nnrp1.deja.com>

You could allways quote the quotation-marks (") but that gets a bit
unwieldy as in:

   print "<img src=\"../images/hello.gif\">";

Better to use the quoting operator qq{} as in:

  print qq{<img src="../images/hello.gif">};

See the perlop documentation for details!

/MiKe

In article <7lh6if$usa$1@nnrp1.deja.com>,
  dtillaud@hotmail.com wrote:
> hi,
>
> From my PERL program, I send some HTML to generate a webpage. The
> problem is that, I want to use this symbol: "
> And I have some problems. Indeed, I write in PERL:
> print "<HTML>HI<Body><HI>HELLO</HI></BODY></HTML>";  #No problem
>
> But I'd like add :
>   <img src="../images/hello.gif">
> so:
> print "<img src="../images/hello.gif">";
> It does'nt work because there are some " and even if I
> write "" like in C or pascal, there is a problem.
> HOW CAN I DO, PLEASE????????
>
> David
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>


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


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

Date: Fri, 2 Jul 1999 18:24:52 +1200
From: "Christopher Fairbairn" <lgcl01@es.co.nz>
Subject: Sending Emails but not using Sendmail etc etc
Message-Id: <930896658.801447@inv.ihug.co.nz>

Hi,

I have access to a webserver (www.es.co.nz). I can write CGI scripts in PERL
and they work fine. The problem is that sendmail is missconfigured rendering
it usless unless you want to send email to a person on the local server ie
anyone whos email address ends in @es.co.nz

Does anyone have any bright ideas on how I could write a PERL CGI script
which would be able to send emails to anyone email address in the world?

I can't ask the System Admin staff to fix the sendmail configuration as
quite rightly I shouldn't have CGI access but a nice staff member gave it to
me. This webserver isn't being used the company which runs it anymore as
they have a new domain / trading name and they have only kept it to help the
older clients who have their systems configured to use the old servers.

I want to be able to produce a webpage where you enter your email address
and my PERL CGI script emails you a specific document in my webspace - say
for example /www/documents/sample.txt

I have the script written but because sendmail is misconfigured no matter
how you try to send an email using sendmail you get the following style of
error messages (when in verbose mode):

<STUFF CHOPPED>
lgcl01@ihug.co.nz: ihug.co.nz matched by inet_hosts:
    routed lgcl01@ihug.co.nz --> lgcl01@ihug.co.nz at ihug.co.nz
transport smtp uses driver tcpsmtp
transport smtp: connect to host ihug.co.nz [203.29.160.32]/smtp...transport
smtp: connect: Connection refused
write_log:lgcl01@ihug.co.nz ... deferred: (ERR_148) transport smtp: connect:
Connection refused
Exit Code 75

This was what was returned when I tried to send an email to
lgcl01@ihug.co.nz from lgcl01@es.co.nz  Both of these email accounts work
and are owned / accessable by me. I have also tried all the email addresses
of my friends etc etc and anything except @es.co.nz ones fail due to
connection refused errors.

I use smtp.es.co.nz to send emails using Outlook Express or Pine etc etc is
there any way I can use this smtp server to send emails via PERL?

In comp.mail.sendmail a person replied with this

"It would appear that sendmail is using the A record from DNS, rather than
MX records.  Nslookup for ihug.co.nz (MX and A records) shows that the
address your test is using is the A record associated with the IHUG DNS
rather than the address of either of the mail exchangers:"

It seems Sendmail can't be fixed due to my limited access to the server so
how else can I send emails?

Thanks for any ideas,
Christopher Fairbairn.




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

Date: 2 Jul 1999 13:05:34 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Sending Emails but not using Sendmail etc etc
Message-Id: <7lideu$1ac$1@gellyfish.btinternet.com>

On Fri, 2 Jul 1999 18:24:52 +1200 Christopher Fairbairn wrote:
> 
> I use smtp.es.co.nz to send emails using Outlook Express or Pine etc etc is
> there any way I can use this smtp server to send emails via PERL?
> 

You can use the module Net::SMTP or one of the Mail::* modules to talk
directly to this server - Of course you might not be able to use either
of these solutions ...


/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Fri, 02 Jul 1999 08:34:36 +0200
From: distler <td90537@hotmail.com>
Subject: sending mail from perl
Message-Id: <377C5D7B.30A6C393@hotmail.com>

I need to send an email from a perl script (executed via web server)
with a large attachement.
I found several solution for sending emails but as I said I need to send
an attachement (binary file) with it as well. I havent found something
for this yet.

Any help would be appreciated,

regards

Thomas



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

Date: Fri, 02 Jul 1999 01:25:09 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: sending mail from perl
Message-Id: <mbudash-0207990125090001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>

In article <377C5D7B.30A6C393@hotmail.com>, td90537@hotmail.com wrote:

>I need to send an email from a perl script (executed via web server)
>with a large attachement.
>I found several solution for sending emails but as I said I need to send
>an attachement (binary file) with it as well. I havent found something
>for this yet.
>
>Any help would be appreciated,
>
>regards
>
>Thomas

MIME::Lite should do the trick... it'll handle attachments, tho i'm not
sure if it handles binary attachments...

good luck!
-- 
| Michael Budash Consulting     | 707-252-7670 voice |
| Perl, Javascript, PHP, MySQL  | 603-250-8679 fax   |
| Official Extropia Developer   | mbudash@sonic.net  |


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

Date: Fri, 2 Jul 1999 15:28:36 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: sending mail from perl
Message-Id: <7lj7ib$7ek4@news.cyber.net.pk>

> MIME::Lite should do the trick... it'll handle attachments, tho i'm not
> sure if it handles binary attachments...

All kinds of attachments! :)

--
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift  ICQ: 4265451
FAX: (815) 846-2877




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

Date: Fri, 02 Jul 1999 14:23:43 GMT
From: GJ <gj_at_work@my-deja.com>
Subject: Sending mail with MAPI
Message-Id: <7lii10$cto$1@nnrp1.deja.com>

I am trying to use PERL to send out an e-mail, however I am running
Windows NT with Microsoft Exchange and therefore sendmail won't work. Is
there anyway to send e-mail with Exchange from a PERL Script?
Thanks for your help


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


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

Date: 2 Jul 1999 14:54:32 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Sending mail with MAPI
Message-Id: <7lijr8$9f6$7@info2.uah.edu>

In article <7lii10$cto$1@nnrp1.deja.com>,
	GJ <gj_at_work@my-deja.com> writes:
: I am trying to use PERL to send out an e-mail, however I am running
: Windows NT with Microsoft Exchange and therefore sendmail won't work. Is
: there anyway to send e-mail with Exchange from a PERL Script?

Step 1: Install an operating system.
Step 2: Give this command: ln -s sendmail /usr/lib/exchange
Step 3: Open a pipe to /usr/lib/exchange and continue as usual.

Trust me on this one. :-)

Greg
-- 
Norm: I'm in a gambling mood, Sammy. I'll take a glass of whatever comes out
      of that tap. 
Sam:  Oh, looks like beer, Norm. 
Norm: Call me Mister Lucky. 


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

Date: Fri, 02 Jul 1999 11:28:25 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Sending mail with MAPI
Message-Id: <377D04C9.4711E74B@mail.cor.epa.gov>

GJ wrote:
> 
> I am trying to use PERL to send out an e-mail, however I am running
> Windows NT with Microsoft Exchange and therefore sendmail won't work. Is
> there anyway to send e-mail with Exchange from a PERL Script?
> Thanks for your help

You're in luck.  A nearly-complete answer to this is given
in the ActivePerl FAQ right there on your hard disk, where
Perl was installed.  In fact, there should be a shortcut key
on your Start Menu to the HTML version of the ActivePerl FAQ.
In the section "Windows 95/NT" there's the answer to your
very question.

And, there's something left out of that answer.  If you ask on
the perl-win32-users listserv (you can subscribe at
http://www.activestate.com/support/mailing)lists.htm )
they can direct you to the new Win32::MAPI module by Amine.
I haven't seen it in theActiveState package repository or
CPAN yet.

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

I thought their slogan was:
"Share what you don't know is right.  Learn what you don't 
know is wrong."

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


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

Date: Fri, 2 Jul 1999 12:33:20 -0700
From: "Rahul" <rervadodkarmove@siebel.com>
Subject: Re: Sending mail with MAPI
Message-Id: <377d144d$0$203@nntp1.ba.best.com>

Did you try blat.exe ? I am not sure if it works with Exchange Server.

GJ <gj_at_work@my-deja.com> wrote in message
news:7lii10$cto$1@nnrp1.deja.com...
> I am trying to use PERL to send out an e-mail, however I am running
> Windows NT with Microsoft Exchange and therefore sendmail won't work. Is
> there anyway to send e-mail with Exchange from a PERL Script?
> Thanks for your help
>
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.




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

Date: Fri, 2 Jul 1999 15:53:06 -0700
From: "Jeremiah and Veronica Adams" <adams1015@worldnet.att.net>
Subject: simple math problem
Message-Id: <7lj8qq$7q9$1@bgtnsc03.worldnet.att.net>

Can you tell me WHY this dosen't work?
require "cgi-lib.pl";
&ReadParse;

$total=$in{'textfield2'}*$in{'textfield3};
print &PrintHeader;

print<<HTML;
<HTML><HEAD><TITLE><title>So Many Collectibles and Gifts</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
PRINT "$total";


This doesnt work either:
require "cgi-lib.pl";
&ReadParse;
$adjective1=$in{'image1'};
$adjective2=$in{'textfield'};
$adjective3=$in{'textfield2'};
$adjective4=$in{'textfield3'};
$adjective5=$in{'textfield4'};
$total=$adjective2*$adjective3;
print &PrintHeader;

print<<HTML;
<HTML><HEAD><TITLE><title>So Many Collectibles and Gifts</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
PRINT "$total";

The first example won't complile. The second example gives 0 as an outpu no
matter what the variables values are. I've been reading through the news and
I see that I should be using CGI.pl instead of cgi-lib.pl but it is not my
server and I dont have permision to instal cgi.pl.
Thanks




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

Date: Fri, 02 Jul 1999 23:01:23 GMT
From: posting.account@lynxview.com (William Herrera)
Subject: Re: simple math problem
Message-Id: <377d4406.116980691@news.rmi.net>

On Fri, 2 Jul 1999 15:53:06 -0700, "Jeremiah and Veronica Adams"
<adams1015@worldnet.att.net> wrote:

>matter what the variables values are. I've been reading through the news and
>I see that I should be using CGI.pl instead of cgi-lib.pl but it is not my
>server and I dont have permision to instal cgi.pl.

Somebody else here will likely fix your cgi-lib dependent stuff.

However, I suggest that you install the CGI.pm module (look for it on
CPAN etc) in the same directory as your own script and use it. It is
much nicer.


---
The above from: address is spamblocked. Use wherrera (at) lynxview (dot) com for the reply address.


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

Date: 2 Jul 1999 22:55:23 GMT
From: "Alex" <alex@exbook.com>
Subject: Socket w/o Library
Message-Id: <01bec4dd$ef8945c0$258eb987@il0015jtampc>

Hi Everyone,

I have a program that running well in UNIX, I use 
the socket in my program, now, I want to port it to my
Windows NT IIS website (A virtual hosting website.),
The website only privide the perl compiler, but without 
the perl library. So which library file I need to place in
my cgi-bin directory in order to make the socket function
working OK?

How to use the 'push' and 'use' command in this case?

I appreciate your help!

Thank you,
Alex


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

Date: Sat, 03 Jul 1999 00:20:28 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Socket w/o Library
Message-Id: <slrn7nqpfc.c5.alastair@calliope.demon.co.uk>

Alex <alex@exbook.com> wrote:
>How to use the 'push' and 'use' command in this case?

Isn't that a frequently asked question?

perlfaq8 : How do I keep my own module/library directory?


-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Thu, 1 Jul 1999 17:15:41 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: sorting info from Hashes
Message-Id: <tplgl7.c44.ln@magna.metronet.com>

Michboy832 (michboy832@aol.com) wrote:
: Ok, I want to print data from a hash into an email, but when I do this, the
: info comes up randomly on the email.  How would I manipulate this into the
: order I want?


   By reading the FAQ like every well-mannered person would have done.


   Perl FAQ, part 4:

      "How do I sort a hash (optionally by value instead of key)?"


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


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

Date: Fri, 02 Jul 1999 19:21:35 GMT
From: tonysl@my-deja.com
Subject: Re: SQL statement in Perl
Message-Id: <7lj3fl$kbh$1@nnrp1.deja.com>

I don't think Perl can send SQL to anywhere without a proper database
driver installed (such as DBI).  After, say DBI, is installed, you can
use commands like 'connect' and 'execute' to connect to a database and
execute SQL statements.  Hope this helps.

TONY


In article <7k87td$joa$1@nnrp1.deja.com>,
  paulm@dirigo.com wrote:
> Not sure what your talking about, but a Perl script will run SQL if
> writen correctly!
>
> I've used 1000 different SQL strings to try and get this working and
> none has worked.  I've tried brackets, quotes, I've even looked at how
> my queries are formatted in Access 97 and used the EXACT same string,
> but it still will not work.
>
> Paul
>
> In article <brian-ya02408000R1506991654440001@news.panix.com>,
>   brian@pm.org (brian d foy) wrote:
> > In article <7k669f$ts0$1@nnrp1.deja.com>, paulm@dirigo.com posted:
> >
> > > Does anyone have any familiarity with writing SQL statements in
> Perl?
> >
> > Perl doesn't know anything about SQL.  data are data.  make sure
that
> > you are constructing the proper strings to send to the database
> server.
> > that only requires you to know SQL, and not Perl ;)
> >
> > good luck :)
> >
> > --
> > brian d foy
> > CGI Meta FAQ
<URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
> > Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
> >
>
> --
> Paul R. Mesker
> System Engineer
> Dirigo Inc.
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>


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


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

Date: 2 Jul 1999 05:19:30 GMT
From: danny@lennon.postino.com (Danny Aldham)
Subject: SUID perl on RH6 with ps
Message-Id: <7lhi52$nje$1@lennon.postino.com>

X-Newsreader: TIN [version 1.2 PL2]

I have a perl script below I want to run suid root to kill & restart named.
I am getting an error that this ps is not safe..., as below. I am trying to
avoid creating a C wrapper. Any thoughts or work-arounds appreciated.

#!/usr/bin/perl -w
delete @ENV{'IFS','ENV','BASH_ENV'} ;
$ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin' ;
$named = `/bin/ps ax | /bin/grep named` ;
@PID = split(/[ \t\n]+/,$named) ;  
print "Killing process : " ,  $PID[1] ;
$return1 = `/bin/kill -9 $PID[1]` ;    #Kill named
$return2 = system("/usr/sbin/named") ; #Restart named
--OUTPUT Below--
This /bin/ps is not secure for setuid operation.Use of uninitialized value at ./kill_named.pl line 6.
Use of uninitialized value at ./kill_named.pl line 7.
usage: kill [ -s signal | -p ] [ -a ] pid ...
       kill -l [ signal ]
--
Danny Aldham     Providing Certified Internetworking Solutions to Business
ww.postino.com  E-Mail, Web Servers, Mail Lists, Web Databases, SQL & Perl


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

Date: Fri, 2 Jul 1999 13:00:37 -0400
From: "Info" <info@zoomnet.net>
Subject: switching uids
Message-Id: <930934851.013.102@news.remarQ.com>

i was wondering if there is a way for my script to run as a certain uid go
thru a loop and then switch to another uid and so on ?? any help would
greatly be appreciated




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

Date: 2 Jul 1999 21:17:36 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: switching uids
Message-Id: <7lja9g$fka$3@fcnews.fc.hp.com>

Info (info@zoomnet.net) wrote:
: i was wondering if there is a way for my script to run as a certain uid go
: thru a loop and then switch to another uid and so on ?? any help would
: greatly be appreciated

sure, look at $< and $> in perlvar. Also, the setuid(2) and
setresuid(2) man pages are helpful. Also, you may need to set $<
and/or $> within a forked subprocess if you can be "stranded" as an
underpriveleged uid.

Andrew




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

Date: Fri, 02 Jul 1999 07:57:42 GMT
From: Nostradamus <mboertien@my-deja.com>
Subject: Sybperl documentation / using stored procedures
Message-Id: <7lhrdi$601$1@nnrp1.deja.com>

I've been searching the net for some info on Sybperl in general and
about using/calling stored procedures.....i didn't find much
information on these subjects....can anyone point me to some
interesting sites?

Thanks in advance

PS. I've already seen the Sybperl pages by M.Peppler......


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


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

Date: Fri, 02 Jul 1999 08:04:24 -0700
From: Michael Peppler <mpeppler@peppler.org>
Subject: Re: Sybperl documentation / using stored procedures
Message-Id: <377CD4F8.D27B5A5@peppler.org>

Nostradamus wrote:
> 
> I've been searching the net for some info on Sybperl in general and
> about using/calling stored procedures.....i didn't find much
> information on these subjects....can anyone point me to some
> interesting sites?

You probably need to read up on calling stored procs via OpenCLient in
the Sybase manuals (available at http://sybooks.sybase.com)

Sybperl is a thin layer between Sybase OPenCLient (either DBlibrary or
Client Library),  so nearly everything that is documented in the Sybase
manuals works the same way for sybperl.

In short however:

You can execute a stored proc just like any other SQL call. If the
proc returns OUTPUT parameters then it gets just a little more tricky, as you
need to declare the Sybase T-SQL variables before calling the procs, or
use the RPC calls (dbrpc*() or ct_command()/ct_param()). Something like:

$sql = "
declare \@return_val int
exec my_proc \@return_val OUTPUT
";
$dbh->ct_execute($sql);
while($dbh->ct_results($restype) == CS_SUCCEED) {
    next unless $dbh->ct_fetchable($restype);
    if($restype == CS_PARAM_RESULT) {   # It's the OUTPUT param....
       while(@d = $dbh->ct_fetch) {
            $return_val = $d[0];
       }
    } else {
       # It's something else...
       while(@d = $dbh->ct_fetch) {
           ... # do something here!
       }
    }
}

There are examples for the rpc calls in the eg/ directory of the sybperl
distribution.

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@peppler.org    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com


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

Date: Fri, 2 Jul 1999 16:17:26 -0500
From: "Gary Yerby" <guapo@postnet.com>
Subject: system call
Message-Id: <Yhaf3.132$bS1.547647@typhoon.stlnet.com>

I am looking for the commant to type in to log the user out of their session
in perl.
would it be system("exit");  ?? if not what would it be?




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

Date: Fri, 02 Jul 1999 19:32:55 -0500
From: Michael Carman <mjcarman@zeus.ia.net>
Subject: Re: text editing question????
Message-Id: <377D5A37.B7C5FE65@zeus.ia.net>

Isn't assigning to $_ deprecated? Anyway, your problem is that you have
embedded quotes within your string. What do you think
    print "He said, "Hello!" as he walked by.";
will actually do? Nothing good, I assure you. You need to either escape out
the embedded quotes (via \") or, since this is a rather long string, use a
here document.

$foo = << "EOT";
Your text
goes here.
EOT


> Perl does not like the line formating I have ... Is there something
> special I am supposed to do to make this work?
>
> #!usr/bin/perl -w
>
> $^I = '.old';
>
> $iterate=0;
>
> while (<>)  {
>   if (m/<BR>/s) {
>         if ($iterate)  {
>                 $_="<sidebar width=138 align=left>
> <table cellpadding=0 cellspacing=0 border=0>
> <tr><TD  colspan=1  ALIGN=CENTER valign=top bgcolor=#000000><br><a
> href="http://www.hp.com/go/webtvprint"><img HSPACE=0 VSPACE=0 border=0
> src="../pix2/hplogob.gif"></a></td>
> <td  bgcolor="#000000" width=10><font
> size="-2">&nbsp;&nbsp;</font></td></tr>
> <tr  colspan=1><TD ALIGN=CENTER  bgcolor=#000000>
> <img src=../pix/15h15w.gif><br>
> <a href="howdoi.html"><img border=0 src=../pix/how_ani.gif><br><img
> vspace=7 border=0 src=../pix/chowdoi.gif></a><br><img
> src=../pix/15h15w.gif><br>
> <a href="problems.html"><img border=0 src=../pix/prob_ani.gif><br><img
> vspace=7 border=0 src=../pix/cproblem.gif></a>
> <BR clear="all"><a
> href="http://proact.hp.com:5050/escforum/internet.html">
> <img border=0 src="../pix/cupani.gif"><BR><img border=0
> src="../pix/saucer.gif"><br><img border=0 src=../pix/qa.gif></a>
> <br>&nbsp;<br>&nbsp;
> </td><TD bgcolor=#000000>&nbsp;&nbsp;</td>
> </TR></TABLE>
> </sidebar><ul>
> <br>";
>                 $iterate++;
>         }
>   }
>   print;
> }



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

Date: 3 Jul 1999 00:36:37 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: text editing question????
Message-Id: <7ljlul$fd0$1@pegasus.csx.cam.ac.uk>

Michael Carman  <mjcarman@zeus.ia.net> wrote:
>Isn't assigning to $_ deprecated?

Eh?     Are you talking about Perl?


Mike Guy


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

Date: Fri, 02 Jul 1999 06:16:26 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: Tied hash not scaling - advice?
Message-Id: <_OYe3.731$_A1.99064@typhoon-sf.snfc21.pbi.net>

In article <377adb2b.36771871@news.rmi.net>,
William Herrera <posting.account@lynxview.com> wrote:
>On Wed, 30 Jun 1999 04:54:32 GMT, snowhare@long-lake.nihongo.org
>(Benjamin Franz) wrote:
>
>>The best fix is to get Berkeley DB 2.x installed. 
>
>Is this something that CPAN.pm can do? If so, which CPAN module
>installs DB_File with db 2.0 ?

No. When you install Perl, it automatically build DB_File against 
the installed DBs. To get BDB 2.x, you need to go to 
<URL:http://www.sleepycat.com/> and get the latest from there. 

*Then* re-install DB_File from CPAN (or if you aren't using the 
latest stable Perl of 5.005_03, upgrade your Perl - it will link 
against your newly installed BDB 2.x during install).

One note - BDB2.x is *not* compatible with BDB1.x by default.
Pay attention to the options for 185 compatibility if you have
old Berkely DBs you want to keep the data from.

-- 
Benjamin Franz


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

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


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