[19571] in Perl-Users-Digest
Perl-Users Digest, Issue: 1766 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 18 09:05:31 2001
Date: Tue, 18 Sep 2001 06:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1000818307-v10-i1766@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 18 Sep 2001 Volume: 10 Number: 1766
Today's topics:
Re: example for rewinddir (Anno Siegel)
Re: How can I automate payments to my Merchant Account (John Hoarty)
HTML-parsing prob - need regexpression help <borgehaga@hotmail.com>
Re: HTML-parsing prob - need regexpression help <Thomas@Baetzler.de>
Re: HTML-parsing prob - need regexpression help <borgehaga@hotmail.com>
Re: Limiting floating point decimal places. <pne-news-20010918@newton.digitalspace.net>
Re: Looking for Perl programers in Toronto <wyzelli@yahoo.com>
Re: Need help with this regex problem: (Anno Siegel)
Re: Objects and Sockets (Del)
Re: Objects and Sockets <Thomas@Baetzler.de>
Re: perl module <bart.lateur@skynet.be>
Re: perl module <bart.lateur@skynet.be>
Re: Persistence in Perl <info@fruiture.de>
Re: Persistence in Perl (EED)
Re: Regular Expresion help needed (Fredrik)
Storing info from a socket connection <oneconcept@yahoo.co.uk>
textarea and /n/n recognising <gwmbox@mbox.com.auNOSPAM>
Re: textarea and /n/n recognising <info@fruiture.de>
Re: textarea and /n/n recognising <gwmbox@mbox.com.auNOSPAM>
Re: textarea and /n/n recognising <info@fruiture.de>
Re: upgrading berkeley DB 1.85 to 3.3? <m.grimshaw@salford.ac.uk>
Re: upgrading berkeley DB 1.85 to 3.3? (Anno Siegel)
Re: What does this do ? "select( (select($writer), $|=1 (Stan Brown)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 18 Sep 2001 09:49:23 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: example for rewinddir
Message-Id: <9o75b3$cjj$1@mamenchi.zrz.TU-Berlin.DE>
According to Joachim Ziegler <ziegler@algorilla.de>:
> can someone give me a good example
> for a situation, in which "rewinddir" is useful?
>
> i don't see any!
You can't think of a situation where it would be useful to read
a directory twice?
Anno
------------------------------
Date: 18 Sep 2001 05:43:15 -0700
From: jhoarty@quickestore.com (John Hoarty)
Subject: Re: How can I automate payments to my Merchant Account with my SSL website ?
Message-Id: <793d6483.0109180443.1bad8c17@posting.google.com>
Your merchant account requires certain information to be posted to
their secure server, such as your account ID or login, the amount of
the intended purchase, the customer's address, credit card number and
expiry, etc. These values are typically passed to the online payment
processor (CyberCash, AuthorizeNet, VeriSIgn, to name a few) via an
HTML form. The processor then processes or denies the transaction and
returns an authorization code (usually a "success" or "fail" message)
and your shopping cart acts on that signal, either by finishing the
order (writes the order to a file, sends you an e-mail, etc.) or by
informing the shopper that the transaction failed.
Hope this is what you were after. Let me know if you want more detail.
John Hoarty
http://www.quickestore.com
yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones) wrote in message news:<3ba2355b@news.victoria.tc.ca>...
> Robert Kattke (invinfo@enteract.com) wrote:
> : Re: How can I automate payments to my Merchant Account with my SSL
> : website ?
> : Re: My website has SSL (Merchant Account too)- How can I integrate
> : them ?
>
> I don't know, but I think there is a perl module to interface to "cashcow"
> that might be a starting place to look.
------------------------------
Date: Tue, 18 Sep 2001 11:59:16 +0200
From: "Boerge Haga" <borgehaga@hotmail.com>
Subject: HTML-parsing prob - need regexpression help
Message-Id: <rYEp7.19293$1T5.225543@news1.oke.nextra.no>
I'm using a Perl-script to parse a web-page for links with
subjects. The relevant parts of the webpage looks like this:
<a href="some url1">SOME TITLE1</a>
<a href="some url2"><b>SOME TITLE2</b></a>
Fetching the URL in this case is no problem. The problem
is fetching the TITLE whether it's in bold or not (with <b>
or not), but the result SHOULD NOT include the <b> &
</b> tags.
The regexp pattern I use now is something like:
<a href=\"(some url2)\"><?b?>?(SOME TITLE2)</
This is not a good solution as you can see (what if e.g.
SOME TITLE2 starts with a "B"?), and I need a
way to group the <b>-string and put a "?" after the whole
string.
So the problem in general is to be able to group a set of characters
and put a "?" after it so that the string might be there or not but
should not be included in the TITLE-part. I guess it should be possible
to use {}'s or []'s or something but I can't seem to get it to
work.
The script I'm using uses LWP and HTML-Parser. If needed
I can post parts of the script.
Boerge
------------------------------
Date: Tue, 18 Sep 2001 13:29:37 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: HTML-parsing prob - need regexpression help
Message-Id: <16beqt437gi9afenqjeeo47uuc1c5lc70n@4ax.com>
On Tue, 18 Sep 2001, "Boerge Haga" <borgehaga@hotmail.com> wrote:
>The regexp pattern I use now is something like:
>
><a href=\"(some url2)\"><?b?>?(SOME TITLE2)</
>
>This is not a good solution as you can see (what if e.g.
>SOME TITLE2 starts with a "B"?), and I need a
>way to group the <b>-string and put a "?" after the whole
>string.
You want clustering braces - see perldoc perlre, "Extended Patterns".
OTTH, I'd say <a.*?href=\"(.*?)\".*?>(?:<b>)?(.*?)(?:</b>)?</a> might
work for your special case.
HTH,
--
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl
------------------------------
Date: Tue, 18 Sep 2001 14:34:21 +0200
From: "Boerge Haga" <borgehaga@hotmail.com>
Subject: Re: HTML-parsing prob - need regexpression help
Message-Id: <VdHp7.19390$1T5.226250@news1.oke.nextra.no>
"Thomas Bätzler" <Thomas@Baetzler.de> wrote in message
news:<16beqt437gi9afenqjeeo47uuc1c5lc70n@4ax.com>...
> On Tue, 18 Sep 2001, "Boerge Haga" <borgehaga@hotmail.com> wrote:
>
> >The regexp pattern I use now is something like:
> >
> ><a href=\"(some url2)\"><?b?>?(SOME TITLE2)</
> >
> You want clustering braces - see perldoc perlre, "Extended Patterns".
>
> OTTH, I'd say <a.*?href=\"(.*?)\".*?>(?:<b>)?(.*?)(?:</b>)?</a> might
> work for your special case.
That worked beautifully, thank you. Now I just need
one more minor justification to get everything to work.
My regexp will now also match occurences of:
<a href=\"(some url2)\"><img src= etc etc></a>
...where img-tag replaces TITLE and BOLD-TAG.
How can I avoid that match and still match everything from
above in this discussion?
I've tried things like:
<a href=\"(some url2)\">(?:<b>)?(?:!<img)?(SOME TITLE)</
<a href=\"(some url2)\">(?:<b>|!<img)?(SOME TITLE)</
(the latter also with \<img excaping and ^<img)
Boerge
------------------------------
Date: Tue, 18 Sep 2001 10:09:57 +0200
From: Philip Newton <pne-news-20010918@newton.digitalspace.net>
Subject: Re: Limiting floating point decimal places.
Message-Id: <1hodqts71rcsaq0k06hurp83sf7uqjse6d@4ax.com>
On Tue, 18 Sep 2001 12:43:45 +0930, "Matthew Frick"
<mfrick@chariot.net.au> wrote:
> $count = 8.333333333333333333
>
> but when I print I only want 8.33 to be displayed. ie I wish to limit the
> decimal accuracy.
`perldoc -q decimal`, and have a look at the last paragraph. Possibly
also `perldoc -f sprintf` and/or a good C library manual's description
of (s)printf.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Tue, 18 Sep 2001 16:52:30 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Looking for Perl programers in Toronto
Message-Id: <8wCp7.63$Bg2.783@wa.nnrp.telstra.net>
"Malcolm Dew-Jones" <yf110@vtn1.victoria.tc.ca> wrote in message
news:3ba6f12d@news.victoria.tc.ca...
> Steffen Müller (tsee@gmx.net) wrote:
> : "hallaj.com" <wael@hallaj.com> schrieb im Newsbeitrag
> : news:orcp7.60560$j65.10376207@news4.rdc1.on.home.com...
> : > Hi
> : >
> : > I'm looking for perl programers in Toronto. Contact me if you know
one.
>
> : jobs.perl.org
>
> Maybe he wants to go out for a beer with some people who like to talk
> about perl...
Casting Perls before a wine?
<ouch>
Sorry.
Wyzelli
--
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass it
around');
$d='$_$a$s$b$w';$e='$_$a$s$b';sub d{$h=shift;$h=~s/\$(\w+)/${$1}/g;return$h}
sub
e{return(shift!=1)?'s':''}for(reverse(1..100)){$s=e($_);$f=d($d);$g=d($e);
$c.="$f\n$g\n$t\n";$_--;$s=e($_);$e=d($d);$c.="$e\n\n";}print"$c*hic*";
------------------------------
Date: 18 Sep 2001 10:25:15 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Need help with this regex problem:
Message-Id: <9o77eb$cjj$2@mamenchi.zrz.TU-Berlin.DE>
According to Cal Dunigan <cdi4@mindspring.com>:
Please place your reply below the suitably trimmed quoted text.
[posting rearranged]
> Batormaster666 wrote:
>
> > Hi all,
> >
> > Could somebody please help me with this regex problem I need to perform for
> > syntax checking?
> > I've got to check the syntax of a string that starts with a positive integer
> > and is padded right by space characters up to a length of 11 characters.
> > This is then followed by a \n.
> > I 1st thought of this but it of course won't work:
> > ^(\d+ *){11}\n$
>
> Would something like this work for you?
> # First make sure the line is exactly 11 characters.
> if ($line =~ /^.{11}$/) {
> if ($line =~ /^ *\d+$/) { # check for spaces followed by digits
>
Testing for the length in a separate step is fine, but using a regex
for that purpose is overkill. Perl has a length function. Further,
you don't have to nest if's to test for multiple conditions, Perl has
an and-operator. Also, your final regex tests for blank padding on the
left while the OP specified right padding.
if ( length( $line) == 11 and $line =~ /^\d+ *$/ ) {
Anno
------------------------------
Date: 18 Sep 2001 02:24:00 -0700
From: delanthear@yahoo.com (Del)
Subject: Re: Objects and Sockets
Message-Id: <999063fd.0109180123.765e64f4@posting.google.com>
"Michael Schlueter" <Michael.Schlueter@philips.com> wrote in message news:<3ba6eebe$0$230$4d4ebb8e@businessnews.de.uu.net>...
> Did you check "Programming Perl"?
>
> Several connections via sockets are described there.
> If so, what are you missing?
>
> Michael
Yeah, sorry. That post wasn't very clear (and had a blatent typo in!)
I'm basically rewriting a set of scripts i've done before but using
objects where before I used imported modules and exported the
functions. I can't work out how, once I've opened a socket in my
object, I can keep it hanging around for other methods.
I think I've failed to grasp some OOP concept somewhere! :)
------------------------------
Date: Tue, 18 Sep 2001 11:53:53 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: Objects and Sockets
Message-Id: <mt5eqtkp40rbcvlc3rl9siamr8q5o4utbi@4ax.com>
On 18 Sep 2001 02:24:00 -0700, delanthear@yahoo.com (Del) wrote:
>functions. I can't work out how, once I've opened a socket in my
>object, I can keep it hanging around for other methods.
You can build your object around a hash ref and store your
instance-specific data like an associated socket in that hash.
Consider this standard constructor skeleton:
sub new {
my $proto = shift;
my $class = ref( $proto ) || $proto;
my $self = {};
# do something
return $self;
}
Each method of the object will receive this hash ref as the first
argument when it is called.
HTH,
--
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl
------------------------------
Date: Tue, 18 Sep 2001 12:15:48 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: perl module
Message-Id: <4eeeqt0nh7tanko4sdntlt88qn67mdhn19@4ax.com>
Joe Chung wrote:
>If every request to a perl script will result in re-compile
>(re-intepret) of the source code, then re-link with the perl module
>source file. the performance would be suffer if the source file are
>big. But why I don't see a big delay when request to a perl script?
>
>when I complie and link a simple c++ file in visual c++. it takes me
>couple seconds.
That's because compilation in perl is fast. Even CGI.pm, which is
roughly 150k of text (amongst the biggest modules you're ever likely to
use), loads in a fraction of a second.
I must add that some tricks have been applied to this module, so that
*not all* of it is compiled at startup. It uses an application of the
mechanism of AUTOLOAD, which makes the module compile a certain sub the
first time it is asked for. That way, unneeded functions are not
compiled. In this case.
IIRC, some tests have shown that recompiling the module's source every
time, is usually actually faster than trying to load the precompiled
module from disk, because of the blow-up in size.
And there's no separate linking stage in Perl. All addresses are
resolved immediately.
--
Bart.
------------------------------
Date: Tue, 18 Sep 2001 12:26:24 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: perl module
Message-Id: <uneeqt85uh3lmgrnldfdqat9jhap7rsvqv@4ax.com>
Joe Chung wrote:
>does perl module all end with pm extension? are they plain text file?
>or binary file? do i need to recomplie my perl interperter to
>integrate the module into perl?
*.pm files are plain text, plain perl. Some modules require parts
written in C, with special preprocessing added, and those are are stored
as *.xs files. These are commonly compiled into DLL's or their
equivalent on your platform, at the time the module is installed (or
precompiled DLL's are possible too) and they get loaded using a method
called bootstrap, from the DynaLoader module.
>or i just need to put xxxx.pm into
>the perl interperter's path?
You need to put it in a directory that is available to perl in the @INC
array. That includes the "lib" subdirectory of your perl installation,
and a directory called "site/lib" or similar.
The "::" in module names should be treated as equivalent to directory
separators, so a module Foo::Bar needs to be located in a file "Bar.pm"
in a subdirectory "Foo" in, say, "lib".
>since i had read some article said i need to recompile perl
>distribution to use some module.
If you ever need to recompile perl in order to use a module, it's either
because our perl is statically linked (no dynamic link libraries), or
because you're trying to use a precompiled XS-library which isn't
compatible with your binary. As a rule of thumb, both need to be
compiled withthe same C compiler.
--
Bart.
------------------------------
Date: Tue, 18 Sep 2001 09:25:00 +0200
From: "fruiture" <info@fruiture.de>
Subject: Re: Persistence in Perl
Message-Id: <9o6svk$lui$02$1@news.t-online.com>
"Venu" <spaceme_2001@yahoo.com> wrote:
> Hi all,
>
> I want to know is there any Persistence mechanism exists in Perl?
>
> Suppose i have a search where i need to display the results 10 per
> page. Now i got 100 matches and need to display in 10 pages.
then my first idea would be to get all results every time an only display
a slice of 'em...
> Now here
> generally what i'm doing now is store 10 records in each text file
> (total 10 files) and display accordingly. But there are lot of
> problems in this. I want to know, is there any way so that i can store
> all the 100 matches in an array or something so that i can display
> through perl? I heard there is a module (persistence module) for this?
> Any one has ever faced this problem? If so please suggest me the way.
use Storable
--
require Time::HiRes;my @m=split(/8/,55.52.56.49.49.55.56.49.49.53);push
@m,map{($_%2)?$_-1:$_+1} map ord($_),split//,'u!`onuids!Qdsm!i`bjds';
unshift @m,43 for(0..@m);for(0..@m){print map chr($_),@m[0..(@m/2-1)];
push @m,shift @m;print "\b"x(@m/2);Time::HiRes::usleep(0246*0xA**3);}
------------------------------
Date: Tue, 18 Sep 2001 11:47:21 +0200
From: "Alexander Farber (EED)" <eedalf@eed.ericsson.se>
Subject: Re: Persistence in Perl
Message-Id: <3BA71829.58114A52@eed.ericsson.se>
Venu wrote:
> I want to know is there any Persistence mechanism exists in Perl?
>
> Suppose i have a search where i need to display the results 10 per
> page. Now i got 100 matches and need to display in 10 pages. Now here
> generally what i'm doing now is store 10 records in each text file
> (total 10 files) and display accordingly. But there are lot of
> problems in this. I want to know, is there any way so that i can store
> all the 100 matches in an array or something so that i can display
> through perl? I heard there is a module (persistence module) for this?
> Any one has ever faced this problem? If so please suggest me the way.
If you use database, there is often a way to restrict a query result
to a number of rows (sometimes with an offset) - depend on the database
------------------------------
Date: 18 Sep 2001 05:10:44 -0700
From: fridden@yahoo.com (Fredrik)
Subject: Re: Regular Expresion help needed
Message-Id: <9ef98ad9.0109180410.47cde7ec@posting.google.com>
Marcelo Montagna <nospam@me.com> wrote in message
> I have an html source and I am trying to remove all the comments with
> regular expressions
As another poster have suggested there are some modules you could use
to achive this. But just to clarify why your code doesnt work I wanted
to reply anyway.
> I tried this:
> $HTML =~ s/\n/ /g;
> $HTML =~ s/<!--[^-->]+-->/ /g;
>
> and this:
> $HTML =~ s/\n/ /g;
> $HTML =~ s/<\!\-\-[^\-\-\>]+\-\->/ /g;
Note that you seem to misunderstand the character class concept
here. [^-->] would match any character *except* '-' or '-' or '>'
and not as you seem to think the sequence of characters -->
Another way would be to do like this:
$html =~ s/<!--.*?-->//gs;
This would read out as follow:
Match <!-- follow by 0 or more characters, followed by -->. By using
the *? we will match the least number of characters found before --> so
we dont catch the beginning of the first comment and the end of the last
comment in the file.
The drawback with this expression however is that it doesnt
handles nested comments. I suggest that you check out perlfaq6
for a similar example regarding stripping C source code comments.
Regards,
Fredrik.
------------------------------
Date: Tue, 18 Sep 2001 11:55:46 +0100
From: "Raj" <oneconcept@yahoo.co.uk>
Subject: Storing info from a socket connection
Message-Id: <1000810510.27820.0.nnrp-13.c2d95a2c@news.demon.co.uk>
Hiya,
I am having a problem storing information from a socket connection to an
array. When I print the information to the screen it displays fine but I
want to add each line into an assoc array.
Then I want to use the values to populate text boxes of a form.
Does anyone have any suggestions on how to acheive this?
Thanks in advance for any help you can provide!
Regards,
Raj
------------------------------
Date: Tue, 18 Sep 2001 15:20:03 +0800
From: "Greg" <gwmbox@mbox.com.auNOSPAM>
Subject: textarea and /n/n recognising
Message-Id: <9o6sj6$j0c$1@ftp.curtin.edu.au>
Hi all
I cannot for the life of me remember how to do this, I have a text area
field in a form that I just want to display the results on screen once the
submit button is pressed, however I want it to be able to recognise carriage
returns so each line is put onto a single line. I know I can use plain text
fileds, but that is not what I need - the tex area is needed as we will not
know how many entries will be added to the field, could be anything from 1
to 50 and we do not want a row of blank text fields.
For example we may have an entry in the field like
Jones, Greg
Hayes, Anthony
Black, Norm
And the results I want is something like
Name: Jones, Greg
Name: Hayes, Anthony
Name: Black, Norm
There is more to it than what I have given examples of above but that is the
general idea.
Many thanks to anyone that can help
Greg
------------------------------
Date: Tue, 18 Sep 2001 09:31:04 +0200
From: "fruiture" <info@fruiture.de>
Subject: Re: textarea and /n/n recognising
Message-Id: <9o6tb0$79s$05$1@news.t-online.com>
"Greg" <gwmbox@mbox.com.auNOSPAM> wrote:
> Hi all
>
> I cannot for the life of me remember how to do this, I have a text area
> field in a form that I just want to display the results on screen once
the
> submit button is pressed, however I want it to be able to recognise
carriage
> returns so each line is put onto a single line. I know I can use plain
text
> fileds, but that is not what I need - the tex area is needed as we will
not
> know how many entries will be added to the field, could be anything from
1
> to 50 and we do not want a row of blank text fields.
>
> For example we may have an entry in the field like
>
> Jones, Greg
> Hayes, Anthony
> Black, Norm
>
> And the results I want is something like
>
> Name: Jones, Greg
> Name: Hayes, Anthony
> Name: Black, Norm
% perldoc perlre
% perldoc perlop
my $fieldinput = CGI::param('field');
for($fieldinput){
s/\n/\<br\/\>/sg;
tr/\r//d;
}
print $fieldinput;
in fact i didn't really get you problem...
--
require Time::HiRes;my @m=split(/8/,55.52.56.49.49.55.56.49.49.53);push
@m,map{($_%2)?$_-1:$_+1} map ord($_),split//,'u!`onuids!Qdsm!i`bjds';
unshift @m,43 for(0..@m);for(0..@m){print map chr($_),@m[0..(@m/2-1)];
push @m,shift @m;print "\b"x(@m/2);Time::HiRes::usleep(0246*0xA**3);}
------------------------------
Date: Tue, 18 Sep 2001 15:53:12 +0800
From: "Greg" <gwmbox@mbox.com.auNOSPAM>
Subject: Re: textarea and /n/n recognising
Message-Id: <9o6uhd$jin$1@ftp.curtin.edu.au>
Ok
Close - maybe I did not explain myself properly
I have a textarea filed that can have a number of entries on each line, each
line is seperated with carriage returns. The results are then posted on
screen as if they are multiple entries, eg
If a person enters into text area field a somethign like
name of a song title
name of a book title
name of a video title
Then after the submit button is pressed the results show up as something
like
Item selected is the 'name of song title'
Item selected is the 'name of book title'
Item selected is the 'name of video title'
So as you can see the text entered is preceeded and may also have additional
text added at the end - the text will be the same for each line - this
making them look like separate entries
Is that any clearer?
"fruiture" <info@fruiture.de> wrote in message
news:9o6tb0$79s$05$1@news.t-online.com...
> "Greg" <gwmbox@mbox.com.auNOSPAM> wrote:
> > Hi all
> >
> > I cannot for the life of me remember how to do this, I have a text area
> > field in a form that I just want to display the results on screen once
> the
> > submit button is pressed, however I want it to be able to recognise
> carriage
> > returns so each line is put onto a single line. I know I can use plain
> text
> > fileds, but that is not what I need - the tex area is needed as we will
> not
> > know how many entries will be added to the field, could be anything from
> 1
> > to 50 and we do not want a row of blank text fields.
> >
> > For example we may have an entry in the field like
> >
> > Jones, Greg
> > Hayes, Anthony
> > Black, Norm
> >
> > And the results I want is something like
> >
> > Name: Jones, Greg
> > Name: Hayes, Anthony
> > Name: Black, Norm
>
> % perldoc perlre
> % perldoc perlop
>
> my $fieldinput = CGI::param('field');
> for($fieldinput){
> s/\n/\<br\/\>/sg;
> tr/\r//d;
> }
> print $fieldinput;
>
> in fact i didn't really get you problem...
>
> --
> require Time::HiRes;my @m=split(/8/,55.52.56.49.49.55.56.49.49.53);push
> @m,map{($_%2)?$_-1:$_+1} map ord($_),split//,'u!`onuids!Qdsm!i`bjds';
> unshift @m,43 for(0..@m);for(0..@m){print map chr($_),@m[0..(@m/2-1)];
> push @m,shift @m;print "\b"x(@m/2);Time::HiRes::usleep(0246*0xA**3);}
>
------------------------------
Date: Tue, 18 Sep 2001 10:47:59 +0200
From: "fruiture" <info@fruiture.de>
Subject: Re: textarea and /n/n recognising
Message-Id: <9o71r6$tk2$07$1@news.t-online.com>
"Greg" <gwmbox@mbox.com.auNOSPAM> wrote:
> Ok
>
> Close - maybe I did not explain myself properly
>
> I have a textarea filed that can have a number of entries on each line,
each
> line is seperated with carriage returns. The results are then posted on
> screen as if they are multiple entries, eg
>
> If a person enters into text area field a somethign like
>
> name of a song title
> name of a book title
> name of a video title
>
> Then after the submit button is pressed the results show up as something
> like
>
> Item selected is the 'name of song title'
> Item selected is the 'name of book title'
> Item selected is the 'name of video title'
>
> So as you can see the text entered is preceeded and may also have
additional
> text added at the end - the text will be the same for each line - this
> making them look like separate entries
>
> Is that any clearer?
perhaps...
use CGI ':standard';
my $field = param('fieldname'); #all input in $field
$field =~ tr/\r//d; #kill carriage return (newlines will survive)
my @lines = split /\n/,$field; #single entries in @lines, newlines are out
now
print "Item selected is '$_'<br/>" foreach @lines;
> [...]
http://learn.to/quote
--
require Time::HiRes;my @m=split(/8/,55.52.56.49.49.55.56.49.49.53);push
@m,map{($_%2)?$_-1:$_+1} map ord($_),split//,'u!`onuids!Qdsm!i`bjds';
unshift @m,43 for(0..@m);for(0..@m){print map chr($_),@m[0..(@m/2-1)];
push @m,shift @m;print "\b"x(@m/2);Time::HiRes::usleep(0246*0xA**3);}
------------------------------
Date: Tue, 18 Sep 2001 10:29:57 +0100
From: mark grimshaw <m.grimshaw@salford.ac.uk>
Subject: Re: upgrading berkeley DB 1.85 to 3.3?
Message-Id: <3BA71415.DE162CEF@salford.ac.uk>
gnari wrote:
> In article <3BA4A4F8.C1F7A591@salford.ac.uk>,
> mark grimshaw <m.grimshaw@salford.ac.uk> wrote:
> >Hi all,
> >
> >I'm currently in the process of transferring our web server from SGI
> >IRIX to Linux. All databases on IRIX used berkeley db 1.85 and ran with
> >perl 5.005_02. All files transferred have been transferred with
> >original owner, group and permissions.
> >
> >LINUX: berkeley 3.3, DB_File (that comes with the 3.3 dist.) and perl
> >5.6.1
> >
> >With all the above installed however, none of my perl scripts (unedited
> >scripts that ran fine on IRIX) will tie() the 1.85 files that were
> >transferred across from the IRIX box. The readme files for berkeley 3.3
> >mentioned possible problems with the perl dist (5.6.0) that comes with
> >some linux distributions hence my reason for installing 5.6.1 (and then
> >reinstalling 3.3 and DB_File).
> >
> >Has anyone had this problem and resolved it? If so, what is the
> >solution?
> >
>
> you should not trust the database files to be binary compatible when
> moved across mystems and versions, especially when moving such a big
> step as between 1.85 and 3.3
>
> in the past i have just made a simple export/import script and
> transferred the files as text. simple and foolproof.
>
> gnari
I had a nice email from one of the people at Sleepycat who pointed out that I
should be using the db_dump185 and db_load utilities provided with 3.3 I
managed this successfully yesterday after a little bit of fiddling around.
------------------------------
Date: 18 Sep 2001 10:31:36 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: upgrading berkeley DB 1.85 to 3.3?
Message-Id: <9o77q8$cjj$3@mamenchi.zrz.TU-Berlin.DE>
According to gnari <gnarinn@hotmail.com>:
> moved across mystems and versions, especially when moving such a big
^^^^^^^
Nice one!
Anno
------------------------------
Date: 18 Sep 2001 06:32:45 -0400
From: stanb@panix.com (Stan Brown)
Subject: Re: What does this do ? "select( (select($writer), $|=1)[0] );" ?
Message-Id: <9o77sd$kbj$1@panix1.panix.com>
In <x78zfddx91.fsf@home.sysarch.com> Uri Guttman <uri@sysarch.com> writes:
>>>>>> "SB" == Stan Brown <stanb@panix.com> writes:
> SB> In <x7d74pe9ms.fsf@home.sysarch.com> Uri Guttman <uri@sysarch.com> writes:
> >> do you have a fscking clue? you posted over 5k lines of code here!! do
> >> you think anyone will wallow through that? instead refer people to a
> >> url where your code is posted. and on top of that, the perl.tk group is
> >> overe there ---->
> SB> Thanks for your helpful reply.
>you're welcome.
> SB> In case you don't bother to read groups you refer people to, I
> SB> have a simple question posted over there which was posted 5 days
> SB> ago.
> SB> Still no reply.
>so, that means you must post 5k lines of code? is that going to help at
>all?
The post in the tk group was unrelated to this one.
> SB> And I'm not at all certain the core problem is perlTK related.
>but all i have seen is perl/tk related issues.
> SB> I am certain that I have bee fighting it for over a week now, and
> SB> have gotten it down to a very simple problem, which I was hopeful,
> SB> I might actually get some useful information about.
>is that 5k lines post your simple problem? not simple in my book.
Can you read?
I ask this, because if you had bothered to look at the post with, what you
claim was "5k of code", you would have found that it consited of t small
subroutines, and a fair amount of debuging printout to demonstrate the
problem that I am faceing.
However, aparntely you did not bother to actually look at the post you
chose to so impolitely criticize.
Hopefully someone intelegent enough to actually _read_ the post will look
at it.
--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 1766
***************************************