[22279] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4500 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Feb 1 21:06:37 2003

Date: Sat, 1 Feb 2003 18:05:06 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 1 Feb 2003     Volume: 10 Number: 4500

Today's topics:
    Re: Finding out whether program is running. (Brian Salter-Duke)
        Free CGI webhosts (Mark007)
    Re: Free CGI webhosts <jeff@vpservices.com>
        Hashes (Mark007)
    Re: Hashes <jurgenex@hotmail.com>
    Re: Hashes (Mark007)
        Having problems installing Windows NT Server 4.0 (Lamonaco)
    Re: Having problems installing Windows NT Server 4.0 <jurgenex@hotmail.com>
        How to echo verbatim lines to output <fma@doe.carleton.ca>
    Re: How to echo verbatim lines to output <tassilo.parseval@post.rwth-aachen.de>
    Re: How to echo verbatim lines to output (h\)
    Re: How to echo verbatim lines to output <fma@doe.carleton.ca>
        Newbie question about getstore <dlaw001@yahoo.co.uk>
    Re: no -e allowed in setuid scripts? (Anno Siegel)
    Re: Parse a logfile - 1st column DateStamp; extract lat (Tim Cargile)
    Re: Parse a logfile - 1st column DateStamp; extract lat <mjcohen@attbi.com>
    Re: Parse a logfile - 1st column DateStamp; extract lat <yliu@stemnet.nf.ca.remove_this>
        Perl and ActiveDirectory Question <jdavis_5@zoomtown.com>
    Re: Perl and ActiveDirectory Question (Tad McClellan)
    Re: Perl and ActiveDirectory Question <jdavis_5@zoomtown.com>
    Re: Perl and ActiveDirectory Question <ajglist@izzy.net>
    Re: Perl DBI and Mysql LAST_INSERT_ID() Problem <spamfilter@cheiron-it.nl>
        perl smpp multitask <andrew.rich@bigpond.com>
    Re: perl smpp multitask <tony_curtis32@yahoo.com>
    Re: printf %*v02x - something happened to 5.8 <rgarciasuarez@free.fr>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 02 Feb 2003 01:38:45 GMT
From: b_duke@octa4.net.invalid (Brian Salter-Duke)
Subject: Re: Finding out whether program is running.
Message-Id: <FE__9.1588$YU1.38741@news.optus.net.au>

On 1 Feb 2003 15:41:30 GMT, Walter Roberson <roberson@ibd.nrc-cnrc.gc.ca> wrote:
> In article <6sM_9.1586$YU1.37055@news.optus.net.au>,
> Brian Salter-Duke <b_duke@octa4.net.invalid> wrote:
>:I have this problem. From within a perl script I need to know whether a
>:particular program is actually running. The program was not started from
>:the perl script. I have tried using system to run ps with various
>:options and this sort-of works. Is there a better way?
> 
> You mention 'ps': are we to assume that you are willing to restrict
> the code to Unix? 

Yes, this is a unix application only.

> To a particular major stream of Unix (e.g.,
> BSD or SVSV)? To a particular operating system? To a particular
> version of a particular operating system?

No, I want it as general as possible. 

> Does the code need to be prepared for the possibility that someone
> else might have started a program with the same name? 

The daemon has to be owned by the same user as the perl script that is
testing for it, so I am using "ps -u $user" at present. I now have in
mind a function that tries various forms of ps and answers true if it
finds the name of the daemon anywhere in the ps output and the user.

Another possibility is for the ps command to be configurable so it can
vary on different systems.

However, a non-ps solution would be better.

> The first
> element that shows up in the process table is usually only the last
> component of the path (and it isn't even certain to be that),
> and it would certainly be easy enough for someone to create a
> a completely different path to someone that happened to have that
> same name.

I pipe the ps output to grep the daemon name and create a file. If the
file is empty it has not found it. It does'nt matter where in the ps
output the daemon name is.

Someone else asked about using a pid file for the daemon. I am starting
the daemon but it sometimes dies without deleting the pid file, so that
test is not good enough.

Thanks to all for the suggestions.

Brian.

-- 
Brian Salter-Duke          Humpty Doo, Nr Darwin, Australia
     My real address is b_duke(AT)octa4(DOT)net(DOT)au
               Use this for reply or followup


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

Date: Sat, 1 Feb 2003 20:29:40 -0500 (EST)
From: sisley3@webtv.net (Mark007)
Subject: Free CGI webhosts
Message-Id: <17285-3E3C7484-153@storefull-2173.public.lawson.webtv.net>

I'm about to shoot myself for lack of finding a cheap cgi webhost!!!
Most aren't webtv compatable, and others aren't navigable...AY! I've
tried netfirms and for some reason the files appear to be there when I
view them in ftp, but when I try to access them from http:// they
seemingly vanish. portland didn't work either! Any suggestions? I'm
about to gve up on cgi. I dont want to pay for one because I'm just
trying to learn now. I don't want anyone to see content I create yet.

Mark



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

Date: Sat, 01 Feb 2003 17:52:02 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Free CGI webhosts
Message-Id: <3E3C79C2.2010208@vpservices.com>

Mark007 wrote:

> I'm about to shoot myself for lack of finding a cheap cgi webhost!!!


Which has nothing to do with perl so this is the wrong place to ask 
about it, but see my answers below.


> Most aren't webtv compatable


A webhost has nothing to do with compatibility for a given browsing 
environment like webtv, it's up to you as the designer of pages to take 
care of that.

> I'm
> about to gve up on cgi. I dont want to pay for one because I'm just
> trying to learn now. I don't want anyone to see content I create yet.


Then the simplest thing to do is to install one of the many free and 
easy to install webservers on your home computer and test there.  If you 
are working with perl try indigoperl which comes with a webserver you 
can use at home.

-- 
Jeff



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

Date: Sat, 1 Feb 2003 17:44:29 -0500 (EST)
From: sisley3@webtv.net (Mark007)
Subject: Hashes
Message-Id: <23781-3E3C4DCD-276@storefull-2175.public.lawson.webtv.net>

Ok, I'm sorry to be such a newbie, but could someone please explain to
me the value of hashes? I don't quite understand them yet, and any help
would be appreciated..

Please mail your reply to me if possible sisley3@webtv.net



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

Date: Sun, 02 Feb 2003 01:07:41 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Hashes
Message-Id: <xb__9.10356$dC3.7598@nwrddc02.gnilink.net>

Mark007 wrote:
> Ok, I'm sorry to be such a newbie, but could someone please explain to
> me the value of hashes? I don't quite understand them yet, and any
> help would be appreciated..

You can think of hashes as general mappings or if you prefer as generalized
arrays.

Arrays are mappings from a continuous subset of the natural numbers to
arbitrary scalars.
Hashes are not limited to continuous natural numbers in the domain but you
can use arbitrary values as the index, including non-continuous number and
any text.

Also, hashes are optimized for fast access, typically in O(1), i.e. in
constant time.

> Please mail your reply to me if possible sisley3@webtv.net

Why do you want to keep replies a secret?

jue




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

Date: Sat, 1 Feb 2003 20:26:22 -0500 (EST)
From: sisley3@webtv.net (Mark007)
Subject: Re: Hashes
Message-Id: <17283-3E3C73BE-338@storefull-2173.public.lawson.webtv.net>

Not that I want to keep it a secret, Its just that I don't check usenet
much and webtv deletes posts in usenet every 14 days...just wanted to be
sure to see the response...thanks.

Mark



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

Date: 1 Feb 2003 13:57:17 -0800
From: Lamonaco@netzero.com (Lamonaco)
Subject: Having problems installing Windows NT Server 4.0
Message-Id: <b94e846e.0302011357.571607fb@posting.google.com>

I am having big problems trying to install Window NT. If you can could
you provide any information that would help my situation. Thank you
I am trying to install window NT 4.00 However, I am continually having
the same problem. When the setup stage is on the last part, I am
getting this error "setup is unable to locate the hard drive partition
prepared by the MS-Dos portion of setup. When you run the MS-Dos
window NT setup program you must specify a temporary drive that is
support by Window NT. See your system Guide for more information." I
am unable to get pass this error. If anyone has suggestion e-mails me
at Lamonaco@netzero.com Thank you";


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

Date: Sun, 02 Feb 2003 01:08:32 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Having problems installing Windows NT Server 4.0
Message-Id: <kc__9.10357$dC3.3840@nwrddc02.gnilink.net>

Lamonaco wrote:
> I am having big problems trying to install Window NT. If you can could

And the relevance to Perl is exactly .....?

jue




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

Date: Sat, 01 Feb 2003 15:05:54 -0500
From: fred <fma@doe.carleton.ca>
Subject: How to echo verbatim lines to output
Message-Id: <3E3C28A2.7080709@doe.carleton.ca>

Hello,

Hopefully, I've done enough of my own research
that I'm not repeating a well known thing.
I've searched for "verbatim" in the faq, perldoc,
and google groups *.perl.*.

Is there a way to echo a few lines from a
perl script file to an output?  For example,
in csh, you can do this

	cat << NoMoreStuff
	some text
	some more text
	still more text
	NoMoreStuff

Everything is echoed to the stdout except
the first and last lines.

For Perl, the only verbatim hits seem to
relate to preparing online documentation
for Perl.

Thanks for any suggestions.

Fred



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

Date: 1 Feb 2003 21:10:24 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de>
Subject: Re: How to echo verbatim lines to output
Message-Id: <b1hd40$sks$1@nets3.rz.RWTH-Aachen.DE>

Also sprach fred:

> Hopefully, I've done enough of my own research
> that I'm not repeating a well known thing.
> I've searched for "verbatim" in the faq, perldoc,
> and google groups *.perl.*.
> 
> Is there a way to echo a few lines from a
> perl script file to an output?  For example,
> in csh, you can do this
> 
> 	cat << NoMoreStuff
> 	some text
> 	some more text
> 	still more text
> 	NoMoreStuff
> 
> Everything is echoed to the stdout except
> the first and last lines.

Very similar in Perl. The construct you are looking for is called a
here-document (see perldata.pod):

    print <<EOT;
    some text
        some more text indended
    interpolating $var
    ...
    EOT

Sometimes they are prone to go wrong so there's a FAQ for them:

    perldoc -q '<<HERE'
    
Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: Sat, 1 Feb 2003 22:17:35 +0100
From: "Michael Peuser \(h\)" <post@mpeuser.de>
Subject: Re: How to echo verbatim lines to output
Message-Id: <b1hdfh$42j$03$1@news.t-online.com>


"fred" <fma@doe.carleton.ca> schrieb im Newsbeitrag
news:3E3C28A2.7080709@doe.carleton.ca...
> Hello,
>
> Hopefully, I've done enough of my own research
> that I'm not repeating a well known thing.
> I've searched for "verbatim" in the faq, perldoc,
> and google groups *.perl.*.
>
> Is there a way to echo a few lines from a
> perl script file to an output?  For example,
> in csh, you can do this
>
> cat << NoMoreStuff
> some text
> some more text
> still more text
> NoMoreStuff
>
> Everything is echoed to the stdout except
> the first and last lines.
>
> For Perl, the only verbatim hits seem to
> relate to preparing online documentation
> for Perl.

You should look for 'here document'

Kindly Mike








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

Date: 1 Feb 2003 23:23:04 GMT
From: Shing-Fat Fred Ma <fma@doe.carleton.ca>
Subject: Re: How to echo verbatim lines to output
Message-Id: <3E3C56D2.90670982@doe.carleton.ca>

fred wrote:

> Is there a way to echo a few lines from a
> perl script file to an output?

Thanks for the pointers to here-document.

I remember reading about this in a Perl
document which I can't seem to find on
the web anymore.  If anyone remembers
this, could you please forward the link?

The document is written by a university
prof, I believe in the U.S.  There were
several parts to this Perl tutorial (3 to 5
parts).  The prof had an asian sounding
name.  And his personal web-page had
alot of information on good noodle houses
in his neighbourhood, including ratings.
This sounds off-track, but it might help
to identify the author.

Why go on about that particular document?
It just seemed very well aimed at an
audience that wants
a guided tour, with a good balance between
detail and overview.  If I had that document,
I probably could have avoided the above
post, because I'd know what I was looking
for.

At the time, I don't think the document was
hyperlinked HTML, it was on letter-sized
pages (PDF or PS).  But it might be because
I printed it from netscape on letter paper.
One of the memorable
disclaimers at the beginning was something
to the effect that if the reader did something
stupid with the information, he didn't want to
hear about it -- except if it was entertaining.

Stupid me.  I thought it would be easy to
find again, if needed (that was about a
year ago).

Fred

--
Fred Ma, fma@doe.carleton.ca
Carleton University, Dept. of Electronics
1125 Colonel By Drive, Ottawa, Ontario
Canada, K1S 5B6





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

Date: Sun, 2 Feb 2003 01:40:27 -0000
From: "Tubs" <dlaw001@yahoo.co.uk>
Subject: Newbie question about getstore
Message-Id: <dS__9.181$RM1.125986@newsfep2-win.server.ntli.net>

Hi

I'm trying to grab some files from the internet on a regular basis, now I've
been doing
some reading and come across the getstore command....

I've installed the relevant packages on my freebsd box and can type

 perl -e' use LWP::UserAgent;' and perl -e' use LWP::Simple;' without
generating
 a whole lot of error messages...

Now my test script is the following

#!/usr/bin/perl

use LWP::Simple;
getstore("http://www.cygwin.com","tmp.html");

Now after running the script (the system reports no errors), but it doesn't
seem to have
created the the file tmp.html. Now am I not doing something or is there
something else
is going a bit a skew. Or alternatively is this the correct perl function I
should be using ?
Any pointers or suggestions greatly appreciated

Thanks
Tubs

----
In total chaos there is random structured order, the trick is to identify
which is which.





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

Date: 1 Feb 2003 20:28:50 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: no -e allowed in setuid scripts?
Message-Id: <b1ham2$7af$1@mamenchi.zrz.TU-Berlin.DE>

John Wiersba <jrw32982@yahoo.com> wrote in comp.lang.perl.misc:
> I'm curious:  what is the insecure scenario which the above error
> message is trying to protect against?
>
> 1) If the perl binary itself is setuid, then that seems at least as
> insecure as having it read a script from the command line.  If the
> perl binary is not setuid, then either 2) a setuid script file with
> #!...perl is being executed, in which case -e is not being used, or 3)
> perl is being called by another program which is setuid, in which case
> why not let that program call perl -e as it wants to?
> 
> I guess I must be missing something but, in any case, it sure is
> inconvenient.  My case falls into #3 above -- a setuid program wants
> to make use of perl's services via -e without creating a separate file
> to hold the one line script.  But the error message forces a separate
> script file with no apparent increase in security.
> 
> Can anyone explain?

There isn't much to explain.  Taint mode isn't terribly intelligent
and works on a rather-safe-than-sorry basis.  In this case, whatever
comes in via "-e" is considered tainted, and Perl will not eval() it.

If your system, and the language your setuid program is written in
permit it, you can remove the safety net by setting the real userid
to the one you're running under (setuid( geteuid()) in C).  Then
Perl will run without taint mode.

Anno


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

Date: 1 Feb 2003 18:00:52 -0800
From: tecargile@hotmail.com (Tim Cargile)
Subject: Re: Parse a logfile - 1st column DateStamp; extract latest mods to an ItemNumber
Message-Id: <8b67aef5.0302011800.eebb455@posting.google.com>

Martin Cohen <mjcohen@attbi.com> wrote in message news:<SkV_9.118498$Ve4.8044@sccrnsc03>...
> shree wrote:
> > Dear Unix scripting experts,
> > 
> > I have a pipe separated log file of over 100,000 lines - a small
> > section of it is shown below. Its made up of
>
> > 
> > Thanks in advance.
> > 
> > Shree
> I would do something like this:
>
> In a csh script:
>

What, this can't be run from within
any OTHER flavor of shell executable!?
 
> awk -f extr.awk datafile
> 
> In extr.awk:
> 
> BEGIN{FS="|"}
> {if(a[$2]<$1){a[$2]=$1;b[$2]=$0}
> END{for(i in b)print b[i]}
> 
> In this code, the array a keeps the greatest time for each ItemNumber,
> and the array b keeps the whole line for that entry.
> 

A caveat:

This is succinct and works for a small number of records,
but I would hesitate to recommend it with 100K lines of input
without knowing the number of unique item numbers in
advance.  It's probably OK, of course, but couldn't it fail
with a large number of unique item numbers?

> Martin Cohen

Tim


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

Date: Sat, 01 Feb 2003 19:36:18 GMT
From: Martin Cohen <mjcohen@attbi.com>
Subject: Re: Parse a logfile - 1st column DateStamp; extract latest mods to an ItemNumber
Message-Id: <SkV_9.118498$Ve4.8044@sccrnsc03>

shree wrote:
> Dear Unix scripting experts,
> 
> I have a pipe separated log file of over 100,000 lines - a small
> section of it is shown below. Its made up of
> 
> TimeStamp in YYYYMMDDHHMMSS
> format|ItemNumber|Attribute1|Attribute2|Attribute3
> 
> Sample Input File
> 20020731114502|0144058Y01|CHRM|LHSG|MISC
> 20030109174500|0144058Y01|PLAS|RHSG|MISC
> 20021210114501|0144058Y01|PLAS|RHSG|MISC
> 20021212114500|0164058E01|PLAS|RHSG|MISC
> 20020731114502|0170273A03|PLAS|MISC|MISC
> 20020731114502|0170273P03|SILV|MISC|MISC
> 20030118194502|0170273P03|PLAT|MISC|MISC
> 20020731114502|0185228C19|PLAS|MISC|MISC
> 20020924114501|0185228C19|ASSY|SUB|MISC
> 
> You will notice that some of the ItemNumbers were modified on
> different dates over time. I need to find a way to extract the latest
> modified line of each ItemNumber. For any given ItemNumber, all date
> stamps corresponding to it are unique and the log file itself isn't in
> any sorted order. Hence, once the file is processed, in the output
> there should be only 1 line per item number and can look like.
> 
> Desired Output
> 20030109174500|0144058Y01|PLAS|RHSG|MISC
> 20021212114500|0164058E01|PLAS|RHSG|MISC
> 20020731114502|0170273A03|PLAS|MISC|MISC
> 20030118194502|0170273P03|PLAT|MISC|MISC
> 20020924114501|0185228C19|ASSY|SUB|MISC
> 
> Can anyone suggest a snippett, I can apply? My environment is Unix Sun
> OS 5.6. As such I have access to binaries that come preinstalled on
> unix boxes including awk, sed and perl.
> 
> Thanks in advance.
> 
> Shree
I would do something like this:

In a csh script:

awk -f extr.awk datafile

In extr.awk:

BEGIN{FS="|"}
{if(a[$2]<$1){a[$2]=$1;b[$2]=$0}
END{for(i in b)print b[i]}

In this code, the array a keeps the greatest time for each ItemNumber,
and the array b keeps the whole line for that entry.

Martin Cohen



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

Date: Sun, 02 Feb 2003 01:44:58 GMT
From: "Dr. Yuan Liu" <yliu@stemnet.nf.ca.remove_this>
Subject: Re: Parse a logfile - 1st column DateStamp; extract latest mods to an ItemNumber
Message-Id: <3E3C7A1C.8090809@stemnet.nf.ca.remove_this>

shree wrote:
> Dear Unix scripting experts,
> 
> I have a pipe separated log file of over 100,000 lines - a small
> section of it is shown below. Its made up of
> 
> TimeStamp in YYYYMMDDHHMMSS
> format|ItemNumber|Attribute1|Attribute2|Attribute3
> 
> Sample Input File
> 20020731114502|0144058Y01|CHRM|LHSG|MISC
> 20030109174500|0144058Y01|PLAS|RHSG|MISC
> 20021210114501|0144058Y01|PLAS|RHSG|MISC
> 20021212114500|0164058E01|PLAS|RHSG|MISC
> 20020731114502|0170273A03|PLAS|MISC|MISC
> 20020731114502|0170273P03|SILV|MISC|MISC
> 20030118194502|0170273P03|PLAT|MISC|MISC
> 20020731114502|0185228C19|PLAS|MISC|MISC
> 20020924114501|0185228C19|ASSY|SUB|MISC
> 
> You will notice that some of the ItemNumbers were modified on
> different dates over time. I need to find a way to extract the latest
> modified line of each ItemNumber. For any given ItemNumber, all date
> stamps corresponding to it are unique and the log file itself isn't in
> any sorted order. Hence, once the file is processed, in the output
> there should be only 1 line per item number and can look like.
> 
> Desired Output
> 20030109174500|0144058Y01|PLAS|RHSG|MISC
> 20021212114500|0164058E01|PLAS|RHSG|MISC
> 20020731114502|0170273A03|PLAS|MISC|MISC
> 20030118194502|0170273P03|PLAT|MISC|MISC
> 20020924114501|0185228C19|ASSY|SUB|MISC
> 
> Can anyone suggest a snippett, I can apply? My environment is Unix Sun
> OS 5.6. As such I have access to binaries that come preinstalled on
> unix boxes including awk, sed and perl.

To make the point that data are not sorted any order, here's a modified 
data file:
$ cat <<EOD > logparse.data
20020731114502|0170273A03|PLAS|MISC|MISC
20020924114501|0185228C19|ASSY|SUB|MISC
20021212114500|0164058E01|PLAS|RHSG|MISC
20020731114502|0144058Y01|CHRM|LHSG|MISC
20020731114502|0170273P03|SILV|MISC|MISC
20021210114501|0144058Y01|PLAS|RHSG|MISC
20020731114502|0185228C19|PLAS|MISC|MISC
20030118194502|0170273P03|PLAT|MISC|MISC
20030109174500|0144058Y01|PLAS|RHSG|MISC
EOD

Using sort and sed:
$ cat <<EOF >logparse.sed
# assumptions about date using only digits, etc. are made
:b
N
s/\([0-9]*|\)\([^|]*\)\(|[A-Z|]*\)\n[0-9]*|\2[A-Z|]*/\1\2\3/
bb
EOF
$ sort -t\| -rk2,2  logparse.data |sed -f logparse.sed
20020924114501|0185228C19|ASSY|SUB|MISC
20030118194502|0170273P03|PLAT|MISC|MISC
20020731114502|0170273A03|PLAS|MISC|MISC
20021212114500|0164058E01|PLAS|RHSG|MISC
20030109174500|0144058Y01|PLAS|RHSG|MISC

Using sort and shell builtin:
$ IFS=\|;sort -t\| -rk2,2  logparse.data |while read date item 
attributes;do [ "$first" = $item ] || { echo "$date|$item|$attributes"; 
first=$item;}; done;unset IFS

In this case, sort can also be done with shell builtin, but would be 
rather messy.

Yuan Liu

> Thanks in advance.
> 
> Shree




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

Date: Sat, 1 Feb 2003 14:45:11 -0500
From: "zoomtown" <jdavis_5@zoomtown.com>
Subject: Perl and ActiveDirectory Question
Message-Id: <3e3c06d2$0$86473$a04e5680@nnrp.fuse.net>

Hi Fellow Perl Programmers,
  My question for today is, Is it possible to query the Active Directory
from Perl to find a specific user and if so which module would get the job
done?

 Thanks in Advance
 James




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

Date: Sat, 1 Feb 2003 14:15:54 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Perl and ActiveDirectory Question
Message-Id: <slrnb3oanq.6nv.tadmc@magna.augustmail.com>

zoomtown <jdavis_5@zoomtown.com> wrote:

> Is it possible to query the Active Directory
> from Perl to find a specific user


What is an "Active Directory" ?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sat, 1 Feb 2003 15:37:54 -0500
From: "zoomtown" <jdavis_5@zoomtown.com>
Subject: Re: Perl and ActiveDirectory Question
Message-Id: <3e3c2f9e$0$14422$a0465688@nnrp.fuse.net>

You have got to be kidding right!!!! Active Directory is the Successor to
the  Microsoft Windows NT Domain structure..
omessage news:slrnb3oanq.6nv.tadmc@magna.augustmail.com...
> zoomtown <jdavis_5@zoomtown.com> wrote:
>
> > Is it possible to query the Active Directory
> > from Perl to find a specific user
>
>
> What is an "Active Directory" ?
>
>
> --
>     Tad McClellan                          SGML consulting
>     tadmc@augustmail.com                   Perl programming
>     Fort Worth, Texas




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

Date: Sat, 01 Feb 2003 21:49:48 GMT
From: Alan Gutierrez <ajglist@izzy.net>
Subject: Re: Perl and ActiveDirectory Question
Message-Id: <0iX_9.81152$GX4.3355298@news2.east.cox.net>

> omessage news:slrnb3oanq.6nv.tadmc@magna.augustmail.com...
>> zoomtown <jdavis_5@zoomtown.com> wrote:
>>
>> > Is it possible to query the Active Directory
>> > from Perl to find a specific user
>>
>> What is an "Active Directory" ?

> Long before he should have, zoomtown wrote:

> You have got to be kidding right!!!! Active Directory is the Successor to
> the  Microsoft Windows NT Domain structure..

How gauche. Mr McClellan is not kidding. There are many who will not
deign to aquaint themselves with a Microsoft, for lack of a better
word, technology, until it is thrust upon them. All too often its
here today, gone tomorrow, and you are left supporting half-baked
software the vendor has abandoned.

You have swallowed the MS marketing whole. The sort of marking that
says "When developers everywhere hear about the insanely great
revolutionary technology in Active Whatever, the reaction is
universal: they roll on the floor and pee. Active Latest Marketing
Push it's not just your fathers breakfast anymore!"

Learn some humility. You sound like a fool.

Don't top post.

LDAP is one possibility. Perl supports LDAP, AD claims to support
LDAP. If there is an ActiveX interface, you can hit it with that.

Hope this helps.

Alan Gutierrez - ajglist@izzy.net


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

Date: Sat, 1 Feb 2003 21:24:03 +0100
From: "Frank Maas" <spamfilter@cheiron-it.nl>
Subject: Re: Perl DBI and Mysql LAST_INSERT_ID() Problem
Message-Id: <3e3c2d37$0$141$e4fe514c@dreader9.news.xs4all.nl>


"Alex Banks" <alex@alexbanks.com> schreef in bericht
news:3e3bce1a$0$245$cc9e4d1f@news.dial.pipex.com...
> I want to insert a value into onetb, but then grab the primary key to use
as
> the fkey value of twotb. Here's my Perl:
>
> use DBI;
> $dbh = DBI -> connect ("DBI:mysql:fabdb","user","password");
> $sql = "insert into onetb (pkey, description) values (NULL,'Description
goes
> here')";
> $sth = $dbh -> prepare($sql);
> $sth -> execute; #fine
my $lii=$dbh->{'mysql_insertid'}
>
> $sql = "insert into twotb (pkey, fkey) values (2,LAST_INSERT_ID())";
                                                   ^^^^^^^^^^^^^^^^ $lii
> $sth = $dbh -> prepare($sql);
> $sth -> execute; #error

> Can anyone offer a solution?

Here's what works for me:

use DBI;
my $dbh = DBI -> connect ("DBI:mysql:fabdb","user","password");
my $sql = "insert into onetb (pkey, description) values
(NULL,'Description...')";
$dbh->do($sql);
my $lii=$dbh->{'mysql_insertid'};
$sql = "insert into twotb (pkey, fkey) values (2,$lii)";
$dbh->do($sql);


--Frank




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

Date: Sun, 02 Feb 2003 09:28:27 +1000
From: "Andrew Rich" <andrew.rich@bigpond.com>
Subject: perl smpp multitask
Message-Id: <QtY_9.38451$jM5.97547@newsfeeds.bigpond.com>

I have written an SMPP script that binds really well.

My question is, in perl how can you get it do other things
instead of just sitting there in a "while" loop.

I need to listen, for incoming data for sure, but at the 
same time I need to send a keep alive packet every xx minutes.

Ideas on 'multi tasking' perl ?

Cheers 

Andrew 



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

Date: Sat, 01 Feb 2003 17:25:47 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: perl smpp multitask
Message-Id: <87el6rshvo.fsf@limey.hpcc.uh.edu>

>> On Sun, 02 Feb 2003 09:28:27 +1000,
>> "Andrew Rich" <andrew.rich@bigpond.com> said:

> I have written an SMPP script that binds really well.
> My question is, in perl how can you get it do other
> things instead of just sitting there in a "while" loop.

> I need to listen, for incoming data for sure, but at the
> same time I need to send a keep alive packet every xx
> minutes.

> Ideas on 'multi tasking' perl ?

    perldoc perlipc

would probably be a good place to start, along with
Randal Schwartz's:

    http://www.stonehenge.com/merlyn/columns.html

hth
t


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

Date: 01 Feb 2003 21:32:29 GMT
From: Rafael Garcia-Suarez <rgarciasuarez@free.fr>
Subject: Re: printf %*v02x - something happened to 5.8
Message-Id: <slrnb3ofjn.62r.rgarciasuarez@dat.local>

Jay Tilton wrote in comp.lang.perl.misc :
> Now, with 5.8, I can't.
> 
>     C>perl -we "printf '%*v02x', ' ', 'foo'"
>     Invalid conversion in printf: "%0" at -e line 1.
>     %*v02x
> 
> The documentation for sprintf() changed considerably between versions,
> but I noticed nothing to indicate this should be broken now, or that I
> was previously exploiting a misfeature that is now fixed.
>
> As ever, TIMTOWTDI, but I'm more concerned with finding a reason why
> this should no longer work.  Is there one?

The checks made by perl on printf formats have become stricter in perl
5.8.0. This is a side-effect of these changes. I think this can be
considered as a bug, as I don't see a reason either why this should be
disallowed.

-- 
You probably wouldn't have expected a communist to have a dog named Harpo.
    -- Malcolm Lowry, Under the Volcano


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.

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 V10 Issue 4500
***************************************


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