[8218] in Perl-Users-Digest
Perl-Users Digest, Issue: 1836 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 9 09:18:05 1998
Date: Mon, 9 Feb 98 06:01:07 -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 Mon, 9 Feb 1998 Volume: 8 Number: 1836
Today's topics:
Re: <META HTTP-EQUIV="Refresh: QUESTION (Mikael Skogstrom)
Attn Programmers: Get listed in CGI City <cgicity@icthus.net>
Re: Being Nice 2 Nice Beings [Was: Reading The FAQ's et <bcoleman@mindspring.com>
FormMail not Mime-capable? (Mikael Skogstrom)
Re: Generic Config-file maintenance (Philip Freed)
help: how to remove html tags from a file with perl? (Alex Dong Li)
Re: How Do I Tell Whether a Key Is Valid for an Associa (M.J.T. Guy)
Re: How to get a listing of the file that is linked? (Michael Wang)
Humour a newbie time... :) (Mr S A Penny)
Re: Linux - Perl Set Up - One Tweak Short <xxTony.Curtis@vcpc.univie.ac.at>
Re: More regular expressions (Mikael Skogstrom)
Named Pipe problem <ccu@sbk-ks.de>
Re: New Perl book reviews (Mikael Skogstrom)
Newbie:Perl Modules <Mike.ware@gbjha.zeneca.com>
Perl <--> ODBC. <paul@u-netsys.com.br>
Re: Perl in a datawarehouse environment <marc@pc216.farm.rug.nl>
perl/oracle7/oracle8/modules <Laurent.Deperthes@renault.com>
Perl/Tk and C++ exceptions <beg@mrl.sps.mot.com>
Problems with sorting a hash by value <jure.simsic@uni-lj.si>
Re: Problems with sorting a hash by value <xxTony.Curtis@vcpc.univie.ac.at>
Q: Using unpack or split to get fixed-length substrings <Morten.Andersen@molbio.uu.se>
Re: Quickie: regexp for valid e-mail addresses (Bart Lateur)
Re: Quickie: regexp for valid e-mail addresses (Bart Lateur)
Re: Sending a message to a pager <c.evans@clear.net.nz>
Re: sending files with email (Mikael Skogstrom)
Re: Sharing variables between scripts (Mikael Skogstrom)
Re: solution for multiline comments??? (Bart Lateur)
sorting an associative array <hvanlint@lodestar.be>
Re: Unpack float (Bart Lateur)
Re: Using flock? (Mikael Skogstrom)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 09 Feb 1998 13:57:58 +0100
From: mikael@techtalk.se (Mikael Skogstrom)
Subject: Re: <META HTTP-EQUIV="Refresh: QUESTION
Message-Id: <B104BBE6966810F100@du164-248.ppp.algonet.se>
In article <01bd34f0$e681bee0$86d548a6@slip166-72-213-134.ut.us.ibm.net>,
"Charles Wilkins" <thehelm@ibm.net> wrote:
>Is there an equivalent to <META HTTP-EQUIV="Refresh"
>Content="10;URL=http://www.anywhere.com"> that
>will work in the perl script.
As the Meta-tag suggests, the refresh is part of the HTTP protocol.
Consequently you can have the script print an HTML page containing the Meta
tag, which will then be returned to the client, resulting in the same
behaviour as the tag ordinarily would do.
Mikael
------------------------------
Date: Mon, 09 Feb 1998 03:21:28 -0600
From: CGI City <cgicity@icthus.net>
Subject: Attn Programmers: Get listed in CGI City
Message-Id: <887015440.2064646152@dejanews.com>
Check out CGI City at
http://icthus.net/CGI-City/
CGI/Perl programmers can post their sites for free under the "Help
Offered" section. People looking for programmers can post their ads
under the "Help Wanted" section.
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Mon, 09 Feb 98 03:25:31 +0400
From: "Ben Coleman" <bcoleman@mindspring.com>
Subject: Re: Being Nice 2 Nice Beings [Was: Reading The FAQ's etc.: a teacher's perspective...]
Message-Id: <wvvmcdbckiyzhum.pminews@user-38lclso.dialup.mindspring.com>
On Sun, 08 Feb 1998 14:38:07 -0800, Denis Goddard wrote:
>When a Wizard says, "RTFM, you moron"
Note that there are two parts to this:
"RTFM" - there's nothing wrong with this. When the answer is already
in the FAQ, or the distributed docs, etc, there's no need to require
the Wizard to spend time composing Yet Another Rehashing Of The
Answer.
"you moron" - this, of course, we could do without.
Ben
--
Ben Coleman NJ8J | The attempt to legislatively
Internet: bcoleman@mindspring.com | micromanage equality results, at
http://bcoleman.home.mindspring.com/ | best, in equal misery for all.
------------------------------
Date: Mon, 09 Feb 1998 11:08:11 +0100
From: mikael@techtalk.se (Mikael Skogstrom)
Subject: FormMail not Mime-capable?
Message-Id: <B104941B9668796B8@du35-155.ppp.algonet.se>
Hi,
I'm trying to use FormMail, from Matt's Script Archive, to have form
replies sent to an e-mail address. Since the the service is aimed towards
Swedish users the replies will contain some letters that are unique to
Swedish. These are all handled by Latin-1 and ISO 8859-1, but not by Matt's
FormMail. Is there anyone who have made a rewrite of the script?
Kindly,
Mikael Skogstrvm
------------------------------
Date: Mon, 09 Feb 1998 07:34:42 GMT
From: phil@freed.com (Philip Freed)
Subject: Re: Generic Config-file maintenance
Message-Id: <34dfa420.56877545@newsfeed1.cybertours.com>
I wrote:
>I'd like to maintain a number of config files to be used by various
>Perl utilities. Before I start writing code,
>[...]
Thanks to all for your help. It seems that this project could be
divided into two pieces:
1) config file maintenance, and
2) use of the rules/restrictions implied by the config files
For part (1), I found that Andy's App::Config could be very useful.
It was my original intent to keep the config in a simple text file,
and to write a consistency checker to verify that folks hadn't messed
them up. Using Andy's module for maintenance makes config errors much
less likely.
As for writing the config file in Perl as Tom suggested - it's a great
idea, but it severly limits who I'd allow to maintain it. I'd much
rather create a simple-minded (or even fancy-minded) config file
"languague" with the parser written in Perl.
>Of the modules already out there Resources is the most complete
This seems like it might be very useful. Thanks for the tip.
>What you wrote reminds me of xml, perhaps you should look at atleast
>using psuedo xml for your module.
A very good point. I hadn't thought of it - but then, I've never
played with SGML (beyond HTML :^). This might be a good opportunity
to learn more about it.
As for your offer of source code - yes, thanks. Although I'm likely
to use Resources for the project at hand, there are several apps down
the road for which a light-weight solution would be more appropriate.
I'd almost always rather start a project on the shoulders of someone
else. It may save me some time, and/or it may allow me to add
improvements that you might find useful.
I'm much obliged for all of your help.
--phil <phil@freed.com>
------------------------------
Date: Sun, 08 Feb 1998 19:56:28 GMT
From: ali@genet.sickkids.on.ca (Alex Dong Li)
Subject: help: how to remove html tags from a file with perl?
Message-Id: <6bko0p$2gn$1@resunix.sickkids.on.ca>
Hello, there,
I need to remove 4 html tags from the following line (it is a single, long
line):
<a
href="http://www.ncbi.nlm.nih.
gov/htbin-post/Entrez/query?
form=6&dopt=g&db=n&uid=02781378">gb|AC004014|AC004014</a> Human BAC clone
RG022K14 from 7q22-q31, co... <a href = #2781378>351</a> 2e-95
I used the following code:
if ($line=~m/<[^>]+>/) {
$line=~s/$&//g;
}
but it cannot remove any html tag in the above line at all!
Could anyone help me on this?
Thanks in advance!
Alex Dong Li
------------------------------
Date: 9 Feb 1998 13:35:10 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: How Do I Tell Whether a Key Is Valid for an Associative Array?
Message-Id: <6bn0me$9ud$1@lyra.csx.cam.ac.uk>
Vladimir Alexiev <vladimir@cs.ualberta.ca> wrote:
>In article <6b677j$3cu@bgtnsc03.worldnet.att.net> Joe Gottman <joegottman@nospam.worldnet.att.net> writes:
>
>> $foo{'bar'} = undef();
>undef()? That's a weird way to write the constant undef.
Well, it's the safe way, especially when you have more complicated
expressions. Compare
perl -e 'undef ? 0 : 1'
and
perl -e 'undef() ? 0 : 1'
(Not intending to be a useful program, but illustrating what lurks in
Perl's syntactic undergrowth. )
Mike Guy
------------------------------
Date: 9 Feb 1998 12:14:05 GMT
From: mwang@alhena.ibk.ml.com (Michael Wang)
Subject: Re: How to get a listing of the file that is linked?
Message-Id: <6bmrud$2il$1@news.ml.com>
use GNU find:
find . -follow -printf %t -print
the -follow will follow symbolic link and -printf %t
will give the time in one of the forms.
In article <34DF946D.CCB74EB2@iris.eee.ntu.edu.sg>,
<benny@iris.eee.ntu.edu.sg> wrote:
>Hi,
>
> I would like to know the time stamp of a file, but if it is
>symlinked, i got to cd to that
> directory to check on that file.
> How can i script perl in the way to check for the sym link then get
>the real time stamp
> from the file?
>
> eg :
>
> lrwxr-xr-x 1 root sys 17 Dec 13 1994 /usr/bin/foo ->
>../lib/free/bar #linked file
> -rwxr-xr-x 1 root sys 65 Dec 19 10:45 /usr/lib/free/bar
>
> Desired result :
>
> filename : /usr/lib/free/bar
> date : Dec 19
> Time : 10:45
> mode : -rwxr-xr-x
>
>
> Benny
> benny@iris.eee.ntu.edu.sg
>
> PS : would be happy if replies thru my email as well as thru the
>newsgroup
>
>
------------------------------
Date: 7 Feb 1998 22:20:27 -0000
From: phuae@csv.warwick.ac.uk (Mr S A Penny)
Subject: Humour a newbie time... :)
Message-Id: <6bimnb$19s@lily.csv.warwick.ac.uk>
I have a couple of questions to ask. Firstly is there a FAQ associated with
this NG? if so where is it? Also I would like to know of any recomended perl
tutorial sites on the internet. I have a project to do in the next 4 weeks
and the lecturer is so dire that I seriously can't remember a single word he's
said over the last term and a half!
SammyTheStressing
--
SammyTheSnake@HotMail.com
PHUAE@Warwick.ac.uk S.A.Penny@Warwick.ac.uk
http://www.geocities.com/Athens/Forum/3353/
Today I am struggling to get back into a working state of mind...
------------------------------
Date: 09 Feb 1998 09:52:31 +0100
From: Remove xx to reply <xxTony.Curtis@vcpc.univie.ac.at>
Subject: Re: Linux - Perl Set Up - One Tweak Short
Message-Id: <7xbtwhxir4.fsf@beavis.vcpc.univie.ac.at>
Re: Linux - Perl Set Up - One Tweak Short, gatman
<gatman@gate.nospam.net> said:
gatman> Linux Redhat 4.2 - Netscape 4.04 and Perl 5.04 all
Which web server are you using? That's the big question
here...
gatman> Perl scripts execute fine from the command line.
You are using CGI.pm and/or the CGI modules I hope?
gatman> I have checked Netscape helper applications and
gatman> .conf files pointing to cgi-bin. Appears ok - but
Hmmm, is it apache?
gatman> don't know if this may be area of problem?
The execution of perl scripts by a server is of course a
server-side problem and the solution therefore depends on
which server you are running.
You'll need to check your server documentation. Questions
posted to a newsgroup related to the server will gain more
enlightening answers :-)
hth
tony
------------------------------
Date: Mon, 09 Feb 1998 13:57:59 +0100
From: mikael@techtalk.se (Mikael Skogstrom)
Subject: Re: More regular expressions
Message-Id: <B104BBE7966810F160@du164-248.ppp.algonet.se>
In article <ThomaJA-0802981856330001@magmysmac.lfc.edu>,
ThomaJA@LFC.EDU (Mike Binkley) wrote:
>Is there a way that I can search for the string (=), but do nothing if it
>is part of the larger string (:=)?
This should do it:
s/(^:)=/$1 = /
Explaination: If the character preceding the = sign _is not_ a colon, then
do the substitution by first putting the preceding character in the memory,
then recall it on the substitution side, also adding a space on each side
of the = sign.
Mikael
------------------------------
Date: 9 Feb 1998 12:45:19 GMT
From: "Carl K. Cunningham" <ccu@sbk-ks.de>
Subject: Named Pipe problem
Message-Id: <01bd3558$13060e00$490e10c1@opal.sbk-ks.de>
Hi folks, I'm having a bit of a problem with a named pipe, and could use
some help. I have an itty-bitty perl program that will for example write
sequential numbers into an existing named pipe:
#---------------------------------------------
#! /usr/bin/perl
$Pipefile = "testfifo.txt" ;
$a = 1 ;
for (;;) {
open(TEST,$Pipefile) || die ;
select(TEST) ;
print(TEST $a,"\n") ;
close(TEST) ;
$a++ ;
}
#---------------------------------------------
If I fire this up and acces the named pipe just using "cat", everything
works dandy.
If however I access it using something like:
#---------------------------------------------
#! /usr/bin/perl
$Pipefile = "testfifo.txt" ;
open(TEST,$Pipefile) || die ;
while (<TEST>) {
print(STDOUT $_) ;
}
#---------------------------------------------
I get at time very unreliable results. In particular if I access the named
pipe using a web server, I sometimes get a runaway process that keeps on
writing to the pipe.
Any ideas?
Carl K. Cunningham
------------------------------
Date: Mon, 09 Feb 1998 13:58:01 +0100
From: mikael@techtalk.se (Mikael Skogstrom)
Subject: Re: New Perl book reviews
Message-Id: <B104BBE9966810F1B0@du164-248.ppp.algonet.se>
In article <34DE46DE.755A@ultranet.com>,
Bob Trieger <corky@ultranet.com> wrote:
>Sorry, you can't say it is a list for beginners without mentioning the
>Llama first. The Llama is by far the best perl primer.
Agree fully. Started with that one myself (even though I'm a former Pascal
programmer and was recommended the more wellknown Camel book; "Programming
Perl"). Each chapter covers a group of related functions and is also
accompanied by a set of exercises.
Mikael
------------------------------
Date: Mon, 9 Feb 1998 11:19:57 -0000
From: "Mike Ware" <Mike.ware@gbjha.zeneca.com>
Subject: Newbie:Perl Modules
Message-Id: <6bmom6$q4p@mailhost.zeneca.co.uk>
I'm new to perl and trying to use some of the perl modules suplied with the
install of perl, which is version 5.003_07 by ActiveWare on an NT4 server.
My registry now has HKLM,SOFTWARE, ActiveWare, Perl5 with PRIVLIB set to
c:\perl\lib and BIN to c:\perl\bin so I guess thats ok and if I type :-
perl -e "$, ='':print@INC"
i get
i386-win32C:\PERL\lib.
so far so good ?
however when I try to write a script which uses a module e.g the
file:copy.pm I am returned the error "Unable to locate copy.pm in @INC"
even if I push the path onto the INC array at the beginning of the script.
I am obviously missing something simple here. So forgive my stupidity and
HELP!!
Thanks in advance
Mike
------------------------------
Date: Mon, 09 Feb 1998 07:35:29 -0200
From: "Paulo C. Marques F." <paul@u-netsys.com.br>
Subject: Perl <--> ODBC.
Message-Id: <34DEDBF1.F8951C27@u-netsys.com.br>
Hi,
I am using Perl5 (latest version) in a FreeBSD 2.2.5
box. I would like to access a database in a remote
machine using ODBC (I don't have the ODBC
drivers for any of the databases, installed in the
FreeBSD box).
I use DBI. But to use DBD-ODBC I probably
need an ODBC driver for my FreeBSD client box. Is there
any Freeware ODBC driver to do this Perl5 / FreeBSD / ODBC
stuff?
Thanks in advance,
Paulo Marques.
------------------------------
Date: 09 Feb 1998 10:04:33 +0100
From: Marc Weeber <marc@pc216.farm.rug.nl>
Subject: Re: Perl in a datawarehouse environment
Message-Id: <86en1dtahq.fsf@pc216.farm.rug.nl>
jdf@pobox.com (Jonathan Feinberg) writes:
>
> tchrist@mox.perl.com said...
> > In comp.lang.perl.misc, eweiss@winchendon.com (Eric Weiss) writes:
> > :And coming
> > :soon (...real soon :-) ) is a Perl compiler.
> >
> > Which is not what anyone thinks it is. The compiler does not make
> > your program smaller in size, faster in run-time, more portable, more
> > maintainable, more secure, nor more robust. In fact, it diminishes all
> > those things.
>
> Which is exactly what my company has been looking for. I'm very excited.
> Where can we find out more about this exciting new technology?
>
hmm... souds like you're company is Microsoft?
(Sorry, but this one was so easy :-)
Marc
> --
> Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
--
------------------------------------------------------------------
Marc Weeber http://pc216.farm.rug.nl/marc
Groningen University Centre for Pharmacy
marc@farm.rug.nl Social Pharmacy and Pharmacoepidemiology
tel: +31 50 3637571 ___ A. Deusinglaan 2
fax: +31 50 3633311 | 9713 AW Groningen, The Netherlands
----------------------0-------------------------------------------
------------------------------
Date: Mon, 09 Feb 1998 11:18:44 +0100
From: Laurent Deperthes <Laurent.Deperthes@renault.com>
Subject: perl/oracle7/oracle8/modules
Message-Id: <34DED804.EA07CDBD@renault.com>
hello , is there a way to access oracle databases
directly in perl with a module or not like :
a = `select foo,bar from database`
and get the vars foo & bar un perl
no line a = `sqlplus -s user/pass @script.sql > $temp`
give doc en example if possible
thanks.
mailto:Laurent.Deperthes@renault.com
------------------------------
Date: 08 Feb 1998 23:55:00 -0800
From: Evgenij Beresin <beg@mrl.sps.mot.com>
Subject: Perl/Tk and C++ exceptions
Message-Id: <6btwhkyaz.fsf@mrl.sps.mot.com>
Hi all,
My question concerns embedding Tcl/Tk (or Perl/Tk) interpreter
and GUI into an existent C++ application.
All functionality of the application is enclosed into try {...} catch
block in the "main()" function.
How should I embed the interpreter to be sure that any exception will
cause correct termination of the interpreter and GUI?
Thanks,
Evgenij Beresin
------------------------------
Date: Mon, 09 Feb 1998 13:15:56 +0100
From: Jure Simsic <jure.simsic@uni-lj.si>
Subject: Problems with sorting a hash by value
Message-Id: <34DEF37C.3FC32A41@uni-lj.si>
I have a code:
foreach $book (sort keys %bookid){
print "$book\t$bookid{$book}\n";
}
which sorts the hash by keys, how would i (nicely) sort it by value?
Jure
p.s. Please answer me (also) by mail as I have limited access to usenet.
--
Jure Simsic
RCU, University of Ljubljana
Kardeljeva ploscad 17, 1000 Ljubljana, Slovenia
email: jure.simsic@uni-lj.si
------------------------------
Date: 09 Feb 1998 13:33:08 +0100
From: Remove xx to reply <xxTony.Curtis@vcpc.univie.ac.at>
To: jure.simsic@uni-lj.si
Subject: Re: Problems with sorting a hash by value
Message-Id: <7x7m75lzzv.fsf@beavis.vcpc.univie.ac.at>
Re: Problems with sorting a hash by value, Jure
<jure.simsic@uni-lj.si> said:
Jure> I have a code: foreach $book (sort keys %bookid)
Jure> { print "$book\t$bookid{$book}\n"; } which sorts the
Jure> hash by keys, how would i (nicely) sort it by value?
perldoc -f sort
has loads of examples. I'm sure this is in the perl faq
too.
hth,
tony
------------------------------
Date: 09 Feb 1998 12:58:34 +0100
From: Morten Stig Andersen <Morten.Andersen@molbio.uu.se>
Subject: Q: Using unpack or split to get fixed-length substrings?
Message-Id: <x5lnvlhtw5.fsf@beagle.bmc.uu.se>
Can someone please help me with this:
I want to break ascii strings into fixed-length substrings as efficient
as possible. I have a string like
my $string = "aaabbbcccd";
If my fixed-length is three, I want it split into a list of substrings
like: ("aaa", "bbb", "ccc", "d")
I've tried
@array = split(/(\w{3})/, $string); # Spits out empty fields as well
@array = split(/(?:\w{3})/, $string); # @array is empty
and other variants that didn't work. The split manual page tells me to
use unpack, but I can only get one element out here:
@array = unpack "a3", $string; # @array now equals ("aaa");
How do I get this right?
Thanks,
--
=-=-=-=-=-=-=-=-=-=-=-= \,`/ / =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Morten Stig Andersen _).. `_ Department of Molecular Biology
( __ -\ BMC, University of Uppsala
tel: +46 18 4714214 '`. Box 590, 751 24 UPPSALA, Sweden
fax: +46 18 557723 ( \>_-_, --------------------------------
mail: moan@biobase.dk _||_ ~-/ http://evolution.bmc.uu.se/~moan
------------------------------
Date: Mon, 09 Feb 1998 08:41:02 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Quickie: regexp for valid e-mail addresses
Message-Id: <34e1b5c6.1250422@news.tornado.be>
Tom Phoenix <rootbeer@teleport.com> wrote:
>Unfortunately, when I tried writing to him to ask what his email address
>is, I uncovered a bug in my mail program, which is unable to handle
>addresses which are infinitely long. As soon as I get that bug fixed, I'll
>let you know what he says.
Huh? You tried sending an e-mail message to somebody, asking about his
e-mail address?
BTW isn't there a limit to the allowabale length of an e-mail message
because of constraints to the maximal line length?
Bart.
------------------------------
Date: Mon, 09 Feb 1998 12:47:05 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Quickie: regexp for valid e-mail addresses
Message-Id: <34e0fa51.3539312@news.tornado.be>
I wrote:
>BTW isn't there a limit to the allowabale length of an e-mail message
I ment, of course, e-mail address! Silly, silly, silly!
>because of constraints to the maximal line length?
Bart.
-
'D*mn!', said Carrot, a difficult linguistic feat.
-- Terry Pratchett, "Feet of Clay"
------------------------------
Date: 9 Feb 1998 22:42:49 +1300
From: Carey Evans <c.evans@clear.net.nz>
Subject: Re: Sending a message to a pager
Message-Id: <87iuqpcdwo.fsf@psyche.evansnet>
spam@fritter.com (team lamer) writes:
[snip - paging]
> 1/ create a query-string & send it to a web site offering a paging
> service (??)
>
> 2/ open up /dev/modem and do all the dialing stuff :(
3. Use Net::SNPP, if your pager company supports the Simple Network
Pager Protocol.
Note that with the second option, some companies provide a service
where you get a tty type connection, so you don't have to guess how
long to wait until it's safe to send the touch tones. For predefined
messages (and a quick hack) I would be inclined to use expect(1) or
chat(8) to do the actual talking after Perl opened the device,
although Perl could do almost as well in the conversation.
I can give you some pointers on opening a serial device properly.
--
Carey Evans http://home.clear.net.nz/pages/c.evans/
GNU GPL: "The Source will be with you... always."
------------------------------
Date: Mon, 09 Feb 1998 13:58:02 +0100
From: mikael@techtalk.se (Mikael Skogstrom)
Subject: Re: sending files with email
Message-Id: <B104BBEA966810F1E9@du164-248.ppp.algonet.se>
In article <6bls0b$2fa$1@pascal.a2000.nl>,
" Pieter Ouwehand" <pwo@speed.a2000.nl> wrote:
>I've been testing to send email's trough a perlscript
>and everything works fine, accept how do i tell
>my mailserver that's it not a ordinary email but one
>with a attachment?
You do that by including a Mime header, like multipart/mixed, which is
transparent to SendMail but tells the browser there is something to be
interpreted or handled -- in this case an attachment.
Search the web for a list of all the Mime codes (RFC) and pick the one you
need.
Mikael
------------------------------
Date: Mon, 09 Feb 1998 13:58:03 +0100
From: mikael@techtalk.se (Mikael Skogstrom)
Subject: Re: Sharing variables between scripts
Message-Id: <B104BBEB966810F220@du164-248.ppp.algonet.se>
In article <34DEAB41.E25A5C31@hotmail.com>,
Larry D'Anna <ldanna@hotmail.com> wrote:
>> I've seen this done before but can't recall how again. All I need to do
>> is share variables that are located in 1 perl script between other scripts
>> .. I've tried 'require' .. that didn't seem to do the trick (and I did
>> give it the relative path to the script with my variables)
If you're talking about CGI scripts, a cookie would be one way to do it.
Another would be to let the first script write the variables as <INPUT
TYPE=hidden>-tags to the generated page and have the second script read
those hidden tags to load the variables.
Mikael
------------------------------
Date: Mon, 09 Feb 1998 08:40:56 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: solution for multiline comments???
Message-Id: <34e0b4ac.968822@news.tornado.be>
alt.fan.e-t-b? What the (bleep) is that? Oh, well. Maybe it is relevant.
Chipmunk <rjk@coos.dartmouth.edu> wrote:
>In my examples of the ambiguity of POD-style comments, the comments are ambiguous
>specifically because of the commenting syntax.
Which makes me think of the following. I've always wondered about this.
What would you make of this?
$a
=$b;
Bart.
------------------------------
Date: Mon, 9 Feb 1998 12:19:41 +0100
From: "Hans Van Lint" <hvanlint@lodestar.be>
Subject: sorting an associative array
Message-Id: <6bmomq$t02$1@news2.xs4all.nl>
How can I sort an associative array ascending by keys, and still use it as
an associative array (sorted on key).
------------------------------
Date: Mon, 09 Feb 1998 08:41:11 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Unpack float
Message-Id: <34e3ba68.2436582@news.tornado.be>
Tom Christiansen <tchrist@mox.perl.com> wrote:
> bart.mediamind@tornado.be (Bart Lateur) writes:
>:BTW Does anybody know what is the fastest way to calculate 2^n in Perl,
>:where n is quite big (so bitshifting won't work, as the result won't fit
>:into an integer)?
>
>Why are you running bitwise xor on non-integers?
>Oh, you misused ^ to mean **. Why do people make this
>mistake? Back to FORTRAN class with you.
All right! I confess! It is... it is... BASIC! Now please stop torturing
me!
I though that FORTRAN used ** too.
>Since you don't want to lose precision, you'll have to do
>this for arbitrarily large exponents:
>
> use Math::BigInt;
> $n = Math::BigInt->new(2);
> $n **= 2000;
> print $n, "\n";
>
>You'll find that 2**2000 is precisely
>
> 1148130695274254524232833201177681...
[rest snipped. Nobody reads this anyway.]
Now why would anybody want such a high precision, except maybe the US
government, to calculate the military expenses? :-)
No, I was think about putting the exponent field in a float, without
depending too much on the float's bit field sizes. Unless I'm mistaking,
these may depend upon the C libraries when Perl was compiled.
So I don't need more precision than the precision of a float. Which,
BTW, gives exact results for powers of 2. (when within a reasonable
range)
>whereas the result of
>
> $a = 2; $n = 2000;
> $a *= 2 while --$n > 0;
> print $a;
>
>is given as the risibly inaccurate "Inf".
Perl knows about Inf? Can it distinguish between +Inf and -Inf, too?
2000 seams to be higher than the maximum allowed value for a float's
exponent.
But your snippet won't work for negative exponents anyway. And it's
slow. Slower than pasting in an exponent field anyway.
Bart.
------------------------------
Date: Mon, 09 Feb 1998 13:58:03 +0100
From: mikael@techtalk.se (Mikael Skogstrom)
Subject: Re: Using flock?
Message-Id: <B104BBEB966810F249@du164-248.ppp.algonet.se>
In article <Pine.GSO.3.96.980208131534.15943Y-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> wrote:
>I think you could use the methods in Randal's fourth Web Techniques
>column, which explains how to use flock() to avoid problems when multiple
>processes need to modify one file. Hope this helps!
I know you're supposed to use FLOCK to lock a file from beeing used by more
than one script at a time. But I really haven't understood why; shouldn't
the OS take care of it, so that no more than one program can write at a
time? (Reading is a bit different, I guess.)
Mikael
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 1836
**************************************