[11780] in Perl-Users-Digest
Perl-Users Digest, Issue: 5380 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 14 10:07:22 1999
Date: Wed, 14 Apr 99 07:00:30 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 14 Apr 1999 Volume: 8 Number: 5380
Today's topics:
Re: accessing an array of subroutine references <jdf@pobox.com>
Re: Another beginner question <c4jgurney@my-dejanews.com>
Re: CGI / IIS problem <gellyfish@gellyfish.com>
Re: Concurrent FTP Transfers <gellyfish@gellyfish.com>
Dummy Question about Perl Licence haytounet@my-dejanews.com
Re: Dummy Question about Perl Licence <gellyfish@gellyfish.com>
File access <haytounet@my-dejanews.com>
Re: File access <tchrist@mox.perl.com>
Re: flocking question - worried NOSPAMcrstlblu@planet.eon.net
Re: Format <Wm.Blasius@ks.sel.alcatel.de>
Get Info from a file haytounet@my-dejanews.com
How to get Info <haytounet@my-dejanews.com>
HTML redirection to FTP site (Oliver Buckie)
I need a script written. <foggy@foggys-funnies.com>
ide advice wanted <ranen@ix.netcom.com>
Re: Is it possible to have "..." appear while processin <wells@cedarnet.org>
Re: Is it possible to have "..." appear while processin (Bart Lateur)
JPL: JNI Panic on 3rd call returning String[] kucerar@hhmi.org
Looking for Tutoral Referenced in the Perl Cookbook (Daniel Beckham)
Re: Looking for Tutoral Referenced in the Perl Cookbook <tchrist@mox.perl.com>
Re: Looking for Tutoral Referenced in the Perl Cookbook (Daniel Beckham)
Re: MLDBM (EXCHANGE:SKY:1Z22)
Re: MLDBM <jdf@pobox.com>
Newbie Question: String Manipulation <glahea@wwdsi.com>
Re: Password encryption - found the solution (I think) <vvb@ibm.net>
Password encryption <vvb@ibm.net>
Re: Perl and MS Access <gellyfish@gellyfish.com>
Re: Perl or C? <cschmitz@stud.informatik.uni-trier.de>
Re: Perl regexps compared to Python regexps matthew.freake@smlawpub.co.uk
Problem duping STDERR to a filehandle (Bodi Zoltan)
Re: Q: Convert two newlines to \n<p> (Mike Collins)
Re: Q: Convert two newlines to \n<p> (Mike Collins)
Re: Q: Convert two newlines to \n<p> <gellyfish@gellyfish.com>
Re: Q: Convert two newlines to \n<p> <tchrist@mox.perl.com>
Re: Q: Convert two newlines to \n<p> (Bart Lateur)
Re: Q: Convert two newlines to \n<p> <tchrist@mox.perl.com>
Re: Question: How to create a logfile? <nospam.reiersol@onlinel.no>
Re: Registry Information <c4jgurney@my-dejanews.com>
Re: removing ^M, ^B and other wierd chars <jdf@pobox.com>
Unitialized var errors & -w flag <gordon.shannon@Central.Sun.COM>
Re: Unitialized var errors & -w flag <tchrist@mox.perl.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 14 Apr 1999 08:54:10 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: Ronny <ronald_f@my-dejanews.com>
Subject: Re: accessing an array of subroutine references
Message-Id: <m34smjbbwt.fsf@joshua.panix.com>
Ronny <ronald_f@my-dejanews.com> writes:
> Given an index $i, I would like to execute the subroutine at
> $subs[$i].
$subs[$i]->($arg)
&{subs[$i]}($arg)
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Wed, 14 Apr 1999 11:20:48 GMT
From: Jeremy Gurney <c4jgurney@my-dejanews.com>
Subject: Re: Another beginner question
Message-Id: <7f1tmb$vq1$1@nnrp1.dejanews.com>
In article <7eu81v$sip@newsops.execpc.com>,
"ibrew" <ibrew@voyager.net> wrote:
> I get an error on the following chunck of code taken directly from the
> "Learning Perl" book, pages 8-9
>
> !#c:/perl/bin/perl
> @words = qw(camel llama alpaca);
>
> I get a compile error on the second statement;
> "Can't modify not in scalar assignment on line two..."
>
> i would be thankful for any help.
>
>
Line 2 is fine, it's line 1 that's causing the problem. You've mangled your
shebang - use this instead.
#!c:\perl\bin\perl.exe
Jeremy Gurney
SAS Programmer | Proteus Molecular Design Ltd.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 14 Apr 1999 11:58:18 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: CGI / IIS problem
Message-Id: <371474ca.0@newsread3.dircon.co.uk>
bernard menez <parpaille@chez.com> wrote:
> hi all, I'm working on a website prototype. I have a client (Win95) and
> a server using WinNT and IIS.
> I wrote a few CGI scripts in Perl, but can't get them to work properly :
> the POST method returns a 501 http
> error (not implemented), whereas the GET method returns the .PL file's
> source code.
>
The I guess you would agree with me that its not really a Perl question
and thus inappropriate for this group. As look would have it though
those nice people at ActiveState provide a fairly comprehensive set
of Win32 specific documentation with their distribution. You will be
interested in particular in :
<file://C:/Perl/html/perl-win32/perlwin32faq6.html>
That discusses how to configure a variety of HTTP servers to work with
ActivePerl.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: 14 Apr 1999 12:05:28 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Concurrent FTP Transfers
Message-Id: <37147678.0@newsread3.dircon.co.uk>
Richard Gordon <abc@abc.com> wrote:
> I am using the libnet module to automate FTP transfers between different
> servers on the internet. This works fine but I only transfer one file at a
> time. I was wondering if anybody could help me out with any suggestions on
> the best way to change my script to handle concurrent FTP transfers.
>
As far as I see it you will need to fork a new process with its own FTP
object for each transfer you want to do concurrently.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Wed, 14 Apr 1999 11:01:46 GMT
From: haytounet@my-dejanews.com
Subject: Dummy Question about Perl Licence
Message-Id: <7f1sin$uta$1@nnrp1.dejanews.com>
Okay, here is my my question, which i am pretty sure most of people will find
stupid.
Anyway, I would like to know the conditions to use Perl. Can I use for non-
commercial and/or commercial use ... ?
Thank you fo answering.
p.s: i tried to read the Faq but my browser crashes each time I try.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 14 Apr 1999 13:51:51 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Dummy Question about Perl Licence
Message-Id: <37148f67.0@newsread3.dircon.co.uk>
haytounet@my-dejanews.com wrote:
> Okay, here is my my question, which i am pretty sure most of people will find
> stupid.
>
> Anyway, I would like to know the conditions to use Perl. Can I use for non-
> commercial and/or commercial use ... ?
>
Yes. Essesntially you can do what you want ;-}
You should read the files README and Artistic that come with the Perl source
distribution. They will give the complete licensing position as far as I
can determine.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Wed, 14 Apr 1999 12:59:53 GMT
From: Arnaud Limbourg <haytounet@my-dejanews.com>
Subject: File access
Message-Id: <7f23g6$4je$1@nnrp1.dejanews.com>
Hello,
I would like to access a text file, get the info in it and update a list in a
html page. I would like to know if there is an existing script that would
work.
I need to create a form with a field that is list of products, this list is
updated every three or four hours, so i cannot use the select tag alone. Is
there a script available to do this ?
If i am not clear do not hesitate to ask me further questions.
--
Arnaud Limbourg
Bull Electronics
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 14 Apr 1999 07:24:06 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: File access
Message-Id: <371496f6@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Arnaud Limbourg <haytounet@my-dejanews.com> writes:
:I would like to access a text file, get the info in it and update a list in a
:html page. I would like to know if there is an existing script that would
:work.
Here's how to do it:
1) open the file
2) get the info from it
3) update your html page
:I need to create a form with a field that is list of products, this list is
:updated every three or four hours, so i cannot use the select tag alone.
Here's how to do it:
1) create the form
2) get the input
3) process it approrpriately
:Is there a script available to do this ?
Millions of them -- none of which were written for your system.
This is a simple-matter-of-programming kind of problem, trivial
to implement given adequate knowledge of your environment,
but impossible to just ask someone else to do by grabbing
their work.
Perhaps you might hire a programmer?
--tom
--
"Some people think abstraction makes things easier, while others think it
makes things harder. It depends on whether you like to think about things."
--Larry Wall
------------------------------
Date: Wed, 14 Apr 1999 11:27:36 GMT
From: NOSPAMcrstlblu@planet.eon.net
Subject: Re: flocking question - worried
Message-Id: <3711e02f.4191045@news.planet.eon.net>
Totally amazing! 20 people thread a Q about flocking - ("it was in the header,
regardless of content!") - and NOBODY SHOWS US FISH THE ANSWER!
I'm not shouting I'm emphasizing :)
Simple Question:
gotto have many people changing data in ONE LITTLE DBM file
it's got 2 copies by the way for some reason (?.pag, and a ?.dir file)
it will be DAMAGED from SIMULTANEOUS modifications by many
so WHAT GETS FLOCKED?
a) the "dbname.pag" file? or the
b) "dbmname.dir" file??
in the
dbmopen(%assarr,"dbmname",0666) command,
neither the PAG or DIR files are SPECIFIED !?!?!? WhyNot?
dbmclose(%assarr)
can "FLOCK" be used by calling the "DBMNAME" by itself?
eg: flock "dbmname",2; #lock the dbm
flock "dbmname",8; #UNlock the dbm
or must one use the FULL NAME ?
eg: flock "dbmname.DIR",2; or,
flock "dbmname.PAG",8; ????
One last DBM question, between the dbmOPEN, and the dbmCLOSE,
an ASSOCIATIVE ARRAY %assarr will be commanded to be EQUAL TO SOMETHING
eg:
$fields{'email'}="$fields{'something'}::$fields{'somethingelse'}::$fields{'anythingelse'}";
I read that ANYTHING DONE TO THE ASSOCIATIVE ARRAY, the SAME IS done to
the DBM file ---------- BUT WHEN ?!?!?!?!?!?
ie: $newkey="$thekeyscontent"; ? the moment this is run?
or dbmclose(%assarr); ? the moment the DBM is CLOSED?
Thank you for your time. I hope that the above questions/examples now properly
asked, if ANSWERED insightfully piece by SEPERATE piece should elleviate a
plethora of questions about dbm's and flocking and/or locking for centuries to
come! ;)
wj.
------------------------------
Date: Wed, 14 Apr 1999 13:42:51 +0200
From: William Blasius #42722 <Wm.Blasius@ks.sel.alcatel.de>
To: markaw2091@my-dejanews.com
Subject: Re: Format
Message-Id: <37147F3B.59E2B600@ks.sel.alcatel.de>
[ a copy of this post was sent to markaw2091@my-dejanews.com ]
markaw2091@my-dejanews.com wrote:
>
> Hi there,
>
> I am havng a problem wih the "format" function". Here is a snippet of my code:
>
> format frm_Report =
> @<< @<<<<<<<<< ^*
> $counter, lc($&), $descrip
>
> What I am looking to achieve is:
>
> 1 file1.pl This is my description. As you can
> now see there is a new line/carriage
> return and as such I want the paragraph
> to be formated like this.
> 2 file2.pl This is the second entry. No LF/CR.
> 3 file3.pl This is the 3rd line. Again, no LF/CR.
>
> Instead I am getting:
>
> 1 file1.pl This is my description. As you can now
> see there is a new line feed/carriage return and as such I want the
> formatting to remain within the column.
> 2 file2.pl This is the second entry. No LF/CR.
> 3 file3.pl This is the 3rd line. Again, no LF/CR.
>
> I was under the impression that using the ^* would ensure the layout was
> continuous. Any advice greatly welcomed at mawilliams@walsh-international.com
> or maw@markaw.demon.co.uk. BTW, I am using perl on win32.
>
...and continuous is what you got, but I don't think that's what you
wanted.
I believe the * prevents truncation and I don't know if ^* is really a
valid
specifier. Since ^ does repetitive splitting, combining that with
continuous
output seems strange to me. To do what I think you want, try this
format:
format frm_Report =
@<< @<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$counter, lc($&), $descrip
~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$descrip
.
hth
Regards,
Wm Blasius
Stuttgart
--
* Failure is not an option. It's bundled with your Microsoft software. *
...now I'm <wm.blasius@ks.sel.alcatel.de> - no matter what my mail
server says!
------------------------------
Date: Wed, 14 Apr 1999 11:41:36 GMT
From: haytounet@my-dejanews.com
Subject: Get Info from a file
Message-Id: <7f1utf$oi$1@nnrp1.dejanews.com>
Hello,
i am designing a web site and I have a problem.
I need to create a form with a list of product which comes from a file. This
file is updated every three or four hours. Therefore i cannot use the classic
<select> tag.
I would like to know if there is a script available that would do the job, as
i am not a programmer.
Thank you
Arnaud Limbourg
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 14 Apr 1999 12:22:01 GMT
From: Arnaud Limbourg <haytounet@my-dejanews.com>
Subject: How to get Info
Message-Id: <7f2194$2nh$1@nnrp1.dejanews.com>
Hello,
I am loonking for a script that could get info form a text fime and iclude
them into a html page. The source file is updated every three or four hours,
so I cannot use the select tag. I cannot asp nor sql nor anything other than
cgi scripts.
I would like to know if some could help me out.
Thank You
--
Arnaud Limbourg
Bull Electronics
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 14 Apr 1999 12:49:19 GMT
From: oliver.buckie@actix.co.uk (Oliver Buckie)
Subject: HTML redirection to FTP site
Message-Id: <924094054.10176.1.nnrp-11.c2de8dd8@news.demon.co.uk>
I am having difficulty redirecting users from my web page to an FTP
site. The FTP site does not allow anonymous logins so the users need
to login using a valid username and password. To do this, I have
created a perl script which passes a username and password from a form
on the web page. These are then used to redirect to the FTP site using
the following syntax:
"Location: ftp://<username>:<password>@FTPsiteIPaddr"
This works but it puts the username & password into the URL display of
the browser. Any way of avoiding this?
Any help much appreciated.
Oliver
------------------------------
Date: Wed, 14 Apr 1999 06:08:12 -0500
From: "Foggy" <foggy@foggys-funnies.com>
Subject: I need a script written.
Message-Id: <924088086.735.35@news.remarQ.com>
I am looking for someone who knows how to write perl, is good at it, and
would like to make a few bucks.
What I want (make that NEED) is a subscription box, that would allow people
to plug in their e-mail address, and hit the button, the script verifies the
address to be good, then send it off to the database, and re-directs them to
a thank you page. Pretty easy stuff, I am sure. Heres the twist- I also want
the same people to be able to come back later, and use the same box to
UNsubscribe. AND - I want it to usable for multiple subscriptions! And
expandable in the future! I think this can be done, but I have never played
with writing perl - and I don't want to learn! Send your monetary
requirements ASAP. I want to get this done very soon! Thanks. Check out what
we're doing at http://www.foggys-funnies.com/dailygiggle.com There is a
singular sub box working there now.
Please send all replies to foggy@foggys-funnies.com
------------------------------
Date: Wed, 14 Apr 1999 08:42:02 +0100
From: lynn ranen <ranen@ix.netcom.com>
Subject: ide advice wanted
Message-Id: <371446CA.DC2D346@ix.netcom.com>
I just got a new computer with NT 4.0, got Perl installed and
ready-to-rock. It's been so long since I used windoze i forgot about
the backwards backslashes!
How can I use my UNIX scripts and keep the fullpath directory names
intact?
Can anyone recommend a decent ide for NT? (or VI for NT?)
thanks -- lynn
------------------------------
Date: Wed, 14 Apr 1999 13:12:01 +0000
From: Steve Wells <wells@cedarnet.org>
Subject: Re: Is it possible to have "..." appear while processing?
Message-Id: <37149421.EA152E58@cedarnet.org>
Poohba wrote:
> Okay...I do know how to write to the screen but i don't know how to "..."
> while the program is running.
Depends on your code. After you turn off buffering and you can write back
to the screen, you need to look carefully at the code. If it runs in a loop
then just have it print "." as part of the loop...
while (...something...) {
print ".";
}
If it's looking things up over the network or the program is busy for a long
period of time and it can't send anything back then you could try:
$SIG{ALRM} = sub { alarm(10);
print ".";
};
Which makes it print "." every 10 seconds. When you are ready to output
your data (you've finished processing) then be sure to shut off the
alarm using: alarm(0);
Another is to fork the process and have the child do the work while the
parent spits out "." when the child is finished the parent can take the
data from the child, pretty it up and send it out.
Yet another (if your OS supports threads and perl has it compiled) is to
have the program fork off a thread and do it's work. The main part of
the program would then output the "." until the thread has finished.
And the last one I can come up for now is to have a client/server
relationship where the client sends a request for work to the server.
As the server processes its data the client outputs a "." until it's
received something back from the server.
Probably the simplest approach is the alarm method unless you really
want some type of interaction going on within the program as it works.
If you just want to output something to make the user "think" you are
working alarm works fine.
HTH,
STEVE
--
-----------
Stephen D. Wells
http://www.iren.net/wellss/
http://expert.cc.purdue.edu/~bgannon/booksearch/
------------------------------
Date: Wed, 14 Apr 1999 13:38:54 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Is it possible to have "..." appear while processing?
Message-Id: <371499fa.15504888@news.skynet.be>
Steve Wells wrote:
>Poohba wrote:
>
>> Okay...I do know how to write to the screen but i don't know how to "..."
>> while the program is running.
>
>Depends on your code. After you turn off buffering and you can write back
>to the screen, you need to look carefully at the code. If it runs in a loop
>then just have it print "." as part of the loop...
>
>while (...something...) {
> print ".";
>}
Indeed. Buffering may be the reason why a simple solution doesn't seem
to work.
You could always print to STDERR, as that is unbuffered by default. I
would. There's no place for the dots in a "permanent output", as what
STDOUT is for.
print STDERR '.';
Bart.
------------------------------
Date: Wed, 14 Apr 1999 12:48:00 GMT
From: kucerar@hhmi.org
Subject: JPL: JNI Panic on 3rd call returning String[]
Message-Id: <7f22pu$42b$1@nnrp1.dejanews.com>
Hello all who understand the workings of JPL:
Anyone know about this problem on Solaris 2.5.1 ? Perl 5.000.0055 or whatever
Always the third call in code like this:
public static perl String[] call( String program ) {{
return [ 'smokin', 'again' ];
}}
public static void main (String[] argv) {
for ( int k = 0; k < 10; k++ ) {
Perly.call( argv[ 0 ] );
}
}
results in:
"JNI Panic: JNI received a class argument that is not a class
at Perly.main(Compiled Code)"
What does this mean? Perly is the name of my test class.
I'd like to at least have JPL up on a separate RMI server, but not
sure if any more time spent on it will pay dividends...
TIA Very Much
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 14 Apr 1999 08:54:26 -0500
From: danbeck@scott.net (Daniel Beckham)
Subject: Looking for Tutoral Referenced in the Perl Cookbook
Message-Id: <MPG.117e5a0c9830083b989687@news.idt.net>
I'm trying to locate a copy of a tutorial that is referenced in the Perl
Cookbook (Christiansen & Torkington) pg 603, paragraph 6.
It's called "An Advanced 4.4BSD Interprocess Communication Tutorial" and
the book mentions that I could find it in /usr/share/doc on most BSD-
derived Unix systems.
Anyone here remember that reference or might know where I can pickup that
tutorial?
Thanks for the help.
Daniel
------------------------------
Date: 14 Apr 1999 07:20:46 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Looking for Tutoral Referenced in the Perl Cookbook
Message-Id: <3714962e@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
danbeck@scott.net (Daniel Beckham) writes:
:the book mentions that I could find it in /usr/share/doc on most BSD-
:derived Unix systems.
:
:Anyone here remember that reference or might know where I can pickup that
:tutorial?
cd /usr/share/doc/psd/21.ipc/
make
--tom
--
"I just hope I'm never promoted to the level of my incontinence."
--Larry Wall
------------------------------
Date: Wed, 14 Apr 1999 09:48:53 -0500
From: danbeck@scott.net (Daniel Beckham)
Subject: Re: Looking for Tutoral Referenced in the Perl Cookbook
Message-Id: <MPG.117e66d3208210b7989689@news.idt.net>
Thanks, my linux box didn't have the tutorial in the doc directory and I
checked on a freebsd system, but didn't know the sub-directory.
Thanks!
Daniel
In article <3714962e@cs.colorado.edu>, tchrist@mox.perl.com says...
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc,
> danbeck@scott.net (Daniel Beckham) writes:
> :the book mentions that I could find it in /usr/share/doc on most BSD-
> :derived Unix systems.
> :
> :Anyone here remember that reference or might know where I can pickup that
> :tutorial?
>
> cd /usr/share/doc/psd/21.ipc/
> make
>
> --tom
>
------------------------------
Date: Wed, 14 Apr 1999 08:57:24 -0400
From: "Soulier, Michael (EXCHANGE:SKY:1Z22)" <msoulier@americasm01.nt.com>
Subject: Re: MLDBM
Message-Id: <371490B4.33EC7622@americasm01.nt.com>
Jonathan Feinberg wrote:
>
> It would help us to help you if
>
> 1) You showed us some code that doesn't do what you expect it to do,
> and
Here's my code:
#!/usr/bin/perl
use SDBM_File;
use MLDBM qw(SDBM_File);
use Fcntl;
use strict;
my (
%streamData,
$filename
);
$filename = "streambase.dat";
# Tie the data hash to the file
tie (%streamData, 'MLDBM', $filename, O_CREAT|O_RDWR, 0666)
or die("Cannot access $filename: $!\n");
if ($ARGV[0] eq "init") {
initData(\%streamData);
}
else {
dumpData(\%streamData);
}
untie(%streamData);
sub initData {
my $hashRef = shift;
$$hashRef{'peg00'}{'build_dir'} = "/opt/corp/fwplb7";
$hashRef->{'peg07'}->{'build_dir'} = "/opt/corp/fwplb8";
$hashRef->{'peg05'}->{'build_dir'} = "/opt/corp/fwplb9";
}
sub dumpData {
my $hashRef = shift;
print "The streams supported are:\n";
foreach my $key (sort keys %$hashRef) {
print "\t$key\n";
}
foreach my $key (sort keys %$hashRef) {
print "The build_dir for $key is $hashRef->{$key}->{'build_dir'}\n";
}
}
>
> 2) You tell us what you expect it to do!
I expect it to serialize the hash to the file, so that when I tie it
again to retrieve the data, the tie automatically links the file with
the hash, making the storage and update completely transparent to me.
That's the purpose of the MLDBM module.
The above code works on my Linux system. However, on HP/UX, it's not
getting the associated strings with 'build_dir'.
Oh, and I'm aware that the -> -> isn't necessary for standard hash use,
but I found on my Linux system that it was, with the MLDBM module. I
don't know why.
Any help would be appreciated.
Thanks,
Mike
--
Michael P. Soulier
1Z22, SKY
Tel: 613-765-4699 (ESN: 39-54699)
Email: msoulier@nortelnetworks.com
Carrier Packet Solutions
Nortel Networks Corporation
"...the word HACK is used as a verb to indicate a massive amount
of nerd-like effort."
-Harley Hahn, A Student's Guide to UNIX
------------------------------
Date: 14 Apr 1999 08:39:33 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: "Soulier, Michael (EXCHANGE:SKY:1Z22)" <msoulier@americasm01.nt.com>
Subject: Re: MLDBM
Message-Id: <m3aewbbcl6.fsf@joshua.panix.com>
"Soulier, Michael (EXCHANGE:SKY:1Z22)" <msoulier@americasm01.nt.com> writes:
> my $hashRef = shift;
> $$hashRef{'peg00'}{'build_dir'} = "/opt/corp/fwplb7";
> $hashRef->{'peg07'}->{'build_dir'} = "/opt/corp/fwplb8";
> $hashRef->{'peg05'}->{'build_dir'} = "/opt/corp/fwplb9";
Your problem is addressed in the MLDBM documentation, under number 1
in the BUGS section.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Wed, 14 Apr 1999 09:44:42 -0400
From: "Aaron Glahe" <glahea@wwdsi.com>
Subject: Newbie Question: String Manipulation
Message-Id: <7f25mq$phm$1@clarknet.clark.net>
I am using Perl 5.005
I have a string
$cgi1 = "GET /cgi-bin/test?xxxxx"
I would like to strip out the first and last part and have "test" be left.
How would I do that. I do not want to depend on looking for "test", but
would rather
strip off "GET /cgi-bin/" and "?xxxx"
Thanks in advance.
------------------------------
Date: Wed, 14 Apr 1999 15:43:22 +0200
From: "Vincent Vanbiervliet" <vvb@ibm.net>
Subject: Re: Password encryption - found the solution (I think)
Message-Id: <37149aea@news.uk.ibm.net>
Hmm. The Perl book (the camel) said there is no easy way to encrypt and
decrypt a password, other then guessing. Maybe I misunderstood what this
meant, but when I use the routine from the book
if (crypt($guess,$pass) eq $pass) ...
and I create $pass as being crypt('mypassword', ''), it works...
So this solves my problem. :-)
Vincent Vanbiervliet
http://learn.ibm.be
------------------------------
Date: Wed, 14 Apr 1999 15:37:57 +0200
From: "Vincent Vanbiervliet" <vvb@ibm.net>
Subject: Password encryption
Message-Id: <371499a1@news.uk.ibm.net>
Hi,
I need to be able to create .htaccess and .htpasswd files on the fly. To do
this, I thought I'd use a perl script where you can enter a userid and
password, and that would then create the needed files.
Problem is that I don't see any way to create the password file. I know in a
Unix environment, there's this command 'htpasswd' that you can use, but as
far as I know, there's no win32 variant of it (I'm using WinNT).
Thanks,
Vincent Vanbiervliet
http://learn.ibm.be
------------------------------
Date: 14 Apr 1999 12:03:55 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl and MS Access
Message-Id: <3714761b.0@newsread3.dircon.co.uk>
Thomas Goesmann <goesmann@do.isst.fhg.de> wrote:
> Hi,
>
> this is maybe a very simple question:
>
> How can I access a MS Access database in Perl?
> The most important requirement is to keep it really SIMPLE.
> What modules are needed?
Win32::ODBC
Its home page at <http://www.roth.net/odbc/>
Alternatively you can use ADO (ActiveX Data Objects) or DAO
(Data Access Objects) from Win32::OLE - this is discussed in the
Perl for Win32 FAQ that comes with the ActivePerl Distribtution.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: 14 Apr 1999 11:13:26 GMT
From: Christoph Schmitz <cschmitz@stud.informatik.uni-trier.de>
Subject: Re: Perl or C?
Message-Id: <7f1t8m$ngd$1@fu-berlin.de>
Alan J. Flavell <flavell@mail.cern.ch> wrote:
: On Sun, 11 Apr 1999 airplanes@altavista.net wrote:
:> Which is a better language to lean - C or Perl???
: One respected colleague considers that the best way to start programming
: is with Java, even though you subsequently migrate to something else for
: your "real work". It's the object orientation, you see. I rather
: suspect he's right. But it all depends on what you want to achieve.
I'd support the idea of using Java as a first language. Concerning
programming in general, I'd like to recommend "The Structure and
Interpretation of Computer Programs" by Abelson and Sussman. Although
this book uses Scheme (which I personally don't like very much), it
focuses on general programming techniques and should be a good starting
point.
Christoph
--
-- Christoph Schmitz <cschmitz(at)stud.informatik.uni-trier.de> --
There's got to be more to life than compile-and-go.
------------------------------
Date: Wed, 14 Apr 1999 12:38:59 GMT
From: matthew.freake@smlawpub.co.uk
Subject: Re: Perl regexps compared to Python regexps
Message-Id: <7f2293$3jc$1@nnrp1.dejanews.com>
In article <slrn7h54l4.5k0.sholden@pgrad.cs.usyd.edu.au>,
sholden@cs.usyd.edu.au wrote:
> A python user will know much better than clpm readers...
>
> --
> Sam
Yup, but I thought Python users would be more likely to be pro-Python and as
I was looking for failings with Python compared to Perl I thought here a good
place to start.
Thanks to everyone for their comments, they've proved really useful. From
what I can make out, any weakness that Python's reg exps have are in areas a
little too esoteric for the kind of stuff I do.
Cheers
Matt Freake
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 14 Apr 1999 13:38:07 GMT
From: zoltan.bodi@socgen.com (Bodi Zoltan)
Subject: Problem duping STDERR to a filehandle
Message-Id: <371699b7.25981960@primo.socgen.hu>
To redirect my warns to a file I reopen STDERR to the desired FH.
My problem is that if I close STDERR before reopening it the warn
wont output anything anywhere.
open FH, ">outfile";
# close STDERR; #Try uncomment this...
open STDERR, ">&FH";
print STDERR "Printing to STDERR...\n";
warn "Where it goes?\n";
Anybody wants to enlighten me what's happening?
Thanks,
Zoltan
------------------------------
Date: Wed, 14 Apr 1999 11:13:11 GMT
From: mike@w3z.com (Mike Collins)
Subject: Re: Q: Convert two newlines to \n<p>
Message-Id: <371477cd.3214096@news.netway.com>
On Tue, 13 Apr 1999 21:12:25 -0500, therzog@knotech.com (Tim Herzog)
wrote:
>>undef $/;
>>while (<TXTFILE>){
>> s/\n\n/\n<p>/sg; #Not even close!
>> print;
>>}
>undef'ing the globals doesn't work very well. Try this instead:
>$everything = join("", <TXTFILE>);
>$everything =~ s/\n\n/\n<p>/sg;
Negative. TXTFILE is open but for some reason the substitution doesn't
seem to detect the two newlines.
Still scratching my head.
------------------------------
Date: Wed, 14 Apr 1999 11:19:51 GMT
From: mike@w3z.com (Mike Collins)
Subject: Re: Q: Convert two newlines to \n<p>
Message-Id: <37157884.3396398@news.netway.com>
On Wed, 14 Apr 1999 04:05:27 GMT, Rick Delaney <rick.delaney@home.com>
wrote:
>> The code shown and many, many variations all fail.
>>
>> undef $/;
>> while (<TXTFILE>){
>> s/\n\n/\n<p>/sg; #Not even close!
>> print;
>> }
>Works for me, assuming TXTFILE refers to an open file. Maybe you want a
>little more that what you're telling us.
It may work for you but it doesn't work for me. Believe me, I'm not
being theroretical. And yes, TXTFILE is open.
The substitution doesn't seem to detect the two new lines, if it does,
it's not doing anything about it. Talk about lazy! There's not much
more to tell you other than I'd like to read through a plain text file
with a regex that counts consecutive newlines.
The more part would be to remove single newlines and convert two or
more consecutive newlines to the change indicated in the substitution
above.
Text::Wrap doesn't do enough for me. If I can get the ISP I'm working
through to add Text::Format, that may help, but the basic problem
remains, I'm having trouble manipulating newlines.
------------------------------
Date: 14 Apr 1999 13:01:43 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Q: Convert two newlines to \n<p>
Message-Id: <371483a7.0@newsread3.dircon.co.uk>
Mike Collins <mike@w3z.com> wrote:
> On Tue, 13 Apr 1999 21:12:25 -0500, therzog@knotech.com (Tim Herzog)
> wrote:
>>$everything =~ s/\n\n/\n<p>/sg;
>
> Negative. TXTFILE is open but for some reason the substitution doesn't
> seem to detect the two newlines.
>
Are you sure you have \n\n where you think you have and not \r\n\r\n
instead ? You could try looking at the file with od to see what is
really there.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: 14 Apr 1999 06:54:01 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Q: Convert two newlines to \n<p>
Message-Id: <37148fe9@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, Jonathan Stowe <gellyfish@gellyfish.com> writes:
:Are you sure you have \n\n where you think you have and not \r\n\r\n
:instead?
All systems end text lines in "\n". Are you forgetting the
transparent conversions?
--tom
--
Comments on data are usually much more helpful than on algorithms. --Rob Pike
------------------------------
Date: Wed, 14 Apr 1999 13:47:43 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Q: Convert two newlines to \n<p>
Message-Id: <37169bec.16002618@news.skynet.be>
Tom Christiansen wrote:
>In comp.lang.perl.misc, Jonathan Stowe <gellyfish@gellyfish.com> writes:
>:Are you sure you have \n\n where you think you have and not \r\n\r\n
>:instead?
>
>All systems end text lines in "\n". Are you forgetting the
>transparent conversions?
Doesn't work if, for example, the HTML files come from a Windows Thing,
and the script is on Unix. Or there's that bizarre behaviour of
Netscape, if you save a HTML file, and inspect it, there's always TWO
CR's and ONE LF.
Getting rid of all "\r" may be a safe idea, in any case.
tr/\r//d;
Bart.
------------------------------
Date: 14 Apr 1999 07:54:24 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Q: Convert two newlines to \n<p>
Message-Id: <37149e10@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, bart.lateur@skynet.be (Bart Lateur) writes:
:Getting rid of all "\r" may be a safe idea, in any case.
: tr/\r//d;
Oh good. You're on a Mac, and you've just deleted all the linefeeds.
--tom
--
"All things are possible, but not all expedient." (in life, UNIX, and perl) -me
------------------------------
Date: Wed, 14 Apr 1999 15:17:15 +0200
From: "Dagfinn Reiersxl" <nospam.reiersol@onlinel.no>
Subject: Re: Question: How to create a logfile?
Message-Id: <sz0R2.165$y75.152@news1.online.no>
You can do it by tying the STDOUT filehandle. (See the "perltie" doc.) By
tying the file handle to your own object, you can write a print method for
the object that will do whatever you want with the output. I've used this to
fool a script into believing it was reading from STDIN and printing to
STDOUT when it was actually being used as a routine, being passed a string
and returning a string. (The intention was having to change the script as
little as possible, since it was tested and stable.)
>Hi everybody,
>I have a problem to create a logfile? How can I manage it, that my programm
>writes simultaniously
> to my STDOUT and a file. I believe I have to use a pipe, but i could not
>find any reference, which
>explains how to do this.
>
>Tahnaks for any help,
>Daniel M|ller
------------------------------
Date: Wed, 14 Apr 1999 10:59:38 GMT
From: Jeremy Gurney <c4jgurney@my-dejanews.com>
Subject: Re: Registry Information
Message-Id: <7f1sen$uqd$1@nnrp1.dejanews.com>
In article <3714CF0F.EC9B248C@rational.com>,
alan rogers <arogers@rational.com> wrote:
> Hi,
>
> I wonder if anybody out there could help me.
> I need to get information from the NT Registry and pass it into a
> variable so I use in my program
> This is the registry information is this
> HKEY_LOCAL_MACHINE\SOFTWARE\ATRIA\ClearCase\CurrentVersion\ProductHome
>
> If any body can help thank you
>
> Best Regards
> Alan rogers
>
>
Alan,
Have a look at the documentation for Win32API::Registry - what you want to do
is covered there.
HTH,
Jeremy Gurney
SAS Programmer | Proteus Molecular Design Ltd.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 14 Apr 1999 08:47:19 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: "kal@valistech.com" <kal@valistech.com>
Subject: Re: removing ^M, ^B and other wierd chars
Message-Id: <m37lrfbc88.fsf@joshua.panix.com>
"kal@valistech.com" <kal@valistech.com> writes:
> If I ftp'd text files (in ascii mode) that contain the above characters,
> how do I get rid of them?
> what regex would clean them off.
See the following documentation: perlop (in the section entitled
"Quote and Quote-like Operators"), which will explain how to represent
control characters; perlop (in the section entitled
"tr/SEARCHLIST/REPLACEMENTLIST/cds"), which will explain the use of
the tr operator.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Wed, 14 Apr 1999 07:24:50 -0600
From: Gordon Shannon <gordon.shannon@Central.Sun.COM>
Subject: Unitialized var errors & -w flag
Message-Id: <37149722.AECC97E4@Central.Sun.COM>
A point of philosophy. I disagree with the way Perl acts when
-w is on, with regard to unitialized variables. Can anyone
change my mind?
Issue 1: Consider the following code.
% #Test A:
% perl -we 'my $foo; print "OK\n" if $foo != 1'
Use of uninitialized value at -e line 1.
OK
% #Test B:
% perl -we 'my $foo; print "OK\n" if !$foo'
OK
It seems inconsistent. Either both should produce the warning
or neither should. Obviously Perl is looser with the concept of
"truth" than that of actual value.
Issue 2: I don't think either should produce a warning! I don't see
the harm in using unitialized variables. Indeed, I think using
them is reasonably in keeping with the spirit of Perl, with its
loose types. I've yet to see this warning actually point out bad code.
After all, this isn't C/C++ where an uninitialized variable might
have garbage (at least the automatic ones). I know, I can just not
use -w, but I still want it, so it can find *real* problems.
As it is, if I have a list of vars to declare, I end up doing stuff like
my ($a, $b, $c, $d, $e) = ('', '', '', '', '');
which seems like too much work for Perl code.
Opinions/comments?
--
Gordon Shannon
Sun Microsystems
------------------------------
Date: 14 Apr 1999 07:57:05 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Unitialized var errors & -w flag
Message-Id: <37149eb1@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, Gordon Shannon <gordon.shannon@Central.Sun.COM> writes:
: % perl -we 'my $foo; print "OK\n" if !$foo'
: It seems inconsistent. Either both should produce the warning
: or neither should. Obviously Perl is looser with the concept of
: "truth" than that of actual value.
Perl's notion of truth is much more powerful and flexible than yours.
Don't write == 0 or == 1 or eq '' or ne '' or m/./ or anything like that.
There are many valid values of true. There are several valid values
of false. Let your true be true, your false be false. Leave it at that.
Don't freak.
--tom
--
Ask Ken. He hates Everything.
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 5380
**************************************