[19463] in Perl-Users-Digest
Perl-Users Digest, Issue: 1658 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 30 14:05:34 2001
Date: Thu, 30 Aug 2001 11:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <999194712-v10-i1658@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 30 Aug 2001 Volume: 10 Number: 1658
Today's topics:
Re: $1 as subroutine parameter - problems (Peter Scott)
Re: Calling sub funcs with scalar variables? nobull@mail.com
Re: Calling sub funcs with scalar variables? <uri@sysarch.com>
Can't locate misc.pl in @INC <Mike.Ditum@Doulos.com>
Comparing two dates! Is there an easy way? <Pcmann1@btinternet.com>
Re: DBI connect string for Sybase Anywhere Studio (Upda <mpeppler@peppler.org>
Re: Difference between .pl, .cgi, and .pm File Extensio <bob@eawf.nospam.com>
Re: Errorlevel checking (Eric Bohlman)
Extracting data from emails <graeme@essistance.co.uk>
Re: File::Find not recursing on Win32 Perl 5.001 <bart.lateur@skynet.be>
Formmail 1.9 not sending <jgrover@acd.net>
Re: Godzilla Stomps Code Red <godzilla@stomp.stomp.tokyo>
Re: HELP ME: I want to know if with Perl i can use the (Eric Bohlman)
How to I background a process and not wait for it. <john@hennessy.net.au>
Re: How to I background a process and not wait for it. <homer@simpsons.com>
Re: How to I background a process and not wait for it. (John J. Trammell)
Re: Is element in array <wizard@psychodad.com>
MIME::Lite quoted-printable <tinamue@zedat.fu-berlin.de>
Re: MIME::Lite quoted-printable <Tassilo.Parseval@post.rwth-aachen.de>
Re: MIME::Lite quoted-printable <tinamue@zedat.fu-berlin.de>
Net::FTP question (David Krainess)
Re: Network topology mapping (Ilja Tabachniks)
newbe problem with Perl (Tom Folkes)
Re: newbie problem with Perl (John J. Trammell)
number of variables limit in CSV files? (Eric White)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 30 Aug 2001 17:01:24 GMT
From: peter@PSDT.com (Peter Scott)
Subject: Re: $1 as subroutine parameter - problems
Message-Id: <Ejuj7.99401$7h.17679082@news2.rdc1.bc.home.com>
In article <m3bskyydiq.fsf@dhcp9-161.support.tivoli.com>,
Ren Maddox <ren@tivoli.com> writes:
>On Tue, 28 Aug 2001, bart.lateur@skynet.be wrote:
>
>> ctcgag@hotmail.com wrote:
>>
>>>Hmmm. This is still somewhat confusing. It looks like special
>>>variables are localized by saving the value someplace else, using
>>>the original address, then restoring the value upon leaving the
>>>block.
>>
>> Nonono. It happens to all global variables, if you use local()
>> yourself on them. The only thing special about $1 and friends is
>> that this localisation happens automatically when you enter a new
>> block that happens to contain a regex. Something like that, anyway.
>
>Did you look at his example code? It demonstrates that there is a
>difference.
>
>Xho, I suspect that the reason for the difference is that the
>automatic localization of $1 happens before the aliasing of @_. So @_
>gets aliased to the already localized $1.
This looks related to something I reported in January 2000 (see
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-01/msg00686.html
) and Ilya Zakharevich explained the reason in
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-01/msg00714.html
. There is indeed something special about $1.
--
Peter Scott
http://www.perldebugged.com
------------------------------
Date: 30 Aug 2001 17:50:47 +0100
From: nobull@mail.com
Subject: Re: Calling sub funcs with scalar variables?
Message-Id: <u9d75dbifs.fsf@wcl-l.bham.ac.uk>
demerphq@hotmail.com (Yves Orton) writes:
> tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrn9or6di.5ak.tadmc@tadmc26.august.net>...
> > GunneR <ds@ss.com> wrote:
> > >Ive tried &($func); &{$func} and the like but no go. Im sure theres a
> > ^^^^^^^^
> > That one works fine for me (after turning strict off).
> >
> > What you are asking for is called "Symbolic references". They are bad:
>
> Well. Im not going to argue they arent a good idea, and shouldn't be
> used in general but really 'They are bad' is a little to absolute and
> simple for me.
Yes I think this may be a case of knee-jerk reaction.
> > an alternative where you won't need them, a dispatch table:
> > $subs{$func}->(); # call mysub2()
Personally, while I would discourage the reuse of your main symbol
table as a a dispatch table, I agree with Yves that there's no reason
not to use a separate package symbol table to act as your dispatch
table. Using a package rather than a simple hash the subroutine
declarations look a little tidier and the debugger stack traces look a
_lot_ tidier.
> Im not sure why this is better than using a symbolic reference.
> Is it becuase you are restricted as to which subs you can call?
Yes this is the main reason. Also it keeps the compile-time/run-time
distiction cleaner.
> Anyway, the reason I am posting is cause it seems to me that using OO
> would be a better way to do this.
>
> my $method='new';
> my $obj=Foo::Bar->$method();
Warning: this is still a symbolic reference.
Symbolic method references are exempted from strict checking because
there's no such thing as a hard method reference so if you're using
method reference syntax at all you must have been deliberately using
symbolic references.
Symbolic method references are still eqaually dangerous from a
security standpoint since $method can contain a package qualified name
and there's no recursive check made of @Foo::Bar::ISA to ensure that
the package specified in $method is really an ancestor of Foo::Bar.
> Generally when I have situations where I need to do this kind of thing
> I use OO.
I recommend not using Foo::Bar->$method() unless the OO paradigm fits
for some other reason.
If you want to use a package symbol table rather than a simple hash as
your dispatch table I recommend:
{ no strict 'refs'; "Foo::Bar::$method"->(); }
Or:
*{$Foo::Bar::{$method}}{CODE}->();
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 30 Aug 2001 17:36:04 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Calling sub funcs with scalar variables?
Message-Id: <x7vgj5h2lu.fsf@home.sysarch.com>
>>>>> "n" == nobull <nobull@mail.com> writes:
>> my $method='new';
>> my $obj=Foo::Bar->$method();
n> Warning: this is still a symbolic reference.
n> Symbolic method references are exempted from strict checking because
n> there's no such thing as a hard method reference so if you're using
n> method reference syntax at all you must have been deliberately using
n> symbolic references.
i wouldn't call that symbolic referencing. all methods are looked up at
run time (and that result is cached somewhat), so there is no way to
have strict enforce it as you say. in fact creating a method name on the
fly is a very useful technique and can support polymorphism and other
things. stem uses this to create the best method name for delivery of a
message.
n> Symbolic method references are still eqaually dangerous from a
n> security standpoint since $method can contain a package qualified name
n> and there's no recursive check made of @Foo::Bar::ISA to ensure that
n> the package specified in $method is really an ancestor of Foo::Bar.
use can() to check that first. again, i do that in stem. if you call an
unknown method it is runtime fatal (unless caught with eval) so that is
a caveat to the coder. you can use symbolic methods but check them
before you call them.
n> I recommend not using Foo::Bar->$method() unless the OO paradigm fits
n> for some other reason.
i disagree. it is not for day to day OO but if you understand how to use
it, it is VERY powerful. many languages wish they could select methods
at run time.
n> If you want to use a package symbol table rather than a simple hash as
n> your dispatch table I recommend:
n> { no strict 'refs'; "Foo::Bar::$method"->(); }
n> Or:
n> *{$Foo::Bar::{$method}}{CODE}->();
those are not method calls, they are straight symref sub calls and are
as bad as the original idea.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Search or Offer Perl Jobs -------------------------- http://jobs.perl.org
------------------------------
Date: Thu, 30 Aug 2001 17:29:38 +0100
From: "Michael Ditum" <Mike.Ditum@Doulos.com>
Subject: Can't locate misc.pl in @INC
Message-Id: <999188978.2133.0.nnrp-14.3e31b93c@news.demon.co.uk>
I have perl (activePerl) set up on my Windows2000 Server and it can run
simple perl scripts fine.
I'm trying to run a perl script that uses a package i've created which is in
the same directory as the
script. I've got it to work on another (Windows 2000 Pro) computer which has
apache and activeperl
installed and that worked fine. but when i run it on the Win2K server i get
this message.
CGI Error
The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:
Can't locate misc.pl in @INC (@INC contains: C:/Program Files/Internet
Utils/Perl/lib
C:/Program Files/Internet Utils/Perl/site/lib .) at
C:\Inetpub\wwwroot\cgi-bin\Time_Keeping\addEntryIntro.pl line 4.
i know its not in any of the stated paths as its held in
c:\inetpub\wwwroot\cgi-bin\time_keeping.
it doesn't seem to be checking the current working directory and i can't
work out how to change it.
any help would be greatly appreciated!
Michael Ditum
------------------------------
Date: Thu, 30 Aug 2001 17:42:32 +0100
From: "Peter Mann" <Pcmann1@btinternet.com>
Subject: Comparing two dates! Is there an easy way?
Message-Id: <9mlqb3$ndc$1@plutonium.btinternet.com>
Dear all!
I have a problem trying to compare the date from two DateEntry widgets. I
need to compare the date so that the 'endDate' is after 'startDate'. Is
there an easy way to do this, I can't find a relevant methods in localtime.
Therefore, is the only alternative to code this using a veriety of if
statements for day, month and year? Or is there some easier method?
Any suggestions would be greatly appreciated!
Thanks in advance
- Pete
my $startDate =$tasks_p->DateEntry (-dateformat => 3, -label=>"Start date:
" , -labelPack => [-side => "left"])->pack();
my $endDate =$tasks_p->DateEntry (-dateformat => 3, -label=>"Complete
date: ", -labelPack => [-side => "left"])->pack();
sub addEntry
{
my $start = $startDate->get; # 06/08/2001
my $complete = $endDate ->get; # 04/08/2001
# I need to compare dates and in this case this should invoke an error!
# maybe pring a wanring to the command prompt!
}
------------------------------
Date: Thu, 30 Aug 2001 08:40:46 -0700
From: "Michael Peppler" <mpeppler@peppler.org>
Subject: Re: DBI connect string for Sybase Anywhere Studio (Update)
Message-Id: <tosnk25dthv481@corp.supernews.com>
In article <9mgq15$1ufg6$1@ID-101758.news.dfncis.de>, "Klaus Koch"
<kkoch@kxsu.de> wrote:
> Klaus Koch wrote:
>
>> I want to connect to a Sybase Anywhere Studio database with the
>> DBD::ODBC module. The database server is called "limes" and the
>> database is called "customers".
>> I dont know what to use in the connect string to get access to the
>> database.
>> I tried:
>> $dbh = DBI->connect("dbi:ODBC:'uid=<user>;pwd=<pwd>;eng=limes'"); but I
>> get a connection error.
>
> it doesnt matter what i try, i keep getting this error:
>
> DBI->connect('uid=<user>;pwd=<pwd>;eng=limes') failed: [iODBC][Driver
> Manager]Invalid string or buffer length (SQL-S1090) [iODBC][Driver
> Manager]Data source name not found and no default driver specified.
> Driver could not be loaded (SQL-IM002)(DBD: db_login/SQLConnect err=-1)
> at line 6
>
> the iODBC driver is definately installed in /usr/local/lib and I dont
> get errors from "use DBD::ODBC" and "use DBI" in the perl programm. It
> wasnt me who installed the DBD module and the iODBC driver, so I am not
> very familiar with it and I couldnt find anything about this error on
> the net.
Have you tried the DBD::ASAny module?
Michael
--
Michael Peppler - Data Migrations Inc. - http://www.mbay.net/~mpeppler
mpeppler@peppler.org - mpeppler@mbay.net
International Sybase User Group - http://www.isug.com
------------------------------
Date: Thu, 30 Aug 2001 10:36:08 -0700
From: Bob Holden <bob@eawf.nospam.com>
Subject: Re: Difference between .pl, .cgi, and .pm File Extensions.
Message-Id: <h1usotogbc2s5vrftjvmf2r6s1cqe53k94@4ax.com>
On 30 Aug 2001 09:51:09 GMT, anno4000@lublin.zrz.tu-berlin.de (Anno
Siegel) wrote:
>According to Alan J. Flavell <flavell@mail.cern.ch>:
>> On Aug 29, brian d foy inscribed on the eternal scroll:
>>
>> (re. use of .pl as a filename 'extension'):
>>
>> > perl *library*. some people frown on using this (or any)
>> > extension for scripts. sometimes you'll see .plx (perl
>> > executable) since some operating systems jsut can't do
>> > without.
>>
>> Well, since the canonical building procedure starts with
>>
>> perl Makefile.PL
>>
>> it would seem that someone "in authority" thinks that Perl scripts
>> have a filename extension of .PL (upper case).
>
>I believe this assumes more deliberation than actually went into the
>naming of that file. Before MakeMaker, module authors packed their
>own Makefile with a product. This led to subtle and not-so-subtle
>differences in the make process for each module.
>
>As a remedy, Andreas Koenig wrote MakeMaker. To make it clear that
>you (the module author) were now supposed to replace your former
>Makefile with an equivalent template for MakeMaker, and as an indication
>to you (the module installer) that you were supposed to run it as a
>Perl program, the standard name for the template became Makefile.PL,
>using the established .pl suffix for a Perl program. Why upper-case,
>I do not know.
What I'm starting to glean out of this is that Perl Modules need to be
Installed onto a server or into Perl itself. Is that right?
>
>I am Cc'ing this to Andreas (Hi!) so he can comment if he feels like it.
>
>Anno
------------------------------
Date: 30 Aug 2001 16:13:19 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Errorlevel checking
Message-Id: <9mlomv$cdt$3@bob.news.rcn.net>
Paul Butt <paul_s_b@hotmail.com> wrote:
> I'm writing a small script to do different things depending on the
> particular error level returned by our anti-virus software.
> Can anybody point out the easiest/quicket way to do this ?
perldoc -f system
------------------------------
Date: Thu, 30 Aug 2001 17:23:02 +0100
From: "Graeme" <graeme@essistance.co.uk>
Subject: Extracting data from emails
Message-Id: <9mlpbv$gsa$1@news8.svr.pol.co.uk>
Help!
I've been told that using perl it is possible to create a script that
extracts data from an email to create a text file?!?
I have a form that I receive from a web site that contains fixed fields, I
would like this exporting to a text file so that I can import this into my
Access database.
Anyone know where I can get such a script, needless to say I'm not a perl
expert!
Thanks, any help much appreciated.
G
------------------------------
Date: Thu, 30 Aug 2001 17:12:09 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: File::Find not recursing on Win32 Perl 5.001
Message-Id: <jsssotg3u2eg51ggsfosoi55k9d3q9u1v3@4ax.com>
Phil Hibbs wrote:
>> What version of perl is it? I tried it on 5.6.1 on 2000 Pro.
>
>It's 5.001 as per the subject line. And no, I can't upgrade it, much
>though I'd like to.
You still using Win3.1, or NT3.51? If no, why not?
Funny how people find it natural to upgrade their soft if it's from
Microsoft, but not from anything else.
--
Bart.
------------------------------
Date: Thu, 30 Aug 2001 11:32:57 -0400
From: "Joe Grover" <jgrover@acd.net>
Subject: Formmail 1.9 not sending
Message-Id: <D0tj7.141$L31.108268@newsfeed.slurp.net>
I'm trying to use FormMail on a Windows NT server. I can successfully use
the ASP version of the script, but the way it sorts the fields in the email
leaves a little to be desired.
I downloaded v1.9 of the script from worldwidemart.com and configured my
script the way I normally would. However, when I submit the form, I receive
the following error:
There was no recipient or an invalid recipient specified in the data sent to
FormMail. Please make sure you have filled in the recipient form field with
an e-mail address that has been configured in @recipients. More information
on filling in recipient form fields and variables can be found in the README
file.
This is what I have specified in my form:
<INPUT TYPE=hidden NAME="RECIPIENT" VALUE="grover.joe@acd.net>
As per the README included with the script, I have the following defined for
my @recipients value:
@recipients = @acd.net;
I have also tried this:
@recipients = ('^grover.joe@acd.net');
I have also put acd.net in the @referers variable and tried the following
setting:
@recipients = @referers;
All configurations give the same error. Any thoughts or help is
appreciated. Thanks!
Joe Grover
------------------------------
Date: Thu, 30 Aug 2001 10:09:40 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Godzilla Stomps Code Red
Message-Id: <3B8E7354.7ECCFB6A@stomp.stomp.tokyo>
David Coppit wrote:
> Michel Dalle wrote:
> > Godzilla! wrote:
(snipped)
> > I'm sure I've seen an almost identical script on the Web,
> > with the same twisted logic...
> Ouch. Godzilla is a plaigarist. There goes whatever reputation she had
> left... [And her response was the usual red herring/ad hominem. Methinks
> its must be plaigarism if she won't defend herself...]
Defending myself against you would quite unsporting of me, quite.
You are no match for me in this sport of intellectual fisticuffs.
Doing so would be analgous to my, being a well trained amateur
boxer, stepping into the ring with six average sissified geeks
from this group. I would be perpetrating a wholesale slaughter.
What you think truly doesn't amount to diddly-squat. You are
incapable of producing coherent rational thought, much like
many others populating this newsgroup, most of whom, are you.
What I think is of importance. What I think is I am moderately
perturbed by your second incident of slinging racial slurs at
me. Your first incident being a well remember one, an incident
so abhorrent and morally repugnant, it is unsurpassed by any
other racist events here on the internet. This first incident,
is, of course, your posting of near two pages of vile, vulgar
and vehement racial slurs, under your fake name, Joe Kline.
Unlike you, thank God and Her Gracious Mercy, I do not respond
to you with idiocy, lies, hatred, bigotry and racism. My own
method of retribution for your sociopathic behavior is pulling
con jobs prompting you to expose yourself as the CLPM Troll,
which you do, most reliably. This is no major feat of which
I can boast. Pulling a con upon you requires nothing more than
a light thump upon your fragile masculine ego with my right
little finger; a well practiced finger of con, at that.
Most enjoyable, my con jobs, my prompting you to make a fool
of yourself, is always done so by posting Perl related matters
of significant benefit to all, save for you. I am quite the
talented one, yes, very much so.
A little thump with my little finger and, you come running,
drooling, slobbering and spewing your usual mule manure
proclaiming yourself to be six different people, all of
whom, quite coincidently, elect to write negative responses
to any given article of mine.
You should, in good taste, change your name to Mark, Frank.
Kiralynne Schilitubi
Choctaw Nation
------------------------------
Date: 30 Aug 2001 16:09:40 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: HELP ME: I want to know if with Perl i can use the most popular scientific functions
Message-Id: <9mlog4$cdt$2@bob.news.rcn.net>
xesquiogx <xesquiogx@pobox.com> wrote:
> I´m very interested in know is Perl let me use the scientific
> funciton like sin, cos, sqrt, Statisticals functions.
If you want to know whether or not Perl has a particular function, just
type, for example,
perldoc -f sin
and you'll get a description of the function.
------------------------------
Date: Thu, 30 Aug 2001 23:52:58 +0800
From: John Hennessy <john@hennessy.net.au>
Subject: How to I background a process and not wait for it.
Message-Id: <3B8E6159.E7F84EC1@hennessy.net.au>
Is there a simple way to do the equivalent of a system call but not wait
for it to finish.
I am not too interested in the success of the backgrounded task but I
must be able to move onto the next foreground command in the script.
Thanks
John.
------------------------------
Date: Thu, 30 Aug 2001 16:56:40 +0100
From: "Homer J Simpson" <homer@simpsons.com>
Subject: Re: How to I background a process and not wait for it.
Message-Id: <9mlnnq$ngq$1@news.formus.pl>
if you are on linux and you have the atd demon running then you can do
$return = `yourtask | at now`;
this will run yourtask in the background and return control immediatly to
your script,
thanks
homer
"John Hennessy" <john@hennessy.net.au> wrote in message
news:3B8E6159.E7F84EC1@hennessy.net.au...
> Is there a simple way to do the equivalent of a system call but not wait
> for it to finish.
> I am not too interested in the success of the backgrounded task but I
> must be able to move onto the next foreground command in the script.
>
> Thanks
>
> John.
>
>
------------------------------
Date: 30 Aug 2001 16:07:23 GMT
From: trammell@haqq.hypersloth.invalid (John J. Trammell)
Subject: Re: How to I background a process and not wait for it.
Message-Id: <slrn9ot8bb.705.trammell@haqq.hypersloth.net>
On Thu, 30 Aug 2001 23:52:58 +0800, John Hennessy wrote:
> Is there a simple way to do the equivalent of a system call but not wait
> for it to finish.
> I am not too interested in the success of the backgrounded task but I
> must be able to move onto the next foreground command in the script.
This is answered in Perl FAQ 8: "How do I start a process in
the background?"
--
Aren't you, at this point, cutting down a California Redwood using a
banana *and* a particle accelerator?
- Bernard El-Hagin, in CLPM
------------------------------
Date: Thu, 30 Aug 2001 10:42:37 -0500
From: "Michael D. Kirkpatrick" <wizard@psychodad.com>
Subject: Re: Is element in array
Message-Id: <3B8E5EED.C9632CD7@psychodad.com>
Joe Schaefer wrote:
> --
> perl -wle '$,=" ";{ my @x; sub x{if(@_){push @x,@_; return sub{push @x,@_; @x}}
> sub{push @x,@_; @x}}
> } print x ("Just")->("another"), x -> ("perl" , "hacker,")'
You must be slipping... Why end it with a comma and not the period. You need to
change "hacker," to "hacker."
------------------------------
Date: 30 Aug 2001 16:40:36 GMT
From: Tina Mueller <tinamue@zedat.fu-berlin.de>
Subject: MIME::Lite quoted-printable
Message-Id: <9mlqa4$2vs2e$2@fu-berlin.de>
hi,
i've got a problem with sending a quoted-printable encoded
email.
i'm using the following:
my $sub = "Subject with oe => ö";
my $msg = new MIME::Lite
From => "webmaster\@server.de",
To => $to,
Subject => $sub,
Type => 'text/plain; charset="iso-8859-1"; format=flowed',
# alternatively i tried Type => 'TEXT'
Encoding => "quoted-printable",
Data => $body;
$msg->send; # with sendmail
this works, if there is no ö in the subject, but
if there is, then the mailserver replaces
the whole quoted-printable-header; the encoding is still
quoted-printable, but the header is missing.
how can i convert letters like ü,ö,ä,ß in the subject into a
mail-readable format?
if i send out such an email with my mail-client, ö gets
converted into '=?iso-8859-1?Q?=F6?='. what do I have
to do in my script to convert it in this format?
is there a module for that? MIME::Tools, etc. don't seem
to support that.
sorry if this an FAQ or belongs to another NG, i just
would like to know if there's a module for it.
thanks,
tina
--
http://www.tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
--- Warning: content of homepage hopelessly out-dated ---
------------------------------
Date: Thu, 30 Aug 2001 18:40:57 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: MIME::Lite quoted-printable
Message-Id: <3B8E6C99.1030503@post.rwth-aachen.de>
Tina Mueller wrote:
> how can i convert letters like ü,ö,ä,ß in the subject into a
> mail-readable format?
Well, the Transfer-Encoding-field only relates to the body of an email
and not to the header. If you have special characters in the header, you
need to encode them by hand. A thus encoded string has a special form:
=?CHARCTER-SET?q?ENCODED-STRING?=
Hence, you can try something like this:
use MIME::QuotedPrint;
$n = "nasty string with ööööääääüüüüü";
$subj = "=?iso-8859-1?q?".encode_qp($n)."?=";
Of course, if you use even weirder characters than German umlauts that
aren't covered by iso-8859-1, you'd have to specify another
character-set.....and hope, the recipient has this one installed. ;-)
> if i send out such an email with my mail-client, ö gets
> converted into '=?iso-8859-1?Q?=F6?='. what do I have
> to do in my script to convert it in this format?
> is there a module for that? MIME::Tools, etc. don't seem
> to support that.
I am not sure whether perhaps MIME::Head could do that for you. However,
if you can't find a module for that do it yourself as described above.
Tassilo
--$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};
------------------------------
Date: 30 Aug 2001 16:55:41 GMT
From: Tina Mueller <tinamue@zedat.fu-berlin.de>
Subject: Re: MIME::Lite quoted-printable
Message-Id: <9mlr6d$2vs2e$3@fu-berlin.de>
Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de> wrote:
> Tina Mueller wrote:
>> how can i convert letters like ü,ö,ä,ß in the subject into a
>> mail-readable format?
> Well, the Transfer-Encoding-field only relates to the body of an email
> and not to the header. If you have special characters in the header, you
> need to encode them by hand. A thus encoded string has a special form:
> =?CHARCTER-SET?q?ENCODED-STRING?=
> Hence, you can try something like this:
> use MIME::QuotedPrint;
> $n = "nasty string with ööööääääüüüüü";
> $subj = "=?iso-8859-1?q?".encode_qp($n)."?=";
aah, thanks, i actually tried this but i made
something else wrong. (i think i
encoded the string two times or something).
this works. (the script is a little bit
more complicated...)
> Of course, if you use even weirder characters than German umlauts that
> aren't covered by iso-8859-1, you'd have to specify another
> character-set.....and hope, the recipient has this one installed. ;-)
actually, at the moment it's just the "ü" =)
>> if i send out such an email with my mail-client, ö gets
>> converted into '=?iso-8859-1?Q?=F6?='. what do I have
>> to do in my script to convert it in this format?
>> is there a module for that? MIME::Tools, etc. don't seem
>> to support that.
> I am not sure whether perhaps MIME::Head could do that for you. However,
> if you can't find a module for that do it yourself as described above.
i looked into MIME::Head, but didn't find anything.
but the above way seems to be okay.
thanks,
tina
--
http://www.tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
--- Warning: content of homepage hopelessly out-dated ---
------------------------------
Date: Thu, 30 Aug 2001 15:33:38 GMT
From: davidkrainess@yahoo.com (David Krainess)
Subject: Net::FTP question
Message-Id: <910D55953davidkrainessyahooco@38.8.213.2>
Background: I transfer a linux mail tarball backup file to our production
NT server for backup purposes (my NT box has a DLT).
I run this on NT using the latest Activestate.
###Begin Code Snippet
use Net::FTP;
$ftp = Net::FTP->new("38.170.xxx.xx");
$ftp->binary();
$ftp->login("xxxx","xxxx");
$ftp->cwd("/");
$ftp->get("mailbackup.gz");
$ftp->quit;
###End Code Snippet
The file transfers and has the same size is reported.
The problem. The transfered file is corrupted on the NT box. If I use
another FTP client (such as WS-FTP), the file is fine. The problem is with
the Net::FTP I believe.
Anyone heard of this before? Perhaps "$ftp->binary();" needs an arguement?
Any help is greatly appreciated.
------------------------------
Date: 30 Aug 2001 08:10:03 -0700
From: billy@arnis-bsl.com (Ilja Tabachniks)
Subject: Re: Network topology mapping
Message-Id: <5d4a715a.0108300710.4da3df22@posting.google.com>
xenite9@my-dejanews.com (Adam) wrote in message news:<b67a511f.0108292137.63f7bac0@posting.google.com>...
> Hello,
>
> How do I take the output of traceroute each time it is run, compare it
> to a previous (array?) route, remove duplicates, and store new values
> in an array?
>
BTW, you may wish to take a look at Net::Traceroute module
(available from CPAN).
Good luck,
Ilja.
------------------------------
Date: 30 Aug 2001 09:49:53 -0700
From: tomfolkes@hotmail.com (Tom Folkes)
Subject: newbe problem with Perl
Message-Id: <7ee7b25f.0108300849.7d74878f@posting.google.com>
I am moving a working Perl code from one machine to another. In
theory they are the same.
I get the following error message.
(program name) did not produce a valid header (program terminated
without a valid CGI header. Check for core dump or other abnormal
termination)
Any help would be appreciated. -Tom
------------------------------
Date: 30 Aug 2001 17:19:37 GMT
From: trammell@haqq.hypersloth.invalid (John J. Trammell)
Subject: Re: newbie problem with Perl
Message-Id: <slrn9otciq.7do.trammell@haqq.hypersloth.net>
On 30 Aug 2001 09:49:53 -0700, Tom Folkes <tomfolkes@hotmail.com> wrote:
> I am moving a working Perl code from one machine to another. In
> theory they are the same.
>
> I get the following error message.
>
> (program name) did not produce a valid header (program terminated
> without a valid CGI header. Check for core dump or other abnormal
> termination)
>
> Any help would be appreciated. -Tom
What do you get when you run the script from the command line?
--
I don't know what the hell is going on dude, but this suspension gives
me more time for fraggin'. Yee haw!
------------------------------
Date: Thu, 30 Aug 2001 15:52:31 GMT
From: ewhite@nospam.ssc.wisc.edu (Eric White)
Subject: number of variables limit in CSV files?
Message-Id: <9mlni3$jh2$1@news.doit.wisc.edu>
I've got some web pages that had been writing data to individual files, but
I'd like to consolidate things and write all the data to one big table. There
are about 1600 variables in this series of pages.
I created a CSV file, which is empty now, except for the header line listing
all 1600 variables. When I try to run the following code, it runs without
reporting any errors, but no values are written to the CSV file.
When I change the CSV file to contain only 10 variables, it runs fine and data
are written. I'm guessing there's some sort of limit on the number of
variables I can have in a CSV file using DBD-CSV. Is this an accurate guess?
Just out of curiosity does anyone know what the limit is?
I'm planning on installing MySQL in response to this. I think this will solve
my problem, but any comments on this plan are welcome, too.
Thanks for any replies.
Here's the code I'm using:
my $dbh = DBI-> connect("DBI:CSV:f_dir=/testing/table/") or die "Cannot
connect: ".$DBI::errstr;
flock (test, LOCK_EX );
#insert new WORKFAMID value into database
my $sth = $dbh->prepare ( "INSERT INTO test (WORKFAMID) VALUES (1234)" ) or
die "Cannot do: " .$dbh->errstr();
$sth->execute();
foreach $key (keys %allvars) {
my $invar = $dbh->quote( $allvars{$key});
my $sth2 = $dbh->prepare ( "UPDATE test SET $key=$invar WHERE
WORKFAMID=1234" ) or
die "Cannot do: " .$dbh->errstr();
$sth2->execute();
}
flock (test, LOCK_UN);
$dbh->disconnect();
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 1658
***************************************