[12003] in Perl-Users-Digest
Perl-Users Digest, Issue: 5603 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 8 05:07:13 1999
Date: Sat, 8 May 99 02:00:17 -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 Sat, 8 May 1999 Volume: 8 Number: 5603
Today's topics:
Can m//thing be a variable? <design@raincloud-studios.com>
Character codes in Perl (Henry Gondorff)
Embedding in Win32 GUI app? <benles@powernet.net>
Re: Find all files regardless of extension (Bart Lateur)
getting autoincrement/serial field value in DBI aaron@soltec.net
Re: HASH references... <mike@facombat.com>
Re: HASH references... (Larry Rosler)
Re: HASH references... <uri@sysarch.com>
Re: HASH references... <design@raincloud-studios.com>
Re: How do I continue a line with a tr argument? (Larry Rosler)
Re: How to match a variable in pattern - Help a newbie <antich@quantum.che.nsk.su>
New to perl <mace@calweb.com>
Re: New to perl <uri@sysarch.com>
Re: Perl in the workplace (Cameron Laird)
Perl reading .htaccess user <mike@facombat.com>
Re: Perl reading .htaccess user <design@raincloud-studios.com>
Re: PERLFUNC: binmode - prepare binary files on old sys <gisle@aas.no>
Re: PERLFUNC: binmode - prepare binary files on old sys (Larry Rosler)
read files in Perl <roberto@mysacramento.com>
Re: SMTP howto attach files <gellyfish@gellyfish.com>
Re: UNIX comands and switches in perl (Larry Rosler)
Re: using $, (was Re: having problems) (Bart Lateur)
Re: Weird problem with perl 5.003, Solaris 2.6 and VXFS (Greg Andrews)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 08 May 1999 08:12:51 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Can m//thing be a variable?
Message-Id: <7mSY2.1009$vP2.166@news.rdc1.tn.home.com>
Or... is there any way besides traditional conditional statements to
achieve a 'toggle' between the various modifiers for matching? Can the i
be a variable?
example... toggling case sensitivity without having to use two different
versions of the match.
if ($case_sen){ m/$phrase/ }else{ m/$phrase/i };
curious as usual.
CT
------------------------------
Date: Sat, 08 May 1999 07:00:58 GMT
From: gondorff@shaws.com (Henry Gondorff)
Subject: Character codes in Perl
Message-Id: <3733de14.17869722@news.intac.com>
Hi,
I'm having problems with the ord() function in perl... it
returns zero for several keys, including the arrow and function keys.
Is this due to Perl itself or to DOS?
Basically, I am looking for a way to differentiate between
user keystrokes; currently, I have no way to tell the difference
between 'F1' and 'Left Arrow' (or 'Right Arrow' or NULL, etc).
I have tried both sysread() calls and the Term::ReadKey module.
Getting the key from the console is no problem, but figuring out
which key an ord() value of zero belongs to is my problem.
I've seen a few attempts at answers to similar questions on
CPAN, but I'm not anxious to use C header files to fix this... I am
wondering if there is a 100% Perl solution.
I am running ActivePerl 5.15 on Windows 98/DOS 7.
Any help will be greatly appreciated.
Thanks in advance,
DTD
------------------------------
Date: Fri, 07 May 1999 22:40:34 -0700
From: Ben & Leslie Allfree <benles@powernet.net>
Subject: Embedding in Win32 GUI app?
Message-Id: <3733CE52.4D75CD94@powernet.net>
Has anyone successfully embedded Perl in an Win32 GUI app? Please help,
even if you only know where to find more information. I'm having trouble
finding out what the differences are between a console app and a GUI
app. Thanks!
Ben
--
Ben & Leslie Allfree
B & L Digital Publishing
www.bldigital.com
benles@bldigital.com
------------------------------
Date: Sat, 08 May 1999 07:42:58 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Find all files regardless of extension
Message-Id: <3734ea82.548920@news.skynet.be>
Larry Rosler wrote:
> Nah... You seem to have overlooked the fact that readdir() returns the
> bare filenames with whatever case was used when they were written. So
> 'FiLeNaMe.tXt' and 'fIlEnAmE.TxT' are the same friggin' file.
Nah... You must have overlooked the fact that you don't need to specify
the path including the drive letter. Your PoB test isn't reliable.
And on MY PoB system (GNU DOS) readdir() returns all lower case.
Bart.
------------------------------
Date: Sat, 08 May 1999 05:25:34 GMT
From: aaron@soltec.net
Subject: getting autoincrement/serial field value in DBI
Message-Id: <7h0hsc$oal$1@nnrp1.deja.com>
Hello
I have two tables in a database
table_a table_a_b
table_a has 3 fields
table_a_id
name
price
table_a_id is a serial field (it increments automatically)
I need the number that is placed there so that I can enter it into table_a_b
I'm using DBI. Is there a way I can find that out?
Aaron
~
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 7 May 1999 23:02:01 -0400
From: "Mike" <mike@facombat.com>
Subject: Re: HASH references...
Message-Id: <aLOY2.2$_u4.115439@rsnws01.mn.mediaone.net>
Someone please correct me if I'm wrong...
for ($i=0; $i<50; $i++) {
$tempval = $i+1;
$hashref = "desc$tempval";
$desc[$i] = $FORM{$hashref};
}
This would put $FORM{'desc1'} into $desc[0] and so forth, you see?
Please send me your comments at mike@cardosa.com , since I most likely won't
be checking back anytime soon...
Regards,
Mike Cardosa
Paul L Tomlinson <keighvin@urjet.net> wrote in message
news:926097562.578.90@news.remarQ.com...
> There've got to be so many newbie questions on here, I apologize. Now
that
> I've got you buttered up I can solicit wisdom:
>
> I have a script reading a form; a lot of the elements in this form are
> incrementally named, i.e. "desc1", "desc2", "desc3", etc... These and
their
> values (desc1=whatever) are all transferred successfully into %FORM. I
want
> to write a loop that will refer to these elements incrementally instead of
> having to write $FORM{'desc1'} ... $FORM{'desc50'} and have a routine for
> each; that's bad code. How can I refer to elements in a hash using a
> pointer, reference, or variable? Maybe I'm thinking too JavaScript on
this
> one but there's got to be a way. This excerpt doesn't work but it does
> explain what I'm trying to do:
>
> $i=0;
> $j=1;
> while($i < 50){
> $priorities[$i] = "priority$j";
> $dls[$i] = "deadlineselect$j";
> $dl[$i] = "deadline$j";
> $descs[$i] = "desc$j";
> $i++;
> $j++;
> }
> while($i < 50){
> if($FORM{$descs[$i]} ne ""){
> .....
> }
> }
>
> Any takers?
>
> Paul L. Tomlinson
> keighvin@urjet.net
>
>
------------------------------
Date: Fri, 7 May 1999 21:43:12 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: HASH references...
Message-Id: <MPG.119d60b879c966c989a0b@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <x7d80ctgzu.fsf@home.sysarch.com> on 07 May 1999 22:47:17 -
0400, Uri Guttman <uri@sysarch.com> says...
...
> i have been saying for as long (maybe longer) than larry that hash
> slices are your friend. i use them regularly in many contexts. the above
> ones are just nice initialization techniques.
Longer. You taught them to me, in March 1998. That was how we 'met'
the first time. Remember:
"QUIZ: what good is this code?"
http://x3.dejanews.com/[ST_rn=ps]/getdoc.xp?AN=329229189
That thread is worth a review, anyone who hasn't seen it.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 08 May 1999 01:34:37 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: HASH references...
Message-Id: <x7aevgt98y.fsf@home.sysarch.com>
>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
LR> [Posted and a courtesy copy sent.]
LR> In article <x7d80ctgzu.fsf@home.sysarch.com> on 07 May 1999 22:47:17 -
LR> 0400, Uri Guttman <uri@sysarch.com> says...
LR> ...
>> i have been saying for as long (maybe longer) than larry that hash
>> slices are your friend. i use them regularly in many contexts. the above
>> ones are just nice initialization techniques.
LR> Longer. You taught them to me, in March 1998. That was how we 'met'
LR> the first time. Remember:
LR> "QUIZ: what good is this code?"
LR> http://x3.dejanews.com/[ST_rn=ps]/getdoc.xp?AN=329229189
i do remember it and it was good.
LR> That thread is worth a review, anyone who hasn't seen it.
i also have my hash slice tutorial. should i repost it?
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Sat, 08 May 1999 07:18:07 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: HASH references...
Message-Id: <PyRY2.991$vP2.302@news.rdc1.tn.home.com>
>i also have my hash slice tutorial. should i repost it?
This thread got me interested. I wouldn't mind seeing it for the first
time.
------------------------------
Date: Sat, 8 May 1999 00:15:37 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How do I continue a line with a tr argument?
Message-Id: <MPG.119d8473389041ad989a0d@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <373387C4.F1D7E83D@amdahl.com> on Fri, 07 May 1999 17:39:32 -
0700, Hal Mounce <whm10@amdahl.com> says...
> I want to build a 256 entry translate table. I couldn't figure out how
> to continue a line of code, and wound up with the mess at the bottom of
> this script, which works, but isn't very clean. (The general case would
> fail, you gotta do the translate in one fell swoop.)
>
> Any tips? I suspect the same problem crops up with regexs.
...
> # create ascii and ebcdic translations (loose the scary bytes)
> $dmpascii = $buf;
> $dmpebcdic = $buf;
> $dmpascii =~ tr/\x20-\x7e/./c; # change non printable bytes to
> dots
> # bad things happen if these next few lines get out of order; should
> have done it byte by byte
> $dmpebcdic =~
> tr/\x00-\x3f\x41-\x4b\x51-\x59\x62-\x6a\x70-\x78/./; # dot out 00-7F
> $dmpebcdic =~ tr/\x40\x4c-\x4e\x50\x5a-\x61/
> <(+&!$*);.\x2d\x2f/; # trans thru 61
> $dmpebcdic =~
> tr/\x6b-\x6f\x79-\x7f/,%_>?`:#@'="/; # trans thru 7F
> $dmpebcdic =~
> tr/\x80\x8a-\x90\x9a-\xa0\xaa-\xbf\xca-\xcf/./; # dot out 80-D0
> $dmpebcdic =~
> tr/\x4f\xa1\xc0\xd0\xe0/|~{}\x5c/; # odds and ends
> $dmpebcdic =~
> tr/\x81-\x89\x91-\x99\xa2-\xa9/a-z/; # get a-z
> $dmpebcdic =~
> tr/\xc1-\xc9\xd1-\xd9\xe2-\xe9\xf0-\xf9/A-Z0-9/; # get A-Z, 0-9
> $dmpebcdic =~
> tr/\xda-\xdf\xe1\xea-\xef\xfa-\xff/./; # dot out D1-FF
The following test program may give you an idea about another way to do
it. I *think* I captured your table correctly, but I don't guarantee
it. (The newsreaders may screw up the tabs that separate the comments,
also.)
#!/usr/local/bin/perl -w
use strict;
my $rhs =
'.' x -(0x00-0x3f-1) . # \x00-\x3f
' ' . # \x40
'.' x -(0x41-0x4b-1) . # \x41-\x4b
'<(+|&' . # \x4c-\x50
'.' x -(0x51-0x59-1) . # \x51-\x59
'!$*);.\-\/' . # \x5a-\x61
'.' x -(0x62-0x6a-1) . # \x62-\x6a
',%_>?' . # \x6b-\x6f
'.' x -(0x70-0x78-1) . # \x70-\x78
'`:#@\'="' . # \x79-\x7f
'.' . # \x80
'a-i' . # \x81-\x89
'.' x -(0x8a-0x90-1) . # \x8a-\x90
'j-r' . # \x91-\x99
'.' x -(0x9a-0xa0-1) . # \x9a-\xa0
'~' . # \xa1
's-z' . # \xa2-\xa9
'.' x -(0xaa-0xbf-1) . # \xaa-\xbf
'{' . # \xc0
'A-I' . # \xc1-\xc9
'.' x -(0xca-0xcf-1) . # \xca-\xcf
'}' . # \xd0
'J-R' . # \xd1-\xd9
'.' x -(0xda-0xdf-1) . # \xda-\xdf
'\\\\' . # \xe0 # Four for the price of one! :-)
'.' . # \xe1
'S-Z' . # \xe2-\xe9
'.' x -(0xea-0xef-1) . # \xea-\xef
'0-9' . # \xf0-\xf9
'.' x -(0xfa-0xff-1) . # \xfa-\xff
"";
print "$rhs\n\n";
my $dmpebcdic =
"\xe3\x88\x89\xa2\x40\x89\xa2\x40\xc5\xc2\xc3\xc4\xc9\xc3\x5a";
print "|$dmpebcdic|\n";
eval "\$dmpebcdic =~ tr/\\x00-\\xff/$rhs/;"; # This does the work.
print "|$dmpebcdic|\n";
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sat, 8 May 1999 14:22:32 +0700
From: "Anton V. Antich" <antich@quantum.che.nsk.su>
Subject: Re: How to match a variable in pattern - Help a newbie !
Message-Id: <Pine.LNX.4.10.9905081419590.32679-100000@quantum.che.nsk.su>
On Fri, 7 May 1999, Larry Rosler wrote:
>
> print if /(\w+)\s+\d+\s+(\w+)/ && $1 eq $f1 && $2 eq $f3;
>
> print if / $f1\s+\d+\s+$f3 /; # add /o if constant for the run.
>
> print if substr($_, 1, 2) eq $f1 && substr($_, 8, 1) eq $f3;
>
Oh.. Thanks.. I guess i had some problems with extra spaces in vars,
that's why the comparisons didn't work.. Hmm, i haven't thought if the
third way - might be the fastest, you right.
A.
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Company
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
>
>
------------------------------
Date: Fri, 7 May 1999 22:22:01 -0700
From: "Mace" <mace@calweb.com>
Subject: New to perl
Message-Id: <3733c956@calwebnnrp>
Hey,
I am new to perl. I have purchased two books. CGI/Perl cookbook by Matt
Wright and Craig Patchett. I also bought a book by some other guy I don't
really know. but could anyone give me a quick run down of subroutines?
------------------------------
Date: 08 May 1999 01:41:03 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: New to perl
Message-Id: <x77lqkt8y8.fsf@home.sysarch.com>
>>>>> "M" == Mace <mace@calweb.com> writes:
M> I am new to perl. I have purchased two books. CGI/Perl cookbook
M> by Matt Wright and Craig Patchett. I also bought a book by some
M> other guy I don't really know. but could anyone give me a quick
M> run down of subroutines?
well, we know matt wright and his code sucks. you should return that book
for a refund. why don't you tell us the name of the other book's author?
the fact that you don't knwo him deosn't matter since yoy don't know perl
yet.
as a minimal rule of thum, the best perl books are by o'reilly &
assoc. there are a few good ones by other publishers but too many are
rife with bugs, bad code, and lies.
check out the book reviews at www.perl.com. in fact you should just read
most of that site to learn more perl and about the perl community. read
the perl faq and the perl docs.
then you will know why matt's code and books suck.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 8 May 1999 01:02:45 -0500
From: claird@Starbase.NeoSoft.COM (Cameron Laird)
Subject: Re: Perl in the workplace
Message-Id: <7h0k25$mml$1@Starbase.NeoSoft.COM>
In article <7gk54k$q9a$1@nnrp1.dejanews.com>, <sstarre@my-dejanews.com> wrote:
>
>
>
>I work for a large Fortune company, where use of Perl is a forbidden
>practice. There are two distinct camps - MIS, who mandates that all CGI will
>be done in VB-script (ack!), and two, engineers and scientists who use an
>ecclectic mix of languages. In my camp (the latter) a small band of us risk
I'm curious--it's not *really* VBScripted CGI, is
it? I suspect they're actually using ASP coded in
VBScript--true?
.
.
.
>Do others find this kind of resistance to Perl at work? If so, were you able
>to make a case to management to at least allow it as a "2nd language"? Have
>you had to "go underground" to get your job done?
I understand that the policies of this employer are
no longer of practical concern to you. More gener-
ally, though, I'm working on <URL:http://
starbase.neosoft.com/~claird/comp.lang.perl.misc/PerlWhitePaper.html>
which I hope will help in some of these situations.
Tom's FAQs are also top-notch sources for helpful
material.
.
.
.
--
Cameron Laird http://starbase.neosoft.com/~claird/home.html
claird@NeoSoft.com +1 281 996 8546 FAX
------------------------------
Date: Fri, 7 May 1999 22:27:30 -0400
From: "Mike" <mike@facombat.com>
Subject: Perl reading .htaccess user
Message-Id: <KeOY2.1$_u4.104014@rsnws01.mn.mediaone.net>
This is a multi-part message in MIME format.
------=_NextPart_000_000B_01BE98D8.CB58B9A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Is there a way for a perl script to pick up what username is accessing =
script, that gains access via .htaccess?
would it be an environment variable?
Thanks,
Mike
------=_NextPart_000_000B_01BE98D8.CB58B9A0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2014.210" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Is there a way for a perl script to pick up what =
username=20
is accessing script, that gains access via .htaccess?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>would it be an environment variable?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>Thanks,</FONT></DIV>
<DIV><FONT size=3D2>Mike</FONT></DIV></BODY></HTML>
------=_NextPart_000_000B_01BE98D8.CB58B9A0--
------------------------------
Date: Sat, 08 May 1999 07:14:37 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: Perl reading .htaccess user
Message-Id: <xvRY2.989$vP2.327@news.rdc1.tn.home.com>
>Is there a way for a perl script to pick up what username is accessing
script, >that gains access via .htaccess?
>would it be an environment variable?
In the common log format for Apache, it gets plugged in the second
element of the access_log when they log in. So it is possible to capture
it. I let Uri pop into a site today and here's what the log caught as
far as the entry...
24.128.120.203 - - [07/May/1999:22:47:12 -0700] "GET /beta HTTP/1.0" 401
350
24.128.120.203 - uri [07/May/1999:22:47:35 -0700] "GET /beta HTTP/1.0"
301 187
You need REMOTE_USER
If you are curious what else Apache can 'catch' so you can cross
reference it to the ENV variables in your scripts...
>From the apache directives...
http://www.apache.org/docs-1.2/mod/mod_log_config.html#formats
CT
------------------------------
Date: 08 May 1999 07:09:39 +0200
From: Gisle Aas <gisle@aas.no>
Subject: Re: PERLFUNC: binmode - prepare binary files on old systems
Message-Id: <m33e18xi3w.fsf@eik.g.aas.no>
lr@hpl.hp.com (Larry Rosler) writes:
> The heuristic is described in perlfunc:
>
> The -T and -B switches work as follows. The first block or so of the
> file is examined for odd characters such as strange control codes or
> characters with the high bit set. If too many strange characters (>30%)
> are found, it's a -B file, otherwise it's a -T file. Also, any file
> containing null in the first block is considered a binary file...
>
> As I said later in that same post in reference to the Unix 'file'
> command, it used to make a meaningful distinction between an ASCII text
> file and others. But Latin-1 screws it completely.
It only screws up for for languages that use more than 30% high-bit
chars in normal text. For Norwegian Latin-1 text I have no problem
using -T to determine its textness. I guess almost all languages that
can be written using Latin-1 is like that.
But, if you said that Latin-7 or Latin-8 screw up -T then I would
agree more.
> Herewith a proposed documentation change:
>
> -T File is an ASCII text file.
^mostly
> -B File is a 'binary' file (opposite of -T).
--
Gisle Aas
------------------------------
Date: Sat, 8 May 1999 00:02:26 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: PERLFUNC: binmode - prepare binary files on old systems
Message-Id: <MPG.119d815957ee8380989a0c@nntp.hpl.hp.com>
In article <m33e18xi3w.fsf@eik.g.aas.no> on 08 May 1999 07:09:39 +0200,
Gisle Aas <gisle@aas.no> says...
> lr@hpl.hp.com (Larry Rosler) writes:
...
> It only screws up for for languages that use more than 30% high-bit
> chars in normal text. For Norwegian Latin-1 text I have no problem
> using -T to determine its textness. I guess almost all languages that
> can be written using Latin-1 is like that.
>
> But, if you said that Latin-7 or Latin-8 screw up -T then I would
> agree more.
If I knew more (anything?) about them, I'm sure I would agree also.
> LR> Herewith a proposed documentation change:
> LR>
> LR> -T File is an ASCII text file.
> ^mostly
s/n/ mostly/;
> LR> -B File is a 'binary' file (opposite of -T).
Good. As Jean-Luc Picard says, "Make it so!" But to whom does one say
it???
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sat, 08 May 1999 00:20:43 -0700
From: Roberto <roberto@mysacramento.com>
Subject: read files in Perl
Message-Id: <3733E5CB.3D3F@mysacramento.com>
Hi,
how can I read a file from another url using Perl script?
Thank you very much
-------------------------------------------
roberto azzimonti
mailto:roberto@mysacramento.com
http://www.mysacramento.com/azzimonti
-------------------------------------------
------------------------------
Date: 8 May 1999 07:35:54 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: SMTP howto attach files
Message-Id: <7h0pgq$vg$1@gellyfish.btinternet.com>
On Fri, 7 May 1999 12:00:13 -0500 john gury wrote:
> Anyone know if its possible to send an attached file using
> the NET::SMTP package in Win32?
You cant attach files using Net::SMTP per se - you probably want to
use the module Mime::Lite or something similar.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Fri, 7 May 1999 20:19:58 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: UNIX comands and switches in perl
Message-Id: <MPG.119d4d35fcaea5f8989a0a@nntp.hpl.hp.com>
In article <7gv4eb$28p71463@news.gomontana.com> on Fri, 7 May 1999
16:37:01 +0100, Dave Evans <devans@radius-retail.kom> says...
> What Mr Bohlman means is that the pattern match operator ( /something/ ) can
> be made to operate without respect to case. See the "perlre" man page for
> the "/i" modifier. Alternatively passing *both* strings through lc() would
> work, but be far less efficient.
You really shouldn't make a statement about performance without having
any data to back it up. Someone may believe you.
In the following benchmark, a variable comparison string in the regex
could be passed through lc *once*, before being substituted into the
regex. This is a trivial cost compared to running the loop on the input
data. I have simply put in a lower-case constant comparison string.
This does not change the message -- "/i" can be s-l-o-o-o-w when the
match, if any, is far out in the string.
#!/usr/local/bin/perl -w
use strict;
use Benchmark;
my @data0 = (('x' x 20) x 100);
my @data1 = (('x' x 50) x 100);
timethese(1 << (shift || 0), {
I00 => sub { scalar grep /foobar/i, @data0 },
I01 => sub { scalar grep /xxxxxx/i, @data0 },
I10 => sub { scalar grep /foobar/i, @data1 },
I11 => sub { scalar grep /xxxxxx/i, @data1 },
Lc00 => sub { scalar grep lc =~ /foobar/, @data0 },
Lc01 => sub { scalar grep lc =~ /xxxxxx/, @data0 },
Lc10 => sub { scalar grep lc =~ /foobar/, @data1 },
Lc11 => sub { scalar grep lc =~ /xxxxxx/, @data1 },
});
__END__
Benchmark: timing 4096 iterations of I00, I01, I10, I11, Lc00, Lc01,
Lc10, Lc11...
I00: 5 wallclock secs ( 5.27 usr + 0.00 sys = 5.27 CPU)
I01: 1 wallclock secs ( 2.13 usr + 0.00 sys = 2.13 CPU)
I10: 13 wallclock secs (12.74 usr + 0.00 sys = 12.74 CPU)
I11: 2 wallclock secs ( 1.92 usr + 0.00 sys = 1.92 CPU)
Lc00: 2 wallclock secs ( 2.25 usr + 0.00 sys = 2.25 CPU)
Lc01: 2 wallclock secs ( 2.37 usr + 0.00 sys = 2.37 CPU)
Lc10: 3 wallclock secs ( 3.02 usr + 0.00 sys = 3.02 CPU)
Lc11: 3 wallclock secs ( 2.97 usr + 0.00 sys = 2.97 CPU)
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sat, 08 May 1999 07:38:44 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: using $, (was Re: having problems)
Message-Id: <3733e998.314775@news.skynet.be>
Larry Rosler wrote:
>What file? I think you missed the smiley. :-)
>
>NUL is the PoB name for /dev/null. If you are using Unix, use
>'/dev/null' and there will be no file to write or remove.
So you need OS dependant code.
Doesn't use of '/dev/null' or equivalent change the execution speed?
Bart.
------------------------------
Date: 7 May 1999 22:07:23 -0700
From: gerg@shell1.ncal.verio.com (Greg Andrews)
Subject: Re: Weird problem with perl 5.003, Solaris 2.6 and VXFS
Message-Id: <7h0gqb$faf$1@shell1.ncal.verio.com>
jeffreyb@gwis2.circ.gwu.edu (Jeffrey Keith Boulier) writes:
>In article <dkcombsFApwrG.E84@netcom.com>,
>David Combs <dkcombs@netcom.com> wrote:
>>> [a perl program runs faster after it has been copied. Reason: it is cached
>>> in the memory.]
>>
>>Does this happen with everyone running 2.6?
>>
>>How about 2.7?
>
>Sure. Sun says "free memory is wasted memory". Any memory not
>explicitly being in use, Solaris will reserve as a disk cache.
>
Slight correction. Solaris doesn't "reserve" memory for caching
files. It simply allows the file cache to grow as the system
continues to open and read files from the disk(s). When the
amount of unused memory drops below a certain threshold, the
system will flush data to disk and mark the memory as free.
-Greg
------------------------------
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 5603
**************************************