[12400] in Perl-Users-Digest
Perl-Users Digest, Issue: 6000 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 15 10:07:26 1999
Date: Tue, 15 Jun 99 07:00:22 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 15 Jun 1999 Volume: 8 Number: 6000
Today's topics:
alarms for win32 <dthusma@netscape.net>
Re: another href extraction question! (Abigail)
Re: Backtits and tainting <gellyfish@gellyfish.com>
Re: Backtits and tainting (Michael Fuhr)
Re: Case select statements: are they in Perl? (Bernie Cosell)
Re: Compiling regexes for the duration of a subroutine <macintsh@cs.bu.edu>
Re: Databases!! HELP!! (Abigail)
Re: Decoding Binaries from NewsGroups [ Again ] (Abigail)
Re: Dynamic Regular Expression <rick.delaney@home.com>
Re: how do I get the total space used in a directory <rootbeer@redcat.com>
Re: how do i make a Multi Dimensional array? <office@asc.nl>
Re: how do i make a Multi Dimensional array? <simon@profero.com>
Re: how do i make a Multi Dimensional array? <gellyfish@gellyfish.com>
Re: how do i make a Multi Dimensional array? <office@asc.nl>
Re: how do i make a Multi Dimensional array? (Bart Lateur)
Re: How to flush to the file each time I write a record <tchrist@mox.perl.com>
Re: Increment counter by Decials? (Abigail)
Load another html page ? <ken.patrick@msl.redstone.army.mil>
Re: Mime...Perl...MS Outlook...and HTML <cpdog@rma.edu>
Re: need a server that supports perl(cgi) (Abigail)
Re: need a server that supports perl(cgi) <office@asc.nl>
parse a string in triplet ? <cousin@ensam.inra.fr>
Re: parse a string in triplet ? <vmurphy@gamora.ndhm.gtegsc.com>
Re: parse a string in triplet ? <gellyfish@gellyfish.com>
Re: regex to replace quotes delimited by quotes. <vicuna@my-deja.com>
Re: Socket Woes <rootbeer@redcat.com>
Re: Sort on mtime (Larry Rosler)
Re: What can and should not be done in Perl (Abigail)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 15 Jun 1999 13:15:55 GMT
From: Darrin Husmann <dthusma@netscape.net>
Subject: alarms for win32
Message-Id: <376654D3.647EA344@netscape.net>
This is what I need to do in win32:
$SIG{ALRM}=\&timed_out;
eval {
alarm(10;
$rc=$conn1->rpc('$host');
alarm(0);
}
if ($@ =~ /TIME OUT/ ){ print "RPC operation timed out\n"; };
sub timed_out {
die "RPC ERR TIME OUT";
}
but I have no idea how in win32 (mutexes/ipc..?)
Any body care to show me how this is done (successfully) on win32?
------------------------------
Date: 14 Jun 1999 22:43:40 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: another href extraction question!
Message-Id: <slrn7mbjfn.cmq.abigail@alexandra.delanet.com>
slmlambert@my-deja.com (slmlambert@my-deja.com) wrote on MMCXIII
September MCMXCIII in <URL:news:7k2pre$mq2$1@nnrp1.deja.com>:
;; I am trying to extract 'a hrefs' from html files...yes I know the
;; answer is to use the Parser HTML::Parser but that is not available to
;; me.
Huh? All CPAN mirrors deny you access?
;; The problem I have is that I have read the html code into one string,
;; and I wish to search it for all instances of a regexp. For each one
;; that is found I wish to copy it to and array.
;;
;; The regexp that I am looking for is: /<a.href.*\/a>/ (i think).
Well, it seems you have found it then.
Do you have another question?
Abigail
--
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 15 Jun 1999 14:20:56 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Backtits and tainting
Message-Id: <37665338@newsread3.dircon.co.uk>
Peter Staab <staab@linopress.com> wrote:
>
>
> Marcel Grunauer wrote:
>
>> On Tue, 15 Jun 1999 11:53:28 +0200, Peter Staab <staab@linopress.com>
>> wrote:
>>
>> >How can I use the backtits ...
>>
>> Shurely shome mishtake?
>
> of course i mean backtick
>
> sorry .... but my question remains
>
You probably want to look at the perlsec manpage to see what that has to
say about tainting.
/J\
--
"Mark my words, sex is never enough. Sooner of later she'll want a
dishwasher" - Policeman, City Central
------------------------------
Date: 15 Jun 1999 07:34:40 -0600
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: Backtits and tainting
Message-Id: <7k5kpg$8mg@flatland.dimensional.com>
Peter Staab <staab@linopress.com> writes:
> 'Insecure $ENV{PATH} while running setuid '
>
> How can I use the backtits without getting these error messages or ist
> there another solution ?
See the perlsec manual page. You can also use Deja.com to see if anybody
has asked this question before:
http://www.deja.com/
Hope this helps.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
------------------------------
Date: Tue, 15 Jun 1999 13:52:10 GMT
From: bernie@fantasyfarm.com (Bernie Cosell)
Subject: Re: Case select statements: are they in Perl?
Message-Id: <376857f6.157030936@news.supernews.com>
Tom Christiansen <tchrist@mox.perl.com> wrote:
} But all the preceding versions share one critical trait: they all
} perform a series of tests sequentially. That's why we called them
} `linear switches' above. That means that they don't scale well to a
} large number of cases. Of course, this really never matters all that
} much, since in the number of different cases we're talking about here
} is virtually always too small to fret over.
}
} But any good programmer, when confronted with extremely similar code,
} has a nearly irrepressible urge to unify.
Indeed, this is to my view the real problem in making the programmer do it
instead of providing the support in the language. When I wrote the innards
of a C compiler, many many moons ago [dunno how they work thesedays!] I
actually put code into the compiler to scan the cases of a switch statement
and pick the best form for the dispatch [my memory on this is a bit shaky,
but I believe that I put in three dispatch techniques: if/else chain,
dispatch table [i.e., linear indexed array, with smart indexing [so if the
cases were 11, 12, 13, 14, 15 it would do an index on [i-11], etc]], and a
hash table.
Almost everyone at the time thought this was the right thing to do: leaving
the programmer to express the desired semantics, and leaving it to the
language processor to pick the best way to implement those semantics [and
indeed, to have those semantics change automatically [and invisibly] from
one compilation to the next depending on changes made into the cases to be
selected on].
My partial-gripe here is NOT that perl isn't expressive enough to be allow
the programmer to construct [elegantly and esthetically!] every damn select
construct known to computer science, but that it forces the programmer to
deal with all of that when the language processor could do a better job.
/Bernie\
--
Bernie Cosell Fantasy Farm Fibers
bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
------------------------------
Date: 15 Jun 1999 13:31:18 GMT
From: John Siracusa <macintsh@cs.bu.edu>
Subject: Re: Compiling regexes for the duration of a subroutine
Message-Id: <7k5kj6$kh9$1@news1.bu.edu>
Ronald J Kimball <rjk@linguist.dartmouth.edu> wrote:
> I must object to this characterization of the null regex technique as
> 'dubious'. Although it will not work for your case, as you say, I have
> put it to very good use in one of my programs for a noticeable gain in
> efficiency.
It's dubious in that it's not always possible to guarantee a
successful match to set up the regex, especially when your
subroutine has no knowledge of the regexes being passed to it.
qr(), or possibly some sort of native regex object support (that's
coming Real Soon Now, right? :) is the sloution I was looking for.
Of course, the reason I didn't find it in the docs is that I'm
running 5.004 here :-/
-----------------+----------------------------------------
John Siracusa | If you only have a hammer, you tend to
macintsh@bu.edu | see every problem as a nail. -- Maslow
------------------------------
Date: 14 Jun 1999 22:45:47 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Databases!! HELP!!
Message-Id: <slrn7mbjjj.cmq.abigail@alexandra.delanet.com>
dragnovich@my-deja.com (dragnovich@my-deja.com) wrote on MMCXIII
September MCMXCIII in <URL:news:7k38t5$s82$1@nnrp1.deja.com>:
{} Hello folks Im a good perl programmer (yea right) and now I have a big
{} problem, I need to use any kind of DB form! but I dont know nothing abou
{} t Data Bases! ... so ok this are the questions (some are not for this
{} group but i post the same message on varius news groups)
{}
{} 1.- I use PERL for programming and I have 4 servers ! 2 Windows NT IIS3,
{} and 2 FreeBSD.
{} 2.- I need some DB routines that can be used with perl in both flavors
{} of OS. You know names?? say them! (if have links! super!)
{} 3.- I dont need a ultra fast mannagers, many users or things like that!
{} I just want to start using DB with perl for Unix and NT.
{}
{} Well I hope you can send me some examples and/or links please!! =-)
http://www.sybase.com
http://www.oracle.com
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 14 Jun 1999 22:46:56 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Decoding Binaries from NewsGroups [ Again ]
Message-Id: <slrn7mbjls.cmq.abigail@alexandra.delanet.com>
Thomas Weholt (thomas@bibsyst.no) wrote on MMCXII September MCMXCIII in
<URL:news:376438E3.40FD0B0A@bibsyst.no>:
::
:: Is there a module or simple code that decodes binary files from
:: newsgroups?
Yes. It's even in the Camel. Look for pack/unpack.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 15 Jun 1999 13:06:00 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Dynamic Regular Expression
Message-Id: <37664F73.241B3F66@home.com>
[posted & mailed]
Bart Lateur wrote:
>
> [B] how qr// could possibly help in constructing the tests like this:
>
> query test (Perl code)
> a /a/
> a b /a/ && /b/
> a b c /a/ && /bb/ && /c/
It doesn't help in constructing the tests but in saving the (compiled)
patterns for testing multiple times. Regardless, you still don't need
eval for these.
# /a/ && /b/
my @pats = map { qr "\b$_\b" } qw/a b/;
for my $x ('a b', 'a bc', 'ab', 'b a', 'abc', 'a b c') {
if (grep( $x =~ $_, @pats) == @pats) {
print "$x\n";
}
}
Combining ands and ors is a different story. But a couple of posts have
pointed to a module that would deal with that.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Tue, 15 Jun 1999 06:52:17 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: how do I get the total space used in a directory
Message-Id: <Pine.GSO.4.02A.9906150634210.4196-100000@user2.teleport.com>
On Mon, 14 Jun 1999, Robert O'Brien wrote:
> I am trying to run this script on a Solaris box. Basically trying to
> emulate du(1). None of the fields I get or simple math on them work
> eg (nblks / blksize) give the same size as
> du -sk /dir1
Don't forget to include the dotfiles, and the space taken by the directory
itself.
> while( $line = <DIRS_TO_CHECK> )
> {
> $line =~ chomp $line;
That's not the way to use chomp. In fact, you generally shouldn't use the
return value from chomp at all.
> print "\$dir = $dir\n";
What's $dir?
> @file_info = stat( $line );
> $blk_size = (stat( $line )) [12];
> $mtime = (stat( $liner )) [9];
Once you have a value in @file_info, you don't need to call stat again and
again.
> Is there a better / smarter way to do this? Can do this in various
> shells using du, but am trying to learn Perl.
Well, du isn't perfect, either; its manpage says that files containing
holes and multiply-linked files may mess up the count. (And you should be
able to read that manpage with the command 'cat man du', don't you think?)
But check the source for du: If you really want your program to give
exactly the same results as du, do as du does. :-)
> Will also want to specify regexps in the file I'm reading
I think you want to use patterns to match the returned values from
readdir. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 15 Jun 1999 15:06:31 +0200
From: "Bastiaan S van den Berg" <office@asc.nl>
Subject: Re: how do i make a Multi Dimensional array?
Message-Id: <7k5j7u$t54$1@zonnetje.NL.net>
great , found it , tnx :)
you wouldn't be any chance know why this does work
$config = substr($ENV{'HTTP_COOKIE'},7) || print "Set-Cookie: config=1\n";
and this doesn't ?
$config = substr($ENV{'HTTP_COOKIE'},7) or { print "Set-Cookie: config=1\n";
$config=1;
};
i really need $config to be set
and i can't seem to be able to use
if !defined $config {$config=1};
--
Bastiaan v/d Berg ; aka buZz
Internet Specialist
Account Software Consultancy
-[ http://www.asc.nl/ ]-[ office@asc.nl ]-
-[ http://huizen.ddsw.nl/bewoners/buzz/ ]-[ buzz@ddsw.nl ]-
------------------------------
Date: Tue, 15 Jun 1999 14:21:38 +0100
From: Simon <simon@profero.com>
Subject: Re: how do i make a Multi Dimensional array?
Message-Id: <37665362.D196E371@profero.com>
Bastiaan S van den Berg wrote:
> you wouldn't be any chance know why this does work
>
> $config = substr($ENV{'HTTP_COOKIE'},7) || print "Set-Cookie: config=1\n";
>
> and this doesn't ?
>
> $config = substr($ENV{'HTTP_COOKIE'},7) or { print "Set-Cookie: config=1\n";
> $config=1;
> };
Something to do with the relative binding strengths of || and 'or' possibly
Look at
ftp://ftp.spu.edu/pub/CPAN/doc/manual/html/pod/perlop.html#C_style_Logical_Or
"
As more readable alternatives to && and || when used for control flow, Perl
provides and and or operators (see below). The short-circuit behavior is
identical. The precedence of ``and'' and ``or'' is much lower, however, so that
you can safely use them after a list operator without the need for parentheses:
unlink "alpha", "beta", "gamma"
or gripe(), next LINE;
With the C-style operators that would have been written like this:
unlink("alpha", "beta", "gamma")
|| (gripe(), next LINE);
Use ``or'' for assignment is unlikely to do what you want.
"
------------------------------
Date: 15 Jun 1999 14:24:18 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: how do i make a Multi Dimensional array?
Message-Id: <37665402@newsread3.dircon.co.uk>
Bastiaan S van den Berg <office@asc.nl> wrote:
> great , found it , tnx :)
>
>
> you wouldn't be any chance know why this does work
>
> $config = substr($ENV{'HTTP_COOKIE'},7) || print "Set-Cookie: config=1\n";
>
> and this doesn't ?
>
> $config = substr($ENV{'HTTP_COOKIE'},7) or { print "Set-Cookie: config=1\n";
> $config=1;
> };
^
|
or do
/J\
--
"Two or three of our staff were stoned on their way to work" - British
Airways Spokesman
------------------------------
Date: Tue, 15 Jun 1999 15:29:18 +0200
From: "Bastiaan S van den Berg" <office@asc.nl>
Subject: Re: how do i make a Multi Dimensional array?
Message-Id: <7k5kik$pa$1@zonnetje.NL.net>
>Something to do with the relative binding strengths of || and 'or' possibly
nope , that's not it , it doesn't work with || either , nor with or
hmm , maybe.. i'll get back to you :)
--
Bastiaan v/d Berg ; aka buZz
Internet Specialist
Account Software Consultancy
-[ http://www.asc.nl/ ]-[ office@asc.nl ]-
-[ http://huizen.ddsw.nl/bewoners/buzz/ ]-[ buzz@ddsw.nl ]-
------------------------------
Date: Tue, 15 Jun 1999 13:44:15 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: how do i make a Multi Dimensional array?
Message-Id: <37665887.26971470@news.skynet.be>
Bastiaan S van den Berg wrote:
>i really need $config to be set
>and i can't seem to be able to use
>
>if !defined $config {$config=1};
Maybe because you forgot the parentheses around the condition?
Bart.
------------------------------
Date: 15 Jun 1999 07:24:57 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to flush to the file each time I write a record to a file?
Message-Id: <37665429@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
"Howel88" <howel@edge.com.sg> writes:
:Anyone knows how to flush each time I write a record to a file?
What part of the very first question in the standard perlfaq5
manpage distributed with perl requires further clarification
before you won't ask this question again? :-(
NAME
perlfaq5 - Files and Formats ($Revision: 1.38 $, $Date:
1999/05/23 16:08:30 $)
DESCRIPTION
This section deals with I/O and the "f" issues: filehandles,
flushing, formats, and footers.
How do I flush/unbuffer an output filehandle? Why must I do this?
The C standard I/O library (stdio) normally buffers characters
sent to devices. This is done for efficiency reasons, so that
there isn't a system call for each byte. Any time you use
print() or write() in Perl, you go though this buffering.
syswrite() circumvents stdio and buffering.
In most stdio implementations, the type of output buffering and
the size of the buffer varies according to the type of device.
Disk files are block buffered, often with a buffer size of more
than 2k. Pipes and sockets are often buffered with a buffer size
between 1/2 and 2k. Serial devices (e.g. modems, terminals) are
normally line-buffered, and stdio sends the entire line when it
gets the newline.
Perl does not support truly unbuffered output (except insofar as
you can `syswrite(OUT, $char, 1)'). What it does instead support
is "command buffering", in which a physical write is performed
after every output command. This isn't as hard on your system as
unbuffering, but does get the output where you want it when you
want it.
If you expect characters to get to your device when you print
them there, you'll want to autoflush its handle. Use select()
and the `$|' variable to control autoflushing (see the section
on "$|" in the perlvar manpage and the "select" entry in the
perlfunc manpage):
$old_fh = select(OUTPUT_HANDLE);
$| = 1;
select($old_fh);
Or using the traditional idiom:
select((select(OUTPUT_HANDLE), $| = 1)[0]);
Or if don't mind slowly loading several thousand lines of module
code just because you're afraid of the `$|' variable:
use FileHandle;
open(DEV, "+</dev/tty"); # ceci n'est pas une pipe
DEV->autoflush(1);
or the newer IO::* modules:
use IO::Handle;
open(DEV, ">/dev/printer"); # but is this?
DEV->autoflush(1);
or even this:
use IO::Socket; # this one is kinda a pipe?
$sock = IO::Socket::INET->new(PeerAddr => 'www.perl.com',
PeerPort => 'http(80)',
Proto => 'tcp');
die "$!" unless $sock;
$sock->autoflush();
print $sock "GET / HTTP/1.0" . "\015\012" x 2;
$document = join('', <$sock>);
print "DOC IS: $document\n";
Note the bizarrely hardcoded carriage return and newline in
their octal equivalents. This is the ONLY way (currently) to
assure a proper flush on all platforms, including Macintosh.
That's the way things work in network programming: you really
should specify the exact bit pattern on the network line
terminator. In practice, `"\n\n"' often works, but this is not
portable.
See the perlfaq9 manpage for other examples of fetching URLs
over the web.
--
f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng.
------------------------------
Date: 14 Jun 1999 22:56:58 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Increment counter by Decials?
Message-Id: <slrn7mbk8l.cmq.abigail@alexandra.delanet.com>
Trent (trent@jps.net) wrote on MMCXIII September MCMXCIII in
<URL:news:3765f095@news1.jps.net>:
## Nothing in Deja,
## Nothing found in FAQ.
##
## Is it possible to increment a counter
## by anything other than 1?
Uhm, uhm, add something else than 1 to it? Nah.... it can't be that simple.
You probably need to hire a voodoo priest, a flock of black goats, a
multitude of black candles, and a dozen sharp, silver knives.
## if (($customerdata[25] =~ /sold/i) && ($customerdata[4] =~ /$salesperson/i)
## || ($customerdata[24] =~ /$salesperson/i)){
## $saw_sold{$salesperson}++;
## }
##
## I need to increment the counters by (.5) for each match found, instead
## of just by (1).
Consult with the voodoo priest mentioned above. Adding .5 to something
is very, very hard. And be patient. It might take a week of chanting
holy prayers and drinking gallons of blood.
## Manipulating the count after sorting the keys doesen't work in this case.
##
## Is there a way?
Yes, yes, yes. Voodoo is the way to go.
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 15 Jun 1999 05:23:16 -0800
From: Ken Patrick <ken.patrick@msl.redstone.army.mil>
Subject: Load another html page ?
Message-Id: <929452998.24162@www.remarq.com>
In a Perl script how do you reference an html page.
i.e.
if <cond>
load html page
Please email me.
Thanks.
**** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****
------------------------------
Date: Tue, 15 Jun 1999 13:48:44 GMT
From: "Tim Clark" <cpdog@rma.edu>
Subject: Re: Mime...Perl...MS Outlook...and HTML
Message-Id: <0Rs93.22$oW.4653@news.cwix.com>
Well, when I do this, outlook thinks its plain text and displays the HTML
tags from $mesg_text, which is hte problem. GRRR!!! Why is outlook so
freaky?!?
> Works fine for me:
>
> my $mesg_text = <<ETY;
> <HTML>
>
> # Bunch of HTML snipped
>
> </HTML>
> ETY
> # Create a new multipart message:
> my $msg = new MIME::Lite
> To => '*************
<*************@internal.dircon.net>',
> Cc => '***********
<***********@internal.dircon.net>, **************
<**************@internal.dircon.net>',
> Bcc => 'jonathan.stowe@internal.dircon.net',
> From =>'Jonathan Stowe
<tdcjs@fatmog.dircon.net>',
> Reply-to => 'jonathan.stowe@dircon.net',
> Subject =>'Radius Statistics',
> Type =>'text/html',
> Data =>$mesg_text;
>
> $msg->send;
>
>
> This works fine and displays the message correctly on my Outlook and the
> various other Mail clients that the other recipients might use ...
------------------------------
Date: 14 Jun 1999 22:27:27 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: need a server that supports perl(cgi)
Message-Id: <slrn7mbihb.cmq.abigail@alexandra.delanet.com>
Leonid Goltser (leonid76@erols.com) wrote on MMCXIII September MCMXCIII
in <URL:news:7k1op3$7vm$1@autumn.news.rcn.net>:
"" Can anybody suggest a server, where I can upload my perl(cgi) scripts?
127.0.0.1
Abigail
--
perl -weprint\<\<EOT\; -eJust -eanother -ePerl -eHacker -eEOT
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 15 Jun 1999 15:19:22 +0200
From: "Bastiaan S van den Berg" <office@asc.nl>
Subject: Re: need a server that supports perl(cgi)
Message-Id: <7k5k03$co$1@zonnetje.NL.net>
>"" Can anybody suggest a server, where I can upload my perl(cgi) scripts?
>
>
>127.0.0.1
hahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahaha
hahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahaha
hahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahaha
hahahahahahahahahahahahahahahahahahahahahahahahahaha
great :)
--
Bastiaan v/d Berg ; aka buZz
Internet Specialist
Account Software Consultancy
-[ http://www.asc.nl/ ]-[ office@asc.nl ]-
-[ http://huizen.ddsw.nl/bewoners/buzz/ ]-[ buzz@ddsw.nl ]-
------------------------------
Date: Tue, 15 Jun 1999 14:59:52 +0200
From: Xavier Cousin <cousin@ensam.inra.fr>
Subject: parse a string in triplet ?
Message-Id: <37664E48.59FC0DE7@ensam.inra.fr>
Hello, I would like to parse a long string in triplets :
a DNA sequence e.g. ACTGTGCATGACG...
in triplets : ACT+GTG+CAT+GAC+G...
I try to find indication on how to do this until the begining string
(which could be a non 3 multiple) ends. But no success... I know how to
do this once with substr but if i try to use a while loop, it loops and
never ends...
Thanks for your help.
Xavier
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Xavier Cousin cousin@ensam.inra.fr
INRA - DCC tel. (33) 04 99 61 28 14
2, place Pierre Viala fax (33) 04 67 54 56 94
34060 Montpellier Cedex 1
ESTHER URL http://www.ensam.inra.fr/cholinesterase/
------------------------------
Date: 15 Jun 1999 09:28:52 -0400
From: Vincent Murphy <vmurphy@gamora.ndhm.gtegsc.com>
Subject: Re: parse a string in triplet ?
Message-Id: <xjg3dztvbhn.fsf@gamora.ndhm.gtegsc.com>
>>>>> "Xavier" == Xavier Cousin <cousin@ensam.inra.fr> writes:
Xavier> Hello, I would like to parse a long string in triplets :
Xavier> a DNA sequence e.g. ACTGTGCATGACG...
Xavier> in triplets : ACT+GTG+CAT+GAC+G...
Xavier> I try to find indication on how to do this until the begining string
Xavier> (which could be a non 3 multiple) ends. But no success... I know how to
Xavier> do this once with substr but if i try to use a while loop, it loops and
Xavier> never ends...
my $dna = 'ACTGTGCATGACG';
my @triplets = $dna =~ /\w{3}/g;
print map {"$_\n"} @triplets;
See perldoc perlre and J. Friedl's _Mastering Regular Expressions_ for more
details.
HTH
--
Vinny Murphy
------------------------------
Date: 15 Jun 1999 14:31:36 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: parse a string in triplet ?
Message-Id: <376655b8@newsread3.dircon.co.uk>
Xavier Cousin <cousin@ensam.inra.fr> wrote:
> Hello, I would like to parse a long string in triplets :
>
> a DNA sequence e.g. ACTGTGCATGACG...
>
> in triplets : ACT+GTG+CAT+GAC+G...
>
> I try to find indication on how to do this until the begining string
> (which could be a non 3 multiple) ends. But no success... I know how to
> do this once with substr but if i try to use a while loop, it loops and
> never ends...
>
$string='ACTGTGCATGACGACTGTGCATGACG';
while($string =~ /(.{3})/g)
{
print $1,"\n";
}
# or
@array = $string=~ /(.{3})/g;
print join "\n",@array;
/J\
--
"He is marvelous at beating men and achieving real penetration" -
Alex Ferguson
------------------------------
Date: Tue, 15 Jun 1999 12:16:15 GMT
From: Vicuna <vicuna@my-deja.com>
Subject: Re: regex to replace quotes delimited by quotes.
Message-Id: <7k5g69$kg7$1@nnrp1.deja.com>
In article <MPG.11cf30545be83787989be0@nntp.hpl.hp.com>,
lr@hpl.hp.com (Larry Rosler) wrote:
> [Posted and a courtesy copy mailed.]
>
> In article <7k3lfi$1gj$1@nnrp1.deja.com> on Mon, 14 Jun 1999 19:34:10
> GMT, Vicuna <vicuna@my-deja.com> says...
> > Greetings.
> >
> > Task: strings must have delimiting quotes but also maybe quotes
within
> >
> > my $example = '123 "She said: "What you say""';
> > my $example2 = ' "sometimes " there is a stray";
>
> Want you this string to terminate?
>
> > all quotes between outer most quote must be replaced by two quotes;
> > $example = '123 "She said: ""What you say"""';
> > $example2 = ' "sometimes "" there is a stray";
> >
> > My work:
> >
> > s/"(.*)"/$_=$1;s|"|""|g;'"'.$_.'"'/e;
> >
> > Challenge: more elegent solution? Perhaps wrong am I?
>
> Yoda are you?
> In input assuming one no more than one quotation, trivially nicer-
> looking these solutions might be, your taste depending on:
>
> s/"(.*)"/$_ = $1; s|"|""|g; qq{"$_"}/e;
> s/"(.*)"/"${$_ = $1; s|\"|\"\"|g; \$_}"/;
Thanking you I am.
Larry king is.
;-)
~V~
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 15 Jun 1999 06:32:43 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Socket Woes
Message-Id: <Pine.GSO.4.02A.9906150630080.4196-100000@user2.teleport.com>
On Mon, 14 Jun 1999, Morgan Whaley wrote:
> I am writing a server pgm & need to determine the absence vs. presence
> of a client connection to a server socket.
Don't the return values from the system calls tell you what you need?
> I've tried
>
> while (<CLIENT>){
> ....
> }
>
> but never encounter the expected results.
What were the expected results, and how did the actual results differ?
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 15 Jun 1999 06:47:02 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Sort on mtime
Message-Id: <MPG.11cff92dfbd0dabb989be3@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <37660ab3@newsread3.dircon.co.uk> on 15 Jun 1999 09:11:31
+0100, Jonathan Stowe <gellyfish@gellyfish.com> says...
...
> That should be grep !/^\.{1,2}$/
...
> At least one but no more than two '.'s - some prefer:
>
> /^\.\.?$/
>
> Which is the same in effect being a '.' followed by zero or one '.'s
> (And one less character for LR).
That is *two* fewer characters, dumdum! Do you think I would waste my
time for just one character? <Ducking, because I probably would ;->
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 14 Jun 1999 22:38:15 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: What can and should not be done in Perl
Message-Id: <slrn7mbj5j.cmq.abigail@alexandra.delanet.com>
Neil (neil@pacifier.com) wrote on MMCXIII September MCMXCIII in
<URL:news:37657bf6.0@news.pacifier.com>:
## I am interested in hearing what things -- small and large -- that people have## [NEWLINE INSERTED]done in Perl. And I am
## interested in what things should not be done in Perl and why. Thank you.
Well, I've dreamed in Perl.
And I can certainly recommend to not driving downtown in Perl.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
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 6000
**************************************