[7227] in Perl-Users-Digest
Perl-Users Digest, Issue: 852 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 12 10:17:13 1997
Date: Tue, 12 Aug 97 07:00:39 -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 Tue, 12 Aug 1997 Volume: 8 Number: 852
Today's topics:
Re: ?? Mail filter using STDIN (Tina Marie Holmboe)
[Q]How to write in textarea with over 30000 characters. <webmaster@drs.no>
ANNOUNCE: ExtUtils::DynaLib <jtobey@user1.channel1.com>
ANNOUNCE: X11::Wcl 0.1 <jhpb@sarto.gaithersburg.md.us>
Buffering output: NT vs Linux differences with the $| v <jadigby@magna.com.au>
Re: Can perl return more than one gif? <jadigby@magna.com.au>
Re: Can't match '3\\\3' (meta-characters) (Mike Stok)
Re: complex argument passing (Mike Stok)
Re: foreach problem <jpm@iti-oh.comNOSPAM>
Re: Hex in ascii to ascii: what module ? (Steffen Beyer)
Re: How to treat "\n" as "\n" ? (Mike Heins)
Large Data Base question <buck@huron.net>
Re: NEWBIE help with sybperl <kevinl@ascend.com>
NEWBIE QUESTION <xuchu@iscs.nus.edu.sg>
Re: NEWBIE QUESTION (Mike Stok)
Re: Perl and ODBMS (Andreas Schmidt)
Re: perl cgi: displaying array of gifs (Ronald L. Parker)
Re: Perl mail interface (Tina Marie Holmboe)
Re: Seeking object enlightenment <merlyn@stonehenge.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 12 Aug 1997 13:16:22 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
Subject: Re: ?? Mail filter using STDIN
Message-Id: <5spnn6$596$3@news1.sol.no>
In article <01bca5b2$2e671300$0701de89@null.bris.ac.uk>,
"Alex Matthews" <alex@darkfire.com> writes:
> I am trying to write a mail filter in perl that is called from the .forward
> file. When mail comes in it can be processed and put in the mailbox
> directly.
One should note that there are allready a number of mailfilters written
in Perl - but you knew that :)
>|/path/to/prog/mailfilter.pl
>
> The problem is that only the mail headers (everything up to the first
> double CR) seem to be passed to the program in STDIN. Why is this, and how
> can I get the rest of the message.
Hum - this doesn't look much like a Perl problem; unless your script is
doing something scwewy - but we'd need to see the script to decide that.
The entire letter should be passed on STDIN[1].
[1]
Disclaimer: it did so the last time I ran my own Perl-based mailfilter;
sometime last night :)
--
Tina Marie Holmboe tina@mail.scandinaviaonline.se
The opinions expressed above are mine, and should in no way or under any
circumstances be associated with Scandinavia Online AB unless this disclaimer
is explicitly revoked.
------------------------------
Date: Mon, 11 Aug 1997 09:40:45 +0200
From: Erlend Ytterstad <webmaster@drs.no>
Subject: [Q]How to write in textarea with over 30000 characters.
Message-Id: <33EEC1FD.2A20@drs.no>
I've got a big problem whith the textarea tag.
I want to display a text, which is over 30000 characters,
and at the same time I want to make changes in it.
The textarea tag displays
all characters, but I can't put in new characters in
the textarea-form before the size is below 30000 character.
Max characters at each line is 1024.
I've tried to adust the cache on my computer, but this have
no effect. The only attributes, in my knowledge, to the textarea tag
is :NAME,ROWS,COLS,WRAP. This attributes have nothing to do
whith my problem.
I need some expert help. Can you help me out, then please
e-mail me: webmaster@drs.no
Below is a textarea tag you can test on to see the problem.
<HTML>
<TITLE>Must be under 30000 characters to edit</TITLE>
<BODY>
<FORM ACTION="a_script.pl.cgi" METHOD="POST">
<INPUT TYPE="TEXTAREA" NAME="longtext">
Display over 30000 character.
</TEXTAREA>
<INPUT TYPE="SUBMIT">
</FORM>
</BODY>
</HTML>
------------------------------
Date: 12 Aug 1997 13:21:17 GMT
From: John Tobey <jtobey@user1.channel1.com>
Subject: ANNOUNCE: ExtUtils::DynaLib
Message-Id: <5spo0d$g3n$1@nadine.teleport.com>
Friends,
I am pleased to announce the first reasonably portable BETA version of
ExtUtils::DynaLib. This module provides a means of calling exported
functions in DYNAMIC libraries directly from Perl.
Until the file makes it around CPAN, it may be retrieved from
http://www.channel1.com/users/jtobey/Perl/ExtUtils-DynaLib-0.30.tar.gz
ftp://www.channel1.com/pub/users/jtobey/Perl/ExtUtils-DynaLib-0.30.tar.gz
EXAMPLE
-------
This code loads the math library and calls its sinh() function. (You
may need to replace "-lm" with the name of your dynamic math library.)
use ExtUtils::DynaLib;
$libm = new ExtUtils::DynaLib("-lm");
$sinh = $libm->DeclareSub("sinh", "d", "d");
print "The hyperbolic sine of 3 is ", &$sinh(3), "\n";
The second and third arguments to DeclareSub here indicate the C
function's return type and parameter type, respectively. (both are
type double)
***************************************************************
***************************************************************
***************************************************************
***** *****
***** NOTE: THIS CODE CONTAINS SYSTEM DEPENDENCIES. *****
***** IT HAS NOT BEEN PORTED TO ALL COMPILERS, MACHINES, *****
***** OR OPERATING SYSTEMS. USE AT YOUR OWN RISK. *****
***** *****
***************************************************************
***************************************************************
***************************************************************
This module contains system-dependent code which will not work on all
platforms. Volunteers are sought to test and port it to other
machines, systems, and compilers. Please report results to me,
jtobey@user1.channel1.com.
Known supported platforms are:
i386-linux
i386-freebsd
sun4-sparc-solaris (gcc and cc)
sun4-sparc-sunos4.1.3 (gcc)
and, with the implied caveats,
MSWin32 (Borland C++ on Windows 95)
WHAT
----
Included are the following packages:
ExtUtils::DynaLib - interface to dynamic libraries
ExtUtils::DynaLib::Callback - convert a perl sub into a usable
C function pointer
ExtUtils::DynaLib::Struct - yet another tool for handling C
compound data structures
WHY
---
In most cases where you want Perl to call C code, you are better off
writing a Perl XS module than using ExtUtils::DynaLib. This is due to
the relative immaturity of the module and the inherent dangers of C
(i.e., pointers).
However, I find there are some advantages to this module's approach:
* for testing, ExtUtils::DynaLib lets you access C functions more
quickly than does writing XS code.
* even in the absence of a compiler for producing XS modules, this
module enables you to call almost any C function in a dynamic
library (provided, of course, that you have obtained a compiled
version of this module, which itself relies on XS).
* efficiency: using this module should consume less disk space and
perhaps less run-time overhead than using XS. It requires less
programmer effort than does writing XS modules.
* callbacks: one of the hardest areas of XS programming is where you
want to make a Perl sub callable from C.
ExtUtils::DynaLib::Callback provides a Perl wrapper for this.
NOTES
-----
This module in its present state is intended for experienced Perl and
C programmers. Some aspects of the interface may change in future
versions.
The task attempted (calling a C function whose prototype is not known
at compile time) is difficult for reasons I believe are inherent in
the C language and its implementations. I am announcing this module
because it must be tested on a wide range of platforms as part of its
development.
Enjoy!
--
John Tobey
jtobey@user1.channel1.com
------------------------------
Date: 12 Aug 1997 13:19:58 GMT
From: "Joseph H. Buehler" <jhpb@sarto.gaithersburg.md.us>
Subject: ANNOUNCE: X11::Wcl 0.1
Message-Id: <5spntu$g3c$1@nadine.teleport.com>
I have just uploaded the initial version (0.1) of X11::Wcl to PAUSE.
This module provides an interface to the Widget Creation Library,
allowing rapid prototyping of GUI interfaces by specifying both
widget trees and widget resources using the standard X resource
syntax. Creating an application mainly involves writing the
resource specifications and the PERL callback routines.
The 0.1 README is attached.
Joe Buehler
This is a PERL module that interfaces PERL to the Widget Creation
Library and Motif.
You must have the following installed before you start:
- Wcl 2.7, with the enclosed patch applied
- Motif (whichever version you want to use with Wcl)
- SWIG 1.1 (later versions will hopefully work)
I have placed a copy of Wcl 2.7 in CPAN with this module, so you do
not have to hunt it down on the net.
To install:
perl Makefile.PL
make
make install
Optimization is on by default, which can take a while. You can
compile with
make OPTIMIZE=
if you want to turn optimization off.
Currently, this has only been tested under RedHat Linux 4.2 using
RedHat Motif 2.0. Porting to other platforms should be easy. Setting
up for the Athena widgets should also be easy.
There is very little custom code in this module, it is mostly
generated from X11 and Motif header files by SWIG.
The Wcl-gen perl script runs the C preprocessor on a selected set of
header files, then edits the output a bit to make it more palatable to
SWIG. To port to a new platform, you should only need to make
modifications to Wcl-gen, and perhaps the header file list in Wcl-i,
and obviously Makefile.PL.
The Makefile is set up to have SWIG generate HTML documentation on the
constants and classes that it generates. There is also some pod
documentation on the functionality provided by the package in the
Wcl-pm file, and in the examples in the examples/ directory.
The Makefile setup is a bit odd, if you know all about MakeMaker, let
me know how to fix it up.
Joe Buehler
jhpb@sarto.gaithersburg.md.us
August 8, 1997
------------------------------
Date: Tue, 12 Aug 1997 23:01:10 +1000
From: Jordan Digby <jadigby@magna.com.au>
Subject: Buffering output: NT vs Linux differences with the $| variable ?
Message-Id: <33F05E95.748D82DD@magna.com.au>
I'm trying to do some CGI Server Push through Perl, and have finally
found out (on NT) that I have to add the line:
$|=1;
("dollarsign verticalbar equalsign one semicolon")
to prevent Perl from buffering the output (this way the output is sent
to the browser before the script ends).
This line, however, seems to have no effect on Linux (i.e. Server Push
does not work, only shows last page).
Can anyone :
a) point me to where I can find documentation on the $| variable ?
b) tell me an alternative way of stopping Linux Perl from buffering
its output
or c) tell me what the script below is doing wrong ? Note that this
seems to work on NT, but not Linux !?
#!/usr/bin/perl
$|=1;
$num = 1;
$bound = "---ThisRandomString---\n";
print "Content-type:
multipart/x-mixed-replace;boundary=---ThisRandomString---\n\n";
print $bound;
while ($num < 8)
{
print "Content-type: text/html\n\n";
print "<html><body>Page $num</body></html>\n";
$num = $num + 1;
print $bound;
sleep 1;
}
print $bound;
Any return replies cc:d to my email would be greatly appreciated.
Jordan Digby
jadigby@magna.com.au
------------------------------
Date: Tue, 12 Aug 1997 22:50:39 +1000
From: Jordan Digby <jadigby@magna.com.au>
Subject: Re: Can perl return more than one gif?
Message-Id: <33F05C1E.519AF0D9@magna.com.au>
Doug Seay wrote:
> R. Terpilowski wrote:
> >
> > Hi, I'm pretty new to programming with perl. Right now I am trying
> to
> > write a script that will return more than one image back to a web
> page.
>
> Danger Will Robbinson, CGI question approaching.
>
> <extending electrically chaged claws>
>
> > Is
> > this possible? I am calling the script with a <img
> src="program.cgi> tag.
> > and in the program I have a line that says print
> > "Location: dir/of/image.gif\n\n"; that prints one image.
>
> You are the one doing the CGI, not me. Does the CGI protocol allow
> this? I would think so, but I don't know for sure.
>
> > But can I output
> > another image to that page also with the same program. Thanks for
> your
> > help.
>
> Yes, Perl will let you print what you want. You could print 10 gifs
> if
> you wanted. Will that be understood by the browser at the other end?
> That I don't know. Go to a WWW group and ask this sort of question
> there. The FAQ for this group has a list of several sources of info
> for
> CGI questions.
>
> Remember that Perl is not CGI.
>
> - doug
comp.infosystems.www.authoring.cgi is a good place to look for CGI help.
Also try looking for "Server Push" through a search engine. There are a
number of references you'll find on how to push multiple images through
one page.
Jordan Digby
jadigby@magna.com.au
------------------------------
Date: 12 Aug 1997 13:48:20 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Can't match '3\\\3' (meta-characters)
Message-Id: <5sppj4$eo6@news-central.tiac.net>
In article <33F02D03.D920E787@swh.sk>,
Benarson Behajaina <Benarson.Behajaina@swh.sk> wrote:
>Is it possible to match a string wich includes meta-characters ?
Yes.
>#!/usr/local/bin/perl -w
>push(@fool, 'http://1\1','2\\2','3\\\3','4\\\\4','5\\\\\\5');
even in single quotes the sequence \\ means \ as \ can be used to escape a
single quote. So yout list gets turned into
http://1\1, 2\2, 3\\3, 4\\4, 5\\\5
as each \\ gets turned into a \. This is done at compile time. If you
change that to:
push @fool, 'http://1\\1', '2\\\\2', '3\\\\\\3', '4\\\\\\\\4', '5\\\\\\\\\\5';
>4. I don't know how to find a string which includes meta-characters.
> Do you see that
> '1\1' is treated as '1\1'
> '2\\2' is treated as '2\2'
> '3\\\3' is treated as '3\\3' if it is from list
> but treated as '3\3' if it's from argument.
Strings which are read from files or the keyboard aren't scanned by the
perl compiler as part of the program text, so there are no escape
sequences in non program literal data unless you decide to process it that
way.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: 12 Aug 1997 13:21:57 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: complex argument passing
Message-Id: <5spo1l$dcn@news-central.tiac.net>
In article <33F05416.3785@textwise.com>,
Dean Hoover <dhoover@textwise.com> wrote:
>I need to call a perl function (semctl) which calls
>an underlying C function that expects one of its
>arguments to be a C union. That union looks like
>this:
>
> union semun {
> int val;
> struct semid_ds *buf;
> ushort *array
> } arg;
>
>I need to set the "val" member of the union and pass
>it to the semctl (perl) function. How do I do it???
Probably the easiest thing to do for some arbitrary function in C is to
write an extension using either XS or swig where the extension language
helps you pass parameters between perl and a C and return values back.
Alternatively you can experiment with a C program to check the size of the
union and where all of the elements start (in this case they'll probably
all start at the beginning of the union) and use pack to create the
appropriate argument. The reason I suggest playing with little C programs
is that when you start dealing with structs there can be packing and
alignment issues which can cause some surprises.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: 12 Aug 1997 13:33:32 GMT
From: "Joshua Marotti" <jpm@iti-oh.comNOSPAM>
Subject: Re: foreach problem
Message-Id: <01bca724$45214200$36601ec6@bach>
I don't exactly know what your problem is but try this...
--
Josh,
Gavin Dragon...
Remove NOSPAM from address...
Sami Sandqvist <samiss@lehtori.cc.tut.fi> wrote in article
<slrn45v0df7.22k.samiss@lehtori.cc.tut.fi>...
> print STDERR keys %luokat; ####HERE
change this to
@temp = keys %luokat;
print STDERR "@temp";
it'll, at least, make the debugging easier.
------------------------------
Date: 12 Aug 1997 12:45:29 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: Hex in ascii to ascii: what module ?
Message-Id: <5splt9$q9$1@en1.engelschall.com>
In comp.lang.perl.misc Michael Kagalenko <mkagalen@lynx.dac.neu.edu> wrote:
> Is there standard module that would convert hex codes (in ascii form,
> not binary)
> into their ascii equivalent ?
Maybe you want the "hex()" function?
See "man perlfunc" for the details.
Yours,
--
Steffen Beyer <sb@sdm.de> http://www.engelschall.com/u/sb/
"There is enough for the need of everyone in this world,
but not for the greed of everyone." - Mahatma Gandhi
>> Unsolicited commercial email goes directly to /dev/null <<
------------------------------
Date: 12 Aug 1997 13:06:59 GMT
From: mheins@prairienet.org (Mike Heins)
Subject: Re: How to treat "\n" as "\n" ?
Message-Id: <5spn5j$gou$1@vixen.cso.uiuc.edu>
Thomas Bahls (thommy@cs.tu-berlin.de) wrote:
: napier@seas.upenn.edu (Bill Napier) writes:
:
: I have asked:
: >> I am looking for a function that does the opposite of quotemeta; I
: >>want Perl to interprete <backslash> <n> (two chars) as carriage
: >>return.
:
: and so many people answered:
: >Double quote (") do this. The single quote (') you were using does
: >not interpret \n or anything else (variable names, etc).
:
: but...
:
: I am sorry that my example was so missleading. I _do_ know the
: difference between 'single' and "double" quotes (as you see ;-).
:
: But I have just adopted a software project, in which I cannot
: (easily) change the data; in fact these are read in from many files
: which contain many different character sequences, that have normally
: "special meanings" in Perl, e.g.
:
: \n \t
: $foo (etc.)
:
:
: so I really have to force Perl to interpret the two chars
: <backslash> and <n> as "newline", <backslash> <t> as tab and even
: <dollar> "foo" as "42" (or whatever its value is).
:
It was clear to me from the first message, but now you have added
variable substitution. If all you want is the \n -type literals,
regexes can do this:
my %tab = (
n => "\n",
b => "\b",
a => "\a",
t => "\t",
r => "\r",
# Plus any more that you want
);
# preload octals and hexes and control chars
for ( 0 .. 255 ) {
$tab{sprintf 'x%02x', $_ } = chr($_);
$tab{sprintf '%o', $_ } = chr($_);
$tab{sprintf '%03o', $_ } = chr($_);
}
for ( 'A' .. 'Z') {
$tab{'c' . $_ } = chr(ord($_) - 64);
}
$text = 'bunch of stuff with \n and \cJ and \x0a and \13 and stuff';
$text =~ s/(\\)(x..|c[A-Z]|[0-7]{1,3}|.)/$tab{$2} || $1 . $2/ge;
print $text;
The anchor of the leading \ will actually make this pretty efficient.
If you want to interpolate variables within your namespace as well,
this should give you a model.
--
Regards,
Mike Heins
This post reflects the
opinion of my employer.
------------------------------
Date: Tue, 12 Aug 1997 09:33:14 -0400
From: Stephen Hill <buck@huron.net>
Subject: Large Data Base question
Message-Id: <33F06613.8995E057@huron.net>
I am going to have a large database, about 1 gig. Would perl be
appropriate to use to search this database or would some other language
be more appropriate?
Any tips on handling a large database would be appreciated.
Thanks :-)
buck@huron.net
------------------------------
Date: 12 Aug 1997 09:22:37 -0400
From: Kevin Lambright <kevinl@ascend.com>
Subject: Re: NEWBIE help with sybperl
Message-Id: <yhfn2mnk02q.fsf@ascend.com>
Per Fredrik Kvarme <perkva@itk.ntnu.no> writes:
>
> Hello
>
> I'm setting up a database on a sybase server, and I want to use
> sybperl to write a CGI interface. Unfortunately I'm all new to perl, and
> so I REALLY need simple, plain, detailed instructions on what I need to
> do to set up sybperl, include modules and libraries, etc, and how to do
> sybperl calls in my script.
>
> Please, somebody help me, or point me to some understandable
> source, because I haven't really found anything that makes sense on the
> net so far :) Thanks in advance!
>
>
> - Per Fredrik Kvarme
It is not exactly a simple, straightforward process. Get the Sybperl module
from CPAN and read through all of the instructions. We have the Sybase
interface statically linked into our perl executable, although I believe
you can have it so that it uses shared libraries as well. Anyhow, the
documentation for the module should cover this. Once you have it
installed, you will have to go through the man pages (there is 1 main
manpage) which are fairly lengthy and will take you some time. From
Sybperl.3, the following is roughly the minimum you would have to do
to open a database connection and perform a query:
use Sybase::DBlib;
$dbh = new Sybase::DBlib 'sa', $pwd, $server, 'test_app';
$dbh->dbcmd("select * from sysprocesses\n");
$dbh->dbsqlexec;
$dbh->dbresults;
while(@data = $dbh->dbnextrow)
{
.... do something with @data ....
}
and believe me, it can get much more complicated than this (although maybe
it won't in your situation).
Hope this helps,
Kevin
--
------------------------------------------------------------------------------
Kevin Lambright email: kevinl@casc.com
Ascend Communications voice: 508-952-7407
1 Robbins Road fax: 508-692-1510
Westord, Ma. 01886
------------------------------
Date: 12 Aug 1997 12:51:32 GMT
From: Xu Chu <xuchu@iscs.nus.edu.sg>
Subject: NEWBIE QUESTION
Message-Id: <5spm8k$9gg@nuscc.nus.sg>
hello, i am new in perl. can someone help me out with this question?
$name{12345} = 'John Doe';
$name{24680} = 'Jane Smith';
$blunk = %name;
print '$blunk=',$blunk,"\n";
i run it and gets "$blunk=2/8". can u tell me why it is the result?
--
wings
------
You cannot learn anything unless you almost know it already.
------------------------------
Date: 12 Aug 1997 13:53:37 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: NEWBIE QUESTION
Message-Id: <5sppt1$etd@news-central.tiac.net>
In article <5spm8k$9gg@nuscc.nus.sg>, Xu Chu <xuchu@iscs.nus.edu.sg> wrote:
>hello, i am new in perl. can someone help me out with this question?
>
> $name{12345} = 'John Doe';
> $name{24680} = 'Jane Smith';
> $blunk = %name;
> print '$blunk=',$blunk,"\n";
>
>i run it and gets "$blunk=2/8". can u tell me why it is the result?
The perldoc manual page includes this:
If you evaluate a hash in a scalar context, it returns a
value which is true if and only if the hash contains any
key/value pairs. (If there are any key/value pairs, the
value returned is a string consisting of the number of
used buckets and the number of allocated buckets,
separated by a slash. This is pretty much useful only to
find out whether Perl's (compiled in) hashing algorithm is
performing poorly on your data set. For example, you
stick 10,000 things in a hash, but evaluating %HASH in
scalar context reveals "1/16", which means only one out of
sixteen buckets has been touched, and presumably contains
all 10,000 of your items. This isn't supposed to happen.)
so %name has 8 buckets allocated and of these 2 are used (so your 2 keys
ended up in different buckets.)
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: 12 Aug 1997 13:08:10 GMT
From: schmidt@miserv2iai.kfk.de (Andreas Schmidt)
To: raz_s@NetVision.net.il (Raz Shlomovich)
Subject: Re: Perl and ODBMS
Message-Id: <5spn7q$sfa$1@nz12.rz.uni-karlsruhe.de>
hola raz
since some weeks there is a nice module for the objectstore database
(objectdesign) available. the module is called ObjStore and was written
by Joshua Nathaniel Pritikin and is available from cpan.
here is a short outcut from the manual pages comming with the module:
SYNOPSIS
use ObjStore;
my $osdir = ObjStore->schema_dir;
my $DB = ObjStore::Database->open($osdir . "/perltest.db", 0, 0666);
try_update {
my $top = $DB->root('whiteboard');
if (!$top) {
$top = $DB->root('whiteboard', new ObjStore::HV($DB, 10**8));
for (my $x=1; $x < 10**9; $x++) {
$top->{$x} = {
id => $x,
m1 => "I will not talk in ObjectStore/Perl class.",
m2 => "I will study the documentation before asking questions.",
};
}
} else {
die "Very impressive. I see you are already an expert.\n";
}
};
print "[Abort] $@\n" if $@;
the module is very flexible and easy to handle. i spend some time reading the
source code and learned a lot.
in comparission with the c++ interface you need only a fractal of time to develop
an application.
takealookatit
smiff
========================================================================
andreas schmidt email: schmidt@iai.fzk.de
institut fuer angewandte informatik (iai) phone: +49 7247 82 5714
forschungszentrum karlsruhe gmbh
- technik und umwelt -
postfach 3640 76021 karlsruhe (germany)
------------------------------
Date: Tue, 12 Aug 1997 13:25:30 GMT
From: ron@farmworks.com (Ronald L. Parker)
Subject: Re: perl cgi: displaying array of gifs
Message-Id: <33f16131.2623418@207.126.101.82>
On Mon, 11 Aug 1997 11:44:46 -0500, "Jack Lawrence"
<jlawrenc@acc.jc.edu> wrote:
> Hey there,
>
>I'm working on a program in which one cgi script displays a table of slide
>descriptions and an <a href> to the user. The user clicks on one of the
>links to select a slide. From there, another cgi script is passed both the
>slide number that was selected and an array of all the slide numbers in that
>table. The selected slide (gif file) is displayed with a 'view next slide'
>and a 'view previous slide' button at the bottom. Is there a way that the
>user can jump back and forth among the array of slides without having to
>recall the cgi file each time? The slide results can get quite large as
>there are about 5000 slides to search from, so it would be nice to only have
>to load the array once. I hope this makes some sense! Thanks for your
>help.
This is not strictly a perl question, since the answer would be the
same for any language. (The first clue that this is the case is that
there are no dollar-signs in my response.) You might get more
coherent answers from someone in a CGI newsgroup. It sounds like what
you want to do is keep a list of slides for each active session.
Obviously, you'll need to keep this list either on the client or on
the server.
If you keep it on the server, you'll need to use some sort of database
and be able to expire old sessions, and you'll need to pass some sort
of key to the client to be used when requesting the next slide from
the list on the server.
If the list of slides is short, you might find it easier to store the
list in a series of hidden fields in the document you send to the
viewer. This has the advantage of making the client maintain the
state, so you don't have to expire sessions when people just go away.
Either way, of course, you will still have to use some kind of CGI
script to interpret the document the user sends to you and choose the
next or previous slide. This may or may not be faster than the
original search script. Experiment.
--
Ron Parker
Software Engineer
Farm Works Software Come see us at http://www.farmworks.com
For PGP public key see http://www.farmworks.com/Ron_Parker_PGP_key.txt
------------------------------
Date: 12 Aug 1997 13:22:55 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
Subject: Re: Perl mail interface
Message-Id: <5spo3f$596$4@news1.sol.no>
In article <5soakg$fjr@news.service.uci.edu>,
"Eric D. Friedman" <friedman@uci.edu> writes:
> Investigate procmail. You could use it to filter incoming mail into
> individual folders, one per user.
Or have a look at
http://www.ee.umd.edu/medlab/filter/
where you will find information about atleast two allready existing
Perl-based filters that do the same job as procmail (and, IMHO, better :)
--
Tina Marie Holmboe tina@mail.scandinaviaonline.se
The opinions expressed above are mine, and should in no way or under any
circumstances be associated with Scandinavia Online AB unless this disclaimer
is explicitly revoked.
------------------------------
Date: 12 Aug 1997 06:34:36 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: neil@domingo.concordia.ca
Subject: Re: Seeking object enlightenment
Message-Id: <8clo27wmmr.fsf@gadget.cscaper.com>
>>>>> "Jay" == Jay Flaherty <fty@hickory.engr.utk.edu> writes:
Jay> Neil Kandalgaonkar (neil@domingo.concordia.ca) wrote:
Jay> :
Jay> : I stumbled onto Randal's object intro
Jay> : (http://www.stonehenge.com/merlyn/UnixReview/col13.html), which
Jay> : helped me more than any other tutorial has. (BTW, the
Jay> : de-referencing tutorial was killer. Thanks, Randal!) However,
Jay> : the concepts of package and bless still don't mean much to me.
Jay> go to:
Jay> http://www.perl.com/perl/nmanual and look at perltoot.html
It's actually rather simple:
package = carving up of the global namespace
bless = having a reference (of any kind) "remember" a particular package
Doing things manually:
$something = [35, "happy", 12];
creates a reference, and
bless $something, "Some::Random::Package";
"blesses" it into the package Some::Random::Package, so that:
$something->foo("bar");
will start by looking for the subroutine called
Some::Random::Package::foo, passing it $something and "bar" as
parameters.
If that's not found, the packages in @Some::Random::Package::ISA are
also searched, recursively, for a subroutine named foo.
That's all there is to the mechanism. Nothing terribly magic.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 385 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 852
*************************************