[10795] in Perl-Users-Digest
Perl-Users Digest, Issue: 4396 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 10 10:07:19 1998
Date: Thu, 10 Dec 98 07:00:30 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 10 Dec 1998 Volume: 8 Number: 4396
Today's topics:
Re: ANN: Ruby the object-oriented scripting language <l.brocard@elsevier.nl>
Change Directory <kcchan@csis.hku.hk>
Re: Decent Editor <dickey@shell.clark.net>
Re: Embedded Perl, or library? <Marcin.Kasperski@softax.com.pl>
encoding URL (umsee)
Re: encoding URL <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: file locking question (umsee)
Re: Finite State Auto.. <tom@imagic.be>
Re: How to read a binary file in Perl? How to install m (Bart Lateur)
Re: IS there a difference really? $var and ${var}? Exam <tom@imagic.be>
Re: Left and right halves of s/// parsed differently? chess@watson.ibm.com
Newbie Question (John Casey)
Re: Perl ARRAYs <gwebb@reedtech.com>
Re: Perl Floating Point Rounding Algorithm? <haverlan@agric.gov.ab.ca>
Re: Perl Floating Point Rounding Algorithm? (brian d foy)
Re: Perl Script and HTML (Cybernetic Bear)
Re: Perl, ORacle & Linux (Victor B Wagner)
Re: PerlScript? Non-asp, & UNIX ... Is it out here? (Victor B Wagner)
Question on using grep to retrive directory on Windows (umsee)
recursive dir in perl <pascal.serode@alcatel.fr>
Re: recursive dir in perl (brian d foy)
Re: Storing In Memory <Arved_37@chebucto.ns.ca>
Re: take out periods adcoment@my-dejanews.com
Re: take out periods (Sam Holden)
Re: TCL <-> PERL, what's better. (Cameron Laird)
Re: TCL <-> PERL, what's better. (Victor B Wagner)
Re: Trouble getting started with DBM (Jeffrey R. Drumm)
Re: Trouble getting started with DBM (Bart Lateur)
xsubpp errors, can't dmake compiler-a3, etc. <5412@bellsouth.net>
y2k and killing creativity (was Re: Y2K potential probl <Russell_Schulz@locutus.ofB.ORG>
Re: y2k and killing creativity (was Re: Y2K potential p (I R A Aggie)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 10 Dec 1998 14:14:09 +0100
From: Leon Brocard <l.brocard@elsevier.nl>
Subject: Re: ANN: Ruby the object-oriented scripting language
Message-Id: <366FC921.C7120BE3@elsevier.nl>
Adam Turoff wrote:
> Looks like Christmas came early this year. :-) :-)
>
> I was going to create a language this Xmas and call it Dwarf, complete
> with builtins like 'cat', 'gimboid', and 'vindaloo'. Oh well...
Hmmm.
I guess the equivalent of $self would be $smeg then.
$smeg->cat(gimboid('angle-head'));
;-), Leon
--
$monger{'Amsterdam.pm'}[0] # $laptop--
------------------------------
Date: Thu, 10 Dec 1998 22:14:36 +0800
From: Rollo Chan Ka Chun <kcchan@csis.hku.hk>
Subject: Change Directory
Message-Id: <Pine.GSO.4.03.9812102207080.25504-100000@virtue.csis.hku.hk>
I would like to ask...when I writing a PERL program to list the
contents of several direcotries under UNIX...there are some unexpected
results...I coded as follow...
@list = {"dir1", "dir2"};
for ($loop = 0; $loop < 2; $loop++)
{
chdir @list[$loop];
opendir(DIR, ".");
while ($_ = readdir DIR)
{
print "$_ \n";
}
closedir(DIR);
}
It just can list the content of the 1st directory(dir1)...but
can't list that of 2nd directory...it seems caused by the "chdir
@list[$loop]" statement which change the current working directory to
"dir1", thus can't list the "dir2" properly...but when I directly pass the
element of array into the "opendir" statement...it fails to list both
directories "opendir(DIR, @list[$loop]);".....what can I do???.....should
I record the initial path of the working directory???...if Yes...how can I
do that???...thanks for all of your help....thanks a lot....
Regards,
Rollo [IS(2)]
______ ______ __ __ ______
/_____/| /_____/| /_/| /_/| /_____/| /\ /\
| _ || | _ || | || | || | _ || /\ \ /\ \
| |_| || | | | || | || | || | | | || / \ \ / \ \
| _|/ | | | || | ||___ | ||___ | | | || /_/\_\/_ /_/\_\/
| |\ \ \ | |_| || | |___/| | |___/| | |_| || /___/|
|_|/\_\/ |_____|/ |_____|/ |_____|/ |_____|/ |___|/
<Pretend you are happy when you are blue,
it isn't very hard to do......>
------------------------------
Date: 10 Dec 1998 13:21:36 GMT
From: "T.E.Dickey" <dickey@shell.clark.net>
Subject: Re: Decent Editor
Message-Id: <74oht0$lj9$1@callisto.clark.net>
Michael Rubenstein <miker3@ix.netcom.com> wrote:
> On Wed, 9 Dec 1998 19:38:26 -0000, "Antony McNulty"
> <tony_mc@hotmail.com> wrote:
>>OK people calm down, let's not get worked up here....
>>
>>
>>I'm on a Windows platform, have access to a UNIX platfom, but prefer to use
>>Windows.
>>
>>I noticed many editors mentioned were UNIX, any ideas for the PC then ??
> Emacs and vi have excellent Windows versions. My preference is GNU
> emacs, but if you prefer vim is an excellent vi-like editor. Both GNU
> emacs and vim provide either character mode or windowed editing.
Likewise elvis and vile:
ftp://ftp.cs.pdx.edu/pub/elvis/README.html
The current version of vile is 8.2
It's available at
http://www.clark.net/pub/dickey/vile/vile.html
ftp.clark.net/pub/dickey/vile
id.wing.net/pub/pgf/vile
ftp.phred.org/pub/vile
> --
> Michael M Rubenstein
--
Thomas E. Dickey
dickey@clark.net
http://www.clark.net/pub/dickey
------------------------------
Date: Thu, 10 Dec 1998 11:41:58 GMT
From: Marcin Kasperski <Marcin.Kasperski@softax.com.pl>
Subject: Re: Embedded Perl, or library?
Message-Id: <366FB399.3856BA20@softax.com.pl>
Fluffy wrote:
> Nah. See the perlembed pod for how to do it. Just take care not to
> get _too_ cute; oddities like running certain XS-based modules inside
> a perl script embedded in a C app may cause your app to die horribly
> on some platforms, but in general it's pretty smooth.
Could you elaborate a bit on those problems (platforms)? I'm just
programming such configuration...
--
Marcin Kasperski
Marcin.Kasperski@softax.com.pl
------------------------------
Date: Thu, 10 Dec 1998 13:09:03 GMT
From: NOSPAM_umsee@microasia.com (umsee)
Subject: encoding URL
Message-Id: <74oh4g$d4p$1@canopus.cc.umanitoba.ca>
I would like to encode a string so that I can pass the string to perl using
GET method.
i.e convert all spaces to '+'
convert special character to coresponding hex value.
......
thanks!!!
------------------------------
Date: 10 Dec 1998 14:39:20 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: encoding URL
Message-Id: <83r9u8w1yv.fsf@vcpc.univie.ac.at>
Re: encoding URL, umsee <NOSPAM_umsee@microasia.com>
said:
umsee> I would like to encode a string so that I can
umsee> pass the string to perl using GET method.
perldoc URI::Escape
and
perldoc LWP
for writing WWW user-agents in perl
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: Thu, 10 Dec 1998 13:26:03 GMT
From: NOSPAM_umsee@microasia.com (umsee)
Subject: Re: file locking question
Message-Id: <74oi4d$e2u$2@canopus.cc.umanitoba.ca>
In article <366E44A2.31D2@iil.intel.com>, Bekman Stanislav <sbekman@iil.intel.com> wrote:
>umsee wrote:
>>
>> I have a file which might be read or write by my program. And I am using both
>> linux AND windows NT version of perl.
>>
>> My question is:
>>
>> Can I open the file and read it while another program lock the file and write
>> to it?
>>
>> Do I need to lock the file if I am only reading it (the other program might
> be
>> locking it for writing)?
>>
>> Thanks You!!
>
>http://www.esafe.com/stas/TULARC/webmaster/myfaq.html#1
>
Just wanted to add that, normally we use a share lock when we are reading a
file and an exclusive lock when we are wrting to a file.
What about directory? Do we need to lock the directory when a new directory or
files is created inside that directory?
Sorry for asking this silly question.
Thanks!
>______________________________________________________________________
>Stas Bekman mailto:sbekman@iil.intel.com http://www.eprotect.com/stas
>Visit: http://www.eprotect.com/stas/TULARC (Perl,CGI,Linux,Web,Java,PC)
------------------------------
Date: Thu, 10 Dec 1998 15:25:16 +0100
From: "Tom Adriaenssen" <tom@imagic.be>
Subject: Re: Finite State Auto..
Message-Id: <74olnj$khg$1@nickel.uunet.be>
>> Tech-No (zerocool@montana.campus.mci.net) wrote:
>> : I was wondering if anyone had a Perl script that would test a string to
>> : see if it was a FSA??? If so please email me the source.
>>
>> A _string_ can be a _machine_?
>>
>> Whatever are you speaking of?
>
>Maybe his string is supposed to be the tape of a Turing machine and he
>wants to check if the Turing machine is simulating a FSA :-)
Or the string is a turing machine that loads itself and checks if another
string is a FSA. Hmmm.
But to answer the original question: don't have it, never seen it (in Perl),
can't be hard to write it.
Tom.
--
You gotta be your own dog... - dEUS
------------------------------
Date: Thu, 10 Dec 1998 12:20:11 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: How to read a binary file in Perl? How to install mod_perl?
Message-Id: <366fbc50.17658003@news.skynet.be>
Ronald J Kimball wrote:
>Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
>
>> Perl can do practically anything (which is algorithmically possible).
>> What you could do was to state your question unambitionally. I cannot
>> make anything out of your question.
>
>I can't make anything out of the word "unambitionally". What the heck
>does that mean?
I think it was intended as "unambiguusly".
Bart.
------------------------------
Date: Thu, 10 Dec 1998 15:21:18 +0100
From: "Tom Adriaenssen" <tom@imagic.be>
Subject: Re: IS there a difference really? $var and ${var}? Example.
Message-Id: <74olg6$k82$1@nickel.uunet.be>
[Posted in comp.lang.perl.misc and mailed]
Ryan wrote in message <366F8990.6365@hotmail.com>...
$var and ${var} are exactly the same. Actually, they're not, but practical
they are (correct me when i'm wrong). $var is the actual var, ${var} is a
symbolic reference, which yields to $var.
You'd only use ${var} in places where Perl can't figure out the var you
mean. Like in:
>obviously $var won't work stated $vardgfdg, but it will as ${var}dgfdg
>(in a printed string for example).
my $var = 'ab';
print "$varcd"; # perl will try to print the variable $varcd
print "${var}cd"; # this will print what you expect: abcd
You can also use the ${} notation with an expression.
foreach my $i ( 1..10 )
{
print "var$i = ", ${'var'.$i}, "\n";
}
This would print out all values of variables $var1 through $var10...
Of course, this can be as complex as you want.
[lot of blah snipped...]
> print "<FORM METHOD=\"POST\" ACTION=\"${some_path}\">\n";
> Or
> print "<FORM METHOD=\"POST\" ACTION=\"$some_path\">\n";
There's no benefit here. Perl know that $some_path ends at the \ so you
don't need to include the {}.
>Another example:
> open(FILE,"<file$var/somefile.dat") || &ErrorSub("Ack... can not open
>file$var/somefile.dat", $!);
>OR:
> open(FILE,"<file${var}/somefile.dat") || &ErrorSub("Ack... can not open
>file${var}/somefile.dat", $!);
Yep, same case as above.
>It is always a good idea to use it? Or is it really a waste of time?
Generally, it's a waste of time and space ;) Only use it when Perl can't
figure out the variable name or when you want to 'make' var names on the
fly.
>And what about: print "this is [$rooms_names[$tmp]]"; would it be better
>to say: print "this is [${rooms_names[$tmp]}]"; instead too? Or again,
>is it only certain chars?
Same as above.
By the way, you can use the same thing with the other var types too of
course: @{var}, %{var}, ...
Tom.
--
You gotta be your own dog...
------------------------------
Date: Thu, 10 Dec 1998 14:09:21 GMT
From: chess@watson.ibm.com
Subject: Re: Left and right halves of s/// parsed differently?
Message-Id: <74okmf$anu$1@nnrp1.dejanews.com>
Thanks! I know what \Q and quotemeta() do, that wasn't my confusion.
Where I was hung up was on what happens to the text after that...
In article <comdog-ya02408000R0912981507300001@news.panix.com>,
comdog@computerdog.com (brian d foy) wrote:
> > $this =~ s/\Q$from\E/\Q$to\E/g;
>
> remember, one side is a regex and one side is a double quotish like
> thingy.
That's obviously the key! On the lefthand side of s///, the pair of
backslashes inside the result of \Q$from\E are treated as a single
backslash for pattern-matching purposes, whereas on the righthand
side they're treated as two individual backslashes for replacement
purposes. Not what I would have predicted, but understandable in
retrospect. So the answer to the question in my Subject: line is
just "yes". *8)
DC
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 10 Dec 1998 14:34:02 GMT
From: jcasey@workingventures.ca (John Casey)
Subject: Newbie Question
Message-Id: <366fd998.151024211@wv-proxy>
Hi all,
It is my first time in this news group so bear with me. I have been a
VB programmer for years now. My boss just came up to me and asked me
to learn CGI by yesterday.........AGHHHHHHH!!! I do not want to do the
shell acount thing with my ISP. So my question is I have a web server
at home running Omnicron HTTPd version 1.6. I know it supports
CGI/Perl, but I do not believe the interpreter comes with it. Does any
one know where to get a simple shareware CGI/Perl interpreter that
will work with the above mentioned software. Ummmmm and any good
CGI/Perl tutorial pages that you would reccomend.
Cheers :o)
John Casey
Applications Support Specialist
Working Ventures Canadian Fund Inc.
------------------------------
Date: Thu, 10 Dec 1998 08:03:52 -0500
From: Garth Webb <gwebb@reedtech.com>
Subject: Re: Perl ARRAYs
Message-Id: <366FC6B7.3EEB71B5@reedtech.com>
The reason I wanted to send objects back to a calling subroutine using die (and I
didn't want to use global variables). By giving a reference to die, $@ will
contain something like "ARRAY(0xXXXXXX)...", which I wanted to use to get
access to the memory.
However I soon realized that the reference I sent would be garbage
collected as soon as die exited. Now its become more of a curiosity because
I'm sure I was able to do it about 2 years ago. I remember wanting to share
memory space between two programs and I remember being able to use the text
value "ARRAY..." to get access to the memory, but then sending that value to
another program I could not access the memory (I had two 'Perl -d -e 1'
sessions going).
----------------------
Garth Webb
Software Developer
Reed Technology and Information Services
gwebb@reedtech.com
------------------------------
Date: Thu, 10 Dec 1998 06:19:12 -0700
From: Gordon Haverland <haverlan@agric.gov.ab.ca>
Subject: Re: Perl Floating Point Rounding Algorithm?
Message-Id: <366FCA50.D57D2052@agric.gov.ab.ca>
Harry P Bloomberg wrote:
>
> How does Perl round floating point numbers when they are output with
> print or sprint?
>
> I did search the Perl FAQ, and there is a short section there on
> rounding, but it does not specify the rounding method, and in fact
> suggests not trusting Perl rounding if the application is critical.
> However, I'm still curious as to the default Perl rounding behavior.
I think the answer is in your question. Perl does not do rounding
of floating point numbers for printing. This is left to the
C library functions which are called. Different C libraries,
different rounding.
Gordon Haverland
------------------------------
Date: Thu, 10 Dec 1998 08:49:21 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl Floating Point Rounding Algorithm?
Message-Id: <comdog-ya02408000R1012980849210001@news.panix.com>
In article <366FCA50.D57D2052@agric.gov.ab.ca>, Gordon Haverland <haverlan@agric.gov.ab.ca> posted:
> Harry P Bloomberg wrote:
> >
> > How does Perl round floating point numbers when they are output with
> > print or sprint?
> I think the answer is in your question. Perl does not do rounding
> of floating point numbers for printing. This is left to the
> C library functions which are called. Different C libraries,
> different rounding.
that is, unless you are using a modern version of Perl that
implements these functions internally ;)
--
brian d foy <brianNOSPAM@NOSPAM.smithrenaud.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
remove NOSPAM or don't. it doesn't matter either way.
------------------------------
Date: Thu, 10 Dec 1998 14:36:25 GMT
From: cybear_x@[nospam]geocities.com (Cybernetic Bear)
Subject: Re: Perl Script and HTML
Message-Id: <366fdc0f.943245@news.webhart.net>
Is the data being sent to the script as a POST or GET? It elicit a
proper HTML response from the server (mine anyways) I have to have
forms submit data using GET.
Dave
On Tue, 08 Dec 1998 18:06:00 GMT, rmaglich@my-dejanews.com wrote:
>I have written a perl script that accepts the contents of a form, but the HTML
>that is supposed to be displayed after the form processing is completed is not
>being returned to the client. The code is as follows (noting modifications):
>
>
>#!/usr/local/bin/perl
>print "Status: 200\nContent-type: text/html\n\n";
>
>%cgivars= &getcgivars ; # getcgivars is a parser-- and it works correctly
>$OURFILE = `/usr/local/bin/tempname temp`; # creates a temporary file name
>
> open(OURFILE, ">$OURFILE");
> foreach (keys %cgivars)
> {
> if ("$_" eq 'signature') # signature is a field of the form
> { print OURFILE ("$cgivars{$_}\n"); }
> }
> close(OURFILE);
> `chmod 777 $OURFILE > /dev/null`;
>
> print <<"EOF";
> <HTML><HEAD><TITLE>Testing Script</TITLE>
> <SCRIPT language="JavaScript">
> var newWin = null
> newWin =
>window.open("http://<IP address>/cgi-bin/wspd_cgi.sh/login.w", "tmwin",
>
>
>"directories=no,menubar=yes,status=yes,toolbar=no,location=yes,scrollbars=yes,re
> sizable=yes")
> self.name = "pretmwin"
> self.blur()
> newWin.focus()
> </SCRIPT>
> </HEAD>
> <BODY>
> <CENTER>
> <h1>Welcome</h1>
> <h2>Copyright 1998</h2>
> <h1>Use the other window.</h1>
> </CENTER>
> </BODY></HTML>
> EOF
> exit;
>
>It works from the command line, but when the form is submitted the HTML is not
>returned to the client machine. Any help would be greatly appreciated......
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 10 Dec 1998 13:55:54 GMT
From: vitus@brass.fe.msk.ru (Victor B Wagner)
Subject: Re: Perl, ORacle & Linux
Message-Id: <74ojta$mu9$2@zware.space.ru>
brewer@avanticorp.com wrote:
: I can say that finding information on Oracle, Linux, and Perl is not easy. I
: have spent most of the day looking myself.
: My problem is as follows. I'm setting up a WebServer on linux. We want cgi
: programs on the webserver to be able to talk to an Oracle7 database on a
: Windows NT server. I keep reading and being told I need sql*net for the perl
: to oracle part of the problem. Does sql*net exist for Linux? What are these
: "oracle libraries" I need to compile/link against to get part of the perl
: interface working?
There exists Oracle 8.0.5 for Linux. Go strainght to www.oracle.com
and find a trial version there. It includes client libraries (known as
OCI). Then go to CPAN and fetch DBI and DBD::Oracle. Read docs. Compile them.
Enjoy.
: If you send e-mail please send to noble@pagesz.net
: THanks for any help....
: -----------== Posted via Deja News, The Discussion Network ==----------
: http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
--
--------------------------------------------------
Victor Wagner vitus@ice.ru
Programmer Office:7-(095)-964-0380
Institute for Commerce Home: 7-(095)-135-46-61
Engineering http://www.ice.ru/~vitus
------------------------------
Date: 10 Dec 1998 13:49:44 GMT
From: vitus@brass.fe.msk.ru (Victor B Wagner)
Subject: Re: PerlScript? Non-asp, & UNIX ... Is it out here?
Message-Id: <74ojho$mu9$1@zware.space.ru>
adcoment@earthling.net wrote:
: It would be very nifty for me to have Perl embedded in HTML Documents that are
: parsed through a server, executed, and displayed. This somewhat similiar to
: what the server engines like msql does with their w3 lite package.
: Is there a system out there now, or will I have to code it myself?
: (Or finish coding it I should say, whew!)
I know three ways of doing so with Apache Web server:
Apache::ASP
Apache::ePerl
HTML::EmbPerl
All three are available on CPAN.
eperl should work with ANY web server on ANY platform which allows
somehow associate files with your executable.
: -----------== Posted via Deja News, The Discussion Network ==----------
: http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
--
--------------------------------------------------
Victor Wagner vitus@ice.ru
Programmer Office:7-(095)-964-0380
Institute for Commerce Home: 7-(095)-135-46-61
Engineering http://www.ice.ru/~vitus
------------------------------
Date: Thu, 10 Dec 1998 13:21:05 GMT
From: NOSPAM_umsee@microasia.com (umsee)
Subject: Question on using grep to retrive directory on Windows NT workstation 4.0 FAT16
Message-Id: <74ohr5$e2u$1@canopus.cc.umanitoba.ca>
the following code is used:
opendir(FH,$basedir);
@dir = grep{-d} readdir{FH};
close(FH);
I noticed that sometimes it doesn't return the directory in $basedir.
Is this a compatibility problem? If so, what is your suggestion?
Thanks!!!
------------------------------
Date: Thu, 10 Dec 1998 14:56:54 -1300
From: pser <pascal.serode@alcatel.fr>
Subject: recursive dir in perl
Message-Id: <366FE136.4EC299D0@alcatel.fr>
I'm looking for some perl script able to do the UNIX "ls -R".
I need it because I'm programming under VMS and I can't call
ls through the system command.
What I need, in fact, is just a script able to go down directories
, recursively, building a list of every file met.
Thanks
DEN
denis.Roux@alcatel.fr
------------------------------
Date: Thu, 10 Dec 1998 09:18:35 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: recursive dir in perl
Message-Id: <comdog-ya02408000R1012980918350001@news.panix.com>
In article <366FE136.4EC299D0@alcatel.fr>, pser <pascal.serode@alcatel.fr> posted:
> I'm looking for some perl script able to do the UNIX "ls -R".
>
> I need it because I'm programming under VMS and I can't call
> ls through the system command.
>
> What I need, in fact, is just a script able to go down directories
> , recursively, building a list of every file met.
File::Find may be what you want.
--
brian d foy <brianNOSPAM@NOSPAM.smithrenaud.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
remove NOSPAM or don't. it doesn't matter either way.
------------------------------
Date: Thu, 10 Dec 1998 08:46:26 -0400
From: Arved Sandstrom <Arved_37@chebucto.ns.ca>
Subject: Re: Storing In Memory
Message-Id: <Pine.GSO.3.95.iB1.0.981210084403.2934B-100000@halifax.chebucto.ns.ca>
Assuming that the other posters were off the mark, somewhat, and that you
actually want more general memory storage, for complex data structures
even, look at module Storable.
On Tue, 8 Dec 1998, Chris Haines wrote:
> I am trying to figure out how I can store a variable or array in my
> system memory. I know this can be done but my book doesn't address
> that. Please help.
------------------------------
Date: Thu, 10 Dec 1998 11:35:50 GMT
From: adcoment@my-dejanews.com
Subject: Re: take out periods
Message-Id: <74obmm$3ck$1@nnrp1.dejanews.com>
> How do I take the "."'s out of the variable
> $release = "2.9.0"
> and assign 290 to $rls_name?
>
> TIA,
>
> Jim
First, not to be critical, check the manuals at CPAN perl.com, as this is
quite routine.
$release = "2.9.0";
$release =~ s/.//g;
$rls_name = $release;
Mind you, this now and ascii value of "290"
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 10 Dec 1998 12:12:09 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: take out periods
Message-Id: <slrn76vekp.5p8.sholden@pgrad.cs.usyd.edu.au>
On Thu, 10 Dec 1998 11:35:50 GMT, adcoment@my-dejanews.com
<adcoment@my-dejanews.com> wrote:
>
>
>> How do I take the "."'s out of the variable
>> $release = "2.9.0"
>> and assign 290 to $rls_name?
>>
>> TIA,
>>
>> Jim
>
>First, not to be critical, check the manuals at CPAN perl.com, as this is
>quite routine.
>
>$release = "2.9.0";
>$release =~ s/.//g;
>$rls_name = $release;
You could at least think about what your code does, testing it would be good
too.
Another reason why reading documentation is better than asking in clpm.
Don't even think about using the above code, as probably everyone else here
would know '.' is a little special in a regex.
The above 'solution' firstly obliterates the value of $release which I would
expect you don't want, and gives the completely wrong answer anyway.
So Jim, ignore this answer and look up the documentation that comes with perl.
--
Sam
Even if you aren't in doubt, consider the mental welfare of the person
who has to maintain the code after you, and who will probably put parens
in the wrong place. --Larry Wall
------------------------------
Date: 10 Dec 1998 05:11:37 -0600
From: claird@Starbase.NeoSoft.COM (Cameron Laird)
Subject: Re: TCL <-> PERL, what's better.
Message-Id: <74oa99$n6m$1@Starbase.NeoSoft.COM>
In article <913242940.793771@iris.nyx.net>,
Tom Poindexter <tpoindex@nyx10.nyx.net> wrote:
.
.
.
>Unfortunately, Tom's "Tcl vs. Perl" analysis is quite a bit dated. Tcl 8.0
>has been available for two years, which addresses most technical concerns
>noted in Tom's page (bytecode compiler & vm, native data representation,
>namespaces, list references, binary data, to name a few.) Aaron Sherman's
>comparision (on the same page) also suffers from the same problem. Neither
>should be considered as reliable analysis.
.
.
.
While Tom and Aaron seem to have moved in,
I welcome help keeping <URL:http://
starbase.neosoft.com/~claird/comp.lang.misc/portable_scripting.html#bilaterals>
current.
--
Cameron Laird http://starbase.neosoft.com/~claird/home.html
claird@NeoSoft.com +1 281 996 8546 FAX
------------------------------
Date: 10 Dec 1998 14:00:10 GMT
From: vitus@brass.fe.msk.ru (Victor B Wagner)
Subject: Re: TCL <-> PERL, what's better.
Message-Id: <74ok5a$mu9$3@zware.space.ru>
Martien Verbruggen (mgjv@comdyn.com.au) wrote:
: In article <74mc1o$at4@mercury.adc.com>,
: bhilton@tsg.adc.com (Brand Hilton) writes:
: > As for me, I used to do a lot of TCL work. Sure beats C/Motif when
: > you're doing GUIs. But, as a language, Perl's so much more powerful
: The gui stuff is Tk. There's also Tk for perl.
Tk was developed with Tcl in mind and doesn't fit to perl syntax so
well.
Really, all depends on your task. Perl is better when you need to handle
texts - much more powerful regexp, faster bytecode etc.
Tcl is better as macro language, especially if you need to extend it
with your own C-written commands or type commands interactively.
Another advantage of Tcl is builtin event model, which allows to
write non-forking TCP/IP servers without resort to low-level select
call.
But perl have -wc switch which is a great advantage when you are writing
something which runs unattended.
: Martien
: --
: Martien Verbruggen |
: Webmaster www.tradingpost.com.au | I'm desperately trying to figure out
: Commercial Dynamics Pty. Ltd. | why kamikaze pilots wore helmets - Dave
: NSW, Australia | Edison
--
--------------------------------------------------
Victor Wagner vitus@ice.ru
Programmer Office:7-(095)-964-0380
Institute for Commerce Home: 7-(095)-135-46-61
Engineering http://www.ice.ru/~vitus
------------------------------
Date: Thu, 10 Dec 1998 12:57:00 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: Trouble getting started with DBM
Message-Id: <366fc2da.579586010@news.mmc.org>
[ posted to comp.lang.perl.misc and a courtesy copy was mailed to the cited
author ]
On Thu, 10 Dec 1998 10:35:29 GMT, bart.lateur@skynet.be (Bart Lateur) wrote:
>I haven't used DBM support in Perl so far. But I've come to a point
>where it seems inavoidable, because the data is getting too big to be
>kept in memory all at once. However, I'm having trouble getting even a
>simple example to work.
>
> #! perl
> use SDBM_File;
use Fcntl; # exports constants such as O_RDRW and O_CREAT
> tie %hash, 'SDBM_File', 'test.db', O_RDWR|O_CREAT, 0644;
(snip)
Regards,
--
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center - Medical Information Systems Group
drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me
------------------------------
Date: Thu, 10 Dec 1998 14:30:00 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Trouble getting started with DBM
Message-Id: <366fd919.326858@news.skynet.be>
Jeffrey R. Drumm wrote:
>> use SDBM_File;
> use Fcntl; # exports constants such as O_RDRW and O_CREAT
>> tie %hash, 'SDBM_File', 'test.db', O_RDWR|O_CREAT, 0644;
Great! This is apparently missing in the documentation for SDBM_File.
Here is it:
=head1 SYNOPSIS
use SDBM_File;
tie(%h, 'SDBM_File', 'Op.dbmx', O_RDWR|O_CREAT, 0640);
untie %h;
Not one mention about Fcntl.
This addition solved the O_SVWST mistery; it probably was a bitwise
orring of the strings.
Unfortunatly, the code still doesn't work. After changing the tieing
code to
tie(...) or die "Cannot tie: $!";
the code dies with a "Cannot tie: file does not exist" message. Damnit.
I thought that that was what the O_CREAT was for? (Strange sentence,
that last one. It looks like a mere collection of loose words to me.)
Bart.
------------------------------
Date: Thu, 10 Dec 1998 14:33:03 GMT
From: John Johnson <5412@bellsouth.net>
Subject: xsubpp errors, can't dmake compiler-a3, etc.
Message-Id: <366FDB6C.EF784264@bellsouth.net>
Hi,
I'm fairly new to Perl, but I've written a couple of fine apps that
need to be compiled. To this end I downloaded Compiler-a3, and have been
trying to make it work for days. One common error no matter what I do
is:
C:\perl\Compiler-a3>perl makefile.pl
Usage: xsubpp [-v] [-C++] [-except] [-prototypes] [-noversioncheck]
[-nolinenumb
ers] [-s pattern] [-typemap typemap]... file.xs
Writing Makefile for B
That error occurs when I try to build other packages too.
I'm using Borland C++ Builder v. 5.2.
I've found that the dmake that comes with perl works better than the
make that comes with BCB. I've also tried editing the makefile generated
by makefile.pl so that it will use DJGPP, but that's a whole new can of
worms.
Here's what it boils down to:
xsubpp complains about it's syntax.
If I run xsubpp by hand, then move b.tc to b.c, the compiler complains
about cw32mti.lib being missing, the other libs listed that are missing
are: odbc32.lib and odbccp32.lib. import32.lib is
the one that comes with BCB.
Thanks to anyone who can help !
JJ
A transcript of the gorey details follows:
C:\perl\Compiler-a3>perl makefile.pl
Usage: xsubpp [-v] [-C++] [-except] [-prototypes] [-noversioncheck]
[-nolinenumb
ers] [-s pattern] [-typemap typemap]... file.xs
Writing Makefile for B
mkdir blib
mkdir blib\lib
cp B/Xref.pm blib\lib\B\Xref.pm
cp B/CC.pm blib\lib\B\CC.pm
cp B/Debug.pm blib\lib\B\Debug.pm
cp B/Showlex.pm blib\lib\B\Showlex.pm
cp B/Asmdata.pm blib\lib\B\Asmdata.pm
cp B/Bblock.pm blib\lib\B\Bblock.pm
cp bytecode.pl blib\lib\bytecode.pl
cp O.pm blib\lib\O.pm
cp B/Assembler.pm blib\lib\B\Assembler.pm
cp B/Disassembler.pm blib\lib\B\Disassembler.pm
cp B/Bytecode.pm blib\lib\B\Bytecode.pm
cp B.pm blib\lib\B.pm
cp B/Stackobj.pm blib\lib\B\Stackobj.pm
cp B/C.pm blib\lib\B\C.pm
cp B/Terse.pm blib\lib\B\Terse.pm
C:\PERL\BIN\perl -Ic:\perl\lib -Ic:\perl\lib
C:\perl\lib\ExtUtils/xsubpp -typem
ap C:\perl\lib\ExtUtils\typemap -typemap typemap B.xs >B.tc &&
C:\PERL\BIN\perl
-Ic:\perl\lib -Ic:\perl\lib -MExtUtils::Command -e mv B.tc B.c
Usage: xsubpp [-v] [-C++] [-except] [-prototypes] [-noversioncheck]
[-nolinenumb
ers] [-s pattern] [-typemap typemap]... file.xs
bcc32 -c -D_RTLDLL -DWIN32 -O -DVERSION=\"a2\"
-DXS_VERSION=\"a2\" -IC
:\perl\lib\CORE B.c
Borland C++ 5.2 for Win32 Copyright (c) 1993, 1997 Borland International
Error: Could not find file 'B.c'
bcc32 -c -D_RTLDLL -DWIN32 -O -DVERSION=\"a2\"
-DXS_VERSION=\"a2\" -IC
:\perl\lib\CORE ccop.c
Borland C++ 5.2 for Win32 Copyright (c) 1993, 1997 Borland International
ccop.c:
bcc32 -c -D_RTLDLL -DWIN32 -O -DVERSION=\"a2\"
-DXS_VERSION=\"a2\" -IC
:\perl\lib\CORE byterun.c
Borland C++ 5.2 for Win32 Copyright (c) 1993, 1997 Borland International
byterun.c:
Warning byterun.c 274: Suspicious pointer conversion in function byterun
Warning byterun.c 288: Suspicious pointer conversion in function byterun
Warning byterun.c 302: Suspicious pointer conversion in function byterun
Warning byterun.c 351: Suspicious pointer conversion in function byterun
Warning byterun.c 358: Suspicious pointer conversion in function byterun
Warning byterun.c 764: Suspicious pointer conversion in function byterun
Warning byterun.c 820: Suspicious pointer conversion in function byterun
mkdir blib\arch
mkdir blib\arch\auto
mkdir blib\arch\auto\B
C:\PERL\BIN\perl "-Ic:\perl\lib" "-Ic:\perl\lib" -MExtUtils::Mksymlists
\
-e "Mksymlists('NAME' => 'B', 'DLBASE' => 'B', 'DL_FUNCS' => { },
'IMPORTS
' => { }, 'DL_VARS' => []);"
"Running Mkbootstrap for B ()"
C:\PERL\BIN\perl -Ic:\perl\lib -Ic:\perl\lib -MExtUtils::Command -e
chmod 644 B.
bs
C:\PERL\BIN\perl -Ic:\perl\lib -Ic:\perl\lib -MExtUtils::Command -e cp
B.bs blib
\arch\auto\B\B.bs
C:\PERL\BIN\perl -Ic:\perl\lib -Ic:\perl\lib -MExtUtils::Command -e
chmod 644 bl
ib\arch\auto\B\B.bs
rem
DMAKE.EXE: Error -- `byteperl.o' not found, and can't be made
If I run xsubpp by hand:
C:\perl\Compiler-a3>perl \perl\lib\extutils\xsubpp -typemap
\perl\lib\extutils\t
ypemap -typemap typemap b.xs >b.tc
it works, so I mv b.tc b.c, then dmake again:
C:\perl\Compiler-a3>dmake
C:\PERL\BIN\perl -Ic:\perl\lib -Ic:\perl\lib
C:\perl\lib\ExtUtils/xsubpp -typem
ap C:\perl\lib\ExtUtils\typemap -typemap typemap B.xs >B.tc &&
C:\PERL\BIN\perl
-Ic:\perl\lib -Ic:\perl\lib -MExtUtils::Command -e mv B.tc B.c
Usage: xsubpp [-v] [-C++] [-except] [-prototypes] [-noversioncheck]
[-nolinenumb
ers] [-s pattern] [-typemap typemap]... file.xs
bcc32 -c -D_RTLDLL -DWIN32 -O -DVERSION=\"a2\"
-DXS_VERSION=\"a2\" -IC
:\perl\lib\CORE B.c
Borland C++ 5.2 for Win32 Copyright (c) 1993, 1997 Borland International
b.c:
tlink32 -Tpd c0d32.obj B.obj ccop.obj
byterun.obj,blib\arch\auto\B\B.dll,,C:\per
l\lib\CORE\perl.lib import32.lib cw32mti.lib odbc32.lib odbccp32.lib
,B.def,
Turbo Link Version 2.0.68.0 Copyright (c) 1993,1997 Borland
International
Fatal: Unable to open file 'cw32mti.lib'
C:\PERL\BIN\perl -Ic:\perl\lib -Ic:\perl\lib -MExtUtils::Command -e
chmod 755 bl
ib\arch\auto\B\B.dll
rem
DMAKE.EXE: Error -- `byteperl.o' not found, and can't be made
And I can't find cw32mti.lib anywhere on my machine, or on CPAN.
------------------------------
Date: Wed, 9 Dec 1998 22:41:10 -0500
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: y2k and killing creativity (was Re: Y2K potential problem in localtime())
Message-Id: <19981209.224110.5S6.rnr.w164w@locutus.ofB.ORG>
fl_aggie@thepentagon.com (I R A Aggie) writes:
> No. Wrong. What it means is that people should consult the documentation
> when confronted with seemingly strange results.
and not only then... but then you say
> James - time for a Larry Wall-ism:
>
> Many computer scientists have fallen into the trap of trying to define
> languages like George Orwell's Newspeak, in which it is impossible to
> think bad thoughts. What they end up doing is killing the creativity
> of programming. -- Larry Wall
please tell me you didn't think this was related in any way to the
year-1900 silliness or to reading documentation.
--
Russell_Schulz@locutus.ofB.ORG Shad 86c
------------------------------
Date: Thu, 10 Dec 1998 09:34:12 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: y2k and killing creativity (was Re: Y2K potential problem in localtime())
Message-Id: <fl_aggie-1012980934130001@aggie.coaps.fsu.edu>
In article <19981209.224110.5S6.rnr.w164w@locutus.ofB.ORG>, Russell Schulz
<Russell_Schulz@locutus.ofB.ORG> wrote:
+ fl_aggie@thepentagon.com (I R A Aggie) writes:
+
+ > No. Wrong. What it means is that people should consult the documentation
+ > when confronted with seemingly strange results.
+
+ and not only then... but then you say
+
+ > James - time for a Larry Wall-ism:
+ >
+ > Many computer scientists have fallen into the trap of trying to define
+ > languages like George Orwell's Newspeak, in which it is impossible to
+ > think bad thoughts. What they end up doing is killing the creativity
+ > of programming. -- Larry Wall
+
+ please tell me you didn't think this was related in any way to the
+ year-1900 silliness or to reading documentation.
Yes, actually. You shouldn't expect your programming language to save you
from your own stupidities -- "bad thoughts", if you will.
James
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 4396
**************************************