[23872] in Perl-Users-Digest
Perl-Users Digest, Issue: 6075 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 3 18:05:53 2004
Date: Tue, 3 Feb 2004 15:05:08 -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 Tue, 3 Feb 2004 Volume: 10 Number: 6075
Today's topics:
Array / scalar conversions <nobody@tatooine.homelinux.net>
Re: Array / scalar conversions (Walter Roberson)
Callback during FTP (Yehuda Berlinger)
Re: CGI syntax error not behaving as I expected but... <mmosher@storm.ca>
Re: Checking to see if a paticular file exists (vijay)
Re: Checking to see if a paticular file exists <bmb@ginger.libs.uga.edu>
Re: Checking to see if a paticular file exists <gnari@simnet.is>
Re: Clarifications <bik.mido@tiscalinet.it>
Re: Cursing my objects? (Eduardo)
DProf %time ? (Walter Roberson)
Re: DProf %time ? <nospam-abuse@ilyaz.org>
Re: Embedded Perl sprintf (symbol?) problem. <gnari@simnet.is>
Re: Embedded Perl sprintf (symbol?) problem. <kalinaubears@iinet.net.au>
Re: File handlings <glodalec@yahoo.com>
Re: File handlings <usenet@morrow.me.uk>
group but do not capture (naren)
Re: group but do not capture <ittyspam@yahoo.com>
Re: group but do not capture <dwall@fastmail.fm>
Looking for MD5-like fingerprint for JPG-files (dede)
Re: Microsoft AD <gnari@simnet.is>
Re: Microsoft AD <gnari@simnet.is>
Re: network card <javier@t-online.de>
Re: network card <usenet@morrow.me.uk>
newbie help <spam@spammer.com>
Re: newbie help <noreply@gunnar.cc>
Re: newbie help <jill_krugman@yahoo.com>
Re: newbie help <noreply@gunnar.cc>
Re: Perl - LDAP - AD <gnari@simnet.is>
Re: Perl For Amateur Computer Programmers <bik.mido@tiscalinet.it>
Searching through worperfect files <nobody@tatooine.homelinux.net>
Re: Use of uninitialized value in concatenation (.) or <noreply@gunnar.cc>
vdmfec and Perl? (Andreas Wachhold)
Re: vdmfec and Perl? <gnari@simnet.is>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 3 Feb 2004 21:46:50 +0100 (CET)
From: starwars <nobody@tatooine.homelinux.net>
Subject: Array / scalar conversions
Message-Id: <9b7d78174c190b454395d0f4c5cef16b@tatooine.homelinux.net>
Idiot perlbie questions...
If have on proceedure that requires input of a list of text, i.e., as an @
array.
The other procedure I have requires a simple scalar, i.e. $ .
I want BOTH procedures to operate on a block of text (mail message).
So, I use join on the @ and feed it to the $ only procedure.
And, vice-versa, using split.
It seems to work, but because of my ignorance, I wonder if I am doing it
"right"?
Question: is there an easy way to convert (or reference) array contents as
scalars without using the join function?
------------------------------
Date: 3 Feb 2004 22:53:09 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: Re: Array / scalar conversions
Message-Id: <bvp8ol$jkk$1@canopus.cc.umanitoba.ca>
In article <9b7d78174c190b454395d0f4c5cef16b@tatooine.homelinux.net>,
starwars <nobody@tatooine.homelinux.net> wrote:
:If have on proceedure that requires input of a list of text, i.e., as an @
:array.
:The other procedure I have requires a simple scalar, i.e. $ .
:I want BOTH procedures to operate on a block of text (mail message).
:So, I use join on the @ and feed it to the $ only procedure.
:And, vice-versa, using split.
:It seems to work, but because of my ignorance, I wonder if I am doing it
:"right"?
:Question: is there an easy way to convert (or reference) array contents as
:scalars without using the join function?
If the manipulation processing of the array elements are independant of
each other, then use map. For example,
@new_lines = map { process_a_line $_ } @lines;
If the processing cannot be done independantly, then you could use
join -- or you could rewrite the scalar subroutine to allow arrays.
Many of the perl operators expect to work on scalars, though, so sometimes
using map is the easiest way.
--
*We* are now the times. -- Wim Wenders (WoD)
------------------------------
Date: 3 Feb 2004 11:35:54 -0800
From: jon@actcom.co.il (Yehuda Berlinger)
Subject: Callback during FTP
Message-Id: <75e50dfd.0402031135.76d6e599@posting.google.com>
I would like to do a callback while transferring via FTP, so as to
print % finished, etc... (and to activate my Tk::Progressbar).
Net::FTP doesn't seem to support this. Is that correct? Is there any
other tool that can do this? Is there anyway to do this using the
'hash' mechanism?
Thanks in advance.
Yehuda
P.S. I would like to avoid using fork()
------------------------------
Date: Tue, 03 Feb 2004 15:12:18 -0500
From: mmosher <mmosher@storm.ca>
Subject: Re: CGI syntax error not behaving as I expected but...
Message-Id: <bvovb4$acq$1@news.storm.ca>
Thomas Kratz wrote:
> mmosher wrote:
>
>> Thank you both for the explaination. Should have relized with was my
>> logic error and not syntax. My thinking was that since it was in an
>> if statement I could not do an assignment. Everything makes sense
>> now. I'll check that document.
>>
>> Yes I can be taught.
>
>
> Can you be taught to stop top posting?
>
> Thomas
>
Sorry about that. Even though I don't post much I do know about that and
for some reason I didn't post correctly.
------------------------------
Date: 3 Feb 2004 11:46:13 -0800
From: vijaysenthilv@yahoo.com (vijay)
Subject: Re: Checking to see if a paticular file exists
Message-Id: <8fec0185.0402031146.5e8f1bcf@posting.google.com>
Hi
I'm sorry i should have posted the code
__________________________________________________
require "cgi-lib.pl";
print "Content-type: text/html\n\n";
if (!(-e 'J:\DWGS\parking\LOT-10.dwg')) {
print "Not working----"
}
else {
print "working---";
}
if (!(-e 'J:\DWGS\Project Archive\911-001-1922-A-002-AB.pdf')) {
print "Not working----"
}
else {
print "working---";
}
____________________________________________________________________
The above code prints working and working when i run it from the DOS
promt but prints working and Not working when i open it in a browser,
i Did try using the %20 and forward slash format but that didnt help
either
Thanks
Sincerly vijay
------------------------------
Date: Tue, 3 Feb 2004 15:35:06 -0500
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Checking to see if a paticular file exists
Message-Id: <Pine.A41.4.58.0402031532010.13968@ginger.libs.uga.edu>
On Tue, 3 Feb 2004, vijay wrote:
> The above code prints working and working when i run it from the DOS
> promt but prints working and Not working when i open it in a browser,
> i Did try using the %20 and forward slash format but that didnt help
> either
I suspect your question is a variation of this faq:
My CGI script runs from the command line but not the browser.
That is, I think you have a CGI question rather than a Perl question.
Regards,
Brad
------------------------------
Date: Tue, 3 Feb 2004 20:53:59 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: Checking to see if a paticular file exists
Message-Id: <bvp1ni$14i$1@news.simnet.is>
"vijay" <vijaysenthilv@yahoo.com> wrote in message
news:8fec0185.0402031146.5e8f1bcf@posting.google.com...
> require "cgi-lib.pl";
> print "Content-type: text/html\n\n";
I am not going to mention strict, warnings and CGI.pm now,
but I might next time.
> ...
> if (!(-e 'J:\DWGS\parking\LOT-10.dwg')) {
> ...
> if (!(-e 'J:\DWGS\Project Archive\911-001-1922-A-002-AB.pdf')) {
> ...
> i Did try using the %20 and forward slash format but that didnt help
> either
the %20 does not apply in your case.
does the problem go away if you rename away the space ?
does the first filepath fail if you rename a space into it?
maybe it is a permission problem. the user executing the script
as cgi is not the same as the one in the shell. and their environments
differ as well.
gnari
------------------------------
Date: Wed, 04 Feb 2004 21:58:51 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Clarifications
Message-Id: <i0i220d3hfr04heutr0rhfbm59ql1skjb6@4ax.com>
On Mon, 02 Feb 2004 15:40:25 GMT, "John W. Kennedy"
<jwkenne@attglobal.net> wrote:
>> BTW: just to be fussy as much as possible, I *think* that (also in
>> English) the correct term should be "abbreviation" and not "acronym"
>> (it is definitely so in Italian, where one finds a sharp distinction
>> between "acronimo" and "sigla"), but in fact one most often finds
>> "acronym" in that acceptation...
>
>No, "acronym" is correct in English if it makes a pronouncable word.
OK, I'll take your word for that!
>I'm afraid my Italian dictionaries don't even list "acronimo", so I
>can't speak to that (of course, I have them more for Arrigo Boito than
>for computers). But "sigla" would certainly be wrong.
Huh?!? Why do you say that? Did you consider the fact that if I
mentioned Italian, there may have been a good reason for that? Like...
it being my native language, for example! And even if I'm not an
"Accademico della Crusca" (*please* don't ask me to translate that in
English!), I'm quite sure I know what (one of) the (two) common
acceptation(s) of "sigla" is.
However you may find it interesting to know what my own dictionary
says about these two terms:
SIGLA sf. [prob. dal lat. singula littera] abbreviatura di una o
piu' parole per lo piu' rappresentata dalle iniziali di esse.
ACRONIMO sm. nome formato con le lettere iniziali di altre parole.
^^^^
And here you have their respective translations (modulo my limited
linguistic skills!):
[probably from the lating "singula littera"] abbreviation of one or
more words most often represented by their initials.
Noun formed with the initial letters of other words.
^^^^
Now, I underlined that detail because I've always thought that an
"acronimo" (and possibly an "acronym" too) can be more generally a
*word* or even a *phrase* formed with the initial letters of other
words. I *think* this is actually the case, but I don't have other
dictionaries at home to check...
Michele
--
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
"perl bug File::Basename and Perl's nature"
------------------------------
Date: 3 Feb 2004 13:54:46 -0800
From: oso@uncoma.edu.ar (Eduardo)
Subject: Re: Cursing my objects?
Message-Id: <3d281369.0402031354.5f97037e@posting.google.com>
> This doesn't break encapsulation as badly as it seems to. If the
> implementation changes and object isn't a hashref anymore, you can
> always overload "%{}" to restore the behavior of "%$t". It gets
> cumbersome when the object remains a hashref, but the contents change
> so that "%$t" isn't usable in the old way any longer, but that can be
> worked around too.
Thank you! I am really amazed at your explanations, people. How would
I go about overloading %{}?
------------------------------
Date: 3 Feb 2004 20:22:47 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: DProf %time ?
Message-Id: <bvovun$fpj$1@canopus.cc.umanitoba.ca>
I am trying to do some measurements with Devel::DProf but am having
difficulty interpreting portions of the results.
My program is taking the time after initialization and again after
the run, and under -d:DProf reports 199 seconds lapsed time.
dprofpp reports:
Total Elapsed Time = 7.964565 Seconds
User+System Time = 6.544565 Seconds
which is decidedly false even when I run without profiling.
dproff continues on to report,
Exclusive Times
%Time ExclSec CumulS #Calls sec/call Csec/c Name
428. 28.06 62.969 50000 0.0006 0.0013 main::parse_line
165. 10.83 19.502 30271 0.0004 0.0006 main::fmt_deny_acl
74.6 4.884 4.884 233430 0.0000 0.0000 main::r_opts
[...]
Notice the %Time figures. One routine is taking 428% of the time??
I can't see any relationship between "428" and any of the other times
or sums of times.
The CumulS figures are wrong compared to the lapsed time of
the run with profiling enabled, but they are in the right range for
the timing with profiling disabled. (Mind you, there's not really
a lot of point in giving times to 3 decimal places if they can be 10%
off of the actual times...)
A simple "split" run over each line of the input file [the heart
of my parse_line routine] takes about 22 seconds, so I'm working on
tracking the other 2/3 of the time, but if the measurement tool
is producing strange numbers, it is hard to know what to trust.
--
I've been working on a kernel
All the livelong night.
I've been working on a kernel
And it still won't work quite right. -- J. Benson & J. Doll
------------------------------
Date: Tue, 3 Feb 2004 20:55:41 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: DProf %time ?
Message-Id: <bvp1sd$22f6$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Walter Roberson
<roberson@ibd.nrc-cnrc.gc.ca>], who wrote in article <bvovun$fpj$1@canopus.cc.umanitoba.ca>:
> the run, and under -d:DProf reports 199 seconds lapsed time.
> dprofpp reports:
> Total Elapsed Time = 7.964565 Seconds
> User+System Time = 6.544565 Seconds
> Exclusive Times
> %Time ExclSec CumulS #Calls sec/call Csec/c Name
> 428. 28.06 62.969 50000 0.0006 0.0013 main::parse_line
> 165. 10.83 19.502 30271 0.0004 0.0006 main::fmt_deny_acl
> 74.6 4.884 4.884 233430 0.0000 0.0000 main::r_opts
> [...]
>
> Notice the %Time figures. One routine is taking 428% of the time??
>
> I can't see any relationship between "428" and any of the other times
> or sums of times.
I can. 428:165:74.6 = 28.06:10.83:4.884.
So %s are just scaled relative to a wrong total duration.
The produced tmon.out file is mostly user-readable, and dprofpp itself
should be quite readable. This may help your investigation...
Hope this helps,
Ilya
------------------------------
Date: Tue, 3 Feb 2004 19:48:40 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: Embedded Perl sprintf (symbol?) problem.
Message-Id: <bvott2$mu$1@news.simnet.is>
"Sisyphus" <kalinaubears@iinet.net.au> wrote in message
news:401f9d76$0$1734$5a62ac22@freenews.iinet.net.au...
[snipped discussion about lack of embedded perl example code]
>
> It's just that it's simply in the best interests of the OP to follow the
> posting guidelines and supply such code. That's all I was trying to get
> at :-)
no quarrel, but in this case, the OP would probably have to post
c code, and someone is sure to complain about that :-)
gnari
------------------------------
Date: Wed, 04 Feb 2004 09:41:15 +1100
From: Sisyphus <kalinaubears@iinet.net.au>
Subject: Re: Embedded Perl sprintf (symbol?) problem.
Message-Id: <40202481$0$1728$5a62ac22@freenews.iinet.net.au>
gnari wrote:
>
> no quarrel, but in this case, the OP would probably have to post
> c code, and someone is sure to complain about that :-)
>
(That wouldn't stop *me* from posting code :-)
I hadn't really considered that aspect. Such a complaint could only be
valid if 'perlembed' issues are OT here - which, admittedly, may well be
the case (and a pity, imho).
I see there's an 'embperl' mailing list at http://lists.perl.org.
Perhaps the OP should direct his question there.
Cheers,
Rob
--
To reply by email u have to take out the u in kalinaubears.
------------------------------
Date: Tue, 3 Feb 2004 20:13:48 +0100
From: Glodalec <glodalec@yahoo.com>
Subject: Re: File handlings
Message-Id: <MPG.1a8a1153f1a4edba98974b@news.siol.net>
In article <bvoe9t$t31$1@wisteria.csv.warwick.ac.uk>,
usenet@morrow.me.uk says...
>
> Glodalec <glodalec@yahoo.com> wrote:
> > Now, I have A program, which listens on a TCP socket. Whenever string
> > come over socket, it should be put on STDIN buffer (yes, STDIN), forking
> > a new child, redirecting the parent SOCKET to child's STDOUT and exec
> > B.pl. (The same way Apache & CGI modules work). I was trying to use
> > select() but no luck.
>
> No, that's not how filehandles work at all. You can't push stuff back
> onto them: if you want to pass stuff to your child you have to use a
> pipe.
Had never used them (except on command line), will read about them.
>
> > A.pl
> > #!/bin/perl
> > use strict ;
> > ...
> > SOCKET CREATION, LISTENING, GETTING LINE FROM A SOCKET INTO $LINE
> > ...
> >
> > TCP settings....
> > ......
> > if (my $pid=fork)
>
> fork can fail, in which case it returns undef.
I know, this script has been arranged a lot when posting here.
>
> > {
> > waitpid($pid,0); # Ok, here is parent
> > } else
> > {
> > my $string="This must be put in STDIN buffer" ; << Don't know how
> > my $old=select(SOCKET) ; << This is not working
> > exec("A.pl"); # and child
> > select $oldstdout ;
> > }
> >
> > Any help would be appreciated
>
> my $pid = open my $TOCHILD, '|-', 'A.pl'
> or die "fork failed: $!";
>
> print $TOCHILD "The child will read this on its STDIN";
THanks for advice. How about a child exec, which should actually write
to parent's SESSION handler (got from accept()), instead of its own
STDOUT.?
>
> See perldoc -f open.
>
> Ben
>
>
------------------------------
Date: Tue, 3 Feb 2004 22:43:15 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: File handlings
Message-Id: <bvp863$eus$1@wisteria.csv.warwick.ac.uk>
Glodalec <glodalec@yahoo.com> wrote:
> > print $TOCHILD "The child will read this on its STDIN";
> THanks for advice. How about a child exec, which should actually write
> to parent's SESSION handler (got from accept()), instead of its own
> STDOUT.?
It's probably easiest to do that manually, viz (untested):
accept my $NEWCONN, $LISTENER or die "accept failed: $!";
# or you'd probably be better off using IO::Socket::INET
my $NEWCONN = $LISTENER->accept or die "accept failed: $!";
pipe my ($FROMPARENT, $TOCHILD) or die "pipe failed: $!";
my $pid = fork;
defined $pid or die "fork failed: $!";
unless ($pid) {
open STDIN, '<&', $FROMPARENT or die "dup2 to STDIN failed: $!";
open STDOUT, '>&', $NEWCONN or die "dup2 to STDOUT failed: $!";
exec 'A.pl' or die "exec failed: $!";
}
close $FROMPARENT;
close $NEWCONN;
Obviously you want to put all this in a sub, so you can say
my $TOCHILD = accept_new_child($LISTENER);
If you get errors from the open '<&' syntax, you may need a newer
version of perl; or you can replace them with
open STDIN, '<&' . fileno $FROMPARENT or ...
Ben
--
Like all men in Babylon I have been a proconsul; like all, a slave ... During
one lunar year, I have been declared invisible; I shrieked and was not heard,
I stole my bread and was not decapitated.
~ ben@morrow.me.uk ~ Jorge Luis Borges, 'The Babylon Lottery'
------------------------------
Date: 3 Feb 2004 11:14:49 -0800
From: naren_tech@yahoo.com (naren)
Subject: group but do not capture
Message-Id: <c3260cc0.0402031114.4ca222bd@posting.google.com>
Hi,
I need some help with a regular expression parsing,
I have to group a string but want to exclude some characters from the
group, for example, I have a string :
>gnl|genbank|2398 this is a test gene
would like to get genbank2398
I have tried following reg ex, but it doesn't work, can any body
help??
m/\|(\w+(?:\|)\d+)/
(?:\|), group but do not capture | , is not working, I am getting
genbank|2398
Thanks in advance,
Naren.
------------------------------
Date: Tue, 3 Feb 2004 14:22:06 -0500
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: group but do not capture
Message-Id: <20040203141907.R483@dishwasher.cs.rpi.edu>
On Tue, 3 Feb 2004, naren wrote:
> Hi,
>
> I need some help with a regular expression parsing,
>
> I have to group a string but want to exclude some characters from the
> group, for example, I have a string :
>
> >gnl|genbank|2398 this is a test gene
>
> would like to get genbank2398
>
> I have tried following reg ex, but it doesn't work, can any body
> help??
>
> m/\|(\w+(?:\|)\d+)/
>
> (?:\|), group but do not capture | , is not working, I am getting
> genbank|2398
>
You're confused as to what (?:) does. It doesn't exclude from capturing
whatever's in the parens. It simply means that these particular
parentheses will not capture any text for setting in $1, $2, $3, etc.
In your example, I would probably break it to two lines:
m/\|(\w+)\|(\d+)/;
$string = $1 . $2;
Paul Lalli
------------------------------
Date: Tue, 03 Feb 2004 20:06:11 -0000
From: "David K. Wall" <dwall@fastmail.fm>
Subject: Re: group but do not capture
Message-Id: <Xns948499A38D6AAdkwwashere@216.168.3.30>
naren <naren_tech@yahoo.com> wrote:
> I need some help with a regular expression parsing,
>
> I have to group a string but want to exclude some characters from the
> group, for example, I have a string :
>
>>gnl|genbank|2398 this is a test gene
>
> would like to get genbank2398
>
> I have tried following reg ex, but it doesn't work, can any body
> help??
>
> m/\|(\w+(?:\|)\d+)/
>
> (?:\|), group but do not capture | , is not working, I am getting
> genbank|2398
Actually, it is working, or $2 would be set to '|'.
You could capture only the parts you want and then concatenate them:
my $string = 'gnl|genbank|2398 this is a test gene';
my $result;
if ($string =~ /\w+\|(\w+)\|(\d+)/) {
$result = $1 . $2;
}
or you could grab everything including the unwanted | and then remove it:
my $string = 'gnl|genbank|2398 this is a test gene';
my $result;
if ($string =~ /^\w+\|(\w+\|\d+)/) {
($result = $1) =~ s/\|//;
}
Or you could split() the string on the |s and then modify the pieces.
Whatever is most convenient....
(and if I were Someone Who Must Not Be Named I'd write it using index()and
substr(), but that's far too painful....)
--
David Wall
------------------------------
Date: 3 Feb 2004 14:13:37 -0800
From: abrey@gmx.net (dede)
Subject: Looking for MD5-like fingerprint for JPG-files
Message-Id: <166f59a6.0402031413.1d41f251@posting.google.com>
Dear all,
in order to provide a convenient method for photographer like me to
detect "equal" or "similar" pictures I am trying to develop a perl
function/method that does exactly this:
Input: JPG file
Output: MD5-like fingerprint of JPG (to be stored in a db)
It should be a hash-value that is very close if two pics are "almost
identical". It must be robust against at least JPG-rotations
(90/180/270 degrees) and "reasonable" scalings. The analysis will be
stored in the EXIF-data of the JPG so the analysed data should be only
the "naked JPG-data" itself.
My basic idea is to create a 2-dimensional bitmap that will be
"normalized", i.e. rotated to a "zero-position" and scaled to let's
say a 1000x1000 JPG.
"Sugar" for this algorithm could be robustness against primitiv
operations like flipping, clipping, changing contrast, watermarking,
etc.
Is there anyone in the community who has done this already? Any help
will be appreciated.
Thanx in advance. Merci.
Andreas
------------------------------
Date: Tue, 3 Feb 2004 20:00:26 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: Microsoft AD
Message-Id: <bvouj5$oj$1@news.simnet.is>
<stan.holmes@eskom.co.za> wrote in message
news:bvnita$6ao$1@newsreader02.ops.uunet.co.za...
> Hi
> I know this is not a helpdesk, but I need to update an AD from a HR
Oracle
> DB. The Oracle is not a problem, but I have no experience with MS AD. Can
> someone assist me with a web site or sample code on how to read and update
> the AD
well, you might start by telling us what AD is, and how it has anything to
do
with perl. have you looked at CPAN ? try search.cpan.org.
have you tried google?
have you tried microsoft ? (apologies if the MS in MS AD is something else)
have you looked at the AD documentation (if any)?
gnari
------------------------------
Date: Tue, 3 Feb 2004 21:02:54 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: Microsoft AD
Message-Id: <bvp28b$19i$1@news.simnet.is>
"gnari" <gnari@simnet.is> wrote in message
news:bvouj5$oj$1@news.simnet.is...
> have you tried microsoft ? (apologies if the MS in MS AD is something
else)
oops. maybe the subject line is a hint about that.
gnari
------------------------------
Date: Tue, 03 Feb 2004 20:39:38 +0100
From: Xaver Biton <javier@t-online.de>
Subject: Re: network card
Message-Id: <bvotbf$eku$05$1@news.t-online.com>
Jay Tilton wrote:
> But you copied it into the wrong place.
>
> Use the normal module installation procedure. The steps are listed in
> that same README.
>
> perl Makefile.PL
> make
> make test
> make install
>
> : I've done it but wenn I run an example
> : script I recieve the following error:
> :
> : Win32::RASE::TAPIlineGetTranslateCaps() called too early to check
> : prototype at c:/Perl/lib/RASE.pm line 266.
> ^^^^^^^^^^^^^^^^^^^
> The path/filename needs to be c:/Perl/lib/Win32/RASE.pm
I've tried it before coping the module by hand in the usual way;
perl Makefile.PL
make
make test
make install
but by make it give me an error:
Makefile:299 *** multiple target patterns. Stop.
what is that?
thks.
Xaver
------------------------------
Date: Tue, 3 Feb 2004 22:03:41 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: network card
Message-Id: <bvp5rt$d4i$1@wisteria.csv.warwick.ac.uk>
Xaver Biton <javier@t-online.de> wrote:
> Jay Tilton wrote:
>
> I've tried it before coping the module by hand in the usual way;
>
> perl Makefile.PL
> make
> make test
> make install
>
> but by make it give me an error:
> Makefile:299 *** multiple target patterns. Stop.
>
> what is that?
Are you using cygwin make? For AS Perl you probably need M$ nmake
(free download from M$), unless you mess with the configuration.
Ben
--
For the last month, a large number of PSNs in the Arpa[Inter-]net have been
reporting symptoms of congestion ... These reports have been accompanied by an
increasing number of user complaints ... As of June,... the Arpanet contained
47 nodes and 63 links. [ftp://rtfm.mit.edu/pub/arpaprob.txt] * ben@morrow.me.uk
------------------------------
Date: Tue, 3 Feb 2004 14:58:44 -0600
From: "Ram" <spam@spammer.com>
Subject: newbie help
Message-Id: <bvp20r$ga$1@grandcanyon.binc.net>
How do I search for just the ordsts start(<ordsts>) and end tags(</ordsts>)
and the data between them, and get just the last matched one. Also would
need an idea of how to get the last two matches.
Thanks for the pointers.
Sample Input file:
<logos>
<ordsts>
<gname>
</gname>
</ordsts>
<ordadd>
<aname>
</aname>
</ordadd>
</logos>
<customer>
<contact>
<pname>
</pname>
</contact>
<ordsts>
<name>
</name>
</ordsts>
<shipname>
<sname>
</sname>
</shipname>
</customer>
<ordsts>
<doc_hdr>
<type_code>ORDSTS</type_code>
<type_suffix>LE</type_suffix>
<direction>IN</direction>
</doc_hdr>
<ord_keys>
<ordno>200000</ordno>
</ord_keys>
<req_obj>
<obj>order_header</obj>
<obj>order_line</obj>
</req_obj>
</ordsts>
<order> <doc_hdr> <type_code>ORDER</type_code>
<type_suffix>LE</type_suffix> <direction>IN</direction> <client_da
a>User Supplied Data</client_data> <client_id>User Supplied
Data</client_id> <correlation_id>414D51204C45555343433033202020
040001EEE00042583</correlation_id>
<response_channel>CC.ORDER.REPLY</response_channel>
<correlation_id>41,4d,51,20,4c,45,55
53,43,43,30,33,20,20,20,20,40,0,1e,ee,0,4,25,83,</correlation_id>
<response_channel>LEUSCS01::CC.ORDER.REPLY.CS.S.Q</response_c
annel> </doc_hdr> <customer> <cus_num>3374831</cus_num>
<bill_to> <contact> <con_num>2</con_num> </
ontact> </bill_to> <ship_to> <address>
<adr_num>1</adr_num> </address> <taxwaregeocode> <
eocode>331003600</geocode></order>
<ordsts> <doc_hdr> <type_code>ORDER</type_code>
<type_suffix>LE</type_suffix> <direction>IN</direction> <client_d
ta>User Supplied Data</client_data> <client_id>User Supplied
Data</client_id> <correlation_id>414D51204C4555534343303320202
2040001EEE00042583</correlation_id>
<response_channel>CC.ORDER.REPLY</response_channel>
<correlation_id>41,4d,51,20,4c,45,5
,53,43,43,30,33,20,20,20,20,40,0,1e,ee,0,4,25,83,</correlation_id>
<response_channel>LEUSCS01::CC.ORDER.REPLY.CS.S.Q</response_
hannel> </doc_hdr> <customer> <cus_num>3374831</cus_num>
<bill_to> <contact> <con_num>2</con_num> <
contact> </bill_to> <ship_to> <address>
<adr_num>1</adr_num> </address> <taxwaregeocode>
geocode>331003600</geocode></ordsts>
------------------------------
Date: Tue, 03 Feb 2004 22:23:27 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: newbie help
Message-Id: <bvp3d5$ujeo2$1@ID-184292.news.uni-berlin.de>
Ram wrote:
> How do I search for just the ordsts start(<ordsts>) and end
> tags(</ordsts>) and the data between them, and get just the last
> matched one.
Assuming the data is in $_:
my ($lastmatch) = /.*(<ordsts>.*<\/ordsts>).*/s;
> Also would need an idea of how to get the last two matches.
I leave that as an excercise to you. :)
> Thanks for the pointers.
http://www.perldoc.com/perl5.8.0/pod/perlre.html
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Tue, 3 Feb 2004 22:24:21 +0000 (UTC)
From: J Krugman <jill_krugman@yahoo.com>
Subject: Re: newbie help
Message-Id: <bvp72l$rgt$1@reader2.panix.com>
In <bvp3d5$ujeo2$1@ID-184292.news.uni-berlin.de> Gunnar Hjalmarsson <noreply@gunnar.cc> writes:
>Assuming the data is in $_:
> my ($lastmatch) = /.*(<ordsts>.*<\/ordsts>).*/s;
Why doesn't this match everthing between the very first <ordsts>
in the file and the last </ordsts>? Isn't the regexp engine supposed
to give the longest match?
jill
------------------------------
Date: Tue, 03 Feb 2004 23:37:21 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: newbie help
Message-Id: <bvp7nu$v8rpc$1@ID-184292.news.uni-berlin.de>
J Krugman wrote:
> Gunnar Hjalmarsson writes:
>> Assuming the data is in $_:
>>
>> my ($lastmatch) = /.*(<ordsts>.*<\/ordsts>).*/s;
>
> Why doesn't this match everthing between the very first <ordsts> in
> the file and the last </ordsts>?
Because the first .* is greedy.
> Isn't the regexp engine supposed to give the longest match?
Nope.
Please read about greediness in perldoc perlre.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Tue, 3 Feb 2004 21:12:58 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: Perl - LDAP - AD
Message-Id: <bvp2r5$1b6$1@news.simnet.is>
<stan.holmes@eskom.co.za> wrote in message
news:bvnsaj$7bo$1@newsreader02.ops.uunet.co.za...
> Hi
> I know this is not a helpdesk, but I need to update an AD from a HR
> Oracle
> DB. The Oracle is not a problem, but I have no experience with MS AD. Can
> someone assist me with a web site or sample code on how to read and
update
> the AD using Perl and LDAP
> Thanks
> Stan
>
> My Email address is stan.holmes@arivia.co.za
you should not start a new thread just to repeat a question. if you need to
add
anything, follow-up to your previous question.
lots of LDAP stuff on CPAN
gnari
------------------------------
Date: Wed, 04 Feb 2004 21:58:50 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Perl For Amateur Computer Programmers
Message-Id: <r2k220d84pcd9itv659q06vtqe2n7thmht@4ax.com>
On Mon, 2 Feb 2004 19:26:09 +0000 (UTC), Ben Morrow
<usenet@morrow.me.uk> wrote:
>> A Megabyte is not a *million* bytes. This mathematically boils down to
>> the fact that the equation 5^n=2^m doesn't have a solution in integers
>> (>0) and that computers tend to privilege powers of two. But n=3, m=7
>> is quite a good approximation and a "better" one , for a precise
>> definition of "better", involves considerably larger numbers.
>
>Eh? What do powers of 5 have to do with the price of cheese? Don't you
>mean 10^3 ~~ 2^10?
Ben, I must admit I'm a bit scared of replying to your comments,
taking into account the kind and the number of mistakes I'm doing
lately! However I think you'll find that the problem of finding
approximate solutions to 5^n=2^m has *much* to do with that of finding
approximate solutions to 10^n=2^m.
>And, just to be pedantic, ISO call a million bytes a megabyte (MB),
>and 1024^2 bytes a megibyte (MiB), for the sake of consistency with
>the rest of the ISO system.
I had heard that, probably in a post similar to this one. And I must
say it does make sense, but it is a matter of a fact that most people
*and programs* think that e.g. a megabyte is 1024^2.
But is that really ISO or SI? (I *think* there's a difference between
them, even though both have to do with "standardization".)
Please note, BTW that the manpage for du (but also df, ls, etc.) both
*slightly* supports my first claim and shows a relevant choice for the
name of a switch related to these issues:
-h, --human-readable
print sizes in human readable format (e.g., 1K 234M 2G)
-H, --si
likewise, but use powers of 1000 not 1024
Michele
--
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
"perl bug File::Basename and Perl's nature"
------------------------------
Date: Tue, 3 Feb 2004 20:46:09 +0100 (CET)
From: starwars <nobody@tatooine.homelinux.net>
Subject: Searching through worperfect files
Message-Id: <343443fd274bb0311cad0a191db52a03@tatooine.homelinux.net>
Any body know of a wordperfect file converter that can be wrapped around a
perl script for searching through file contents in subdirectories?
------------------------------
Date: Tue, 03 Feb 2004 22:54:12 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Use of uninitialized value in concatenation (.) or string
Message-Id: <bvp570$ua4bg$1@ID-184292.news.uni-berlin.de>
Since this was your first post here, I'd like to make a couple of
additional comments besides the pointer to what caused the unexpected
behaviour.
S wrote:
> In advance sorry for the lengthy email. I'm new at using Perl and I
> have never posted here so my goal is to hopefully provide as much
> information as neccessary. I provided:
> - a broken test script exhibiting a problem (along with the output)
> - a fixed test script no longer exhibiting the problem (along with
> the output)
> - a quick description of my environment
> - a list of what I tried
Don't be sorry. Your post was very good. Yes, there was a lot of info
that proved to be redundant, but bottom line is that the info you
provided made it easy to help.
> One could wonder why I'm posting here since I already have 'a fix'.
> Well, I would like to understand why moving this specific line of
> code fixed the problem. Specifically, I want to understand why it
> seems that a 'hash' can be alternatively 'initialized' or
> 'uninitialized' in the broken script. It just does not make sense
> to me with my limited knowledge.
Great! That's the right attitude to programming. Don't be content only
because something "works" if you don't understand *why* it works.
> In my example, assuming that %messages turned out to be a very big
> hash, what would be the impact of rebuilding the @sortedmessages
> array every time in the loop as I'm doing in the 'fixed' test
> script?
Well, now you know that that is not necessary, so there is no reason
to find out...
> Note 2: English is not my native language and I'm trying really
> hard to be understood on this forum. :-)
You do very well. It's not my native language either. Guess 'they'
have to stand it. :)
> use strict;
> use warnings;
Glad to see that you had enabled both strictures and warnings in your
first scripts here.
> my %messages;
> $messages{"C"}="333";
> $messages{"B"}="222";
> $messages{"A"}="111";
> my @sortedmessages = map { { ($_ => $messages{$_}) } } sort keys %messages;
It's unnecessary to create an array of hashes here. An array of arrays
should be sufficient:
my @sortedmessages =
map { [ ($_ => $messages{$_}) ] } sort keys %messages;
------------^-----------------------^
> my $maxi=2;
> my $message_element;
> my $key = my $value;
No need to declare $key and $value separately here.
> foreach my $i (0...$maxi)
> {
> foreach $message_element (@sortedmessages)
> {
> ($key, $value) = each %$message_element;
Assuming an array of arrays:
my ($key, $value) = @$message_element;
----^^
(can be declared here instead)
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 3 Feb 2004 13:10:26 -0800
From: night_blade@t-online.de (Andreas Wachhold)
Subject: vdmfec and Perl?
Message-Id: <13bddb54.0402031310.28806ea8@posting.google.com>
Hello, I am trying to use the program vdmfec from within perl. I am
trying to use it together with tar or gzip etc. I wonder how it works?
Every time I use it, i get error messages. Has anyone any experince
with vdmfec?
Thanks in advance....:)
------------------------------
Date: Tue, 3 Feb 2004 21:25:01 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: vdmfec and Perl?
Message-Id: <bvp3ho$1dl$1@news.simnet.is>
"Andreas Wachhold" <night_blade@t-online.de> wrote in message
news:13bddb54.0402031310.28806ea8@posting.google.com...
> Hello, I am trying to use the program vdmfec from within perl. I am
> trying to use it together with tar or gzip etc. I wonder how it works?
> Every time I use it, i get error messages. Has anyone any experince
> with vdmfec?
no idea what vdmfec is, but:
a) first see if it works from without perl.
if not, bug the vdmfec related newsgroups
b) then see if your perl code works with something
other than vdmfec. if not, then your perl has a bug
c) then show us a very simple example of what you are
doing, along with some hints about what kind of error
messages you are getting.
gnari
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 6075
***************************************