[11304] in Perl-Users-Digest
Perl-Users Digest, Issue: 4904 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 16 09:07:11 1999
Date: Tue, 16 Feb 99 06:00:28 -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 Tue, 16 Feb 1999 Volume: 8 Number: 4904
Today's topics:
Re: /i in regexp kills performance. (Ilya Zakharevich)
Re: /i in regexp kills performance. (Larry Rosler)
Re: Can 2 "submit" buttons in 1 form do different thing <23_skidoo@geocities.com>
Re: Creating individual arrays from an array <tchrist@mox.perl.com>
Re: DBD::Oracle, Apache DBI, mod_perl <matthew.sergeant@eml.ericsson.se>
Freelance cgi programmer required <annao@cancerbacup.org>
Geographic Map of Perl Monger Groups <leon@netcraft.com>
Re: HELP! error: Bad name after Uname:: at shift.pl lin (M.J.T. Guy)
How to converT decimal to hex???????? (James Bond 098)
Re: how to sort by file date with year (Sam Holden)
Re: how to sort by file date with year <bill@fccj.org>
Re: Negative lookahead problem <antti.boman***NOSP@M***helsinki.fi>
NET::FTP with ActiveState <Arnold_Mueller@csi.com>
Re: Passing imput variable from one script to another <rkingsto@jwgrnci6.jaguar.ford.com>
Password protection help needed (Curtiss Hammock)
Re: Password protection help needed <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: Password protection help needed <bill@fccj.org>
perl cgi nntp question <NOSPAM@somewhere.else.com>
Re: Perl s///...can it be done in one line? <rchmllr@ix.netcom.com>
Re: Perl s///...can it be done in one line? (Larry Rosler)
Re: Perl Xbase Module. pvdkamer@inter.NL.net
POP3, SMTP and MIME-Types (Udo Woitek)
Problem with UPLOAD files by perl !?? (James Bond 098)
Re: problem: NYTimes access via LWP / UserAgent <tchrist@mox.perl.com>
redefining a sub <ekkis@arix.com>
Re: Redirectiong STDERR (Peter Palfrader)
Regex Expansion and Metrics dmulholl@cs.indiana.edu
Re: SRC: pmexp - show a module's exports <tchrist@mox.perl.com>
Re: Windoze Dial up networking with PERL chris_kirby@geocities.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 16 Feb 1999 07:50:19 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: /i in regexp kills performance.
Message-Id: <7ab7vr$1dk$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Zack
<zack44@altavista.net>],
who wrote in article <36C9156E.7A1DA5D5@altavista.net>:
> I noticed this in doing some search timing.
>
> Iterating through a file, looking for matches.....20,000 entries:
>
> ### Takes over 19 seconds to complete
> if ($LINE =~ /(test)/i) { print "Match\n"; }
>
> ### Takes only 3 seconds to complete.
> if ($LINE =~ /(test)/) { print "Match\n"; }
>
> WOW. Is this a bug in perl?
Feel free to amend fbm_*() functions to work with case-folding too.
Ilya
------------------------------
Date: Mon, 15 Feb 1999 23:55:35 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: /i in regexp kills performance.
Message-Id: <MPG.1132c4469b6214d9989a44@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <36C9156E.7A1DA5D5@altavista.net> on Tue, 16 Feb 1999
01:51:26 -0500, Zack <zack44@altavista.net> says...
> I noticed this in doing some search timing.
>
> Iterating through a file, looking for matches.....20,000 entries:
>
> ### Takes over 19 seconds to complete
> if ($LINE =~ /(test)/i) { print "Match\n"; }
>
> ### Takes only 3 seconds to complete.
> if ($LINE =~ /(test)/) { print "Match\n"; }
>
> WOW. Is this a bug in perl?
It is an implementation detail (extra copying) which is documented,
though from home I can't put my finger on it in the books. I didn't
find it mentioned in the online docs or FAQ.
The simplest workaround is to use lc($LINE) in your code above, use
lower-case letters in your regex, and drop the /i modifier.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 16 Feb 1999 13:20:28 +0000
From: 23_skidoo <23_skidoo@geocities.com>
Subject: Re: Can 2 "submit" buttons in 1 form do different things?
Message-Id: <36C9709B.799B@geocities.com>
> On Sun, 14 Feb 1999 20:27:52 -0800, Pamela Schultz <vikette@earthlink.net>
> wrote:
> >I have a polling script being executed as a result of a form submit. See
> >http://www.lineoffire.com/vote.html. Right now my "vote" button is in 1 form
> >and my "view results" button is in another form -- therefore they are on
> >separate lines in my html page since I can't put 2 forms on the same line.
> >My perl script looks for values in hidden fields in order to determine what
> >to do. Like this:
> >
> >if ($fields{'action'} eq "VIEW")
> > {
> > &do_stuff;
> > exit;
> > }
> >
> > if ($fields{'action'} eq "VOTE")
> > {
> > &do_other_stuff;
> > exit;
original post has dropped off my news server, apologies for replying to
a reply,
i recently got stung by using hidden fields, i had used the following
format:
<input type="hidden" name="log_in">
and in my script used:
if ($input{'log_in'}) {
#etc etc
}
this all worked fine until someone tried to use it with MS internet
explorer which differs from netscape in that it doesn't send hidden
variables that don't have both a name and a value, netscape will happily
send the above name only which triggers the condition, for IE i had to
make it
<input type="hidden" name="log_in" value="anything">
chalk it up to inexperience i guess. i know better now.
p.s. i know this should all be in comp.infosystems.www.authoring.cgi but
the self approval bit doesn't seem to like me, can anyone who posts to
that group tell me how to get self approved? i tried sending passme
messages but nothing shows.
-23
------------------------------
Date: 16 Feb 1999 06:03:32 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Creating individual arrays from an array
Message-Id: <36c96ca4@csnews>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
lchuck@home.com writes:
:Sorry about the title of the message. What I'm looking to do is to take an
:array of values (numbers, words, etc) and create an array for each of the
:values in the initial array. Example:
:
:@furniture=("chair", "table", "couch");
:
:I would like to write a snippet of code that could take each item in the
:@furniture array and create seperate arrays, called @chair, @table, and
:@couch.
No, you don't.
=head2 How can I use a variable as a variable name?
Beginners often think they want to have a variable contain the name
of a variable.
$fred = 23;
$varname = "fred";
++$$varname; # $fred now 24
This works I<sometimes>, but it is a very bad idea for two reasons.
The first reason is that they I<only work on global variables>.
That means above that if $fred is a lexical variable created with my(),
that the code won't work at all: you'll accidentally access the global
and skip right over the private lexical altogether. Global variables
are bad because they can easily collide accidentally and in general make
for non-scalable and confusing code.
Symbolic references are forbidden under the C<use strict> pragma.
They are not true references and consequently are not reference counted
or garbage collected.
The other reason why using a variable to hold the name of another
variable a bad idea is that the question often stems from a lack of
understanding of Perl data structures, particularly hashes. By using
symbolic references, you are just using the package's symbol-table hash
(like C<%main::>) instead of a user-defined hash. The solution is to
use your own hash or a real reference instead.
$fred = 23;
$varname = "fred";
$USER_VARS{$varname}++; # not $$varname++
There we're using the %USER_VARS hash instead of symbolic references.
Sometimes this comes up in reading strings from the user with variable
references and wanting to expand them to the values of your perl
program's variables. This is also a bad idea because it conflates the
program-addressable namespace and the user-addressable one. Instead of
reading a string and expanding it to the actual contents of your program's
own variables:
$str = 'this has a $fred and $barney in it';
$str =~ s/(\$\w+)/$1/eeg; # need double eval
Instead, it would be better to keep a hash around like %USER_VARS and have
variable references actually refer to entries in that hash:
$str =~ s/\$(\w+)/$USER_VARS{$1}/g; # no /e here at all
That's faster, cleaner, and safer than the previous approach. Of course,
you don't need to use a dollar sign. You could use your own scheme to
make it less confusing, like bracketed percent symbols, etc.
$str = 'this has a %fred% and %barney% in it';
$str =~ s/%(\w+)%/$USER_VARS{$1}/g; # no /e here at all
Another reason that folks sometimes think they want a variable to contain
the name of a variable is because they don't know how to build proper
data structures using hashes. For example, let's say they wanted two
hashes in their program: %fred and %barney, and to use another scalar
variable to refer to those by name.
$name = "fred";
$$name{WIFE} = "wilma"; # set %fred
$name = "barney";
$$name{WIFE} = "betty"; # set %barney
This is still a symbolic reference, and is still saddled with the
problems enumerated above. It would be far better to write:
$folks{"fred"}{WIFE} = "wilma";
$folks{"barney"}{WIFE} = "betty";
And just use a multilevel hash to start with.
The only times that you absolutely I<must> use symbolic references are
when you really must refer to the symbol table. This may be because it's
something that can't take a real reference to, such as a format name.
Doing so may also be important for method calls, since these always go
through the symbol table for resolution.
In those cases, you would turn off C<strict 'refs'> temporarily so you
can play around with the symbol table. For example:
@colors = qw(red blue green yellow orange purple violet);
for my $name (@colors) {
no strict 'refs'; # renege for the block
*$name = sub { "<FONT COLOR='$name'>@_</FONT>" };
}
All those functions (red(), blue(), green(), etc.) appear to be separate,
but the real code in the closure actually was compiled only once.
So, sometimes you might want to use symbolic references to directly
manipulate the symbol table. This doesn't matter for formats, handles, and
subroutines, because they are always global -- you can't use my() on them.
But for scalars, arrays, and hashes -- and usually for subroutines --
you probably want to use hard references only.
--
"If it makes goo on the windshield, we'll call it a bug." --Larry Wall
------------------------------
Date: Tue, 16 Feb 1999 12:54:31 +0000
From: Matt Sergeant <matthew.sergeant@eml.ericsson.se>
Subject: Re: DBD::Oracle, Apache DBI, mod_perl
Message-Id: <36C96A87.13B82BD5@eml.ericsson.se>
Al Funk wrote:
>
> I'm receiving the following error message upon the first attempted
> database activity of a Web based application (error_log):
>
> [Tue Feb 16 05:52:25 1999] [error] Can't load
> '/usr/lib/perl5/site_perl/5.005/i686-linux/auto/DBD/Oracle/Oracle.so'
> for module DBD::Oracle: libclntsh.so.1.0: cannot open shared object
> file: No such file or directory at
> /usr/lib/perl5/5.00502/i686-linux/DynaLoader.pm line 169.
>
> The file Oracle.so exists.
It's libclntsh.so that it can't find. Do the following:
$ locate libclntsh.so.1.0
and add the path where it finds libclntsh.so.1 to /etc/ld.so.conf, then
re-run /sbin/ldconfig and all your woes will dissappear (unless there
are _more_ libs it can't find.....).
--
<Matt email="msergeant@ndirect.co.uk" />
| Fastnet Software Ltd | Perl in Active Server Pages |
| Perl Consultancy, Web Development | Database Design | XML |
| http://come.to/fastnet | Information Consolidation |
------------------------------
Date: Tue, 16 Feb 1999 12:53:43 +0000
From: Anna Ollier <annao@cancerbacup.org>
Subject: Freelance cgi programmer required
Message-Id: <36C96A57.9EA698E0@cancerbacup.org>
If you are:
an experienced CGI programmer with
a sound knowledge of databases
a sound knowledge of UNIX and/or NT
we are interested in hearing from you to update transactional facilities
on the CancerBACUP Web site (site search, online ordering, databases and
documentation).
Full brief available on request. London based.
Anna Ollier, Web Manager
CancerBACUP www.cancerbacup.org.uk
------------------------------
Date: Tue, 16 Feb 1999 11:09:37 +0000
From: Leon Brocard <leon@netcraft.com>
Subject: Geographic Map of Perl Monger Groups
Message-Id: <36C951F1.B4C373C2@netcraft.com>
Yes, yes, I was bored ;-)
A little hard work and a little Perl::Magick to glue
it all together has produced:
<URL:http://hfb.pm.org/~bath/map/>
Anyway, check it out and tell me what you think...
I'll play around with the mapping a bit because locations
aren't 100% right, but it's *almost* there...
Leon
--
real programmers don't have .signatures
------------------------------
Date: 16 Feb 1999 13:05:21 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: HELP! error: Bad name after Uname:: at shift.pl line 665
Message-Id: <7abqeh$s2k$1@pegasus.csx.cam.ac.uk>
In article <36c89f52.2242996@news.bigpond.com>, <silent1@bigpond.com> wrote:
>Everytime I try to run my program I get the error:
>Bad name after Uname:: at shift.pl line 665
>
>this is line 665:
> if ($csray{$Form{'Uname'}}[1] ne $Form{'Pword'}) {
>}
Heh, heh! You've just been bitten by Perl4 compatibility.
In Perl4, ' was the package separator instead of :: , and Perl5 still
honours this.
Your actual bug is that a closing ' is missing on some previous line.
The corresponding opening ' will be the last ' previous to line 665.
Mike Guy
------------------------------
Date: Tue, 16 Feb 1999 13:00:57 GMT
From: burningboy@hotmail.com (James Bond 098)
Subject: How to converT decimal to hex????????
Message-Id: <36738004.57331741@news.au.ac.th>
How to converT decimal to hex????????
plz teach me....................................
------------------------------
Date: 16 Feb 1999 07:06:01 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: how to sort by file date with year
Message-Id: <slrn7ci66p.2au.sholden@pgrad.cs.usyd.edu.au>
On Tue, 16 Feb 1999 06:48:16 GMT, Steve . <syarbrou@nospam.enteract.com> wrote:
>I have a list of files with the year in it. I want to sort from
>newest to oldest. Thought of a system call with a reverse listing,
>but didn't work, because it doesn't account for the year the way I
>want. Basically it looks like this:
>
>PC122198
>PC010799
>
>Linux/UNIX thinks that 122198 is newer because technically it's a
>larger number. How would you do a sort so that it sets the second
>file as the newer one in the list? Thanks. By the way, this sort
>would be done on a large group of files.
The obvious way is to change the names of the files to the much more
logical format of <PREFIX>YYYYMMDD.
That way a standard sort will put them in the right order, it doesn't
break in a bit over 10 months, and stays human-readable (I guess adding some
delimiters would make it more readable YYYY-MM-DD).
This doesn't have lot to do with perl though, since working out the
comparison function for the sort is not very language-specific.
--
Sam
There's no such thing as a simple cache bug.
--Rob Pike
------------------------------
Date: Tue, 16 Feb 1999 06:25:03 -0500
From: "Bill Jones" <bill@fccj.org>
Subject: Re: how to sort by file date with year
Message-Id: <36c954f6.0@usenet.fccj.cc.fl.us>
In article <36c91404.39026059@news.enteract.com>,
syarbrou@nospam.enteract.com (Steve .) wrote:
> I have a list of files with the year in it. I want to sort from
> newest to oldest. Thought of a system call with a reverse listing,
> but didn't work, because it doesn't account for the year the way I
> want. Basically it looks like this:
>
> PC122198
> PC010799
>
> Linux/UNIX thinks that 122198 is newer because technically it's a
> larger number. How would you do a sort so that it sets the second
> file as the newer one in the list? Thanks. By the way, this sort
> would be done on a large group of files.
>
> Steve
Use a Date module from CPAN.
HTH,
-Sneex- :]
______________________________________________________________________
Bill Jones | FCCJ Webmaster | http://www.fccj.org/cgi/mail?webmaster
Join the Jacksonville Perl Mongers Chapter - http://hfb.pm.org/~jax
http://certserver.pgp.com:11371/pks/lookup?op=get&search=0x37EFC00F
http://rs.internic.net/cgi-bin/whois?BJ1936
"Be not the first by whom the new are tried,
nor yet the last to lay the old aside..."
------------------------------
Date: Tue, 16 Feb 1999 08:14:27 GMT
From: "Antti Boman" <antti.boman***NOSP@M***helsinki.fi>
Subject: Re: Negative lookahead problem
Message-Id: <DN9y2.21$bg3.298@read1.inet.fi>
>The reason it doesn't work is that you're using a negative look*ahead*
>when what you need is a negative look*behind*. Your lookahead
>says "don't match the 'http://...' if what we're currently looking at is
>a space followed by 'href...'" and has no effect because the stuff past the
>lookahead can't possibly match the stuff inside the lookahead.
I knew this was the point. What I didn't know was:
>As of Perl 5.005, you can use negative lookbehinds, which do what you
>want (they impose constraints based on "what we were just looking at"
>rather than "what we're now looking at").
The documentation of my perl 5.003 mentioned about lookebehind, but I didn't
know it was to be iplemented.
Thanks,
Antti
------------------------------
Date: Tue, 16 Feb 1999 12:06:49 +0100
From: "Arnold M|ller" <Arnold_Mueller@csi.com>
Subject: NET::FTP with ActiveState
Message-Id: <#JO1$vZW#GA.269@nih2naac.prod2.compuserve.com>
Hello,
I have some problems accessing the NET::FTP module in ActiveState-PERL for
NT. Is it not included in the distribution? Or else, can I take any FTP.pm
or does it depend on the version of PERL and the Winsock?
Thanks in advance
Arnold
------------------------------
Date: Tue, 16 Feb 1999 09:19:34 +0000
From: Richard Kingston <rkingsto@jwgrnci6.jaguar.ford.com>
Subject: Re: Passing imput variable from one script to another
Message-Id: <36C93826.2B4B269A@jwgrnci6.jaguar.ford.com>
Ariel wrote:
> 1. A variable is read from an html form in the following way:
>
> <FORM METHOD="POST" ACTION="../cgi-bin/search.pl">
>
> <INPUT name="folder" type="text" value="" size="20">
>
> 2. The variable value is then read by search.pl in the following way:
> $folder=$MYDATA{"FOLDER"}; - all functions properly - search.pl displays an
> output html with various links for the user to click on (all is ok):
>
> 3. The problem is that in the output html generated by search.pl, the links
> are to another script such as --- ../cgi-bin/disp.pl?NUMBER=1053636" --- and
> at that point I would like to pass the same variable value (for "folder")
> that was read by the first script.
Not really a Perl question, but try the following.
When writing the HTML file from search.pl, you can write in a HIDDEN input
whose value can then be passed on to disp.pl with any other values you want to
pass.
------------------------------
Date: Tue, 16 Feb 1999 04:49:54 -0500
From: curtiss@desertisle.com (Curtiss Hammock)
Subject: Password protection help needed
Message-Id: <curtiss-1602990449540001@user-38lcb8i.dialup.mindspring.com>
I've searched on both DejaNews and Hotbot and found nothing applicable, so
I will ask here in hope that someone can point me in the right direction.
I need to have a webpage where you enter a name and password in an HTML
form. When it's submitted to the server, the user is sent to the index in
a specified directory. For instance, if the user name is "Hyperdyne," and
he/she has the correct password, "hyperdyne/index.html" is loaded into
their browser.
Our server is Mindspring, and it's easy to set up password protection with
their control panel. I'm assuming that it uses the htaccess file (though I
can't swear to it), so my Perl script would presumably interact with that.
I've been trying just to get the page to redirect, and I've had no luck so
far, so even that would be helpful. I can use SSIs on the site, but don't
want to add a bit of HTML to a page, but rather load a fresh page in a
subdirectory.
Any advice, sample scripts or pointers would be greatly appreciated.
Curtiss
Curtiss R. Hammock II Atlanta, GA, USA
Online Portfolio http://www.desertisle.com/curtiss/
The Cavedogs http://www.desertisle.com/cavedogs/
Funk Pop A Roll http://www.desertisle.com/funkpoparoll/
------------------------------
Date: 16 Feb 1999 12:20:00 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Password protection help needed
Message-Id: <83zp6evbmn.fsf@vcpc.univie.ac.at>
Re: Password protection help needed, Curtiss
<curtiss@desertisle.com> said:
Curtiss> I need to have a webpage where you enter a
Curtiss> name and password in an HTML form. When
Curtiss> ...
Curtiss> Our server is Mindspring, and it's easy to
Curtiss> set up password protection with their
Curtiss> control panel. I'm assuming that it uses
Curtiss> the htaccess file (though I can't swear to
Curtiss> it), so my Perl script would presumably
Curtiss> interact with that.
Well, if you want to do authentication via
roll-your-own then you need to set up handlers for
the authentication (e.g. perl script via CGI).
If you want to take advantage of the server's
built-in protection mechanism then this is a matter
between the client and the server and not an HTML
matter.
For the built-in stuff, you could make the index
file in the protected realm also a "CGI script" and
just have it do a redirect($new_url);
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: Tue, 16 Feb 1999 06:40:51 -0500
From: "Bill Jones" <bill@fccj.org>
Subject: Re: Password protection help needed
Message-Id: <36c958af.0@usenet.fccj.cc.fl.us>
In article <curtiss-1602990449540001@user-38lcb8i.dialup.mindspring.com>,
curtiss@desertisle.com (Curtiss Hammock) wrote:
>
> Our server is Mindspring, and it's easy to set up password protection with
> their control panel. I'm assuming that it uses the htaccess file (though I
> can't swear to it), so my Perl script would presumably interact with that.
You need to find out for sure what they are doing on the
server end of things.
The answer is highly dependent upon whether:
1) They are using Apache, AND you have CGI access or just SSI;
2) They use something else and they are writing an .htaccess file;
3) They are doing something else...
Also, I would have to say that the probable answer
is on DejaNews, but you have overlooked it because
it didn't jump out as the obvious answer to you - Why?
I would say that because you are not sure what they
are doing on the Server end with regard to security.
HTH,
-Sneex- :]
______________________________________________________________________
Bill Jones | FCCJ Webmaster | http://www.fccj.org/cgi/mail?webmaster
Join the Jacksonville Perl Mongers Chapter - http://hfb.pm.org/~jax
http://certserver.pgp.com:11371/pks/lookup?op=get&search=0x37EFC00F
http://rs.internic.net/cgi-bin/whois?BJ1936
"Be not the first by whom the new are tried,
nor yet the last to lay the old aside..."
------------------------------
Date: Tue, 16 Feb 1999 13:54:58 +0000
From: J W <NOSPAM@somewhere.else.com>
Subject: perl cgi nntp question
Message-Id: <36C978B2.693E@somewhere.else.com>
Hi,
I want to use a perl script to process a form and send an email and a
message to a newsgroup. I can do all apart from the newsgroup bit.
Normally one would use sendmail to send an email, but since there is no
equivalent 'sendnews', what is the best approach. I am using Perl 5.003
under Unix. I don't have root privileges either.
Ta
--
Jason Webb
csx1jw@ee.surrey.ac.uk
------------------------------
Date: Tue, 16 Feb 1999 00:04:46 -0600
From: Rich Miller <rchmllr@ix.netcom.com>
Subject: Re: Perl s///...can it be done in one line?
Message-Id: <36C90A7E.5C888426@ix.netcom.com>
Dustin Christopher Preuitt wrote:
>
> Okay, I'm trying to figure out if I can make the following changes with one line of code
>
> if the line reads like this:
>
> billy bob likes to shout, "Hey Gordo McMourdo" to his brother paul.
>
> I want to add a '!' after every capital letter in the quotes. So the modified
> line would be:
>
> billy bob likes to shout, "H!ey G!ordo M!cM!ourdo" to his brother paul.
>
> So...I'm stuck. I can't figure out how to do more than one Capital within
> the quotes...
>
> $line =~ s/"([^A-Z]*)([A-Z])(what else do I need?)"/"$1.$2.???."/g
>
> Is it possible?
1 while $line =~ s/(".*[A-Z])([^!].*")/\1!\2/;
HTH,
Rich Miller
------------------------------
Date: Tue, 16 Feb 1999 05:51:23 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl s///...can it be done in one line?
Message-Id: <MPG.113317b7d457f608989a45@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <36C90A7E.5C888426@ix.netcom.com> on Tue, 16 Feb 1999
00:04:46 -0600, Rich Miller <rchmllr@ix.netcom.com> says...
...
> 1 while $line =~ s/(".*[A-Z])([^!].*")/\1!\2/;
Very nice. But surely the '-w' flag told you that back-references in
the substitution should be written as $1 and $2, not \1 and \2. You
*did* use the '-w' flag when you tested this before posting it, didn't
you? If not, why not?
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 16 Feb 1999 13:05:36 GMT
From: pvdkamer@inter.NL.net
Subject: Re: Perl Xbase Module.
Message-Id: <36c96c67.1838441@news.wxs.nl>
Honza Pazdziora is right and i qoute from the DBD:XBase CPAN archive :
==============
The support for ndx/ntx index files is rather minimal. It currently
allows you to search directly to the record you want, in the XBase
module. But you cannot create the index, nor is the index updated when
you change the dbf. Check the eg/ directory for how you can help to
make it better.
================
Does anyone have experience with DBD:Xbase ? Does it work OK ?
Is it fast ?
Thanks for replying
On Mon, 15 Feb 1999 18:52:49 GMT, adelton@fi.muni.cz (Honza Pazdziora)
wrote:
>On 15 Feb 1999 11:25:23 -0500, Clay Irving <clay@panix.com> wrote:
>> In <36c83c01.18453387@news.wxs.nl> pvdkamer@inter.NL.net writes:
>>
>> >Does anyone know a good Perl-Xbase lib. One that can create and
>> >maintain dbf's and indexes ?
>>
>> Like DBD:XBase?
>
>Well, DBD::XBase doesn't maintain indexes. Having said that, I do not
>know about any other Perl solution that would maintain the indexes for
>you.
>
>--
>------------------------------------------------------------------------
> Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
> make vmlinux.exe -- SGI Visual Workstation Howto
>------------------------------------------------------------------------
------------------------------
Date: Tue, 16 Feb 1999 02:59:20 -0800
From: Udo.Woitek@bigfoot.com (Udo Woitek)
Subject: POP3, SMTP and MIME-Types
Message-Id: <Mdcy2.10265$bq.61911975@WReNphoon2>
Please help,
I want to use Net::POP3 and Net::SMTP to manage a newsletter. The mails I
send to the
newsletter-address as the administrator can contain attachents in MIME-
format.
I get these mails with the POP3 get-Method, split them into header and body
lines and send these lines
via Net::SMTP to the recipients of the newsletter. To do this, I copy all
header lines starting with
"MIME-Version:", "Subject:", "Content-Type:" and "Content-Transfer-
Encoding:" from the original
message to the new generated mail. The body lines are copied without any
filtering.
When a recipient of the newsletter gets this mail it have the rigth size but
nothing but the header lines
can be seen when he is reading the mail.
What am I doing wrong? Is there an other easy way to manage a newsletter
with attachments? Do you
know of a newsletter script I can use in an application for a professional
website?
Thank you in advance,
Udo Woitek.
*** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ***
------------------------------
Date: Tue, 16 Feb 1999 13:00:57 GMT
From: burningboy@hotmail.com (James Bond 098)
Subject: Problem with UPLOAD files by perl !??
Message-Id: <34e836fb.5313680@news.inet.co.th>
Ah....
I've written a perl script for uploading files.
IT's
require "cgi-lib.pl";
$data=$in{'data'};
open(file,">anyname.jpg");
print file $data;
close(file);
But...... Do you know how to change "anyname.jpg" to the real name
of file(from the client), such as , sending a file named "test.txt"
the my script save it to "test.txt", not "anyname.jpg" !!?
------------------------------
Date: 16 Feb 1999 06:01:40 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: problem: NYTimes access via LWP / UserAgent
Message-Id: <36c96c34@csnews>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
newsmf@bigfoot.com writes:
:I wrote a little perl program that fetches a NYT page for me (the pages work
:with passwords; accessing them with a browser, they display a "first time
:user" page if no password is supplied of if there's no cookie, I guess).
:
:My problem: sometimes it gets the real page, sometimes it gets the page for
:first time users. I'm really confused because the behavior seems quite random.
I have noticed problems with them lately myself. I think they're
doing something wrong/tricky, but don't know what it is.
--tom
--
Fancy algorithms are slow when n is small, and n is usually small. --Rob Pike
------------------------------
Date: Tue, 16 Feb 1999 03:47:49 -0800
From: "Ekkis" <ekkis@arix.com>
Subject: redefining a sub
Message-Id: <AUcy2.4288$bP2.34697@typhoon-sf.pbi.net>
My little script below generates "new" as I expect it should:
#!/bin/ksh
$\ = "\n";
sub tst1 { print 'old'; }
sub tst { tst1(); }
sub tst1 { print 'new'; }
tst();
...however, if I break it up into 2 files as such:
--> FILE: t.inc
#!/bin/ksh
sub tst1 { print 'old'; }
sub tst { tst1(); }
--> FILE t.pl
#!/bin/ksh
$\ = "\n";
require 't.inc';
sub tst1 { print 'new'; }
tst();
...I get "old". Can someone explain to me why? how can I override a
function defined inside of t.inc?
- thx
------------------------------
Date: Tue, 16 Feb 1999 12:19:11 GMT
From: palfrader@usa.net (Peter Palfrader)
Subject: Re: Redirectiong STDERR
Message-Id: <36c96189.2528162@news.uibk.ac.at>
On Tue, 16 Feb 1999 02:43:08 GMT, "Jalil Feghhi" <jalilf@home.com>
wrote:
>I would like to redirect STDERR to a file. How should I do that?
under the linux bash it works this way:
cmd < STDIN > STDOUT 2>STERR
so you would call
your-sript 2> error.txt
--
Weasel mailto:palfrader@writeme.com
Peter http://www.holidayinfo.com/weasel
Member of the Coder's Guild - http://www.netalive.org/codersguild
Admin at the Coder's Knowledge Base - http://www.netalive.org/ckb
-----------------------------------------------------------------
It is a simple task to make things complex,
but a complex task to make them simple.
------------------------------
Date: Tue, 16 Feb 1999 10:12:38 GMT
From: dmulholl@cs.indiana.edu
Subject: Regex Expansion and Metrics
Message-Id: <7abgai$b6v$1@nnrp1.dejanews.com>
Greetings All,
I am working on a spell checker type application (for a semetic language
sub-family) and taking a regex approach to it thus far. Perl has been a
great tool for debugging the regex expressions that define a properly derived
word.
I would like to use the same regex to construct derived forms of words.
Does the Perl regex library offer such a service? In short I would like to
pass a regex to a routine and have returned to me a list of the possible
formations. And/or a routine that could return a pointer to the _next_
expansion of a regex. Similarly, is there a routine that can return an
integer value for the number of possible expansions of an arbitrary regex?
I haven't yet looked beyond Perl for what other regex tools have to offer
so I would be grateful for pointers to any utilities in this area.
thank you,
Daniel
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 16 Feb 1999 05:53:29 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: SRC: pmexp - show a module's exports
Message-Id: <36c96a49@csnews>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, Jonathan Feinberg <jdf@pobox.com> writes:
:Tom Christiansen <tchrist@mox.perl.com> writes:
:> #!/usr/bin/env perl
:[snip]
:> BEGIN { $^W = 1 }
:
:Why not
: #!/usr/bin/env perl -w
:which is documented to work (at least in my neck of the unix-like
:woods)?
Because it fails on
BSD
Linux
SunOS
--tom
--
"If you think Emacs is such a great editor, just look what it did for
Richard Stallman's typing skills!"
------------------------------
Date: Tue, 16 Feb 1999 07:21:31 GMT
From: chris_kirby@geocities.com
Subject: Re: Windoze Dial up networking with PERL
Message-Id: <36c88f3d.11405489@news.freeserve.net>
ursa@ici.net wrote:
>
>Hi Gary,
>
>No solution here but I seek the same little code snipplet!
>
>I would really like to work the dial-up process and start, monitor AND
>disconnect from my perl program. Maybee a post to a Visual Basic newsgroup would
>help?
>
>- Ursa
>
Hi All,
I'm seeking the same answer - I've just posted to uk.comp.os.Win95 and
uk.comp.misc - then I saw this!
Will pass it on if I get an answer.
I'd be happy just to let it timeout on lack of activity after, say two
minutes, - but I think thats more of an ISP job. I wonder if sending
+++ATH to the modem would do ? But how to write to the modem when
winsock has got it ?
Regards
Chris
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 4904
**************************************