[18439] in Perl-Users-Digest
Perl-Users Digest, Issue: 607 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 3 00:06:09 2001
Date: Mon, 2 Apr 2001 21:05:45 -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: <986270744-v10-i607@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 2 Apr 2001 Volume: 10 Number: 607
Today's topics:
Re: - Looking for this type of TALKBACK user feedback s <blah@blah.com>
Re: - Looking for this type of TALKBACK user feedback s <vemba72@hotmail.com>
Re: Adding Values from an Array (Anno Siegel)
Re: Advice on speeding up Perl launch <iltzu@sci.invalid>
Re: atan2(y,x)*180/pi; (Mark Jason Dominus)
Re: atan2(y,x)*180/pi; <joe+usenet@sunstarsys.com>
Re: bash history from perl? (Monte)
Re: binaries with Net::SMTP <dan@tuatha.sidhe.org>
Re: binaries with Net::SMTP <hillr@ugs.com>
Re: binaries with Net::SMTP (Logan Shaw)
breakpointing at a in another another module <cs61b-tf@cory.eecs.berkeley.edu>
Re: breakpointing at a in another another module <kevin@vaildc.net>
Chroot and IO::Socket::INET <admin@gatordev.net>
Re: Data::Dumper (Anno Siegel)
Re: DBI AS/400? (Alan Barclay)
Re: DBI AS/400? (Jason)
Dialect Translator Script <rgosens2@zonnet.nl>
Re: Disguising Perl scripts (Rafael Garcia-Suarez)
Email Gurus - Help! <zkent@together.net>
evaluating a dereference in a method call (Eric Smith)
Re: Extract JPEG's Width & Height - How? (Mark Jason Dominus)
Re: FAQ 8.24: Why can't I get the output of a command <goldbb2@earthlink.net>
Re: fetch back STDERR outputs <goldbb2@earthlink.net>
Re: Formatting HTML using Perl <patrickolson@qwest.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 1 Apr 2001 09:57:03 +0100
From: "Phil Hayz" <blah@blah.com>
Subject: Re: - Looking for this type of TALKBACK user feedback script... --
Message-Id: <W1Cx6.8134$u93.1097381@news6-win.server.ntlworld.com>
"Jon" <vemba72@hotmail.com> wrote wrote the following drivel:-
>
> Are you guys done being condescending cumstains now, or is there more to
> this routine I haven't yet seen?
There'll probably be more, stick around and see.
> For what it's worth, emailing the site owners is something I did way
before
> I posted the question the FIRST time.
Good boy.
> Not that it matters, of course.
No?
> Is this the part where you ask me what they said, or can you pretty much
> figure that one all by yourself?
What did they say?
> You are so damn witty, after all.
Whythankewe
Oh and be a good lad and read this
http://members.home.net/krobb7/quoting.html
--
Phil Hayz
http://allmyfaqs.com/ - FAQ's
http://www.w3schools.com/ - Web building tutorials
http://members.home.net/krobb7/quoting.html - Please, FFS, bottom post
------------------------------
Date: Sun, 1 Apr 2001 03:47:37 -0400
From: "Jon" <vemba72@hotmail.com>
Subject: Re: - Looking for this type of TALKBACK user feedback script... --
Message-Id: <d3Bx6.120$104.7242@wagner.videotron.net>
Are you guys done being condescending cumstains now, or is there more to
this routine I haven't yet seen?
For what it's worth, emailing the site owners is something I did way before
I posted the question the FIRST time.
Not that it matters, of course.
Is this the part where you ask me what they said, or can you pretty much
figure that one all by yourself?
You are so damn witty, after all.
"Phil Hayz" <blah@blah.com> wrote in message
news:6N4x6.4219$MZ2.769859@news2-win.server.ntlworld.com...
> "Mogga" <mogga@mogga.com> wrote the following drivel:-
> >
> > >>
> > >> Email the site owners.
> > >> --
> > >
> > >I told him to do that when he asked exactly the same question about two
> or
> > >three weeks ago. Obviously he took no notice.
> > >
> >
> > Ohhhhhhhhh why doesn't that surprise me?
> >
>
> Cause he's clearly a silly bugger?
> Cause you're not easily surprised?
> Cause you're psychic?
> Cause you are in fact Jon in disguise?
> Cause you're sleeping with him on the sly and you know what he's like?
>
> : ¬)
>
> --
> Phil Hayz
> http://allmyfaqs.com/ - FAQ's
> http://www.w3schools.com/ - Web building tutorials
> http://members.home.net/krobb7/quoting.html - Please, FFS, bottom post
>
>
------------------------------
Date: 31 Mar 2001 13:02:19 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Adding Values from an Array
Message-Id: <9a4kgr$he8$3@mamenchi.zrz.TU-Berlin.DE>
According to Chris Stith <mischief@velma.motion.net>:
> Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>
> > [dysfunctional comp.lang.perl trimmed from the newsgroups]
>
> > According to Chris Stith <mischief@velma.motion.net>:
> >> FORM Rookie <m0rejunkmail@home.com> wrote:
> >> > OK here we go again. I need your help.
> >>
> >> > Here's what I have:
> >>
> >> > %some_things = ($thing1 => "2",
> >> > $thing2 => "4");
> >>
> >> [snip]
> >>
> >> > I need to add the values of $thing1 (2) and $thing2 (4) for a Grand
> >> > Total.
> >>
> >> [snip]
> >>
> >> my $total = eval join '+', values %foo;
>
> > Oh, come on. This may look pretty, but it is about as elegant as
> > shaving with a lawn mower. Don't string-eval unless you must.
>
> Okay, let's relegate it to golf, then. I guess I'm just having
> flashbacks to another language where evaluating a string isn't
> such a strike on performance. What ever did happen to my Rexx
> manual, anyway? Oh, that's right, I ritualistically burned it
> when I started learning Perl.
Ah, Rexx. Could it be that the hit isn't so bad because Rexx *is*
a string-interpreting engine?
> >> or maybe:
> >>
> >> my $total;
> >> for (values %foo) { $total += $_ }
>
> > The standard solution. It is 26 times more efficient than the eval-
> > thing on my machine.
>
> But not as pretty. ;-)
>
> I am surprised it's only 26 times more efficient.
>
>
> >> or for the really perverse:
> >>
> >> my $total;
> >> $total = (map { $total += $_ } values %foo)[-1];
>
> > Well... ahem... never mind :)
>
> I did place a warning on that one.
I was just afraid you were succumbing to the relentless propaganda
of the AAEVC[1], led by one prominent clpm poster. I note you are
still using one element of map's array, so there is hope.
[snip]
Anno
[1] Action for Application of Eval in Void Context, called CWA[2]
by its detractors.
[2] Cycle Waster's Association
------------------------------
Date: 1 Apr 2001 11:47:40 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Advice on speeding up Perl launch
Message-Id: <986124924.24423@itz.pp.sci.fi>
In article <3ac67ecc$1@news.dsldesigns.com>, David Akers wrote:
>I am running a web server with Activestate perl, Apache running on windows
>98.
>
>It takes 3 seconds to launch any Perl script - not bad really, but I would
>like it to be a bit more snappy.
3 seconds?? That's ridiculously slow. It shouldn't take more than a
second, even in the worst case, even on Windows. No way.
The only sensible explanation I can think of is that you're running out
of memory, and Windows has to start swapping data to the disk to get
enough free space for perl to load. That *can* really take a while,
particularly if it ends up having to immediately read back something it
just swapped out, etc.
If that's the case, the solution is to get more RAM. Of course, even if
it isn't, extra memory won't hurt anything but your wallet.
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla / Kira -- do not feed the troll.
------------------------------
Date: Sat, 31 Mar 2001 16:37:06 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: atan2(y,x)*180/pi;
Message-Id: <3ac607b1.5c4b$e3@news.op.net>
Keywords: ambling, discrepant, pickoff, referent
In article <9a39gv$r1b$1@newsg4.svr.pol.co.uk>,
Milliwave <milliwave@rfengineering.freeserve.co.uk> wrote:
>The problem still exists
>when I use atan(y,x)*180/pi;
>say y= -600
> x = -600
>answer = 45 degrees but instead gives me approx 90 degress
The correct answer is -135 degrees, not 45 degrees, and that is indeed
what I get:
% perl -le 'print atan2(-600,-600)*180/3.14159'
-135.000114029718
If you get 'approx 90 degrees' you should show the *exact* code that
you're using, because either you're making a weird mistake (which we
won't be able to guess) or your atan2() really is broken (which we
also won't be able to guess.)
>>when y is (say) 0 and x = -600
>>$variable gives me an answer of 180 degrees which is incorrect,
No, you are mistaken. 180 is exactly the right answer.
0 degrees is east; 90 degrees is north; 180 degrees is west.
The point (-600, 0) is on the negative X axis, which is indeed west.
>>atan2(0, -600) should be equal to zero,
Certainly not. You are confused.
------------------------------
Date: 31 Mar 2001 17:10:30 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: atan2(y,x)*180/pi;
Message-Id: <m33dbt7fop.fsf@mumonkan.sunstarsys.com>
jmcnamara@cpan.org (John McNamara) writes:
> Ar 30 Mar 2001 19:53:07 -0500, do scriobh Joe Schaefer:
> > "A cynic is a man who knows the price of everything and the
> > value of nothing."
> > --Mark Twain
>
> s/Mark Twain/Oscar Wilde/
Ah, I knew something useful would come of this thread. I've got too many
Twain-isms as it is ;-)
Actually I've been considering posting a url to my sig rotator and news
"filter" (a twisted adaptation tchrist's msgchk script he posted here a
few months ago), so corrections are most welcome and appreciated.
They're (taint-clean) gnus-centric scripts, but should be easily
modifiable by any suitably motivated individual.
Then again, most people here can easily write their own :-)
Thanks again.
--
Joe Schaefer "Most people are other people. Their thoughts are someone else's
opinions, their lives a mimicry, their passions a quotation."
-- Oscar Wilde
------------------------------
Date: Sat, 31 Mar 2001 15:47:40 GMT
From: montep@about.com (Monte)
Subject: Re: bash history from perl?
Message-Id: <3ac5fb65.16950143@news.hal-pc.org>
On Fri, 30 Mar 2001 23:12:37 +0000 (UTC), abigail@foad.org (Abigail)
wrote:
>Peter Bismuti (bismuti@cs.fsu.edu) wrote on MMDCCLXVIII September
>MCMXCIII in <URL:news:9a0lo3$qto$1@news.fsu.edu>:
>,,
>,, I tried writing a script that executed the 'history' command and
>,, parsed the output. What I discovered is that the history command is
>,, a bash command, there is no binary file, no /bin/history or
>,, /usr/bin/history. I can't figure out any way of executing it from within
>,, perl, `` don't work. Reading in the .bash_history command directly
>,, doesn't work either since the history is cached and what is in the file
>,, does not represent the current history, but what the history was the
>,, last time a shell exited ( I believe ).
>,,
>,,
>,, How can this be done?
Your problem probably isn't a Perl problem. It's the usual suspects.
1. Permissions Root/owner only
2. Proper pathing /home/owner/.bash_history
3. Did you remember the "." it is part of the file name.
I just got off my Linux and wrote a perl script that worked fine,
followed up with a C as well.
if your gonna spam.....
admin@loopback, $LOGIN@localhost, $LOGNAME@localhost, $USER@localhost, $USER@$HOST, -h1024@localhost, root@mailloop.com root@localhost, postmaster@localhost, admin@localhost, abuse@localhost Chairman Reed Hundt: rhundt@fcc.gov Commissioner James Quello: jquello@fcc.gov Commissioner Susan Ness: sness@fcc.gov Commissioner Rachelle Chong: rchong@fcc.gov US Postal Service: customer@email.usps.gov Fraud Watch: fraudinfo@psinet.com Pyramid Schemes: pyramid@ftc.gov Federal Trade Commission: consumerline@ftc.gov net-abuse@nocs.insp.irs.gov
------------------------------
Date: Mon, 02 Apr 2001 16:53:36 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: binaries with Net::SMTP
Message-Id: <k82y6.79330$Ok4.6431235@news1.rdc1.ct.home.com>
novastar <root@novastar.dtds.net> wrote:
> Thanks Logan,
> I knew it, it would be hard !
While I'm not entirely sure that's a bad thing, (Though not quite as
bad as jeapordy posting... :) it's not that hard. While MIME::Tools
would work OK for this, MIME::Lite would be a better one.
Dan
> "Logan Shaw" <logan@cs.utexas.edu> wrote in message
> news:9a9blv$b17$1@boomer.cs.utexas.edu...
>> In article <986195439.688961@athnrd02.forthnet.gr>,
>> novastar <root@novastar.dtds.net> wrote:
>> >Is there any way to post binaries with Net::SMTP module ? I can post
> plain
>> >text but what about small images (gif) ?
>>
>> SMTP allows you to send mail messages.
>>
>> Those mail messages may contain attachments, but that's
>> pretty much a separate issue from sending the mail messages.
>>
>> I suggest if you want to create messages with attachments
>> that you look into the MIME-tools distribution. See
>> http://search.cpan.org/search?mode=dist&query=MIME-tools .
>>
>> - Logan
>> --
>> whose? my your his her our their _its_
>> who's? I'm you're he's she's we're they're _it's_
------------------------------
Date: Mon, 02 Apr 2001 10:18:39 -0700
From: Ron Hill <hillr@ugs.com>
Subject: Re: binaries with Net::SMTP
Message-Id: <3AC8B46F.49970CC9@ugs.com>
novastar wrote:
>
> Thanks Logan,
>
> I knew it, it would be hard !
>
> George
>
[snipped]
It's not that hard try something like this
use Mail::Internet;
use MIME::Entity;
$top = MIME::Entity-> build( Type => "multipart/mixed",
From => 'someone@somewhere.com',
To => 'someone@somewhere.com',
Subject => "test message",
);
$top->attach( Path => '/your/binary/here',
Type => "/your/type/here",
Encoding => "base64");
$top->attach(Path=>"/your/text/file/here");
$top->smtpsend(host=>'your.smtphost.here');
------------------------------
Date: 2 Apr 2001 22:16:20 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: binaries with Net::SMTP
Message-Id: <9abfa4$39l$1@boomer.cs.utexas.edu>
In article <9aalhp$6qn$1@216.155.32.18>,
Scott R. Godin <webmaster@webdragon.unmunge.net> wrote:
>does this use Net::SMTP ?
>
>if so, it might also be sending invalid RFC-822 headers (something I
>encountered recently).. Would anyone know the method for sending the
>above (or similarly via MIME::Lite) created MIME message via
>Mail::Mailer instead?
It shouldn't use invalid rfc822 stuff. MIME stands for Multipurpose
Internet Mail Extensions, meaning that it's rfc822 plus attachments.
So, a valid MIME message should (in theory) be a valid RFC 822 message.
However, if still want to send via Mail::Mailer (several valid reasons
to do this probably exist), then I believe there is a method to convert
a MIME entity into its string representation. I believe you could do
that and then send it.
- Logan
--
whose? my your his her our their _its_
who's? I'm you're he's she's we're they're _it's_
------------------------------
Date: Sat, 31 Mar 2001 05:07:53 -0800
From: "David Liu" <cs61b-tf@cory.eecs.berkeley.edu>
Subject: breakpointing at a in another another module
Message-Id: <9a4kos$5bh$1@agate.berkeley.edu>
Hi,
Suppose that I do the following:
> perl -d driver.pl
driver.pl uses someClass.pm
and I want to breakpoint in someClass.pm, line 55.
is there anyway I can tell the debugger to do this off the top? For example:
b someClass.pm:55
The line above does not work, but can anybody tell me how to do what I want
to do? I know about:
b someClass::someMethod
which works, but I was hoping for a finer granularity breakpointing
mechanism.
TIA
------------------------------
Date: Sat, 31 Mar 2001 09:55:36 -0500
From: Kevin Michael Vail <kevin@vaildc.net>
Subject: Re: breakpointing at a in another another module
Message-Id: <310320010955366039%kevin@vaildc.net>
In article <9a4kos$5bh$1@agate.berkeley.edu>, David Liu
<cs61b-tf@cory.eecs.berkeley.edu> wrote:
> Suppose that I do the following:
>
> > perl -d driver.pl
>
> driver.pl uses someClass.pm
>
> and I want to breakpoint in someClass.pm, line 55.
f someClass.pm
This sets the debugger to be looking at someClass.pm. Then you can
list, set breakpoints, etc. by line number.
--
Kevin Michael Vail | a billion stars go spinning through the night,
kevin@vaildc.net | blazing high above your head.
. . . . . . . . . | But _in_ you is the presence that
. . . . . . . . . | will be, when all the stars are dead. (Rainer Maria Rilke)
------------------------------
Date: Tue, 03 Apr 2001 01:20:53 GMT
From: Scott <admin@gatordev.net>
Subject: Chroot and IO::Socket::INET
Message-Id: <3AC8CF2B.784B1313@gatordev.net>
I'm running Apache in a chroot environment on the latest version of
FreeBSD.
I tried to run a perl script that opens up an internet socket..
I get this error: cannot determine protocol
the socket is constructed with proto => 'tcp'
Just for laughs I made a oneline perl script that reads:
print getprotobyname('tcp');
That will print out a value when ran outside the chroot but not inside.
This leads me to believe that I need to put some system libraries into
my
chroot, since perl's socket stuff is dependent upon them, but I don't
know which ones. Any help is appreciated.
Thanks,
Scott
------------------------------
Date: 31 Mar 2001 13:01:13 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Data::Dumper
Message-Id: <9a4kep$he8$2@mamenchi.zrz.TU-Berlin.DE>
According to Uri Guttman <uri@sysarch.com>:
> >>>>> "AS" == Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> writes:
>
> AS> I find that Data::Dumper doesn't do what I expect:
> AS> my $x = [ ( [] ) x 2 ];
>
> AS> $y = eval Dumper( $x);
>
> AS> $VAR1 = [
> AS> [],
> AS> $VAR1->[0]
> AS> ];
>
> set this global before you call Dumper
>
> $Data::Dumper::Purity = 1 ;
>
> you now will get:
>
> $VAR1 = [
> [],
> []
> ];
> $VAR1->[1] = $VAR1->[0];
>
> which is what you wanted.
Aha. The documentation led me to believe the Purity flag was only
required when circular references are involved. (I tried it anyway
and fell for the same trap Tina mentions elsewhere in this thread:
eval no longer returns the recovered data structure but whatever
the last "extra" statement happens to return.)
Thanks to you and Tina for clearing this up, and also for the
rest of this thread, which I read with interest.
Anno
------------------------------
Date: 1 Apr 2001 02:52:27 GMT
From: gorilla@elaine.furryape.com (Alan Barclay)
Subject: Re: DBI AS/400?
Message-Id: <986093537.14125@elaine.furryape.com>
In article <3abfa001.642799@nntp.rhtc.net>, Jamie <jrdarkiii@rhtc.net> wrote:
>I'll try not to be too vague...Here goes...Anyone had any experience
>getting mainframe data on the web for businesses?? It seems there are
>alot of AS/400's out there...Someone in the know let me in on how they
Well an AS/400 isn't a mainframe. It's a minicomputer. My experience
is mainly with mainframes, but I think it's still applicable.
MQ series is a common way of accessing mainframe data. Basically you
pass a message to a mainframe program, which will then send you a message
with the data you want.
------------------------------
Date: Sun, 01 Apr 2001 05:12:01 GMT
From: none@none.com (Jason)
Subject: Re: DBI AS/400?
Message-Id: <3ac6b89e.4851928@pubnews.netcom.net.uk>
On 1 Apr 2001 02:52:27 GMT, gorilla@elaine.furryape.com (Alan Barclay)
wrote:
>In article <3abfa001.642799@nntp.rhtc.net>, Jamie <jrdarkiii@rhtc.net> wrote:
>>I'll try not to be too vague...Here goes...Anyone had any experience
>>getting mainframe data on the web for businesses?? It seems there are
>>alot of AS/400's out there...Someone in the know let me in on how they
>
>Well an AS/400 isn't a mainframe. It's a minicomputer. My experience
>is mainly with mainframes, but I think it's still applicable.
>
>MQ series is a common way of accessing mainframe data. Basically you
>pass a message to a mainframe program, which will then send you a message
>with the data you want.
>
Actuly the AS/400 uses the db2/udb. You should be able to use the perl
DBD::DB2 with standard sql statements.
------------------------------
Date: Sun, 1 Apr 2001 00:50:58 +0200
From: "Rik G." <rgosens2@zonnet.nl>
Subject: Dialect Translator Script
Message-Id: <84tx6.1913$Aa.11271@zonnet-reader-1>
Can anyone point me to a Dialect Translator script, preferably using CGI.
Regards
Rik
------------------------------
Date: Mon, 02 Apr 2001 15:14:18 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Disguising Perl scripts
Message-Id: <slrn9ch5qt.2aa.rgarciasuarez@rafael.kazibao.net>
Tad McClellan wrote in comp.lang.perl.misc:
> Mark Warnes <mark.warnes@limecs.com> wrote:
> >
> >The problem I have is that I need to disguise the Perl
> >source
>
> Perl FAQ, part 3:
>
> "How can I hide the source for my Perl program?"
Besides the FAQ, there's a funny obfuscation module on CPAN (uploaded
yesterday, 1st april):
http://search.cpan.org/search?dist=Buffy-1.00
I wouldn't use it to do anything serious though. But is hiding the
source of a program written in an interpreted language serious?
--
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: Mon, 2 Apr 2001 15:37:37 -0400
From: "Zachary Kent" <zkent@together.net>
Subject: Email Gurus - Help!
Message-Id: <Lw4y6.1783$jc2.557071@nntp2.onemain.com>
I am creating a script for a client that needs a small ASCII file attached
to an email message. I am using Sendmail to generate the mail - no problem
there. The host is AT&T and they dont have Mime::Lite or Mail::Sender
installed and won't do it. I found a bash script that (I am told) generates
the correct boundaries and mimetypes for attachments using sendmail but I am
having trouble converting it to Perl.
I don't know what to do with the line:
echo /usr/bin/mimencode $filename
Here is the bash script. My script is below it.
######## bash script ##########
#!/bin/bash
#
# Script: sendfile
#
# Purpose: Send the specified file via email as a MIME
# attachment to the specified address.
#
# Author: Anthony E. Greene <agreene@pobox.com>
#
# License: GPL <http://www.gnu.org/>
#
# Note: This script does not include any error checking, so
# it should only be called from within other scripts.
# The correct syntax for using this script is:
#
# sendfile filename user@domain | /path/to/sendmail -t
#
# First we set up some global variables.
# Some code should be added to verify the commandline arguments.
sender=root@localhost
filename=$1
basefile=`/bin/basename $filename`
recipient=$2
DATE=`date -I`
echo From: $sender
echo To: $recipient
echo Subject: File $basefile from $DATE
echo MIME-Version: 1.0
echo "Content-Type: multipart/mixed;
Boundary=\"sendfile-attachment-boundary\""
echo
echo --sendfile-attachment-boundary
echo 'Content-Type: text/plain; charset=us-ascii'
echo
echo This is a MIME encoded message. If your mail software
echo cannot properly handle the attached file, you may need
echo to get a MIME-aware mailer.
echo
echo --sendfile-attachment-boundary
echo "Content-Type: application/octet-stream; name=\"$basefile\""
echo Content-Transfer-Encoding: base64
echo "Content-Disposition: attachment; filename=\"$basefile\""
echo
/usr/bin/mimencode $filename
echo --sendfile-attachment-boundary--
#end of script
########### my script ##############
#!/opt/local/bin/perl
print "Content-type: text/html\n\n";
#### Global Variables
$mail_prog = '/usr/lib/sendmail';
open (MAIL,"|$mail_prog -t") or &CgiError("File Error: $mail_prog $!");
print MAIL ("To: zkent\@together.net\n");
print MAIL ("From: test\@serviceadvisortablet.com\n");
print MAIL ("Reply-to: reply\@serviceadvisortablet.com\n");
print MAIL ("Subject: Test of attachment\n\n");
print MAIL ("MIME-Version: 1.0");
print MAIL ("Content-Type: multipart/mixed;
Boundary=\"sendfile-attachment-boundary\"");
print MAIL ("\n");
print MAIL ("--sendfile-attachment-boundary");
print MAIL ("Content-Type: text/plain; charset=us-ascii");
print MAIL ("\n");
print MAIL ("This is a MIME encoded message. If your mail software");
print MAIL ("cannot properly handle the attached file, you may need");
print MAIL ("to get a MIME-aware mailer.");
print MAIL ("\n");
print MAIL ("--sendfile-attachment-boundary");
print MAIL ("Content-Type: application/octet-stream; name=\"file.txt\"");
print MAIL ("Content-Transfer-Encoding: base64");
print MAIL ("Content-Disposition: attachment; filename=\"test.log\"");
print MAIL ("--sendfile-attachment-boundary--");
close MAIL;
print "done";
Thanks in Advance,
Zach
------------------------------
Date: 2 Apr 2001 14:01:46 GMT
From: eric@fruitcom.com (Eric Smith)
Subject: evaluating a dereference in a method call
Message-Id: <slrn9ch1i5.3sm.eric@apple.fruitcom.com>
How may I get the following working two lines ...
my $ldap_method=$_[0]->{ldap_method};
my $result = $ldap->$ldap_method(&return_ldap_entry_object);
into one line ... (nievely) like ...
my $result = $ldap->$_[0]->{ldap_method}(&return_ldap_entry_object);
... which does not work as do not a number of permutations I have
tried.
Eric Smith
------------------------------
Date: Mon, 02 Apr 2001 16:51:38 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: Extract JPEG's Width & Height - How?
Message-Id: <3ac8ae19.28c9$1d3@news.op.net>
In article <tch1pu1t0rhje0@corp.supernews.com>,
Dave Dumond <ddumond@firstauto.com> wrote:
>Is it possible to use Perl to open a JPEG binary file and extract the JPEG's
>width and height parameters?
The Image::Size module, which you can find at search.cpan.org, is very
nice for that.
------------------------------
Date: Sun, 01 Apr 2001 03:50:52 GMT
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: FAQ 8.24: Why can't I get the output of a command with system()?
Message-Id: <3AC6A66F.432A04E4@earthlink.net>
Matthew O. Persico wrote:
>
> PerlFAQ Server wrote:
[snip]
> Given this, how useful does anyone else feel about a module that could
> call a 'command' with the following properties:
>
> - Get the output (a 'la backticks)
> - Get the exit info (a 'la system)
> - Specify which exit values indicate success/warning/failure and text
> to describe each status
> - Specify a timeout maximum running time in seconds, after which the
> command is killed, all output to that point is returned.
Sounds like you want to use the "Expect" module from cpan.
--
Sometimes the journey *is* its own reward--but not when you're trying to
get to the bathroom in time.
------------------------------
Date: Sun, 01 Apr 2001 05:22:11 GMT
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: fetch back STDERR outputs
Message-Id: <3AC6BBD5.FD3316D0@earthlink.net>
Rick Delaney wrote:
>
> Mark Jason Dominus wrote:
> >
> > In article <3AC34836.BB261E6@home.com>,
> > Rick Delaney <rick.delaney@home.com> wrote:
> > >The purpose of 'use vars' is to prevent 'use strict' from
> > >complaining about unqualified package variables. In this sense, it
> > >is obsolete because 'our' can now fill that role.
> >
> > That's not exactly true. 'use vars' has also been advertised as a
> > way to avoid 'only once' warnings.
>
> Okay, I stand corrected.
>
> > >So there is nothing for
> > >
> > > our(*TOUCH)
> > >
> > >to do.
> >
> > I find it amazing that you could say this in response to an article
> > of John's which shows quite clearly that there *is* something for
> > our(*touch) to do.
>
> I don't see what's so amazing given the premise I started with.
>
> > >If you only want to suppress the "used once"
> > >warning then I'd suggest 'use warnings'.
> >
> > 'use warnings' does not work properly in 5.6.0 with regard to 'only
> > once' warnings.
>
> That's a pretty sweeping generalization.
>
> $ perl -Mwarnings -e 'no warnings "once";print $x'
> Use of uninitialized value in print at -e line 1.
> $
>
> But if
>
> {
> no warnings "once";
> open TOUCH,"+>zero-length.file" or die $!;
> }
>
> is a little wordy, one can still do
>
> {
> our $TOUCH;
> open TOUCH,"+>zero-length.file" or die $!;
> }
>
> since "only once" warnings apply only to the symbol name. But I think
> the intention of the first is clearer.
Of course, since in this particular case, we probably want TOUCH to be
closed immediatly after the block, it would likely be better to say:
{
local *TOUCH;
open TOUCH,"+>zero-length.file" or die $!;
}
Or perhaps:
new FileHandle "+>zero-length.file" or die $!;
--
Sometimes the journey *is* its own reward--but not when you're trying to
get to the bathroom in time.
------------------------------
Date: Mon, 2 Apr 2001 21:26:51 -0500
From: "Patrick" <patrickolson@qwest.net>
Subject: Re: Formatting HTML using Perl
Message-Id: <Zoby6.1686$u5.658939@news.uswest.net>
The sig I think
--
Geekette
"Try Not. Do or do not. There is no try."
-If you don't know who said this,
I don't want to talk to you. ;-)
"Nothing is impossible, no matter how improbable."
-Anonymous
"Me" <moiraine@qwest.net> wrote in message
news:3AC8EA52.B1AB537C@qwest.net...
> Uh.....
> Did I miss something? I'm new to the group and new to more advanced CGI
using
> Perl...
> I know it's not the most efficient templating..but it seems the easiest to
> learn.
> Maybe I'm wrong, but nobody else said anthing. I didn't want to leave the
poor
> guy hanging.
>
>
> Chris Hartles wrote:
>
> > hahahaha
> >
> > Uncle Zien
> > Is that Right?
> >
>
> <snip>
>
> --
> Geekette
>
> "Try Not. Do or do not. There is no try."
> -If you don't know who said this,
> I don't want to talk to you. ;-)
>
> "Nothing is impossible, no matter how improbable."
> -Anonymous
>
>
>
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 607
**************************************