[22002] in Perl-Users-Digest
Perl-Users Digest, Issue: 4224 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 6 06:05:56 2002
Date: Fri, 6 Dec 2002 03:05:11 -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 Fri, 6 Dec 2002 Volume: 10 Number: 4224
Today's topics:
Array problem. <spikey-wan@bigfoot.com>
Re: Array problem. <josef.moellers@fujitsu-siemens.com>
Re: Array problem. <bernard.el-hagin@DODGE_THISlido-tech.net>
Re: Array problem. <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
Re: Array problem. <bart.lateur@pandora.be>
Re: Benchmark testing <palladium@spinn.net>
creating new linux user passwd using perl (Mitchell Laks)
Re: creating new linux user passwd using perl (Jay Tilton)
Re: Deleting from arrays <wksmith@optonline.net>
Re: Deleting from arrays (Anno Siegel)
Re: Deleting from arrays <bart.lateur@pandora.be>
Re: Getting a URL Page <cboston@e-duct-tape.com>
Re: Getting a URL Page <tassilo.parseval@post.rwth-aachen.de>
Re: help: multi-dimensional hash from flat array (Simon Hardy-Francis)
how to create database & tables using DBI Perl ? <paul@nohotmail..com>
Re: how to create database & tables using DBI Perl ? <linuxnb@yahoo.com>
Re: how to create database & tables using DBI Perl ? <bart.lateur@pandora.be>
how to use DBM or DBI ? <paul@nohotmail..com>
Re: how to use DBM or DBI ? <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
License cost for commercial use? <m.bosgraaf@biotopen.nl>
Re: License cost for commercial use? (Anno Siegel)
Re: License cost for commercial use? <bernard.el-hagin@DODGE_THISlido-tech.net>
Re: mysql <bart.lateur@pandora.be>
Re: perl DBI / Mysql / Apache / ikonboard problem (Marek Ochal)
Re: read from a process <RobTM@fake.addr.ess>
Re: read from a process <RobTM@fake.addr.ess>
Re: reference to a tied hash (Anno Siegel)
smoother way to create an inital array <a@b.c>
Re: smoother way to create an inital array <bernard.el-hagin@DODGE_THISlido-tech.net>
Re: smoother way to create an inital array (Anno Siegel)
Re: Win32 and *NIX, cryptographically secure random num (Sisyphus)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 6 Dec 2002 09:51:48 -0000
From: "Richard S Beckett" <spikey-wan@bigfoot.com>
Subject: Array problem.
Message-Id: <aspsd0$bje$1@newshost.mot.com>
Chaps,
I had a routine to disable all the buttons in my Tk GUI that went like
this...
sub disable_buttons {
$button1 -> configure (-state => 'disable');
$button2 -> configure (-state => 'disable');
$button3 -> configure (-state => 'disable');
$button4 -> configure (-state => 'disable');
etc...
}
I was long and laborious, and I had to repeat it to enable them all later.
So, I had a bright idea and tried this...
my @buttons = "\$button1, \$button2, \$button3, etc...";
sub disable_buttons {
foreach $button (@buttons) {
$button -> configure (-state => 'disable');
}
}
But it doesn't work. How should I do this properly?
Thanks.
R.
------------------------------
Date: Fri, 06 Dec 2002 11:08:41 +0100
From: Josef =?iso-8859-1?Q?M=F6llers?= <josef.moellers@fujitsu-siemens.com>
Subject: Re: Array problem.
Message-Id: <3DF07729.7FA86B0D@fujitsu-siemens.com>
Richard S Beckett wrote:
> =
> Chaps,
> =
> I had a routine to disable all the buttons in my Tk GUI that went like
> this...
> =
> sub disable_buttons {
> $button1 -> configure (-state =3D> 'disable');
> $button2 -> configure (-state =3D> 'disable');
> $button3 -> configure (-state =3D> 'disable');
> $button4 -> configure (-state =3D> 'disable');
> etc...
> }
> =
> I was long and laborious, and I had to repeat it to enable them all lat=
er.
> So, I had a bright idea and tried this...
> =
> my @buttons =3D "\$button1, \$button2, \$button3, etc...";
> sub disable_buttons {
> foreach $button (@buttons) {
> $button -> configure (-state =3D> 'disable');
> }
> }
> =
> But it doesn't work. How should I do this properly?
my @buttons =3D ($button1, $button2, , $button3, ...);
The rest should work.
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
------------------------------
Date: Fri, 6 Dec 2002 10:12:31 +0000 (UTC)
From: Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: Array problem.
Message-Id: <aspt6f$q3n$2@korweta.task.gda.pl>
In article <aspsd0$bje$1@newshost.mot.com>, Richard S Beckett wrote:
> Chaps,
>
> I had a routine to disable all the buttons in my Tk GUI that went like
> this...
>
> sub disable_buttons {
> $button1 -> configure (-state => 'disable');
> $button2 -> configure (-state => 'disable');
> $button3 -> configure (-state => 'disable');
> $button4 -> configure (-state => 'disable');
> etc...
> }
>
> I was long and laborious, and I had to repeat it to enable them all later.
> So, I had a bright idea and tried this...
>
> my @buttons = "\$button1, \$button2, \$button3, etc...";
my @buttons = ($button1, $button2, $button3, ...);
Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'
------------------------------
Date: Fri, 06 Dec 2002 11:22:49 +0100
From: Koos Pol <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
Subject: Re: Array problem.
Message-Id: <newscache$1u0p6h$iaf$1@news.emea.compuware.com>
Richard S Beckett wrote (Friday 06 December 2002 10:51):
> Chaps,
>
> I had a routine to disable all the buttons in my Tk GUI that went like
> this...
>
> sub disable_buttons {
> $button1 -> configure (-state => 'disable');
> $button2 -> configure (-state => 'disable');
> $button3 -> configure (-state => 'disable');
> $button4 -> configure (-state => 'disable');
> etc...
> }
>
> I was long and laborious, and I had to repeat it to enable them all later.
That is not a Good Thing.
> So, I had a bright idea and tried this...
That _is_ a Good Thing!
> my @buttons = "\$button1, \$button2, \$button3, etc...";
Make this:
my @buttons = ($button1, $button2, $button3);
In your code the list consists of only one string value.
(As Tk buttons are already object refs, you can leave away the \.)
> sub disable_buttons {
> foreach $button (@buttons) {
> $button -> configure (-state => 'disable');
Now this works becuase $button is an object ref. In your original
example you should have been using $$button, because your were
passing reference references!
Even better would be to isolate the function arguments from
the calling arguments, as in:
my @buttons = ($button1,$button2,$button3);
disable_buttons(@buttons); # pass the object refs...
sub disable_buttons {
my @b = @_; # and fetch them here...
foreach my $b (@b) {
$b->configure (-state => 'disable');
}
}
HTH
--
KP
------------------------------
Date: Fri, 06 Dec 2002 10:50:38 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Array problem.
Message-Id: <1tv0vu41ioomr1ldfr470ehmkpnaop1q5d@4ax.com>
Richard S Beckett wrote:
>I had a routine to disable all the buttons in my Tk GUI that went like
>this...
>
>sub disable_buttons {
> $button1 -> configure (-state => 'disable');
> $button2 -> configure (-state => 'disable');
> $button3 -> configure (-state => 'disable');
> $button4 -> configure (-state => 'disable');
> etc...
>}
>
>I was long and laborious, and I had to repeat it to enable them all later.
>So, I had a bright idea and tried this...
>
>my @buttons = "\$button1, \$button2, \$button3, etc...";
A string!?!?! At least, you should have tried
my @buttons = (\$button1, \$button2, \$button3);
>sub disable_buttons {
> foreach $button (@buttons) {
> $button -> configure (-state => 'disable');
> }
>}
>
>But it doesn't work.
Of course it doesn't. You're using a reference to an object instead of
an object. Note that in Perl, an object is a blessed reference, so if
you do an assignment with a Perl object, you make a copy of the
reference, no of the object. So in
$a = new Foo;
$b = $a;
now $a and $b both point to the same object, and you can use them
interchangeably.
>How should I do this properly?
To make a long story short: loop through the scalars containing the
blessed references. Despite your subject line, you don't need an array,
you can just do:
sub disable_buttons {
foreach my $button ($button1, $button2, $button3) {
$button -> configure (-state => 'disable');
}
}
--
Bart.
------------------------------
Date: Thu, 5 Dec 2002 21:40:56 -0700
From: "Rod" <palladium@spinn.net>
Subject: Re: Benchmark testing
Message-Id: <uv0c00a6psg2b8@corp.supernews.com>
"doofus" <jim.bloggs@eudoramail.com> wrote in message
news:aspamc$t8pub$1@ID-150435.news.dfncis.de...
> What's a good way of stepping through a program to find out what's
> taking it so long.
http://search.cpan.org/search?query=BenchMark&mode=all
You should be able to find something here.
Rodney
------------------------------
Date: 5 Dec 2002 22:24:29 -0800
From: mlaks2000@yahoo.com (Mitchell Laks)
Subject: creating new linux user passwd using perl
Message-Id: <ab3b13db.0212052224.2885a184@posting.google.com>
Hi i am trying to use perl script to create a new user passwd. the
following script almost works
#!/usr/bin/perl
my $password="bar";
print "we now change password for foo \n ";
open(PASS, "|passwd --stdin foo");
print PASS "$password \n";
print PASS "$password \n";
close(PASS);
output from running it:
./try.pl
we nowchange password for foo
Changing password for user foo.
passwd: all authentication tokens updated successful
so it seems to work... but when you try login to the account
the password "bar" doesnt work.
why?
i also tried using
print PASS "$password "; insead of
print PASS "$password \n"; but it doesnt help
thanks wizards!
------------------------------
Date: Fri, 06 Dec 2002 08:52:49 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: creating new linux user passwd using perl
Message-Id: <3df06491.118491352@news.erols.com>
mlaks2000@yahoo.com (Mitchell Laks) wrote:
: Hi i am trying to use perl script to create a new user passwd. the
: following script almost works
:
: #!/usr/bin/perl
: my $password="bar";
: print "we now change password for foo \n ";
: open(PASS, "|passwd --stdin foo");
: print PASS "$password \n";
^
: print PASS "$password \n";
^
: close(PASS);
[...]
: the password "bar" doesnt work.
Does the space after the password really belong?
Are you sure it's not being changed to "bar "?
------------------------------
Date: Fri, 06 Dec 2002 05:16:29 GMT
From: "Bill Smith" <wksmith@optonline.net>
Subject: Re: Deleting from arrays
Message-Id: <NoWH9.1$jy.0@news4.srv.hcvlny.cv.net>
"OaxacaGangster" <oaxacagangster@cs.com> wrote in message
news:20021205171921.14181.00000159@mb-cj.news.cs.com...
> When I delete an index from an array, the entry is somehow
uninitialized.
> I know the actual list size is not reduced by one unless the deleted
element is
> at
> the end of the list.
> When I do an " exists $list[4]", it returns true.
>
> According to Programming Perl by Larry Wall, it should return false.
>
> I am using Perl 5.6
In earlier version of Perl, "delete" and "exists" were only defined for
hash elements. They referred to the key, not the value. Neither
Programming Perl nor the perldoc in 5.6.1 clearly explain their
extension to array elements. It seems that "exists $list[4]" and
"defined $list[4]" should always give the same result. If so, I prefer
"defined".
Could anyone give an example where this is not true?
Bill
------------------------------
Date: 6 Dec 2002 05:46:39 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Deleting from arrays
Message-Id: <aspdjv$qko$1@mamenchi.zrz.TU-Berlin.DE>
According to Bill Smith <wksmith@optonline.net>:
>
> "OaxacaGangster" <oaxacagangster@cs.com> wrote in message
> news:20021205171921.14181.00000159@mb-cj.news.cs.com...
> > When I delete an index from an array, the entry is somehow
> uninitialized.
> > I know the actual list size is not reduced by one unless the deleted
> element is
> > at
> > the end of the list.
> > When I do an " exists $list[4]", it returns true.
> >
> > According to Programming Perl by Larry Wall, it should return false.
> >
> > I am using Perl 5.6
>
> In earlier version of Perl, "delete" and "exists" were only defined for
> hash elements. They referred to the key, not the value. Neither
> Programming Perl nor the perldoc in 5.6.1 clearly explain their
> extension to array elements. It seems that "exists $list[4]" and
> "defined $list[4]" should always give the same result. If so, I prefer
> "defined".
>
> Could anyone give an example where this is not true?
An array element exists if its index is smaller than the length of the
array. It still can be undefined, as for index 1 in this example:
my @x = ( 1, undef);
for my $i ( 0 .. 3) {
print "$i\n" if not defined $x[ $i] and exists $x[ $i];
}
Anno
------------------------------
Date: Fri, 06 Dec 2002 09:35:19 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Deleting from arrays
Message-Id: <6ir0vusdkf8bcft92n5vbsd9bv46g6ac7g@4ax.com>
Bill Smith wrote:
>It seems that "exists $list[4]" and
>"defined $list[4]" should always give the same result.
They needn't. The exists() function on arrays exist to be able to
emulate hashes on top of an underlying array implementation, the
so-called pseudo-hashes. There's no reason in the world why a normal
person would ever use it on a normal array. As you said: an array
element ought to be thought of as existing as soon as it is within the
index range for this array, which for common uses is from 0 to 1 less
than the size of the array.
I would think that people who want to delete() an array element,are
actually looking for splice(). (Or grep().)
--
Bart.
------------------------------
Date: Fri, 6 Dec 2002 04:01:30 -0500
From: "Chris Boston" <cboston@e-duct-tape.com>
Subject: Re: Getting a URL Page
Message-Id: <TsZH9.28008$nd5.12683@news.bellsouth.net>
I agree with the dont triple post. That was an accident. Had some network
problems.
And as to why I wrote what I did. It is just an example. As you well know
there are about a million ways to do everything in perl. This is just one
that was quick and dirty that I know will work.
"Uri Guttman" <uri@stemsystems.com> wrote in message
news:x7bs40q7tw.fsf@mail.sysarch.com...
> >>>>> "CB" == Chris Boston <cboston@e-duct-tape.com> writes:
>
> don't top post.
>
> and don't triple post.
>
> CB> Here is an example to get just a certain page off of a webserver
> CB> and write it to an output file that you can do something with
> CB> later, or you can pipe the oupt of wget to another process and
> CB> dont have to write the file.
>
> CB> $get = "/usr/local/bin/wget --output-document=google.index.html";
> CB> $link = "http://www.google.com/index.html";
> CB> system("$get $link");
>
> CB> once you install wget just issue wget --help and it will give you
more
> CB> options than you will probably ever use.
>
> and running a process from perl when it is not needed is good in what
> way?
>
> and that is better than LWP how?
>
> and how well does that handle & in the url?
>
> and why would you pipe the output to another process when you can read
> it in perl directly?
>
> and why did you basically write a shell script in perl?
>
> if you can answer those questions, then you might be able to answer
> others in this newsgroup.
>
> uri
>
> --
> Uri Guttman ------ uri@stemsystems.com --------
http://www.stemsystems.com
> ----- Stem and Perl Development, Systems Architecture, Design and
Coding ----
> Search or Offer Perl Jobs ----------------------------
http://jobs.perl.org
------------------------------
Date: 6 Dec 2002 09:38:04 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de>
Subject: Re: Getting a URL Page
Message-Id: <aspr5s$83b$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Chris Boston:
> "Uri Guttman" <uri@stemsystems.com> wrote in message
> news:x7bs40q7tw.fsf@mail.sysarch.com...
>> >>>>> "CB" == Chris Boston <cboston@e-duct-tape.com> writes:
>>
>> don't top post.
>>
>> and don't triple post.
> I agree with the dont triple post. That was an accident. Had some network
> problems.
>
> And as to why I wrote what I did. It is just an example. As you well know
> there are about a million ways to do everything in perl. This is just one
> that was quick and dirty that I know will work.
While there may be million ways to do everything in Perl there is only
one way to do it in this newsgroup: Silently ignoring what Uri said
about top-posting isn't it. (In fact, it is one way - and actually a
good one - to find your way into people's killfiles).
So once again:
Do not top-post! Just in case this term is unclear to you, it means do
not put your reply on top of the stuff you reply to.
Do not quote signatures either. Do not quote those parts you are not
referring to in your reply.
Taking that into account will make reading your postings much easier for
the group and increase your chances of getting a useful reply.
Tassilo
--
$_=q!",}])(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus;})(rekcah{lrePbus;})(lreP{rehtonabus;})(rehtona{tsuJbus!;
$_=reverse;s/sub/(reverse"bus").chr(32)/xge;tr~\n~~d;eval;
------------------------------
Date: 6 Dec 2002 02:55:42 -0800
From: simonhf@web.de (Simon Hardy-Francis)
Subject: Re: help: multi-dimensional hash from flat array
Message-Id: <c19bcaa7.0212060255.c5eacd8@posting.google.com>
Benjamin Goldberg <goldbb2@earthlink.net> wrote in message news:<3DEFCBF2.35F53A89@earthlink.net>...
> Simon Hardy-Francis wrote:
> > Just for completeness then here's the compact version without any
> > loops:
> >
> > my $var = "a-b-c-d-e";
> > my %h;
> > (my $statement = qq[\$h{$var}=823]) =~ s/-/}{/g;
>
> The /g on your s/// performs a loop.
Correct. But this "implicit" loop works much faster at run-time than
the equivalent "explicit" loop. However in the example code then any
run-time speed advantage gained in this way is lost by the very slow
eval statement. In all then the solution I suggested works about 3
times slower than your solution. On the plus side then it might be
considered easier to debug and/or maintain for non-Perl-Gurus (please
see snipprt of run-time generated code below). What do you think?
Having said all this then I normally go for recursive solutions
specifically for the performance reasons. However in this thread then
Damian already made that offering...
> > eval $statement;
>
> Out of curiousity, what happens if someone has a string like:
>
> 'a-b-system "rm /*"-c-d'
This is an excellent example of how something dangerous can occur--and
a good reason why one should not conduct everyday business logged in
as "root" :-)
What we really want is run-time generated code looking like this in
order to avoid danger:
$h{'a'}{'b'}{'system "rm /*"'}{'c'}{'d'}="test0";
$h{'a'}{'b'}{'c'}{'d'}{'e'}="test1";
$h{'f'}{'g'}{'h'}{'i'}{'j'}="test2";
$h{'a'}{'g'}{'h'}{'i'}{'j'}="test3";
$h{'a'}{'b'}{'h'}{'i'}{'j'}="test4";
$h{'f'}{'g'}{'c'}{'d'}{'e'}="test5";
Produced from:
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my %h;
my $statements = join ("", <DATA>);
$statements =~ s/^(.+)$/\$h\{'$1;/gm;
$statements =~ s/-/'\}\{'/gm;
$statements =~ s/(\{[^=]+)=/$1'\}=/gm;
eval $statements;
warn() if $@;
print Dumper( \%h );
exit;
__DATA__
a-b-system "rm /*"-c-d="test0"
a-b-c-d-e="test1"
f-g-h-i-j="test2"
a-g-h-i-j="test3"
a-b-h-i-j="test4"
f-g-c-d-e="test5"
Such a danger could pop-up anywhere if one doesn't beware:
my %h;
my $var = 'a-b-system "rm /*"-c-d';
my $href = \%h;
my @keys = split /-/, $var, -1;
my $finalkey = pop @keys;
foreach( @keys ) {
$href = ( $href->{$_} ||= {} );
}
$href->{$finalkey} = 823;
# print $h{a}{b}{system "rm /*"}{c}{d}, "\n";
# ^^^ Danger, Will Robinson!
print $h{'a'}{'b'}{'system "rm /*"'}{'c'}{'d'}, "\n";
Greetings, Simon
------------------------------
Date: Fri, 6 Dec 2002 16:04:21 -0800
From: "paul-new" <paul@nohotmail..com>
Subject: how to create database & tables using DBI Perl ?
Message-Id: <3df05775$1_2@news.tm.net.my>
how to create database & tables using DBI Perl ?
how to select from tables ?
i run the script below and it says i have DBI Perl installed on my RH8.0
Ikonboard Path and Environment Test
This script checks your paths and environment variables and prints the
results based on its best information available.
The absolute path to this script is: /var/www/cgi-bin, on a Linux based
platform.
This server is running perl version: 5.008.
DOCUMENT_ROOT: /var/www/html.
CGI Version: 2.81
Has DB_File Perl module installed? Yes
Has CGI Perl module installed? Yes
Has DBI Perl module installed? Yes
Has DBD-Mysql Perl module installed? Yes
Results:
You can run either a DBM or SQL database as all required perl modules are
installed. You will need to contact your server administrator for SQL usage
information.
------------------------------
Date: Fri, 06 Dec 2002 09:11:50 GMT
From: matt <linuxnb@yahoo.com>
Subject: Re: how to create database & tables using DBI Perl ?
Message-Id: <qRZH9.135717$GR5.39855@rwcrnsc51.ops.asp.att.net>
paul-new wrote:
> how to create database & tables using DBI Perl ?
>
> how to select from tables ?
Didn't you just post this same question?
> You can run either a DBM or SQL database as all required perl modules are
> installed. You will need to contact your server administrator for SQL
> usage information.
Why don't you folow the advice of this script and contact them with your
question.
You could also read the DBI and DBD::mysql documentation on CPAN.
http://search.cpan.org/
------------------------------
Date: Fri, 06 Dec 2002 09:41:48 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: how to create database & tables using DBI Perl ?
Message-Id: <usr0vuofr7d971n3a0tehc2jvn8qurrsv9@4ax.com>
paul-new wrote:
>how to create database & tables using DBI Perl ?
>
>how to select from tables ?
Look up the DBI basic documentation, which comes with DBI. It's all in
there, really. Basically, you wrap some SQL statements in strings which
you then prepare and execute (and fetchrow* for select statements).
There's also some DBI FAQs on <http://dbi.perl.org>, and then there's
the hardcopy book, which gets you up to speed quickly. There's a sample
chapter online at O'Reilly's website which describes the basics. You can
find a direct link at the DBI homepage.
--
Bart.
------------------------------
Date: Fri, 6 Dec 2002 15:58:20 -0800
From: "paul-new" <paul@nohotmail..com>
Subject: how to use DBM or DBI ?
Message-Id: <3df0560d_1@news.tm.net.my>
hi, how do i use dbm ?
what are the commands to select, update, etc ?
Ikonboard Path and Environment Test
This script checks your paths and environment variables and prints the
results based on its best information available.
The absolute path to this script is: /var/www/cgi-bin, on a Linux based
platform.
This server is running perl version: 5.008.
DOCUMENT_ROOT: /var/www/html.
CGI Version: 2.81
Has DB_File Perl module installed? Yes
Has CGI Perl module installed? Yes
Has DBI Perl module installed? Yes
Has DBD-Mysql Perl module installed? Yes
Results:
You can run either a DBM or SQL database as all required perl modules are
installed. You will need to contact your server administrator for SQL usage
information.
------------------------------
Date: Fri, 06 Dec 2002 09:22:35 +0100
From: Koos Pol <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
Subject: Re: how to use DBM or DBI ?
Message-Id: <newscache$n9vo6h$27f$1@news.emea.compuware.com>
paul-new wrote (Saturday 07 December 2002 00:58):
> hi, how do i use dbm ?
>
> what are the commands to select, update, etc ?
>
> Ikonboard Path and Environment Test
>
> This script checks your paths and environment variables and prints the
> results based on its best information available.
>
>
> The absolute path to this script is: /var/www/cgi-bin, on a Linux based
> platform.
> This server is running perl version: 5.008.
> DOCUMENT_ROOT: /var/www/html.
> CGI Version: 2.81
>
> Has DB_File Perl module installed? Yes
> Has CGI Perl module installed? Yes
> Has DBI Perl module installed? Yes
> Has DBD-Mysql Perl module installed? Yes
>
> Results:
>
> You can run either a DBM or SQL database as all required perl modules are
> installed. You will need to contact your server administrator for SQL
> usage information.
Why are you multi posting? That is not Good Thing.
What is your Perl question?
This has all to do with your specific application (Ikonboard?) environment.
You must familiarize with it's instructions and documentation. There you
should find answers for your problems.
--
KP
------------------------------
Date: Fri, 6 Dec 2002 11:36:29 +0100
From: "Martijn J.M.W. Bosgraaf" <m.bosgraaf@biotopen.nl>
Subject: License cost for commercial use?
Message-Id: <aspv5a$i30$1@reader11.wxs.nl>
Hello,
Are there any costs for using Perl when making an application for commercial
distribution?
Thanks.
Martijn J.M.W. Bosgraaf
------------------------------
Date: 6 Dec 2002 10:51:55 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: License cost for commercial use?
Message-Id: <aspvgb$5qi$4@mamenchi.zrz.TU-Berlin.DE>
According to Martijn J.M.W. Bosgraaf <m.bosgraaf@biotopen.nl>:
> Hello,
>
> Are there any costs for using Perl when making an application for commercial
> distribution?
No.
Anno
------------------------------
Date: Fri, 6 Dec 2002 10:53:32 +0000 (UTC)
From: Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: License cost for commercial use?
Message-Id: <aspvjc$586$1@korweta.task.gda.pl>
In article <aspv5a$i30$1@reader11.wxs.nl>, Martijn J.M.W. Bosgraaf wrote:
> Hello,
>
> Are there any costs for using Perl when making an application for commercial
> distribution?
0 N, where N is your currency of choice.
Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'
------------------------------
Date: Fri, 06 Dec 2002 09:29:44 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: mysql
Message-Id: <khq0vu01e16cobhpl87pgdv13i007jkj9s@4ax.com>
David Means wrote:
>Where is a FAQ on how to construct this stuff for standard SQL
>connections. Say, Sybase, or MSSQL Server?
There isn't, AFAIK. The official DBI homepage is at
<http://dbi.perl.org>, the FAQ is now at
<http://www.xmlproj.com/cgi/fom.cgi> (a community project; still a bit
skeleton-like, at the moment).
BTW you best connect to MSSQL Server with DBD::ODBC, at least from
Windows. Why anyone would want to connect to MSSQL Server from any
platform is an open question to me... :-) Well, I gather you can still
use DBD::Sybase, though it's beyond my expertise.
The best way is to use Google to scan for sample scripts, one you figure
out which DBD to use. The basic connection string can be very simple,
but as soon as you need extra features, the syntax becomes quite driver
dependent. And you can always ask on the DBI Users mailing list (two
links away from the DBI homepage).
--
Bart.
------------------------------
Date: 6 Dec 2002 01:37:49 -0800
From: marek_ochal@yahoo.com (Marek Ochal)
Subject: Re: perl DBI / Mysql / Apache / ikonboard problem
Message-Id: <641abc57.0212060137.6b6454ad@posting.google.com>
"Matt Darcy" <matthew@darcy.demon.co.uk> wrote in message news:<aqp1dd$jrs$1@helle.btinternet.com>...
> Hi,
>
> I am trying to install and configure ikonboard on apache 1.3.27 with redhat
> linux 7.3
> [...]
I was installing IB3 and I had the same error message! The solution
was quite easy, although it took me several hours to find it :).
Simply go back to the screen named "Installing ikonboard files" and
choose "Extract the tar archives for me" insteed of "I have my
archives already extracted...(or so)".
There is another hint I would like to share: if you are new to
IkonBoard (as I was), on the next screen ("Tar archive setup") DON'T
choose default answer "No" to the second question ("Remove any old
databases..."). Insteed choose "Yes" and you'll probably save your
time...
Best regards
Marek
------------------------------
Date: 6 Dec 2002 08:46:30 GMT
From: Robert Szczygiel <RobTM@fake.addr.ess>
Subject: Re: read from a process
Message-Id: <slrn.pl.av0ov6.174.RobTM@pcmic25.cern.ch>
Benjamin Goldberg wrote:
>> open3( \*WRH, \*RDH, \*ERH, "perl",$pname,@args);
>> close( WRH );
>> my @stdout = <RDH>;
>> my @stderr = <ERH>;
>
> What happens if the program prints so much to it's stderr that it fills
> up the pipe? Writing will block, and the process will go to sleep until
> something reads from the other end of the pipe. But, since your parent
> process is first reading from the stdout, not the stderr, of the child
> process, it will block, waiting for EOF, and go to sleep. Since both
> processes are asleep, waiting for the other to do IO, the result is
> deadlock. Oops.
This was just an example to give an idea. The <RDH>,<ERH> can be treated
as any file handles. You can easily limit the number of lines, e.g:
$i=0;
$limit=<something>
while(<ERH>){
<do something with error line if you wish>
$i++;
last if $i>$limit;
}
The same with standard output.
RobTM:)
--
** - Why a bike cannot stand up by itself?
** - Because it is two-tyred!
-- http://3226865153/~szczygie --
------------------------------
Date: 6 Dec 2002 09:11:37 GMT
From: Robert Szczygiel <RobTM@fake.addr.ess>
Subject: Re: read from a process
Message-Id: <slrn.pl.av0qea.174.RobTM@pcmic25.cern.ch>
... and do not forget to kill the child when the error limit is
exceeded.
RobTM:)
--
** - Why a bike cannot stand up by itself?
** - Because it is two-tyred!
-- http://3226865153/~szczygie --
------------------------------
Date: 6 Dec 2002 10:50:43 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: reference to a tied hash
Message-Id: <aspve3$5qi$3@mamenchi.zrz.TU-Berlin.DE>
According to Brian McCauley <nobull@mail.com>:
> "Lois" <lois@hotmail.com> writes:
>
> > Is $r a reference to a tied hash?
> >
> > my $r = \tie %event, "DB_File", "events.db", O_CREAT | O_RDWR or die "$!\n";
>
> No. See "perldoc -f tie" for a description of the return value of the
> tie() function.
>
> > and when this is passed to a sub, how can %event be used.
>
> There is no way to infer \%event from the value in $r.
Absolutely. However, a reference to a tied hash can be obtained and used
like any other hashref:
tie %event, "DB_File", "events.db", O_CREAT | O_RDWR or die "$!\n";
my $r = \ %event;
$r->{ foo} = 123;
Anno
------------------------------
Date: Fri, 06 Dec 2002 11:09:42 +0100
From: ZZT <a@b.c>
Subject: smoother way to create an inital array
Message-Id: <aspt16$qol$1@news1.wdf.sap-ag.de>
Hello,
at this time I create an data-array (for easier looped processing) in
the header of my script like this way:
name[0]="...";
address[0]="...";
name[1]="...";
address[1]="...";
Is there a better way to create such an array?
thanks
------------------------------
Date: Fri, 6 Dec 2002 10:15:08 +0000 (UTC)
From: Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: smoother way to create an inital array
Message-Id: <asptbc$q3n$3@korweta.task.gda.pl>
In article <aspt16$qol$1@news1.wdf.sap-ag.de>, ZZT wrote:
> Hello,
>
> at this time I create an data-array (for easier looped processing) in
> the header of my script like this way:
>
> name[0]="...";
> address[0]="...";
>
> name[1]="...";
> address[1]="...";
>
> Is there a better way to create such an array?
I'm not sure what you're trying to do, but perhaps this is what you're
looking for:
@name = ('...') x @name;
@address = ('...') x @address;
Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'
------------------------------
Date: 6 Dec 2002 10:20:36 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: smoother way to create an inital array
Message-Id: <asptlk$5qi$1@mamenchi.zrz.TU-Berlin.DE>
According to ZZT <a@b.c>:
> Hello,
>
> at this time I create an data-array (for easier looped processing) in
> the header of my script like this way:
>
> name[0]="...";
> address[0]="...";
>
> name[1]="...";
> address[1]="...";
That is not Perl. Presumably you're doing
$name[ 0] = "...";
etc.
> Is there a better way to create such an array?
Who knows. It depends on how your raw data are given. If you are
setting them from strings in the source, this is an alternative:
@name = ( 'name0', 'name1', ..., 'nameN');
@address = ( 'addr0', 'addr1', ..., 'addrN');
Anno
------------------------------
Date: 5 Dec 2002 23:15:52 -0800
From: kalinabears@hdc.com.au (Sisyphus)
Subject: Re: Win32 and *NIX, cryptographically secure random numbers with PERL
Message-Id: <e615828f.0212052315.31f23413@posting.google.com>
"Michael D. Carey" <michael@giantsquidmarks.com> wrote in message news:<3def9d3a_3@spamkiller.newsgroups.com>...
> It looks like Math::Random is on both platforms. Any
> comments on the cryptographic security of Math::Random...?
>
> I am not a crypto-idiot, but I also am not Bruce Schneier...
Its documentation says that it is a Perl port of the C version of
randlib.
As to whether any of the randlib routines can be considered
"cryptographically secure" - the folks at sci.crypt might know (if
no-one here does). The topic might even be covered in the sci.crypt
archive.
Does either Crypt::SSLeay or Net::OpenSSL provide access to the
OpenSSL pseudorandom generator? You would need OpenSSL for that ......
Cheers,
Rob
------------------------------
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 4224
***************************************