[10761] in Perl-Users-Digest
Perl-Users Digest, Issue: 4362 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 4 23:07:23 1998
Date: Fri, 4 Dec 98 20:00:20 -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 Fri, 4 Dec 1998 Volume: 8 Number: 4362
Today's topics:
Re: big problem with Perl's time() limitations (Ilya Zakharevich)
can match $n times be done? <pjl@be-NOSPAM-st.com>
Re: can match $n times be done? <rick.delaney@shaw.wave.ca>
Re: can match $n times be done? <sternji@mail.northgrum.com>
Re: can match $n times be done? (Don Arbow)
Re: can match $n times be done? (Tad McClellan)
clearing the screen in perl? (Jim Matzdorff)
Help with DBI & Perl & Sybase <info@chrislands.com>
Re: help, please, <aqumsieh@matrox.com>
Re: java servlets vs imbedded mod_perl for servers (Felix K Sheng)
Re: More information defining PODs needed. dzuy@my-dejanews.com
Re: Newbie need help to run Makefile by using script (Greg Ward)
Re: Newbie needs help with regex in perl script! (James Huff)
Re: Newbie:shell commands in perl script... (Charles DeRykus)
Re: perlshop 3.1 (Steve)
Re: Petition: Contrast: South Australian gov't has 20 y <ara@neWave.net.au>
Problem with seek..... <rainman@dustyhoffman.com>
Re: Problem with seek..... (Tad McClellan)
Re: Regular Expression Question <rick.delaney@shaw.wave.ca>
Re: Removing a line... (Greg Ward)
Re: Removing a line... (Tad McClellan)
Re: search: script for sending form by mail (Andrew Allen)
Re: Seeking Win32::DES.pm <dpainter@lightspeed.net>
Threads and Perl? otis@my-dejanews.com
Understanding the debugger <pking@pdq.net>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 4 Dec 1998 23:05:07 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: big problem with Perl's time() limitations
Message-Id: <749pr3$a4u$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Abigail
<abigail@fnx.com>],
who wrote in article <749n16$aq5$1@client3.news.psi.net>:
> ++ Btw, I think Solaris 7 allows you to have 64-bit time, so one may have
> ++ a sane time *today* on Unixish systems too, not only on mainframes.
>
> I don't think so.
I did not say that *Perl* on Solaris 7 will *by default* use 64-bit
time. I do not even know if Perl *anywhere* is ready for 64-bit time.
Ilya
------------------------------
Date: 4 Dec 1998 15:45:02 -0800
From: "Paul J. Lucas" <pjl@be-NOSPAM-st.com>
Subject: can match $n times be done?
Message-Id: <pjl.912814736@shell3.ba.best.com>
I have a string of words I want to truncate after the nth word
where $n is a variable:
$_ = "now is the time for all good men";
$n = 5;
$pat = "^((?:[^\s]+\s+){$n}).*";
s/$pat/$1/o;
doesn't work, nor does:
$code = "s!^((?:[^\s]+\s+){$n}).*!\$1!;";
eval { $code };
Is there any way to do what I want? E-mail replies to
de-spammed address preferred; thanks.
- Paul
------------------------------
Date: Sat, 05 Dec 1998 00:42:59 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: can match $n times be done?
Message-Id: <3668834C.6962F63A@shaw.wave.ca>
"Paul J. Lucas" wrote:
>
> I have a string of words I want to truncate after the nth word
> where $n is a variable:
>
> $_ = "now is the time for all good men";
> $n = 5;
> $pat = "^((?:[^\s]+\s+){$n}).*";
> s/$pat/$1/o;
You need to escape the backslashes.
$pat = "^((?:[^\\s]+\\s+){$n}).*";
Not really sure why you're using (?:). And [^\s] is usually better
written as \S.
$pat = "^((\\S+\\s+){$n}).*";
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: Sat, 5 Dec 1998 02:15:33 GMT
From: "James M. Stern" <sternji@mail.northgrum.com>
Subject: Re: can match $n times be done?
Message-Id: <36689745.90C1EEC1@mail.northgrum.com>
Paul J. Lucas wrote:
>
> I have a string of words I want to truncate after the nth word
> where $n is a variable:
>
> $_ = "now is the time for all good men";
> $n = 5;
> $pat = "^((?:[^\s]+\s+){$n}).*";
> s/$pat/$1/o;
>
> doesn't work, nor does:
>
> $code = "s!^((?:[^\s]+\s+){$n}).*!\$1!;";
> eval { $code };
>
> Is there any way to do what I want? E-mail replies to
> de-spammed address preferred; thanks.
Regular expressions are not your problem. String assignment is. Double
each backslash in the assignments to $pat and $code. Also, use
eval "$code"; # not eval { $code };
above. Better, don't use eval for this.
--
James M. Stern Northrop Grumman Corp. Hawthorne, CA
Opinions expressed above are not necessarily my employer's.
------------------------------
Date: Fri, 04 Dec 1998 17:55:42 -0800
From: donarb@nwlink.com (Don Arbow)
Subject: Re: can match $n times be done?
Message-Id: <donarb-0412981755420001@192.168.0.2>
In article <pjl.912814736@shell3.ba.best.com>, "Paul J. Lucas"
<pjl@be-NOSPAM-st.com> wrote:
: I have a string of words I want to truncate after the nth word
: where $n is a variable:
:
: $_ = "now is the time for all good men";
: $n = 5;
: $pat = "^((?:[^\s]+\s+){$n}).*";
: s/$pat/$1/o;
:
: doesn't work, nor does:
:
: $code = "s!^((?:[^\s]+\s+){$n}).*!\$1!;";
: eval { $code };
:
: Is there any way to do what I want? E-mail replies to
: de-spammed address preferred; thanks.
:
: - Paul
The problem is the quotes around the pattern. When you assign the pattern
to $pat, perl interpolates the \s. If you put a print statement after the
$pat = line, you'll see it looks like this:
^((?:[^s]+s+){5}).*
To fix it, you need to double up the backslashes like this:
$pat = "^((?:[^\\s]+\\s+){$n}).*";
You could also code it this way, alternating word and space runs:
$pat = "^((?:\\w+\\s+){$n}).*";
Don
--
Don Arbow, Partner, CTO
EveryDay Objects, Inc.
mailto:donarb@nwlink.com
http://www.edo-inc.com
------------------------------
Date: Fri, 4 Dec 1998 21:39:41 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: can match $n times be done?
Message-Id: <tt9a47.jmb.ln@metronet.com>
Paul J. Lucas (pjl@be-NOSPAM-st.com) wrote:
: I have a string of words I want to truncate after the nth word
: where $n is a variable:
: $_ = "now is the time for all good men";
: $n = 5;
: $pat = "^((?:[^\s]+\s+){$n}).*";
: s/$pat/$1/o;
: doesn't work, nor does:
Did you try
print "pat '$pat'\n";
??
If you had, you probably would have then tried:
$pat = "^((?:[^\\s]+\\s+){$n}).*";
And it would have worked ;-)
But I would have written it:
$pat = "^((?:\\S+\\s+){$n}).*";
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 4 Dec 1998 17:07:39 -0800
From: syran@shell1.ncal.verio.com (Jim Matzdorff)
Subject: clearing the screen in perl?
Message-Id: <74a10r$mem$1@shell1.ncal.verio.com>
So, I have looked around at perl.com, couldn't find an answer.
SO... :)
Is there a way to clear the screen in perl? Such as "clear" in a shell? I
can't backtick it and run clear, since that clears the shell's screen, not the current
screen. Am I (and I know I am) missing something simple here?
--jim
------------------------------
Date: Fri, 4 Dec 1998 21:36:25 -0500
From: "Jaymes H. Sorbel" <info@chrislands.com>
Subject: Help with DBI & Perl & Sybase
Message-Id: <74a694$st3$1@supernews.com>
I am relatively new to PERL and I am having problems with the following line
of code.
$inwriter->execute(\$Form{'username'}, \$Form{'password'},
\$Form{'lastname'}, \$Form{'firstname'}, \$Form{'initial'},
\$Form{'address'}, \$Form{'city'}, \$Form{'state'}, \$Form{'zip'},
\$Form{'phone'}, \$Form{'email'}, \$Form{'articles'}, \$Form{'employee'});
The \ before each variable is the last attempt - then I received the error
"ct_param() failed!" Before
adding the \ I received the error "unable to bind non-scalar variable"
Of course prior to running this I use the ->prepare statement below
$inwriter = $dbh->prepare("INSERT INTO writer (wrt_username, wrt_password,
wrt_lastname, wrt_firstname, wrt_middle_init, wrt_address, wrt_city,
wrt_state, wrt_zip, wrt_phone, wrt_email, wrt_number_of_aricles,
wrt_employee_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
I have tried many variations of this without success, I have even tried
the ->Do method. I never received any error with the DO but I never received
any data in the table either.
Is there a limit as to how many ???? can be in a statement?
Any help is greatly appreciated (I'm running out of time).
Thanks
Jaymes H. Sorbel
info@chrislands.com
------------------------------
Date: Fri, 4 Dec 1998 11:42:31 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: help, please,
Message-Id: <x3ypv9z3lth.fsf@tigre.matrox.com>
Daniel J Mandel <dmandel@CS.Arizona.EDU> writes:
<snip>
> #!/usr/local/bin/perl -w
> $string2="(0|(1|(0|1)))"; # just a test string
> #BEGIN expression
> while($string2=~/(\([^\(|\)]*\))/ # This part looks for the first complete parentheses
1) you don't close the right bracket for the while() loop.
2) you don't open a left brace
while ($string2 =~ /blah blah/) {
> if $1=~/([^|]*)\|([^|]*)/ # This checks to see if it is in an OR format
if() needs a pair of brackets around its argument if it is at the
beginning of a command.
> {
> # This next line carries out the OR operation
> while($temp=~s/([^\|]*)\|([^\|]*)/if (int(rand(1000))%2==0) {$2} else {$1}/e)
WOW! why do you need a while there??? I truly don't understand what
you are trying to do here. I advise you to read the Llama book before
you go on with your Perl life.
> }
> /ex) # END expression
and this /ex is what exactly??
> # The e option is so that the replacement string is evaluated as
> #a Perl expression, and the x is supposed to allow whitespace
yeah .. but which regexp does it belong to??
>
> This is the compiler message I get:
>
> syntax error at regular.pl line 5, near "if"
> Execution of regular.pl aborted due to compilation errors.
>
> I don't know what is wrong. Any help would be greatly appreciated. Thank
> you.
Hope this sheds some light,
Ala
------------------------------
Date: Sat, 5 Dec 1998 00:38:30 GMT
From: felix@badlands.deasil.com (Felix K Sheng)
Subject: Re: java servlets vs imbedded mod_perl for servers
Message-Id: <slrn76h0fa.hc0.felix@badlands.deasil.com>
On 4 Dec 1998 19:12:42 GMT, Erik <eln@cyberhighway.net> wrote:
>[comp.lang.perl.modules trimmed from newsgroups...not really relevant]
>In article <Pine.LNX.3.96.981204145012.23067B-100000@aura>,
> Pat Trainor <ptrainor@title14.com> writes:
>> I had a discussion with a tech who is writing in java for an intranet
>> server and he said that perl is way too wasteful what with spawned
>> processes to be considered for a large/intense project.
>
>Why are "spawned processes" considered wasteful? Each perl program is
>one spawned process. If you're using more, quit writing perl programs
>with a bunch of system calls and forks. In a program that gets hit several
>billion times a day, the interpretive nature of perl might end up
>causing a slowdown, but not a really huge one, and if you're really
If he said spawned processes, he must be thinking of cgi and *not*
mod_perl. There is a huge performance difference. If he was speaking
of cgi, then yes, in a high volume system there is a great deal of
overhead which will generally cause great headaches for all concerned.
>> To the best of my knowledge, apache running perl thus will not
>> spawn children the way CGI does, nor will simultaneous connections eat
>> more memory than a normal httpd running..
>
>Er...you're using perl to run CGI scripts, or you're using it to run
>your web server? What exactly are you trying to accomplish here? Do
>you want to incorporate your CGI scripts directly into Apache? What
>kinds of scripts are these? If they're forms and such, you might just
>want to enable FastCGI or something of the sort. Either way, Java is
>not designed to do anything of the sort, nor was it ever intended to
>do anything like that.
Yes, if you are running mod_perl in apache it will not cause you the
overhead that cgi does. FastCGI is another very good option and I
am not quite sure why more people don't use it. It's language independent,
solves the overhead of CGI and allows great scalability by being able
to offload the fastcgi handlers to machines remote from the webserver.
I guess it probably was bad marketing.
Of course, Java can be used in very much the same capacity as servlets,
solving all the same problems. There are pros and cons to all three
of these methods (FastCGI, mod_perl, servlets) - but they are all good
and no one is clearly better than the other.
If you're running apache and you know perl, there's probably not much
reason to choose not to use mod_perl or FastCGI. If you think you're
going to be moving scripts around to different platforms or web servers,
maybe servlets or FastCGI is a good way to handle things. It all depends.
felix
--
felix sheng .. felix@deasil.com
fa lah lah lah lah, lah lah, lah, lah
------------------------------
Date: Fri, 04 Dec 1998 23:30:14 GMT
From: dzuy@my-dejanews.com
To: conmara@tcon.net
Subject: Re: More information defining PODs needed.
Message-Id: <749ra6$3j5$1@nnrp1.dejanews.com>
In article <3667DB07.392E3453@tcon.net>,
Ken McNamara <conmara@tcon.net> wrote:
> Hawkwynd -
>
> I like a Tom Christiansen post entitled "PerlPoint".
>
> I like it so well I printed it off - but didn't save an electronic copy.
> It was posted on comp.lang.perl.moderated on 8/24/98 - but has long since
> dropped off.
>
> I searched on a couple of web sites but it didn't jump out. Perhaps
> someone could point you to a copy.
>
Deja News archive all newsgroup articles since 1995. The post you're
looking for is still there. Use Deja News Power Search.
> KenMc
>
> Hawkwynd wrote:
>
> >
> >
> > 3. More information regarding writing perl, styles, and "tactics"
> > behind writing good code.
> >
>
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 4 Dec 1998 23:00:37 GMT
From: gward@thrak.cnri.reston.va.us (Greg Ward)
Subject: Re: Newbie need help to run Makefile by using script
Message-Id: <749pil$9p9$3@news0-alterdial.uu.net>
Yulia Tjahjadi <yt@cs.purdue.edu> wrote:
> OK I have lots of directory. In every directories I have a Makefile that
> I want to run. What command can I use to achieve this?
> I have put all the directories in my @dirs array.
>
> foreach $dir (@dirs)
> {
> what should I put in here?
> below is my dumb version. Ignore it if it's confuse you.
> $temp = `$dir/make`;
> $DUMP=`$temp`;
> }
Read the fine manual. Start with the backquotes operator (``, aka qx//)
to learn why you're misusing it. (Hint: it slurps up the child process'
stdout, which is excess overhead that you don't need here.)
Then read about 'system', which is what you should be using.
Finally, you don't seem to understand how make and Makefiles interact.
'make' is an executable program that lives somewhere unchanging on the
disk, say '/usr/bin/make'. Assuming your makefile is called 'Makefile'
or 'makefile', 'make' will find it automatically -- so you all have to
do is run 'make' (or '/usr/bin/make') in each directory.
Try this:
use Cwd;
my $start_dir = getcwd;
foreach $dir (@dirs)
{
chdir ($dir) || die "$0: couldn't chdir to $dir: $!\n";
system 'make';
}
chdir ($start_dir) || die "$0: couldn't chdir back to $start_dir: $!\n";
NOTE: this assumes that all the directories listed in @dirs are
absolute! If not, you'll either have to do some mucking around to make
them absolute, or chdir back to $start_dir at the end of every loop
iteration. Your call (although the latter would be easier).
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: Fri, 04 Dec 1998 15:46:02 -0800
From: james.huff@sierra.com (James Huff)
Subject: Re: Newbie needs help with regex in perl script!
Message-Id: <_u_92.630$m4.1821733@WReNphoon2>
Many thanks to the replies. Yes, you were right. I didn't have the new line
going anywhere. As soon as I
did that I worked! Thanks again.
-James H.
-**** Posted from remarQ, Discussions Start Here(tm) ****-
http://www.remarq.com/ - Host to the the World's Discussions & Usenet
------------------------------
Date: Fri, 4 Dec 1998 20:01:27 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Newbie:shell commands in perl script...
Message-Id: <F3GIAF.H36@news.boeing.com>
In article <3667C877.93E750F0@se.bel.alcatel.be>,
David Van den Brande <brandeda@se.bel.alcatel.be> wrote:
>
>I want to use shell commands in a perl script but even this simple test
>won't work :-(
>
>#!/usr/local/bin/perl5.004 -w
>use Shell qw(ls);
>ls;
>
Very close.
Perl autoloads a subroutine to capture the shell's
output; you'll need to capture that sub's output.
(perldoc perlsub for details about AUTOLOAD)
So, something like this'll work:
print ls;
$ls = ls;
Otherwise you're tossing out the value of the shell command
and nothing happens visibly.
hth,
--
Charles DeRykus
------------------------------
Date: Sat, 05 Dec 1998 03:46:22 GMT
From: chubbys@cci-internet.com (Steve)
Subject: Re: perlshop 3.1
Message-Id: <3668ab81.8526400@news.cci-internet.com>
On Thu, 03 Dec 1998 11:34:09 GMT, vivekvp@hotmail.com wrote:
>anyone have any luck installing perlshop 3.1???
>
>i have tried but still get problems:
>
>
>i downloaded and try to install perlshop on a unix server. i am running into
>the folowing error:
>
>Invalid Transmission #3 received from: 192.58.194.69
>If your connection was interrupted, you must Enter the shop from the beginning
>again.
>
>
>i am not using ssl, and have cookies turned off. can you give me any idea why
>this is happening?
>
>thanks!!
>
>please email me at personally if you have any info!
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
I have had the same problem. Perlshop installed perfectly on one site
but when I tried to use it on 2 other locations (using the same setup)
I received the same Invalid Transmission #3 error from my IP address.
Suspect problem is related to version of Perl being run on the server
but dont know for sure. Hope somebody has an answer because it is
a great program.
------------------------------
Date: 5 Dec 1998 00:54:10 GMT
From: "ARA" <ara@neWave.net.au>
Subject: Re: Petition: Contrast: South Australian gov't has 20 yr Microsoft-Only Contract!
Message-Id: <01be1ff2$c98dc250$0a00000a@KangalCreek>
I read with interest your call for petition signers...
By contrast, can you imagine the up-hill battle you'd
have in South Australia, where (perhaps to get EDS to
relocate to Adelaide) the State gov't has reportedly
signed a contract which makes it ILLEGAL for them to
use anything but Microsoft software products?
For details, find an archive of our local LUNIX SA
mailing list (Nov/Dec 98) and read what "insiders"
have had to say about the deal.
At least you have a somewhat easier climb, eh? ;)
As well as some NASA examples of what LINUX can do
Best wishes!
Clay Shirky <clays@panix.com> wrote in article
<749dom$5he@panix2.panix.com>...
> Please sign the petition:
>
> The Federal Government Should Evaluate Open Source Software Whenever
> It Purchases or Upgrades Computers.
------------------------------
Date: Sat, 5 Dec 1998 09:17:09 +1100
From: "bravo" <rainman@dustyhoffman.com>
Subject: Problem with seek.....
Message-Id: <749sb6$u5p$1@reader1.reader.news.ozemail.net>
I have a small script that bascially allows someone to fill out a form which
gets written to a text file, then is read and displays the info on that text
file.
Everything's working fun but the problem is my stuff gets appended to the
bottom(as normal).
What I want to do is append it to the top so the most recent info is on top.
I am using the following code in my script.
open(OUTF,">>data.txt");
flock(OUTF, 8) or die "cannot unlock file: $!";
seek(OUTF,0,0);
But it still appends to the bottom.....
Any suggestions?
Thanks in advance
David
------------------------------
Date: Fri, 4 Dec 1998 22:00:57 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Problem with seek.....
Message-Id: <p5ba47.4rb.ln@metronet.com>
bravo (rainman@dustyhoffman.com) wrote:
: Everything's working fun but the problem is my stuff gets appended to the
: bottom(as normal).
: What I want to do is append it to the top so the most recent info is on top.
: I am using the following code in my script.
: open(OUTF,">>data.txt");
: flock(OUTF, 8) or die "cannot unlock file: $!";
Is the file locked?
unlocking a file that isn't locked isn't going to accomplish
much of anything...
: seek(OUTF,0,0);
: But it still appends to the bottom.....
: Any suggestions?
1) write the new stuff to a temp file
2) append the old stuff to the end of the temp file
3) move the temp file over the original
(this is not how to do it if you are really using
file locking though...)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 05 Dec 1998 01:04:43 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: Regular Expression Question
Message-Id: <36688864.6E2CECB9@shaw.wave.ca>
[posted & mailed]
aschneid@cmp.com wrote:
>
> I am trying to do the following using a regular expression... any idea
>
> How do I extract the aa only?
>
> aa/bb/cc/dd/ee
>
You're a little vague about what you're really trying to do with that
example string. Oh well, here are a few ways.
#!/usr/local/bin/perl -w
$_ = 'aa/bb/cc/dd/ee';
foreach $pattern (
'..',
'aa',
'a{2}',
'^\w+',
'[^/]+',
'a.*?\b',
'.*?(?=/)',
'([^\W\dA-Z_b-z])\2',
) {
/($pattern)/ and print "$1 <= m!($pattern)!\n";
}
__END__
There are many more. perldoc perlre.
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: 4 Dec 1998 23:03:36 GMT
From: gward@thrak.cnri.reston.va.us (Greg Ward)
Subject: Re: Removing a line...
Message-Id: <749po8$9p9$4@news0-alterdial.uu.net>
R. Alcazar <alcazar@netcomp.net> wrote:
> I'm trying to remove a line from a text delimited list... a user enters
> a string. Whatever line this string is located on needs to be deleted. The
> text file looks like this (assume an indefinite amount of lines):
[example data and code deleted]
You can't do it with just one filehandle: you'll have to open the input
file, create a fresh output file, and copy all lines *except the ones
you want to delete* to the output file. Then, close both files, rename
the input file so it looks like a backup (eg. "$filename~" or
"$filename.bak"), and rename the output file to have the name of the
original input file.
That's just life when you're dealing with text files: no way around it.
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: Fri, 4 Dec 1998 21:55:34 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Removing a line...
Message-Id: <mraa47.4rb.ln@metronet.com>
Greg Ward (gward@thrak.cnri.reston.va.us) wrote:
: R. Alcazar <alcazar@netcomp.net> wrote:
: > I'm trying to remove a line from a text delimited list... a user enters
: > a string. Whatever line this string is located on needs to be deleted. The
: > text file looks like this (assume an indefinite amount of lines):
: [example data and code deleted]
: You can't do it with just one filehandle: you'll have to open the input
: file, create a fresh output file, and copy all lines *except the ones
: you want to delete* to the output file. Then, close both files, rename
: the input file so it looks like a backup (eg. "$filename~" or
: "$filename.bak"), and rename the output file to have the name of the
: original input file.
: That's just life when you're dealing with text files: no way around it.
^^^^^^^^^^^^^^^^
Unless you read the whole file into memory and then
truncate()/seek() back to the beginning, and then write
(most of) it all back out. But that is Not So Good for
large files, and an awful lot of work.
But your absolute should have been qualified somehow... ;-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 4 Dec 1998 23:33:33 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: search: script for sending form by mail
Message-Id: <749rgd$5ga@fcnews.fc.hp.com>
Erk Nissen (nissen@dasinternetbuero.de) wrote:
: hi,
: i`m looking for a really good perl script, which can send a form by mail. it
: should give a answer to the user. i will pay for it. does anybody noes?
: thanks to all.
I usually ignore these questionable requests for "hire", but this one
really irked me. This guy expects to hire/pay someone when he doesn't
use any capital letters? Or any clear definition or scope of the
needed work, or any pay ranges? This is the internet equivalent of
standing on a public sidewalk with a piece of crudely-lettered
cardboard saying "will pay for perl programming". Good grief.
: Eric
whoops-- I guess his shift key does work.
Andrew
------------------------------
Date: Fri, 04 Dec 1998 16:32:23 -0800
From: "David L. Painter" <dpainter@lightspeed.net>
Subject: Re: Seeking Win32::DES.pm
Message-Id: <36687F17.5BC38E9@lightspeed.net>
Andrew,
This is not really in response to your module problem, but I thought
that you might know something about how
to build/install/configure Perl for Win95. I've
downloaded the latest port (5.005) but don't have
any clear idea of how to proceed with the installation.
Any help, suggestions, or references would help.
Andrew Lee wrote:
>
> I know someone has written a perl module that implements DES in Win32,
> but I can not, for the life of me, find it!
>
> Any help is greatly appreciated!
>
> --
>
> Andrew F. Lee
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> When I say, "Ignore the man behind the curtain."
> That is because there is no man behind the curtain.
--
David L. Painter
Kraftwerk Web Design
dpainter@prontomail.com
dpainter@lightspeed.net
ph: 209-292-5366
fx: 209-292-0410
------------------------------
Date: Sat, 05 Dec 1998 02:25:09 GMT
From: otis@my-dejanews.com
Subject: Threads and Perl?
Message-Id: <74a5i4$c1v$1@nnrp1.dejanews.com>
Hello,
looking for thread* & perl in Dejanews wasn't very useful, so I was wondering
if anyone here could tell me what exactly is the current status of threads in
perl. Are there modules that implement threads, or should I get the latest
(developers' ?) version of perl instead of the latest perl for the masses?
I can deal with beta material, I just need it for some little scripts, nothing
big.
Thanks,
Otis
--
eZines Db - 3,000+ magazines, newspapers, journals, e-zines...
http://www.dominis.com/Zines/?dn
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 04 Dec 1998 22:49:59 +0000
From: Philip King <pking@pdq.net>
Subject: Understanding the debugger
Message-Id: <36686717.A228515F@pdq.net>
I am interested in understanding the internals of the Perl debugger (the
one shipped standard, and invoked with perl -d.) I have found the
debugger most useful in understanding the code of other utilities, and
was wondering if anyone knows of a way to invoke the debugger on the
debugger.
In other words, is there is a way to use the debugger, to step through
the code of the debugger, which happens to be stepping through a
most-likely "toy" program???
I have abandoned my study of the debugger a couple of times in the past
6 months, and I know I tried some funky invocations, but it has been a
while. The only thing that comes to mind right now is:
perl -de 'system( "perl -de 0" );'
I know this kind of thing has probably been asked before, but I can't
find it. Any help would be appreciated...
Philip
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 4362
**************************************