[16343] in Perl-Users-Digest
Perl-Users Digest, Issue: 3755 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 20 06:10:29 2000
Date: Thu, 20 Jul 2000 03:10:18 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <964087818-v9-i3755@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 20 Jul 2000 Volume: 9 Number: 3755
Today's topics:
Re: NEW: AI::NeuralNetwork - idea, comments <jdb@wcoil.com>
Re: NEW: AI::NeuralNetwork - idea, comments <callgirl@la.znet.com>
Re: NEW: AI::NeuralNetwork - idea, comments <jdb@wcoil.com>
Re: NEW: AI::NeuralNetwork - idea, comments <rhomberg@ife.ee.ethz.ch>
Re: Newbie Question - about calendars <sb@muccpu1.muc.sdm.de>
Re: Newbie Question - about calendars <gellyfish@gellyfish.com>
Re: Newcomer question on Multithreading In Active Perl nso@manbw.dk
Re: passing through a proxy server <gus@black.hole-in-the.net>
Re: Patternmatch and replace values?? <callgirl@la.znet.com>
Re: perl rendering html tables - slow <gus@black.hole-in-the.net>
Re: perl-5.6.0: Bug with "not" operator? (Rafael Garcia-Suarez)
Re: Posting bug reports = mail spam?? <gellyfish@gellyfish.com>
Re: Problem with Building some XS functions <pavel@gingerall.cz>
Quoting, interpolation and regular expressions <roman.stawski@fr.adp.com>
Re: Sign Up Script <gellyfish@gellyfish.com>
SSI - Stink like poo? <jheide@sprint.ca>
Translation from csh to Perl? <a.voerg@ieee.org>
Re: Truly Orthogonal Persistence <pdcawley@bofh.org.uk>
Re: Unflattening a multi-dimensional array <mauldin@netstorm.net>
Re: variable cheching ? (Rafael Garcia-Suarez)
Re: while (readdir DIR) <gellyfish@gellyfish.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 20 Jul 2000 06:28:08 GMT
From: "Josiah Bryan" <jdb@wcoil.com>
Subject: Re: NEW: AI::NeuralNetwork - idea, comments
Message-Id: <8l665o$hhb$0@206.230.71.54>
I am trying to be nice, Godzilla.
I am not delibretly provoking anyone.
I am meerly here to learn from others
the art of programming perl, not to
engage with egomanics and narcistic
perl trolls. Not pointing any fingers, mind
you, but your response to a message
in which i was only asking for assistance
and direction in the art of perl came back
as if you had taken personal offense at
my humble request! Isnt that what
this group is about? Sharing knowledge
relating to the art of perl, and not to go around
cutting each other down for perceived
insults, relevant or not? I just wish to learn,
to be taught, and somday, teach. I find
Perl facinating, not insulting you. I do
not wish to listen to insults being thrown around,
but rather hear about the beauty of
Perl. Is it so hard for you to accept
that some people are just not interested
in insulting you or playing your wonderful
cyberpoker? My friend, you have much to
learn about life and people if you look
at everyone as an enemy or potential enemy.
"Please, can't we all just be friends?" - R.D. Simmons, 1984, The Birth of
Jessica
cheers!
~ josiah
------------------------------
Date: Thu, 20 Jul 2000 00:12:48 -0700
From: "Godzilla!" <callgirl@la.znet.com>
Subject: Re: NEW: AI::NeuralNetwork - idea, comments
Message-Id: <3976A670.CBDA58B1@la.znet.com>
Josiah Bryan wrote:
> My friend,
(snippage)
I'm not your friend.
I've never been much of one to stand around
plow harnessed behind a twitchy Missouri Mule,
jawing with some city slicker leaning on my back
forty rail fence while trying to sell me a bit of
share cropping, telling me I'd be right better off in
the long run giving him thirty percent of my harvest
in exchange for the right to tend his piss poor plow
dulling toe stubbing rabbit holed rocky fields.
If you will excuse me Mister, I am off to fetch a short
switch to scrape this mule manure off my calloused clod
busting bare feet, then return to my chores lest my
granddaddy use a switch on my scrawny butt.
Godzilla!
--
print "http://3483852801/%7e%63%61ll%67i%72l/%63y%62ef%61r%6d.%68tm%6c";
------------------------------
Date: 20 Jul 2000 07:45:11 GMT
From: "Josiah Bryan" <jdb@wcoil.com>
Subject: Re: NEW: AI::NeuralNetwork - idea, comments
Message-Id: <8l6am7$2ok$0@206.230.71.54>
My friend, Some people just can't help
acting like complete assholes, can they?
I am refering to you, godzilla.
~ josiah
------------------------------
Date: Thu, 20 Jul 2000 10:48:19 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: NEW: AI::NeuralNetwork - idea, comments
Message-Id: <3976BCD3.ED5D0E33@ife.ee.ethz.ch>
Kiralynne Schilitubi wrote:
>
> I will register an objection to use of "AI" within
> your module name. This suggests your module employs
> "Artificial Intelligence" which is, with current
> technology, regardless of programming language,
> quite impossible even at a primitive level.
> We are centuries away from any programming
> which can be labeled, Artificial Intelligence,
> with any degree of accuracy and truth.
I always thought that the "Intelligence" in AI has nothing to do with
human intelligence, but that it is the same word as in "military
intelligence", i.e. the gathering and processing of information.
- Alex
------------------------------
Date: 20 Jul 2000 06:41:42 GMT
From: Steffen Beyer <sb@muccpu1.muc.sdm.de>
Subject: Re: Newbie Question - about calendars
Message-Id: <8l66v6$co9$1@solti3.sdm.de>
In article <964018930.15862.0.nnrp-10.c246f12b@news.demon.co.uk>, Neil Lathwood <laf@gameonline.co.uk> wrote:
> Hi Folks, I know this is being covered in a different post but I have a bit
> of a different question.
> In my cgi script if I run:
> #!/usr/bin/perl
> print "content-type:text/html\n\n";
> @fini = `cal 12 2000`;
> print "@fini";
> it prints out the date's fine but what I want to do is format the date into
> a table, the problem I have is that the output produced by the calendar
> contains a lot of spaces, how do I go about removing those spaces but still
> keeping the dates in the correct order. Hope I have explained myself
> correctly and many thanks to anyone that responds back.
> Neil
There is a module on CPAN (as far as I can remember) to create HTML
calendars (with clickable days):
HTML::CalendarMonth 1.03 M/MS/MSISK/HTML-CalendarMonth-1.03.tar.gz
Good luck!
--
Steffen Beyer <sb@engelschall.com>
http://www.engelschall.com/u/sb/whoami/ (Who am I)
http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...)
http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)
------------------------------
Date: 20 Jul 2000 09:47:38 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Newbie Question - about calendars
Message-Id: <8l6eba$7kq$1@orpheus.gellyfish.com>
[ Multiple Jeopardectomy performed ]
On Wed, 19 Jul 2000 17:00:37 +0100 Neil Lathwood wrote:
> "Young" <noemail@noemail.com> wrote in message
> news:3975CBB6.85FEAF24@noemail.com...
>> Neil Lathwood wrote:
>>
>> > Hi Folks, I know this is being covered in a different post but I
>> > have a bit of a different question.
>> >
>> > In my cgi script if I run:
>> >
>> > #!/usr/bin/perl
>> >
>> > print "content-type:text/html\n\n";
>> >
>> > @fini = `cal 12 2000`;
>> >
>> > print "@fini";
>> >
>> > it prints out the date's fine but what I want to do is format the
>> > date into a table, the problem I have is that the output produced
>> > by the calendar contains a lot of spaces, how do I go about removing
>> > those spaces but still keeping the dates in the correct order. Hope
>> > I have explained myself correctly and many thanks to anyone that
>> > responds back.
>> >
>>
>> Do you have an example?
Nice, quote the whole thing for a no-op response.
>>
>
> I have attached the file, and it is available @
> www.lathwood.co.uk/cgi-bin-local/date.cgi
>
You really didnt need to uuencode the file - I have just ignored as I am
too lazy to go that extra keystroke ...
> i have just added the <PRE> tag into the html page and it prints it out on
> the page like it should, but what i want to do is put all the dates into a
> table in the right columns...how would i go about this?
>
Anyhow here is a slight rehashed version of on that I prepared (quite a lot )
earlier that does what I think you want to do :
#!/usr/bin/perl -w
use strict;
use CGI qw(:standard *table);
my ($month,$year) = (localtime)[4,5];
$month++;
$year += 1900;
my $command = "/usr/bin/cal $month $year";
my @cal = ();
chomp(my @thiscal = `$command`);
splice @thiscal, 0,2;
foreach (@thiscal)
{
my @days = split;
if ( $days[0] == 1 )
{
unshift @days, (' ') x (7 - @days);
}
elsif ( scalar @days < 7 )
{
push @days, (' ') x ( 7 - @days);
}
push @cal, \@days;
}
print header,start_html,start_table();
print Tr(td($_)),"\n" foreach (@cal);
print end_table(),end_html;
The entire middle foreach loop section could probably be done in a single
rather unclear statement but I leave that as an exercise to the reader.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 20 Jul 2000 08:24:37 +0200
From: nso@manbw.dk
Subject: Re: Newcomer question on Multithreading In Active Perl MSWin32
Message-Id: <usnt5iaje.fsf@manbw.dk>
Drew Simonis <care227@attglobal.net> writes:
> nso@manbw.dk wrote:
[...]
> > ActivePerl seems to have interpreter threads enabled. How is this feature
> > accessed?
>
> $ perldoc perlthrtut
Naturally I read that document before posting here.. The perlthrtut
describes the "old school" thread package in Perl 5.005. I presume that one
day that package will be converted to use the 5.6.0 interpreter threads
mechanism.
From perlthrtut:
WARNING: Threading is an experimental feature. Both the interface and
implementation are subject to change drastically. In fact, this
documentation describes the flavor of threads that was in version
5.005. Perl 5.6.0 and later have the beginnings of support for
interpreter threads, which (when finished) is expected to be
significantly different from what is described here. The information
contained here may therefore soon be obsolete. Use at your own risk!
My understanding is that the interpreter thread mechanism is compiled into
the ActivePerl binary. The problem is that there is no perl level package
to make any use of it.
Best regards,
--
Niels Skou Olsen, M.Sc.
Intelligent Engine, R&D
MAN B&W Diesel A/S
mailto://nso@manbw.dk
------------------------------
Date: Thu, 20 Jul 2000 08:44:25 GMT
From: Gus <gus@black.hole-in-the.net>
Subject: Re: passing through a proxy server
Message-Id: <964082665.3065.3.nnrp-09.c29f015a@news.demon.co.uk>
claudio <lab.sistemas@est.ipcb.pt> wrote:
> I have a CGI, where i have a socket. How can i configure the
> cgi to pass through a proxy ?
HTTP? NNTP? ICMP?
If you are using a Net:: module and this is a proxy-able protocol,
then (assuming it's not already set up) then perldoc Net::Config
will tell you how.
If you are using LWP, then it includes a proxy method in LWP::UserAgent
Regards,
_Gus
--
gus@black.hole-in-the.net
0x58E18C6D
82 AA 4D 7F D8 45 58 05 6D 1B 1A 72 1E DB 31 B5
http://black.hole-in-the.net/gus/
------------------------------
Date: Wed, 19 Jul 2000 21:56:57 -0700
From: "Godzilla!" <callgirl@la.znet.com>
Subject: Re: Patternmatch and replace values??
Message-Id: <39768699.59CC30A7@la.znet.com>
John Casey wrote:
> $initial_new = "10 k"
> $next_new = "25 k"
> $pctincrease_new = "35"
> I would like to do a pattern match on the following statement ($line) :
> create unique index TABLE_IDX on TABLE_G(DD) storage (initial 30 k next 35 k
> pctincrease 10) tablespace idxts
> and replace the values after initial (30 k), next (35 k), pctincrease (10)
> with values from variables $initial_new, $next_new and $pctincrease_new
> I tried ,
> $line =~ ( Whew... one very long substitution operator )
Earlier, I read some good advice from someone whom I would
credit if my memory would cooperate. Jist is, KISS.
Keep It Simple Silly
This person suggested to another, in so many words,
"Start simple, work towards complex."
Why bother driving a big fat gas guzzling high cost
expensive hard to park Mercedes Benz when you can
whip around town in a sleek Mako Shark sled rocket
much like I do, T-tops down and T-shirt down.
I have removed your " k " from your variables. No
real need to replace those, yes? How about you
start off with three KISS substitution operators
and go from there? You are making this too hard
for yourself. Look over this short test script
and printed results. You will figure this.
TEST SCRIPT:
____________
#!/usr/local/bin/perl
print "Content-Type: text/plain\n\n";
$initial_new = "10";
$next_new = "25";
$pctincrease_new = "35";
$line = "create unique index TABLE_IDX on TABLE_G(DD) storage
(initial 30 k next 35 k pctincrease 10) tablespace idxts";
print "Input: $line\n\n";
$line =~ s/l [\d]+/l $initial_new/;
$line =~ s/t [\d]+/t $next_new/;
$line =~ s/e [\d]+/e $pctincrease_new/;
print "Output: $line";
exit;
PRINTED RESULTS:
________________
Input: create unique index TABLE_IDX on TABLE_G(DD) storage
(initial 30 k next 35 k pctincrease 10) tablespace idxts
Output: create unique index TABLE_IDX on TABLE_G(DD) storage
(initial 10 k next 25 k pctincrease 35) tablespace idxts
Godzilla!
--
use LWP::Simple;
$g = get
("http://3483852801/%7e%63%61ll%67i%72l/%76i%64%65%67%6f%64z%2e%68%74%6dl");
$g =~ s/(<([^>]+)>)|\n|GODZILLA|Blue Oyster Cult//g;
$g =~ s/([a-z])([A-Z])/$1\n$2/g; $g =~ s/(He )/S\l$1/g;
$g =~ s/H(e')/Sh$1/; print ${\substr ($g, 9, 429)}; exit;
------------------------------
Date: Thu, 20 Jul 2000 08:49:07 GMT
From: Gus <gus@black.hole-in-the.net>
Subject: Re: perl rendering html tables - slow
Message-Id: <964082947.3065.4.nnrp-09.c29f015a@news.demon.co.uk>
Mark Worsdall <linux@worsdall.demon.co.uk> wrote:
> Hi,
> I am rendering an html table from a data file, this csv file is 67K in
> size, it has 887 records, each record has 6 fields, it takes over
> 1minute 8 seconds an an ISDN 64K link.
Are you /sure/ that it does ? Have you tested this without a browser to
make sure that it is the script which is causing the delay ?
I just tried the URL >/dev/null and the transfer took 5 seconds. Perhaps
the delay is in the rendering of the table.
> So how to render partially as we get the data or to speed up generally?
Probably more of a question for comp.infosystems.www.authoring.cgi or
comp.infosystems.www.authoring.html
Regards,
_Gus
--
gus@black.hole-in-the.net
0x58E18C6D
82 AA 4D 7F D8 45 58 05 6D 1B 1A 72 1E DB 31 B5
http://black.hole-in-the.net/gus/
------------------------------
Date: Thu, 20 Jul 2000 07:12:35 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: perl-5.6.0: Bug with "not" operator?
Message-Id: <slrn8nd9s7.d3v.rgarciasuarez@rafael.kazibao.net>
i_am_leo@my-deja.com wrote in comp.lang.perl.misc:
>
>By the way, if perl5.6.0 always uses the concept
>"if it looks like a function, it is a function",
>then why don't these two expressions give the
>same value for $a:
>
> $a = (1 || (0) , 2)
> $a = (1 or (0) , 2)
A binary operator does not look like a function, does it?
--
Rafael Garcia-Suarez
------------------------------
Date: 20 Jul 2000 01:06:42 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Posting bug reports = mail spam??
Message-Id: <8l5fqi$6co$1@orpheus.gellyfish.com>
On 19 Jul 2000 19:14:05 GMT The WebDragon wrote:
> In article <3bRgOF$V0K@openbazaar.net>,
> gellyfish@gellyfish.com.bbs@openbazaar.net (Jonathan Stowe) wrote:
>
> | Quite honestly I know I do get spam but even relatively simple filters
> | prevent me from actually seeing the vast majority of it. I wouldnt
> | care to take a guess from where my address has been harvested though
> | - and I have sent bug-reports to p5p.
>
> Indeed. I have Outlook Express watching 5 e-mail addresses for me.. the
> simplest SPAM filter I've devised is this:
>
Well not to be snotty or anything but I was talking about simple *procmail*
filters ... ;-}
MAILDIR=/home/gellyfish/mail
:0
* ^TOyapc_cfp@gellyfish.com
{
:0 c :
|/home/gellyfish/yapc/autoresp.pl
:0
yapc_cfp
}
:0
* ^TOperlfaq-prime@list.perlfaq.com
perlfaq-prime
:0
* ^Sender: yas-talk@metronomicon.com
yas-talk
:0
* ^TOeuropean-yapc@othersideofthe.earth.li
yapc
:0
* !^TO.*(gellyfish|webmaster|root)@(gellyfish.com|tackleway.co.uk|btinternet.com)
junk
:0 c :
|/home/gellyfish/speakmail/speakmail.pl
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Thu, 20 Jul 2000 09:26:37 +0200
From: Pavel Hlavnicka <pavel@gingerall.cz>
Subject: Re: Problem with Building some XS functions
Message-Id: <3976A9AD.3080000@gingerall.cz>
HI Zachary,
if I do understand well, it is simple.
During make process is xs file translated to C file, which is compiled
and linked to extension code. All you've written before "package" and
"module" (in uppercase) keywords in xs file is included in this c file.
So the simplest way is declaration of some global variable in this part.
(something like: void *foo;). In more complicated models you may need
some more sophisticated data structure.
Another problem is reentrance of such piece of code. You need make this
code reentrant in sevreal cases. F.e. for multithreading or if you perl
library is object, and "native" data are tied to instance of it.
In this case you need (there are another choices, but this one is simple
one) pass native reference back to perl. You can set "property" of perl
object (if it is HASHREF or ARRAYREF), or you can set "magic" value of
blessed SV* (see perlguts).
Common (but not unconditional) problem with "remembering data" is
possibility of circular reference between native structures and perl
structures.
Regrads
Pavel
P.S.: feel free to contact me via my personal address
Zachary Kessin wrote:
> I am having a problem. I am trying to write a perl front end to
> some C code. I have created an xs file etc and it will load
> etc. However I can't figure how how to do one thing. I have 1 function
> which returns a pointer (void) which then has to be passed back to the
> other functions in the library so that they know what data to use. Is
> there any easy of having the xs layer hold onto this data without
> passing it back to perl.
>
>
> If anyone has any ideas on this please let me know. I've tried the
> perlguts man page and the perlxs page etc and I'm kind of lost here.
>
> Thanks.
>
> --Zach
------------------------------
Date: Thu, 20 Jul 2000 10:16:27 +0200
From: Roman Stawski <roman.stawski@fr.adp.com>
Subject: Quoting, interpolation and regular expressions
Message-Id: <3976B55B.266CAE75@fr.adp.com>
Hi all,
PROBLEM
I want to change a string into a regular expression so that '*' is
replaced '.*?'. Other patterns will be added at a later stage.
Naturally characters like '.' should not be interpreted as special
characters.
<FEEBLE ATTEMPT AT SOLUTION>
#!perl -lw
use strict;
sub try {
my $regexp = shift;
print "Try using $regexp";
print "[$_] ", ($_ =~ $regexp) ? "matched" : "didn't match"
for ( 'ajunkb.c', # Should match
'ajunkbxc', # Shouldn't match
);
print '---';
}
my $sample_user_input = 'a*b.c';
my $massaged_input = $sample_user_input;
$massaged_input =~ s/\*/\E.*?\Q/g;
try(qr(^\Q$massaged_input\E$)i);
my $text = "\Q$massaged_input\E";
try(qr(^$text$)i);
$text = "\Q" . $massaged_input . "\E";
try(qr(^$text$)i);
# Try a different way of massaging
$massaged_input = $sample_user_input;
$massaged_input =~ s/\*/\\E.*?\\Q/g;
$massaged_input = '\Q' . $massaged_input . '\E';
print $massaged_input;
try(qr(^$massaged_input$)i);
__END__
Try using (?i-xsm:^a\.\*\?b\.c$)
[ajunkb.c] didn't match
[ajunkbxc] didn't match
---
Try using (?i-xsm:^a\.\*\?b\.c$)
[ajunkb.c] didn't match
[ajunkbxc] didn't match
---
Try using (?i-xsm:^a.*?b.c$)
[ajunkb.c] matched
[ajunkbxc] matched
---
\Qa\E.*?\Qb.c\E
Try using (?i-xsm:^\Qa\E.*?\Qb.c\E$)
[ajunkb.c] didn't match
[ajunkbxc] didn't match
</FEEBLE ATTEMPT AT SOLUTION>
All I found in perlop was that "there are no multiple levels of
interpolation" so the approach I'm using above is probably
doomed to failure.
I thought I saw some comments about this sort of thing not long ago,
but I can't find them again. Does anyone have any ideas on how to go
about this? or where to look for words of wisdom? Any help appreciated.
--
Roman Stawski - ADPgsi
------------------------------
Date: 20 Jul 2000 10:16:22 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Sign Up Script
Message-Id: <8l6g16$7nr$1@orpheus.gellyfish.com>
On Wed, 19 Jul 2000 01:09:52 -0400 MrClyde wrote:
> Does anyone know where I can get a script to work with an account sign up
> forms page? I need something that determines if the client's requested
> account name is available and if 2 password enteries they are required to
> fill in are identical prior to the form being processed.
>
This is trivial, write it yourself. Come back when you have a question
about Perl.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Wed, 19 Jul 2000 22:04:32 -0700
From: "Glen Heide" <jheide@sprint.ca>
Subject: SSI - Stink like poo?
Message-Id: <2Nvd5.12502$_J1.148223@newscontent-01.sprint.ca>
I wrote a little CGI script which simply prints to the standard output
"Hello", and the SHTML file that I use has the contents as follows:
<TABLE><TR><TD><!--#exec cgi="/cgi-bin/helloworld.cgi" --></TD></TR></TABLE>
The resulting HTML file that the server returns has nothing from the CGI
script. It only returns
<TABLE><TR><TD></TD></TR></TABLE>
I also tested it with a longer running script which reads 2 large files, so
I know they're being ran, but I still get no output. Do server side include
files do what I'm trying to do? (Print hello in the table) Or are they
simply pieces of code to be "executed". Can anyone help? It would be
greatly appreciated.
--
Yours Truly,
Glen Heide
------------------------------
Date: Thu, 20 Jul 2000 10:45:51 +0200
From: "Andreas Vörg" <a.voerg@ieee.org>
Subject: Translation from csh to Perl?
Message-Id: <8l6e4v$q1k$1@mail.sican.de>
Hi,
Is there a translator like a2p or s2p for csh scripts availible?
It also helps if there is a parser that extracts the csh commands at runtime
and translates them to Perl commands.
I have to translate lots of csh scripts!
Thanks
Andreas
------------------------------
Date: 20 Jul 2000 09:49:42 +0100
From: Piers Cawley <pdcawley@bofh.org.uk>
Subject: Re: Truly Orthogonal Persistence
Message-Id: <m11z0prxsp.fsf@rt158.private.realtime.co.uk>
newsvan33@hotmail.com writes:
> The tangram module touts itself as such a solution for SQL databases.
> However, because SQL data is typed (numerical, time/date, text, BLOB,
> etc), the data from an object cannot be efficiently stored in an
> SQL table without a schema to tell what kind of data it is.
> This can be important when large amounts of data are present.
> However, I would argue that it is not truly orthogonal-- You
> don't need special methods but you do need to code schema.
> It would be more accurate to say that it is as orthogonal
> as humanly possible given the restrictions imposed by an SQL database.
> (Actually I have suggested a way to make tangram more flexible
> to the author, but nevermind that.)
Actually, Tangram makes some assumptions about the internal structure
of the objects it's dealing with which means that it can't work with
anything that doesn't base the object on a hash. A fine example of
this being Damien's ever so wonderful Class::Contract.
--
Piers
------------------------------
Date: Thu, 20 Jul 2000 05:09:57 GMT
From: Jim Mauldin <mauldin@netstorm.net>
Subject: Re: Unflattening a multi-dimensional array
Message-Id: <397688CC.BB4D377D@netstorm.net>
"Randal L. Schwartz" wrote:
>
> Well, the array can be defined recursively fairly easily, so a recursive
> subroutine would be the most straightforward way to me to built it.
>
> @data = (1..30);
> @dims = (5,2,3);
> my @result = reformat(@dims);
>
> sub reformat {
> my $count = shift;
> if (@_) { # more recursion needed
> map { [reformat(@_)] } 1..$count;
> } else {
> splice(@data, 0, $count);
> }
> }
>
This is very nice piece of code, Randal. I couldn't figure out how it
worked unitl I realized that @_ must be local. And of course now I find
that you and Larry and Tom stated this quite plainly in "Programming
Perl" 2nd edition on page 112. You live and learn. (I'm unable to @get
= <BOOK>; I have to while my way through it). Anyway, it was fun.
-- Jim
------------------------------
Date: Thu, 20 Jul 2000 07:39:38 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: variable cheching ?
Message-Id: <slrn8ndbeu.d3v.rgarciasuarez@rafael.kazibao.net>
Cameron Kennedy wrote in comp.lang.perl.misc:
>In article <8l561q$is9$1@enterprise.cistron.net>, "Ed Bras"
><e.bras@hccnet.nl> wrote:
>
>> How can I check the existens of a variable, which name is stored in another
>> variable ?
>>
>
>soft references came to mind first.
>if(${$var}){ do something}
This will not do what is intended if the variable referenced by $var is
defined and false (e.g. it is '0').
You can use "if (defined $$var) { ... }". This will test if $$var has a
defined value. This will not test if $$var already exists :
dereferencing will bring $$var into existence if it does not exist
first. See the perlref manpage.
If you really want to know whether a variable exists, you will have to
look into the symbol table:
if ($::{$var}) { ... }
See perlmod for info on symbol tables.
--
Rafael Garcia-Suarez
------------------------------
Date: 20 Jul 2000 00:50:39 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: while (readdir DIR)
Message-Id: <8l5esf$6bm$1@orpheus.gellyfish.com>
On Wed, 19 Jul 2000 17:04:41 GMT melet@my-deja.com wrote:
> hello
>
> you must affect the result of readdir(DIR) in a table.
>
>
> @ls=readdir(DIR);
>
> foreach $f (@ls){
> .....
> }
>
No you dont have to.
#!/usr/bin/perl -w
use strict;
opendir(DIR, '.') || die "Ooof - $!\n";
while ( my $file = readdir DIR )
{
print $file,"\n";
}
Please read the documentation for readdir() .
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3755
**************************************