[6774] in Perl-Users-Digest
Perl-Users Digest, Issue: 399 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 30 14:17:18 1997
Date: Wed, 30 Apr 97 11:00:32 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 30 Apr 1997 Volume: 8 Number: 399
Today's topics:
2-way commuication with external program <ghartlieb@mail.arc.nasa.gov>
Re: Die problem (Bill Blohm)
Re: HELP: system call <seay@absyss.fr>
Re: How to write '&' through Perl's decoding johnsonn@masirv.com
Re: Notice to antispammers <nojunk@mail.please>
Re: Notice to antispammers (Nathan V. Patwardhan)
Re: Notice to antispammers <usenet-tag@qz.little-neck.ny.us>
Re: Notice to antispammers <usenet-tag@qz.little-neck.ny.us>
Re: Object IDs are good ( was: Object IDs are bad ) (Patrick Doyle)
Re: Perl 5 under IRIX 6.2 (Zsolt Ferenczy)
Re: Perl 5 under IRIX 6.2 <gtk@walsh2.med.harvard.edu>
Re: Perl access of SQL database NT4.0 SQL Server 6.5 buckinm@nfric.nesusa.com
Re: Perl equivalent of "source in c-shell" or "dot comm <seay@absyss.fr>
Re: Perl using Microsoft Personal Web Server (Jon Bell)
Re: Q: How do I ... <ajohnson@gpu.srv.ualberta.ca>
Re: References in foreach loop variable <kraven@keystone.westminster.edu>
Regexp bug or feature? (perl claims null string match) <polani@pandora.informatik.uni-mainz.de>
SDBM_file and 'Hash of Hashes' from Camel (Cornelius Griffin)
SIMPLE REG-EXP Please Help! <andrea@iternet.it>
Re: SIMPLE REG-EXP Please Help! (Nathan V. Patwardhan)
Re: SIMPLE REG-EXP Please Help! <usenet-tag@qz.little-neck.ny.us>
Re: SIMPLE REG-EXP Please Help! <ajohnson@gpu.srv.ualberta.ca>
The Perl Clinic - Commercial Support For Perl and/or Or <Tim.Bunce@ig.co.uk>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 30 Apr 1997 09:26:21 -0700
From: George Hartlieb <ghartlieb@mail.arc.nasa.gov>
Subject: 2-way commuication with external program
Message-Id: <336772A7.476C@mail.arc.nasa.gov>
What I want to do is pipe data to an external program than capture the
output in a perl variable.
Is there any newer way to do 2-way commuication with an external program
than what is in the "Blue Camel Book".
I looked at the IO::Pipe module but I need an example to figure out how
to do this.
All ideas considered
Thanks,
------------------------------
Date: 30 Apr 1997 16:00:59 GMT
From: bblohm@boi.hp.com (Bill Blohm)
Subject: Re: Die problem
Message-Id: <5k7qbr$3p12@hpbs1500.boi.hp.com>
Thanks one and all, for all the help and pointers. My problem is
not only solved, I also understand what was going on much better.
BTW, there is another reference point, in the man pages for perlrun,
specifically the -i entry, that also helps.
Thanks again.
Bill B.
------------------------------
Date: Wed, 30 Apr 1997 18:00:32 +0100
From: Douglas Seay <seay@absyss.fr>
Subject: Re: HELP: system call
Message-Id: <33677AAF.63A53216@absyss.fr>
Aurangzeb Agha wrote:
>
> I'm trying to take the output from a system call and put it into a variable.
>
> 1) $test = system("date");
> 2) print("*** test: $test\n");
Why are you using system? When you read the entry for system in the
perlfunc man page, which sentence made you think it returned the
standard out of the program launched? Here is an exerpt from that very
man page
The return value is the exit
status of the program as returned by the wait()
call. To get the actual exit value divide by 256.
See also the exec entry elsewhere in this
document. This is NOT what you want to use to
capture the output from a command, for that you
should merely use ...
I'm being an ass and cutting it before the key word. You seem to need
to learn how to use man pages, this is a chance for you to learn.
> 1 -- executes the system call and sets $test to 0 to show successful execution
> 2 -- prints 0 for successful execution
Both of these are correct. It seems that you do understand what is
going on.
> How can I make a system call to 'date', and direct the output to $test
> (preferably without output to STDIO)?
It cannot be done with system(). If you were using C, would you use
system()? Of course not, well, not if you wanted it to work. You would
use popen(). system() in Perl is the same (more or less) as system() in
C. You need another command, one that is clearly labeled in the man
pages.
> PS -- Please eMail me at: aagha@cis.ohio-state.edu
It is rude to post to Usenet but ask for an answer via email.
- doug
------------------------------
Date: Wed, 30 Apr 1997 11:34:17 -0600
From: johnsonn@masirv.com
To: o.c.kwon@durham.ac.uk
Subject: Re: How to write '&' through Perl's decoding
Message-Id: <862417440.27794@dejanews.com>
In article <5k7a8p$sp7@mercury.dur.ac.uk>,
O C Kwon <O.C.Kwon@durham.ac.uk> wrote:
>
> Dear All,
> I used & in an HTML file in order to display '&' in
> an HTML form. However, when an '&' in a word is written
> in a file it is processed as a new line, because I had to
> use the '&' to split the whole data and to write each
> name-value pair in each line of a file.
> Can anyone tell me how to write a special character,'&',
> in a file, which is inserted by user's selection from
> a fill-out form.
>
> Any help would be appreciated.
>
> Oh-Cheon email o.c.kwon@durham.ac.uk
>
>
It sounds like you are doing cgi stuff. If you are then use one of the
standard perl libraries to parse the input to the cgi script from the web
page, They handle this stuff. Also try using the HTML Coded Character
Set representation of & for the ampersand.
The complete character set is available at the World Wide Web Consortium:
http://www.w3.org/pub/WWW/MarkUp/html-spec/html-spec_13.html
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Wed, 30 Apr 1997 16:25:55 GMT
From: David Nadler <nojunk@mail.please>
Subject: Re: Notice to antispammers
Message-Id: <33677293.445344F5@mail.please>
Terry Carroll wrote:
Terry Carroll wrote:
> People who use invalid email addresses to thwart spammers have made a
> decision to shift their problem of wanting to avoid spam from themselves
> to the persons who want to legitimately correspond with them. They have
> decided that the inconvenience to spammers outweighs the inconvenience to
> legitimate users, and they have decided on this without regard to the
> legitimate users.
This is how I do it in my signature. If it's an undue hardship
to reply to me, then you don't have to. As far as any malicious
publication of my email address in a web page by a soi-disant
philologist and grammarian who still hasn't corrected the overly-
accusative "whomever" in article 6 of the artistic "licence" is
concerned, I'll be consulting my attorneys to see whether that's
a tortious invasion of my privacy. You do not have my consent
to publish my email address in a form easily scanned by junk
mailers.
David Nadler
--
You too have probably gotten junk e-mail. If you'd
like to reply to me, please send to "dnadler" at
linex.com.
------------------------------
Date: 30 Apr 1997 16:04:33 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Notice to antispammers
Message-Id: <5k7qih$2o1@fridge-nf0.shore.net>
Matt Kruse (mkruse@shamu.netexpress.net) wrote:
: Nice solution, but not practical in many, if not most, circumstances.
ok ok. I admit it. I'm not going to open the can of whoop-ass about
the whole issue, but I have to add a couple more things to purge my
soul of this nonsense.
I disagree. It's very practical - in most cases, I theorize. Like I
said, those who don't use providers who allow mail filtering should retain
providers who can. OR, those who don't have mail clients which support
filtering should install clients which can.
: You shouldnt assume that
Heh. I'm not assuming anything. Read below. You're assuming that I'm
assuming - so we're all meandering to and fro like a herd of mad cows.
: 1) everyone runs their mail server on unix
I used procmail as an example, but there are mail filters for every
platform.
: 2) everyone even has access to install/use things like this
When I get my website back up, one of the sections will involve mail
filtering tools (programs, and mail clients [like Eudora]) for as many
platforms as I can find. In other words, everyone has access to such
tools - it's a matter of how much research one wants to do before deciding
to munge their address.
: 3) everyone has the knowledge needed to create filters
I'll try to document as many products as I can; I suspect that people
who find one mail program which filters will find another, and suggest
that I add it to the list. Such has been the case with other software,
usenet group suggestion postings, etc, that I've written - it's great
to have the input and contributions.
I agree that many people don't have this knowledge, BUT if you've
chosen to dabble in a technical field (like computing) and put yourself
in a situation (like usenet or the internet) where there is a lot of
interaction from the outside, you have to accept the consequences of
your decision - which means you MUST *learn* things.
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: 30 Apr 1997 17:15:12 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: Notice to antispammers
Message-Id: <5k7un0$cl0$1@news.netusa.net>
Followups set to news.admin.net-abuse.policy, a robomoderated group
which allows no crossposting.
Matt Kruse <mkruse@shamu.netexpress.net> wrote:
>Nathan V. Patwardhan <nvp@shore.net> wrote:
>: Please use a mail filter, like procmail. If you're using a provider that
>: doesn't offer one (from what I've heard, you can even filter your mail
>: through AOL of all things), please get a provider who can.
Yes, but their filter (last I checked) doesn't understand the concept
of wordboundries, making it very annoying for us netusa.net customers
trying to mail people who have blocked usa.net.
>Nice solution, but not practical in many, if not most, circumstances.
>
>You shouldnt assume that
>1) everyone runs their mail server on unix
No such assumption was made. Notice the reference even to AOL.
>2) everyone even has access to install/use things like this
This filtering can be done at many levels, not just those which
require special privledges.
>3) everyone has the knowledge needed to create filters
Hell I don't assume that, so I have made great efforts to help others.
See <URL:http://www.netusa.net/~eli/faqs/addressing.html> for one
effort. See my refinement of Johnbob's jmdigest scoring script for
another <URL:ftp://ftp.netusa.net/users/eli/jmdigest> and
<URL:ftp://ftp.netusa.net/users/eli/jmdrc>. That one is a perl script,
and this being a perl group, it is not unreasonable that people here
would be able to run it. Setting it up to run automatically is another
issue, I have instructions for using it with procmail because I know
procmail. If someone gives me instructions for other systems I will
gladly archive them with it.
>: I'd hate to think that someone (legitimate) who was trying to contact
>: me couldn't because I munged my headers.
>me too, which is why i just put up with the spam (lots of it) for now.
>but not everyone feels this way.
I use a special address for usenet posts. It gets heavy spam filtering.
I use a different address for regular email, it gets less filtering. I
have found this very effective.
People who wish to minimize their exposure to spam should not post to
usenet from their regular address, should not give out their regular
address to forms on the web, should not let their browser give out
their address without permission. (I only use a hacked lynx and a
specially hacked netscape. Don't talk to me about violating the license
agreement by editing my copy of netscape, I don't believe it can legally
apply to software for my own use.)
Posting to usenet from addresses that do not work is rude. Get a freebie
mail address at usa.net or hotmail or where ever to keep your regular
account free if you want, but allow for a way for regular replies to
work.
Elijah
------
usenet is not a right
------------------------------
Date: 30 Apr 1997 17:33:55 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: Notice to antispammers
Message-Id: <5k7vq3$cnd$1@news.netusa.net>
David Nadler <dnadler@linex.com>, posing as <nojunk@mail.please> wrote:
>This is how I do it in my signature. If it's an undue hardship
>to reply to me, then you don't have to. As far as any malicious
>publication of my email address in a web page by a soi-disant
>philologist and grammarian who still hasn't corrected the overly-
>accusative "whomever" in article 6 of the artistic "licence" is
>concerned, I'll be consulting my attorneys to see whether that's
>a tortious invasion of my privacy. You do not have my consent
>to publish my email address in a form easily scanned by junk
>mailers.
Noted. You cannot copyright an email address and as such you
cannot stop people from publishing it. Besides, I could easily
write a ten line script to scan for and fix all addresses of
the form
m&[-:';_+=|\\//"`]? *\S+ *\b[-:';_+=|\\//"`]? *(at|@|.?at.?) *
[\w-]+ *\b(\.|dot|.?dot.?) *([\w-]+ *\b(\.|dot|.?dot.?) *)*
(com|net|org|mil|gov|[a-z][a-z])\b&isx
With some handy logic to remove NOSPAMs and REMOVE-TO-REPLYs,
so YMMV with that "form easily scanned by junk mailers" clause.
If I felt really ambitious, I could even combine it with some
understanding to fix the more obvious date-stamped expiring
addresses.
>You too have probably gotten junk e-mail. If you'd
>like to reply to me, please send to "dnadler" at
>linex.com.
Elijah
------
Friedl has only taught me efficiency
------------------------------
Date: Wed, 30 Apr 1997 15:34:47 GMT
From: doylep@ecf.toronto.edu (Patrick Doyle)
Subject: Re: Object IDs are good ( was: Object IDs are bad )
Message-Id: <E9GJ9z.Ety@ecf.toronto.edu>
In article <5k67a4$nit@mulga.cs.mu.OZ.AU>,
Andrew Bromage <bromage@cs.mu.OZ.AU> wrote:
>
>doylep@ecf.toronto.edu (Patrick Doyle) writes:
>
>> Can you give an example of two immutable objects, alike in every way,
>>which need to be distinguished?
>
>They may need to be distinguished for the purpose of compile-time
>garbage collection. If you create two immutable identical objects,
>it may be easier to discover when they become garbage because the
>references to them are unique, than if they were one object with
>a shared reference.
>
>Admittedly the programmer does not necessarily need to see this.
Neither does the GC. It can simply throw away one of the objects
immediately and use the other, can't it?
-PD
--
--
Patrick Doyle
doylep@ecf.utoronto.ca
------------------------------
Date: 30 Apr 1997 16:53:31 GMT
From: zsolt@crisis.atlanta.sgi.com (Zsolt Ferenczy)
Subject: Re: Perl 5 under IRIX 6.2
Message-Id: <5k7teb$je2@fido.asd.sgi.com>
In article <3367641F.446B@out.trw.com>,
Robert M. Cothren, PhD <robert_cothren@out.trw.com> wrote:
>I need to get Perl 5 running under IRIX 6.2. However, it seems to have a
>bunch of configuration problems using the ./Configure script. Can anyone
>tell me what magic things I need to do to get it to compile so I don't
>have to rediscover everything myself?
>
>Thanks.
>
>--
>--Robert M. Cothren, PhD------------------robert_cothren@out.trw.com--
> TRW Systems Integration Group
> Advanced Medical Imaging Laboratory voice: 510 881-0469
>--Ogden, Utah--------------------------------------fax: 510 727-9781--
You can get perl off the Freeware 2.0 CD.
U fw_LWperl5.sw.perl [d] 212- Perl5 interpreter and std library
There is also a version on the first IRIX 6.2 CD.
S eoe.sw.gifts_perl [d] 4+ Perl Software
--
+---------------------------------------------------------------------------+
Zsolt Ferenczy zsolt@atlanta.sgi.com
Systems Engineer Co-op 770/475-0464
Silicon Graphics, Atlanta
------------------------------
Date: 30 Apr 1997 13:01:55 -0400
From: Gregory Tucker-Kellogg <gtk@walsh2.med.harvard.edu>
Subject: Re: Perl 5 under IRIX 6.2
Message-Id: <w2wwpkbg1o.fsf@walsh2.med.harvard.edu>
What is the error?
I got perl 5 to compile on IRIX 6.2 using just the defaults and the
SGI compiler. The only problem I had was when I had include files
remaining from an old gcc installation, and Configure tried to use
them. If you are using SGIs cc, libs, and headers, it should work fine.
Greg
"Robert M. Cothren, PhD" <robert_cothren@out.trw.com> writes:
>
> I need to get Perl 5 running under IRIX 6.2. However, it seems to have a
> bunch of configuration problems using the ./Configure script. Can anyone
> tell me what magic things I need to do to get it to compile so I don't
> have to rediscover everything myself?
>
> Thanks.
--
Gregory Tucker-Kellogg
Department of Biological Chemistry and Molecular Pharmacology
Harvard Medical School, Boston MA 02115
"Mojo Dobro" Finger for PGP info
------------------------------
Date: Wed, 30 Apr 1997 12:02:13 -0600
From: buckinm@nfric.nesusa.com
Subject: Re: Perl access of SQL database NT4.0 SQL Server 6.5
Message-Id: <862419373.29708@dejanews.com>
In article <3365B0C6.57FA@syskonnect.de>,
tschuber@syskonnect.de wrote:
>
> Hello,
>
> I want to place some data into a SQL database.
> The data should be accessable via IntraNet.
> Therefore I have several questions:
> - is there any way to access a SQL database using Perl?
> - if yes, is it possible to send SQL commands using Perl?
>
> Has anybody experiences doing this?
> Any help would be greatly appreciated.
>
> Thanks
> Thomas Schuber
I'm doing this quite a bit now actually... As far as I know, you have two
options: If you are running on NT, you can use Dave Roth's excellent
Win32::ODBC module. This is really easy to use.
If you are on Unix, then you can use sybperl to talk to NT SQL Server.
My only fear with this method is that eventually, NT SQL Server may be to
different to work correctly. (4.2 certainly isn't, I doubt that 6.5 is
a problem either.) Note that you want to use the DBLib portion of
sybperl, because CTLib isn't part of NT SQL Server.
I'm talking to 4.2 and 6.5 with ODBC on Win32 perl. I've only used 4.2
with sybperl.
Hope this helps
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Wed, 30 Apr 1997 18:09:21 +0100
From: Douglas Seay <seay@absyss.fr>
To: kim <kktan@concentric.net>
Subject: Re: Perl equivalent of "source in c-shell" or "dot command in Korn shell" ?
Message-Id: <33677CC1.4A6B2381@absyss.fr>
[posted and mailed]
kim wrote:
>
> Hi there,
> Is there a Perl equivalent of "source command" in c-shell or "dot"
> command in Korn shell ? right now I have to run a shell script with multiple
> command, including the "dot" command just because I need to run all those
> in the same shell environment. I will rather do it all in Perl if I know how.
> thanks for any info.
>
Kim,
To have one Perl script load (and run?) another you have several
choices, "require" being the best for loading just a few functions or
variables, but "use", "eval"
and "do" all do something of the sort. If you had glanced at the docs
you would have seen this. "man perlfunc" and then grep for include
would have found both "do" and "require". Please use look at the
documentation before you post. People have taken time to write the
documentation, please don't ignore this effort.
If this program is something that you will maintain for a while, do
yourself a big favor, buy the camel and read it.
- doug
------------------------------
Date: Wed, 30 Apr 1997 15:54:39 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: Perl using Microsoft Personal Web Server
Message-Id: <E9GK74.Lxp@presby.edu>
Sidney Snodgrass <jspencer@netcomuk.co.uk> wrote:
>I have just installed MS PWS and need to run Perl, can someone tell me
>where to download it from and if there are any 'special' install
>instructions to be aware of.
Check out the Perl FAQ at http://www.perl.com/faq/
--
Jon Bell <jtbell@presby.edu> Presbyterian College
Dept. of Physics and Computer Science Clinton, South Carolina USA
[for beginner's Usenet info, see http://web.presby.edu/~jtbell/usenet/ ]
------------------------------
Date: Wed, 30 Apr 1997 12:21:45 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Q: How do I ...
Message-Id: <33677FA9.76A872@gpu.srv.ualberta.ca>
Gordon Lee wrote:
! convert a string to uppercase except for quoted text which
! may occur 0 or more times within the string? Example:
!
! $line = <img src="image.gif" align="left">;
!
! The following will work on the above:
!
! $line =~ s/(.*?)(\".*?\")/\U$1\E$2/g;
!
! but won't work on:
!
! <img>
something like the following might be along
the lines of what you want:
$line =~ s/(<\w+|\w+=)/\U$1\E/g;
though you may have to adjust it to handle
other special cases.
regards
andrew
------------------------------
Date: Wed, 30 Apr 1997 12:14:57 -0400
From: Keith Arner <kraven@keystone.westminster.edu>
Subject: Re: References in foreach loop variable
Message-Id: <33677001.4474@keystone.westminster.edu>
David Alan Black <dblack@icarus.shu.edu> wrote:
> (The following answer is predicated on the assumption that you meant
> "print $$i;", not "print $i;", in the third example.)
Yes... that's what I meant. I knew I should have cut-and-paste.
> In foreach $$i (), the expression $$i has to be a scalar lvalue.
>
> If $i doesn't contain anything (your first example), then the expression
> $$i is a dereferencing of nothing, which doesn't work.
If we pull this out of the foreach:
$$i = 2;
Generates the error:
Can't use an undefined value as a SCALAR reference at - line 1.
However:
$$i[0] = 2;
..is successful.
Perl dynamicly creates the annonymous array
referenced by $i. It would stand to reason that perl would dynamicly
create the anonymous scalar referenced by $i in '$$i = 2', since
"references of an appropriate type simply spring into existance if you
dereference them in a context that assumes they exist" (p. 248).
> If $i contains neither nothing nor a plain string, but, instead, a
> hard reference, then Perl checks to see whether it is the right type of
> reference for the occasion. In the case of your second example, it
> isn't - it's a scalar reference, where only a glob reference will do.
Now that's the point that has me baffled. Why does it need to be a
glob ref rather than a scalar ref? Consider the following two
programs:
$i = *foo;
$foo = 1;
print $$i;
print $foo;
$i =\$foo;
$foo = 1;
print $$i;
print $foo;
These both give the same end result (and they work the same if the
assignment on the second line is to $$i). This seems to say that
the glob and the hard ref can be used interchangeably (assuming you
don't want to muck around in symboltables). What is special about the
foreach loop that it's control variable cannot be found through a hard
reference to a scalar?
My gut seems to be telling me that the problem lies in the fact that
perl does some sort of glbo assignment on the control variable (to
allow assignment to the control variable to change the original
value), but I can't quite put it into words.
> Hoping this isn't too dense, fuzzy, long, wide....
"This one's just right", said Goldylocks.
--
|/ /| Keith.Arner@Industry.Net
|\ e i t h /-| r n e r
@________________
When all else fails, duct tape it.|
----------------------------'
------------------------------
Date: 30 Apr 1997 19:27:04 +0200
From: Daniel Polani <polani@pandora.informatik.uni-mainz.de>
Subject: Regexp bug or feature? (perl claims null string match)
Message-Id: <ucohawmnfb.fsf@pandora.Informatik.Uni-Mainz.DE>
Hi Perlers,
in a script I am testing for a match of lines of the form
10111010|10010110|01111111|10100101
and similar. I am using the following regexp
/^[01]+(|[01]+)+/
for the match (which seems to work), however perl claims that
(|[01]+)+ matches null string many times at 'pe' line 10.
I do not understand why that regexp should ever match a zero length
string. Am I missing something, or is this a bug?
Daniel Polani
| Institut fuer Informatik | Staudingerweg 9 |
| Fachbereich Mathematik | 55099 Mainz |
| Johannes Gutenberg-Universitaet | Germany |
| ---------------------------------------------------------------|
| polani@informatik.mathematik.uni-mainz.de, Tel. +6131/39-3608 |
| http://www.informatik.uni-mainz.de/PERSONEN/Polani.html |
BTW: Any idea, why /^([01]+|)+[01]+/) takes much longer to run? Isn't
the first term treated greedily?
------------------------------
Date: Wed, 30 Apr 1997 12:57:15 -0400
From: EScrubb@worldnet.att.net (Cornelius Griffin)
Subject: SDBM_file and 'Hash of Hashes' from Camel
Message-Id: <MPG.dd143f79bcaf65e989681@netnews.worldnet.att.net>
Hello,
I'm working through the Camel book and I am able to implement all
of the examples in the 'Hash of Hashes', p.270, section of the book. My
problem enters when I attempt to tie() the hash I have created to an
SDBM_File. It appears as if the first time I run the script from the
command line only the second, 'nohelp', variable is appended to the file.
Running the script again, places both the, 'help', and, 'nohelp', entries
in the file. The code I use is this:
use SDBM_File;
$O_BINARY = hex( '0x8000' ); # binary flag
$O_CREAT = hex( '0x0100' ); # create flag
$O_RDWR = hex( '0x0002' ); # read-write flag
tie( %myhash, SDBM_File, "numbertest",
$O_BINARY | $O_CREAT | $O_RDWR, 0666 ) || die "Can't tie: $!";
$title = "Program_termination";
%myValues = (help => "0",
nohelp => "23"); #Create the hash that will be appended
for $what ( keys %myValues ) {
$myhash{$title}{$what} = $myValues{$what}; #Write values
}
foreach $file (keys %myhash) {
print "$file: ";
foreach $val (keys %{$myhash{$file}}) {
print "$val=$myhash{$file}{$val} "; #Print out the Contents
}
print "\n";
}
untie(%myhash);
When I am not using the SDBM_file, the assignment works fine and both
variables are listed when I print them the first time. Anyone have any
ideas??? I am using NT & Perl for Win32, Thanks in advance.
Cornelius
------------------------------
Date: Thu, 01 May 1997 18:09:15 +0200
From: andrea <andrea@iternet.it>
Subject: SIMPLE REG-EXP Please Help!
Message-Id: <3368C02B.4A47BA4C@iternet.it>
I'm not a reg-exp guru but i think this one is too simple to fail.
I've 600 html files with <\B> instead of </B> as it should be.
i've done this:
perl -p -i -e "s/<\\B>/<\/B>/i;" *.html
doesn't work.
so i tried
perl -p -i -e "s/\<\\B\>/\<\/B\>/i;" *.html
using a backslash before < and >, in the remote case they were some
strange option i don't know.
I also tried usinq \Q and \E but i had no success.
please Help and explain me.
TIA.
andrea
------------------------------
Date: 30 Apr 1997 17:31:31 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: SIMPLE REG-EXP Please Help!
Message-Id: <5k7vlj$864@fridge-nf0.shore.net>
andrea (andrea@iternet.it) wrote:
: I'm not a reg-exp guru but i think this one is too simple to fail.
: I've 600 html files with <\B> instead of </B> as it should be.
: i've done this:
: perl -p -i -e "s/<\\B>/<\/B>/i;" *.html
perl -pi.bak -e 's/<\\B>/<\/B>/g' *.html
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: 30 Apr 1997 17:49:33 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: SIMPLE REG-EXP Please Help!
Message-Id: <5k80nd$cpf$1@news.netusa.net>
Posted and mailed.
andrea <andrea@iternet.it> wrote:
>I'm not a reg-exp guru but i think this one is too simple to fail.
It's not a regexp problem.
>perl -p -i -e "s/<\\B>/<\/B>/i;" *.html
The shell is eating the backslashes. Try it with 'single' quotes or
in a file instead. Or add more backslashes.
>perl -p -i -e "s/\<\\B\>/\<\/B\>/i;" *.html
>
>using a backslash before < and >, in the remote case they were some
>strange option i don't know.
In many regexp languages, \< and \> are word boundry markers for
start and end of word respectively. This is not so in perl, but that
would cause you perhaps more confusion: in this case it would fail
for all your <\B>s, and work on all your <B>s.
Elijah
------
likes regexp languages with both \b and \< and \>
------------------------------
Date: Wed, 30 Apr 1997 12:36:51 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: SIMPLE REG-EXP Please Help!
Message-Id: <33678333.6F93D7F6@gpu.srv.ualberta.ca>
andrea wrote:
! I've 600 html files with <\B> instead of </B> as it should be.
!
! i've done this:
!
! perl -p -i -e "s/<\\B>/<\/B>/i;" *.html
!
! doesn't work.
put single quotes around your statement
perl -p -i -e 's/<\\B>/<\/B>/i;' *.html
and it should work.
regards
andrew
------------------------------
Date: Wed, 30 Apr 1997 16:06:10 GMT
From: Tim Bunce <Tim.Bunce@ig.co.uk>
Subject: The Perl Clinic - Commercial Support For Perl and/or Oraperl
Message-Id: <E9GKqA.8ys@ig.co.uk>
The Perl Clinic - Supporting People Using Perl
* Do you need professional support for Perl and/or Oraperl?
* Do you need a support contract with defined levels of service?
* Do you want to pay only for what you need?
----------------------------------------------------------------------------
WHO WE ARE
The Perl Clinic has been established to provide a home for Perl commercial
support services.
The Perl Clinic is a service of the Paul Ingram Group and provides
professional support for companies and individuals who use Perl. The Paul
Ingram Group has provided quality software development and support to some
of the worlds largest corporations for ten years. We are now offering the
same quality support services for Perl.
This service is led by Tim Bunce, an active perl5-porter since 1994 and well
known as the author and maintainer of the DBI, DBD::Oracle and Oraperl
modules and author/co-maintainer of The Perl5 Module List.
We are committed to supporting The Perl Institute in its mission to "help
people help Perl help people". To that end, we will be donating 20% of the
profit from The Perl Clinic to the The Perl Institute.
----------------------------------------------------------------------------
WHAT WE OFFER
A strong professional technical support service, working with clients to:
* identify and resolve problems
* provide fast answers to technical questions
* work effectively with the Perl development team on your behalf if
required - saving time and effort for everyone
* offer consultancy and development on a time and materials basis if
required
We cannot guarantee to solve every problem, however we will guarantee to
give you our best efforts and stake our reputation on your ultimate
satisfaction.
----------------------------------------------------------------------------
HOW IT WORKS
Support is purchased and delivered in Units to Support Contacts. We offer
two types of units: time-based (15 minutes each) and incident-based, priced
separately and offering different levels of support to best fit your needs.
Units are purchased in advance and unused units will lapse after twelve
months. Additional units can be bought at any time. The Perl Clinic provides
you with support via email, phone and fax, although email is preferred.
Incident-based Support
An `incident' is defined as a single problem or question on a single
supported topic (listed below). An incident covers the complete resolution
of a problem from initial receipt to closure. No matter how long it takes
only one incident unit will be charged.
Incident-based support is a premium service which we limit to specific
problem areas for which we can provide total in-depth coverage. We do
reserve the right to close incidents that remain intractable after at least
5 hours work. However, we will not charge for any incident which we feel we
have not been able to offer useful assistance and an effective workaround
for your problem.
Time-based Support
The clock starts when one of our technical staff acknowledge receipt of your
email, fax or telephone message. The clock is only running when our
technical staff are actively working on your problem and we won't use more
than one initial 15 minute unit without your agreement. After 15 minutes we
will send you our fixes/suggestions/advice etc. and the clock stops.
If we have not resolved the problem we will include an estimate of the
number of further units required. It is then your choice whether or not we
continue with the resolution of the problem for you or you pursue it
yourself using the information we have provided. If you want us to continue
we will send you progress reports and won't use more units than the estimate
without your agreement.
If you have any incident-based units you can `upgrade' the problem to an
incident if appropriate and reclaim your initial 15 minute time unit.
(Time-based support is the default for customers with both.)
Tailored Support
In addition to our Incident-based Support and Time-based Support services we
can custom-tailor a support package to your needs. Please contact us to
discuss how we can best meet your requirements.
Registered Support Contacts
Each support agreement names one or more Registered Support Contacts in your
organization who act as your interface to The Perl Clinic. Using named
contacts ensure effective management and monitoring of the agreement and
helps ensure a smooth working relationship, both corporate and personal.
Each contact is assumed to have the authority to `spend' support units.
Contacts should ideally be among the most perl-proficient people in your
organization and must have a reliable electronic mail address. Contacts may
delegate to others if they will be unavailable.
----------------------------------------------------------------------------
WHAT WE SUPPORT
Incident-based support is available for any problems or questions relating
to:
* Use of the Perl script language and the standard Perl library modules
(Perl5.003 or later full release versions. Not including installation.)
* Use of the DBI module and the DBD::Oracle/Oraperl modules (Not
including installation.)
Time-based support is available for:
* Any perl related issue on any platform (including installation
problems, any modules, CGI, XS etc).
It's worth saying that again just so it's clear: Time-based support is
available for any perl related issue on any platform.
----------------------------------------------------------------------------
VALUE ADDED SERVICES
If we are aware of additional information or other resources that you may
find useful, we will supply you with applicable reference material (manuals,
FAQs etc.) or point you to where it can be found.
We offer hourly consulting on the Perl language and software design and
development in Perl to help you find problems before they occur. Our Module
Design Check service is a particularly cost effective way to improve your
design process (details on request).
Our core business is bespoke software systems development (specializing in
bulk data acquisition/reporting and data-driven WWW systems for large
corporates). We would be happy to discuss any requirements you may have and
offer you a fixed price quotation.
----------------------------------------------------------------------------
CHARGES, PAYMENT AND DISCOUNTS
There are no hidden charges or complex requirements. We aim to offer clear
and quantifiable value for money.
When taking out or renewing a support contract, you purchase a Starter Pack
and any additional units or support contacts you require. Additional items,
as listed below, can be purchased at any time.
Support Package Services US Dollars UK Pounds
------------------------ ---------- ---------
Starter Pack A 1,361 851
(1 contact + 20 time units (5 hours) + 1 incident unit)
Starter Pack B 6,845 4,278
(2 contacts + 48 time units (12 hours) + 5 incident units)
Starter Pack C 10,911 6,819
(2 contacts + 72 time units (18 hours) + 10 incident units)
Additional Support Contact 2,000 1,250
Additional 10 time units 350 219
Additional 50 time units (saving 5%) 1,667 1,042
Additional 1 incident unit 770 481
Additional 5 incident units (saving 5%) 3,667 2,292
Module Design Check and other software services (per hour) Discounts
and fixed prices quotations available. Details on request.
126 80
Discounts
All starter packs include 1 free Registered Support Contact and include a
further discount over the basic prices (8%, 10% and 12% respectively).
Beyond the discounts included in the Starter Packs and Additional Units
above we also offer an additional 10% discount off the overall cost if all
the Registered Support Contacts are paid-up members of The Perl Institute
(at Annual level or higher).
Payment
Payment should be made in US Dollars for US residents and UK Pounds Sterling
for all other countries. No support can be offered until the support
agreement has been signed and payment has been received.
----------------------------------------------------------------------------
WHAT NOW
If you are interested in using the services of The Perl Clinic or you would
like to know more, please contact us by e-mail at TPC@perl.co.uk or by phone
on +44 1483 424424 (ask for Sue Tolson or Tim Bunce).
----------------------------------------------------------------------------
WHAT NEXT
The Perl Clinic has been established to provide a home for Perl commercial
support services. The services described above are simply a starting point
for the clinic. We plan to expand and offer more packaged services in the
months and years to come. If you need a commercial support agreement for
Perl which goes beyond the terms described above, we are keen to work with
you to create a custom support and service package for you.
We are also keen to talk to anyone who eithers wants a commercial perl
service of any description or is offering a commercial perl service of any
description.
As new services become available existing clients will be able to upgrade to
those services at preferential rates and thus protect their investment.
----------------------------------------------------------------------------
------------------------------
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 399
*************************************