[19631] in Perl-Users-Digest
Perl-Users Digest, Issue: 1826 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 27 00:05:38 2001
Date: Wed, 26 Sep 2001 21:05:08 -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: <1001563508-v10-i1826@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 26 Sep 2001 Volume: 10 Number: 1826
Today's topics:
Re: AoA(LoL) Sorting (Martien Verbruggen)
Re: Can not grab program output on error <novastar@novastar.dtdns.net>
carriage return <min_c_lee@yahoo.com>
Re: carriage return (Tim Hammerquist)
Combining Lines From Database <markschaver@home.com>
Re: Combining Lines From Database <tony_curtis32@yahoo.com>
Re: Combining Lines From Database <markschaver@home.com>
Convert Case <gte574u@prism.gatech.edu>
Re: Convert Case <sralpert@charter.net>
Re: Convert Case <gte574u@prism.gatech.edu>
Re: Convert Case <Jon.Ericson@jpl.nasa.gov>
Re: Encrypt/Decrypt (Logan Shaw)
Re: Encrypt/Decrypt <wyzelli@yahoo.com>
Re: eval-statement fools garbage-collection ? (Kevin Reid)
File I/O Problem <dickbrom@worldnet.att.net>
Re: File I/O Problem <wyzelli@yahoo.com>
Re: File I/O Problem <bogus@mail.address.com>
Re: File I/O Problem <wyzelli@yahoo.com>
Re: launching acrobat on Win32 <wyzelli@yahoo.com>
Re: MIME::Lite problem <tintin@snowy.calculus>
Re: Net::FTP help for login & script (Martien Verbruggen)
Re: ONE QUESTION (hugh1)
Re: Pattern Matching <phookie@xmission.com>
Re: Peek and Poke on Perl? (Logan Shaw)
Re: Perl running slow... <wyzelli@yahoo.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 27 Sep 2001 09:34:38 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: AoA(LoL) Sorting
Message-Id: <slrn9r4pge.8ai.mgjv@martien.heliotrope.home>
On Wed, 26 Sep 2001 22:21:30 +0200,
Steffen Müller <tsee@gmx.net> wrote:
> "Jonathan Clover" <jclover@nati.org> schrieb im Newsbeitrag
> news:tr4a47l8co31b2@corp.supernews.com...
>> @tmp = split /, /, $_;
>> push @log, [ @tmp ];
>
> This could rather be:
>
> push( @log, [ split( ', ', $_ ) ] );
>
> The most important change would be /, / to ', '. Don't use re's where you
> don't need them.
Makes no difference. The first argument to split() is always interpreted
as a regular expression [1].
Martien
[1] Except when it is a space (' ', but not / /).
--
Martien Verbruggen |
Interactive Media Division | That's not a lie, it's a
Commercial Dynamics Pty. Ltd. | terminological inexactitude.
NSW, Australia |
------------------------------
Date: Thu, 27 Sep 2001 01:04:48 +0200
From: "novastar" <novastar@novastar.dtdns.net>
Subject: Re: Can not grab program output on error
Message-Id: <9otmud$keb$1@usenet.otenet.gr>
"Malcolm Dew-Jones" <yf110@vtn1.victoria.tc.ca> wrote in message
news:3bb0c876@news.victoria.tc.ca...
> novastar (novastar@novastar.dtdns.net) wrote:
> : I was writing a big perl program, and everything was fine untill the
point I
> : had to grab a program output on fault conditions. Disaster, perl
returned
> : absolute nothing ( WinNT4 )
>
> : @output=`dir /zz`;
> : foreach (@output) { print "$_\n"; }
>
> : The @output array is completely empty. It is not the dir command but a
good
> : example to the situation I face, please help.
>
>
> On nt you can redirect stderr, so the following may work
>
>
> @output=`dir /zz 2>&1`;
>
>
>
>
>
> --
> Want to access the command line of your CGI account? Need to debug your
> installed CGI scripts? Transfer and edit files right from your browser?
>
> What you need is "ispy.cgi" - visit http://nisoftware.com/ispy.cgi
Thanks, it worked like a charm : )
------------------------------
Date: Thu, 27 Sep 2001 02:00:38 GMT
From: "Michael" <min_c_lee@yahoo.com>
Subject: carriage return
Message-Id: <aLvs7.417$Le.17536@sea-read.news.verio.net>
How do I replace carriage ruturn character with a space?
s/\n/ /g or s/\r\n/ /g can't work.
Michael
------------------------------
Date: Thu, 27 Sep 2001 02:23:34 GMT
From: tim@vegeta.ath.cx (Tim Hammerquist)
Subject: Re: carriage return
Message-Id: <slrn9r546b.oj9.tim@vegeta.ath.cx>
Me parece que Michael <min_c_lee@yahoo.com> dijo:
> How do I replace carriage ruturn character with a space?
> s/\n/ /g or s/\r\n/ /g can't work.
>
> Michael
You don't need the s/// op.
$string =~ tr/\n\r/ /;
... will turn each carriage-return or newline into a space.
"a\nb" => "a b"
"a\rb" => "a b"
"a\r\nb" => "a b"
"a\n\rb" => "a b"
"a\n\n\nb" => "a b"
# etc...
If you consecutive want a single space for each set of consecutive EOL
characters, just add an /s at the end:
$string =~ tr/\n\r/ /s;
"a\nb" => "a b"
"a\rb" => "a b"
"a\r\nb" => "a b"
"a\n\rb" => "a b"
"a\n\n\nb" => "a b"
# etc...
Is this what you want? Otherwise you'd get into the /m and /s options
for perl's s/// operator.
HTH
Tim Hammerquist
--
C combines all the power of assembly language with all
the ease of use of assembly language.
-- trad
------------------------------
Date: Thu, 27 Sep 2001 02:41:08 GMT
From: "Mark Schaver" <markschaver@home.com>
Subject: Combining Lines From Database
Message-Id: <8lws7.43854$P8.14121294@news1.elmhst1.il.home.com>
I beseech the holders of true wisdom to help a miserable supplicant.
I have tab-delimited records from a database like this:
FIELD1 FIELD2 FIELD3 FIELD4 FIELD5
Joe Smith 1/1/1941 0001 abc
Joe Smith 1/1/1941 0002 def
Joe Smith 1/1/1941 0003 ghi
Jane Doe 2/2/1952 0001 jkl
Jane Doe 2/2/1952 0002 mno
Sam Spade 3/3/1963 0001 pqr
Sam Spade 3/3/1963 0002 stu
I want to rearrange them so I have the following:
FIELD1 FIELD2 FIELD3 FIELD4
Joe Smith 1/1/1941 abcdefghi
Jane Doe 2/2/1952 jklmno
Sam Spade 3/3/1963 pqrstu
I'm a newbie and have futzed with reading the text in one line at a time,
stuffing the fields into arrays and all the rest but haven't made any
progress, nor have I found anything directly relevant in the documentation.
Can anyone show me the way to enlightenment?
------------------------------
Date: Wed, 26 Sep 2001 22:11:49 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Combining Lines From Database
Message-Id: <87elotnx8q.fsf@limey.hpcc.uh.edu>
>> On Thu, 27 Sep 2001 02:41:08 GMT,
>> "Mark Schaver" <markschaver@home.com> said:
> I beseech the holders of true wisdom to help a miserable
> supplicant. I have tab-delimited records from a
> database like this:
>
> FIELD1 FIELD2 FIELD3 FIELD4 FIELD5
> Joe Smith 1/1/1941 0001 abc
> Joe Smith 1/1/1941 0002 def
> Joe Smith 1/1/1941 0003 ghi
> Jane Doe 2/2/1952 0001 jkl
> Jane Doe 2/2/1952 0002 mno
> Sam Spade 3/3/1963 0001 pqr
> Sam Spade 3/3/1963 0002 stu
>
> I want to rearrange them so I have the following:
>
> FIELD1 FIELD2 FIELD3 FIELD4
> Joe Smith 1/1/1941 abcdefghi
> Jane Doe 2/2/1952 jklmno
> Sam Spade 3/3/1963 pqrstu
> Can anyone show me the way to enlightenment?
Om.
OK, basically what you want to do is to consolidate FIELD5
in those records where FIELD1-3 are the same (the same
person. 2 people with the same name can have different
DsOB).
This basically involves aggregating FIELD5 in otherwise
duplicate rows. Whenever you see the word "duplicate"
in perl think "hash".
So construct a hash indexed on the first name, last
name and DOB, and concatenate FIELD5, e.g.
my ($first, $last, $dob, undef, $data) = split /\s+/;
# <-- don't need sequence index, right?
$people{$first}{$last}{$dob} .= $data;
And then iterate over the various depths of the hash to
serialise the aggregated rows.
You can muck around with different key constructs
depending on whether you want do further things with the
individual parts of the name etc., e.g. you could simplify
the hash with
$people{"$first $last $dob"} .= $data;
if you don't need (or don't mind parsing out again) the
person's "uniqueness".
Hope that puts you on the path to the required level of
enlightenment. Sit under a Bo hash, and not a Bo tree.
--
Yes way! Mmmmkay?
------------------------------
Date: Thu, 27 Sep 2001 03:35:22 GMT
From: "Mark Schaver" <markschaver@home.com>
Subject: Re: Combining Lines From Database
Message-Id: <_7xs7.43955$P8.14168597@news1.elmhst1.il.home.com>
In my case, it's duuuh...
This is the way of understanding. Thanks. That's a great help.
Now if I can only get help with the hash I've made of my life ...
"Tony Curtis" <tony_curtis32@yahoo.com> wrote in message
news:87elotnx8q.fsf@limey.hpcc.uh.edu...
> >> On Thu, 27 Sep 2001 02:41:08 GMT,
> >> "Mark Schaver" <markschaver@home.com> said:
>
> > I beseech the holders of true wisdom to help a miserable
> > supplicant. I have tab-delimited records from a
> > database like this:
> >
> > FIELD1 FIELD2 FIELD3 FIELD4 FIELD5
> > Joe Smith 1/1/1941 0001 abc
> > Joe Smith 1/1/1941 0002 def
> > Joe Smith 1/1/1941 0003 ghi
> > Jane Doe 2/2/1952 0001 jkl
> > Jane Doe 2/2/1952 0002 mno
> > Sam Spade 3/3/1963 0001 pqr
> > Sam Spade 3/3/1963 0002 stu
> >
> > I want to rearrange them so I have the following:
> >
> > FIELD1 FIELD2 FIELD3 FIELD4
> > Joe Smith 1/1/1941 abcdefghi
> > Jane Doe 2/2/1952 jklmno
> > Sam Spade 3/3/1963 pqrstu
>
> > Can anyone show me the way to enlightenment?
>
> Om.
>
> OK, basically what you want to do is to consolidate FIELD5
> in those records where FIELD1-3 are the same (the same
> person. 2 people with the same name can have different
> DsOB).
>
> This basically involves aggregating FIELD5 in otherwise
> duplicate rows. Whenever you see the word "duplicate"
> in perl think "hash".
>
> So construct a hash indexed on the first name, last
> name and DOB, and concatenate FIELD5, e.g.
>
> my ($first, $last, $dob, undef, $data) = split /\s+/;
> # <-- don't need sequence index, right?
>
> $people{$first}{$last}{$dob} .= $data;
>
> And then iterate over the various depths of the hash to
> serialise the aggregated rows.
>
> You can muck around with different key constructs
> depending on whether you want do further things with the
> individual parts of the name etc., e.g. you could simplify
> the hash with
>
> $people{"$first $last $dob"} .= $data;
>
> if you don't need (or don't mind parsing out again) the
> person's "uniqueness".
>
> Hope that puts you on the path to the required level of
> enlightenment. Sit under a Bo hash, and not a Bo tree.
>
> --
> Yes way! Mmmmkay?
------------------------------
Date: Wed, 26 Sep 2001 19:03:12 -0400
From: "Brady Doll" <gte574u@prism.gatech.edu>
Subject: Convert Case
Message-Id: <9otmqj$3o5$1@news-int.gatech.edu>
How do I go about converting the case of a string...from CAPS to lowercase
and back.
This would allow me to have an if that didn't matter with case...
$temp = "HI";
...
if ($temp eq "hi")
{
}
would be true
Does anyone know how to do this?
------------------------------
Date: Wed, 26 Sep 2001 19:24:40 -0400
From: Steve Alpert <sralpert@charter.net>
Subject: Re: Convert Case
Message-Id: <ato4rt443r6um0sfa3tnit43du6l19io9v@4ax.com>
On Wed, 26 Sep 2001 19:03:12 -0400, "Brady Doll" <gte574u@prism.gatech.edu>
wrote:
>How do I go about converting the case of a string...from CAPS to lowercase
>and back.
>
>This would allow me to have an if that didn't matter with case...
>
>$temp = "HI";
>...
>if ($temp eq "hi")
>{
>}
>
look at uc() and lc()
/sra
------------------------------
Date: Wed, 26 Sep 2001 19:37:56 -0400
From: "Brady Doll" <gte574u@prism.gatech.edu>
Subject: Re: Convert Case
Message-Id: <9otorm$4qt$1@news-int.gatech.edu>
Thanks thats what I wanted.
"Steve Alpert" <sralpert@charter.net> wrote in message
news:ato4rt443r6um0sfa3tnit43du6l19io9v@4ax.com...
> On Wed, 26 Sep 2001 19:03:12 -0400, "Brady Doll"
<gte574u@prism.gatech.edu>
> wrote:
>
> >How do I go about converting the case of a string...from CAPS to
lowercase
> >and back.
> >
> >This would allow me to have an if that didn't matter with case...
> >
> >$temp = "HI";
> >...
> >if ($temp eq "hi")
> >{
> >}
> >
>
> look at uc() and lc()
>
> /sra
>
------------------------------
Date: 26 Sep 2001 15:14:42 +0000
From: Jon Ericson <Jon.Ericson@jpl.nasa.gov>
Subject: Re: Convert Case
Message-Id: <86d74ehtlp.fsf@jon_ericson.jpl.nasa.gov>
"Brady Doll" <gte574u@prism.gatech.edu> writes:
> How do I go about converting the case of a string...from CAPS to
> lowercase and back.
$ perldoc -f lc
Jon
------------------------------
Date: 26 Sep 2001 21:01:14 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Encrypt/Decrypt
Message-Id: <9ou19a$gs8$1@charity.cs.utexas.edu>
In article <9otf71$lt8$01$1@news.t-online.com>,
Steffen Müller <tsee@gmx.net> wrote:
>"David Wall" <darkon@one.net> schrieb im Newsbeitrag
>news:Xns9128AA5FCF3B8darkononenet@207.126.101.97...
>> So is "buttload" one of those Perl culture terms like JAPH or Schwartzian
>> Transform?
>
>Maybe just bad English?
Yeah, it is an English measurement unit (most of which are bad). The
metric unit for the same quantity is the "metric buttload".
Closely related to the "buttload" is the "boatload". There is a
"metric boatload" too.
- Logan
--
"Everybody
Loves to see
Justice done
On somebody else" ( Bruce Cockburn, "Justice", 1981 )
------------------------------
Date: Thu, 27 Sep 2001 11:42:50 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Encrypt/Decrypt
Message-Id: <MOvs7.46$ou4.721@wa.nnrp.telstra.net>
"Logan Shaw" <logan@cs.utexas.edu> wrote in message
news:9ou19a$gs8$1@charity.cs.utexas.edu...
> In article <9otf71$lt8$01$1@news.t-online.com>,
> Steffen Müller <tsee@gmx.net> wrote:
> >"David Wall" <darkon@one.net> schrieb im Newsbeitrag
> >news:Xns9128AA5FCF3B8darkononenet@207.126.101.97...
> >> So is "buttload" one of those Perl culture terms like JAPH or
Schwartzian
> >> Transform?
> >
> >Maybe just bad English?
>
> Yeah, it is an English measurement unit (most of which are bad). The
> metric unit for the same quantity is the "metric buttload".
>
> Closely related to the "buttload" is the "boatload". There is a
> "metric boatload" too.
In Australia, all metric boatloads get sent to Nuaru.
Wyzelli
--
push@x,$_ for(a..z);push@x,' ';
@z='092018192600131419070417261504171126070002100417'=~/(..)/g;
foreach $y(@z){$_.=$x[$y]}y/jp/JP/;print;
------------------------------
Date: Thu, 27 Sep 2001 03:03:47 GMT
From: kpreid@attglobal.net (Kevin Reid)
Subject: Re: eval-statement fools garbage-collection ?
Message-Id: <1f08pz1.1ihsqo1aqeqdcN%kpreid@attglobal.net>
Joe Schaefer <joe+usenet@sunstarsys.com> wrote:
> Completely agreed- 5.6.1 is much improved over 5.6.0; but it's still
> very easy to produce memory leaks when working with closures, eval,
> and the like. A nasty one (and it's not entirely uncommon in a
> modperl setting) was discussed recently on p5p and the modperl mailing
> lists:
>
> {
> my $bigvar = "really big variable";
> my $x = sub { sub { $bigvar } };
> }
And here's an even simpler closure causing a memory leak; this can
happen if the closure is recursive:
{
my $closure;
$closure = sub {$closure};
}
This, however, is easy to avoid - just change the value of $closure
after the closure is executed.
--
Kevin Reid
------------------------------
Date: Thu, 27 Sep 2001 00:22:34 GMT
From: "RICHARD BROMBERG" <dickbrom@worldnet.att.net>
Subject: File I/O Problem
Message-Id: <ejus7.9672$WW.949948@bgtnsc05-news.ops.worldnet.att.net>
I am learning Perl . The following code generates an error on the fourth
line, the "print" statement . Any idea what's wrong.
#! /perl/work -w
print ("\nPerl program running\n ");
open("mydata",">>filea") || die "Opening filea ... $! ";
print "mydata" "abc";
close "mydata" || die ;
------------------------------
Date: Thu, 27 Sep 2001 10:09:45 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: File I/O Problem
Message-Id: <trus7.34$ou4.630@wa.nnrp.telstra.net>
"RICHARD BROMBERG" <dickbrom@worldnet.att.net> wrote in message
news:ejus7.9672$WW.949948@bgtnsc05-news.ops.worldnet.att.net...
> I am learning Perl . The following code generates an error on the fourth
> line, the "print" statement . Any idea what's wrong.
print will accept a list, but the list items must be separated by a comma.
> #! /perl/work -w
> print ("\nPerl program running\n ");
> open("mydata",">>filea") || die "Opening filea ... $! ";
> print "mydata" "abc";
print "mydata", "abc";
or if you want the two items with a space,
print "mydata abc";
though since they are not variables, and you don't have any metacharacters,
single quotes would suffice.
print 'mydata abc';
> close "mydata" || die ;
Wyzelli
--
@x='074117115116032097110111116104101114032080101114108032104097099107101114
'=~/(...)/g;
print chr for @x;
------------------------------
Date: Thu, 27 Sep 2001 00:58:17 GMT
From: "Robert Petty" <bogus@mail.address.com>
Subject: Re: File I/O Problem
Message-Id: <JQus7.236953$8c3.40707497@typhoon.tampabay.rr.com>
"RICHARD BROMBERG" <dickbrom@worldnet.att.net> wrote in message
news:ejus7.9672$WW.949948@bgtnsc05-news.ops.worldnet.att.net...
> I am learning Perl . The following code generates an error on the fourth
> line, the "print" statement . Any idea what's wrong.
>
> #! /perl/work -w
> print ("\nPerl program running\n ");
> open("mydata",">>filea") || die "Opening filea ... $! ";
> print "mydata" "abc";
> close "mydata" || die ;
>
>
>
You don't need to quote the filehandle try this:
#! /perl/work -w
print ("\nPerl program running\n ");
open(mydata,">>filea") || die "Opening filea ... $! ";
print mydata "abc";
close(mydata) || die ;
------------------------------
Date: Thu, 27 Sep 2001 11:26:15 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: File I/O Problem
Message-Id: <dzvs7.40$ou4.553@wa.nnrp.telstra.net>
"Robert Petty" <bogus@mail.address.com> wrote in message
news:JQus7.236953$8c3.40707497@typhoon.tampabay.rr.com...
> "RICHARD BROMBERG" <dickbrom@worldnet.att.net> wrote in message
> news:ejus7.9672$WW.949948@bgtnsc05-news.ops.worldnet.att.net...
> > I am learning Perl . The following code generates an error on the fourth
> > line, the "print" statement . Any idea what's wrong.
> >
> > #! /perl/work -w
> > print ("\nPerl program running\n ");
> > open("mydata",">>filea") || die "Opening filea ... $! ";
> > print "mydata" "abc";
> > close "mydata" || die ;
>
> You don't need to quote the filehandle try this:
>
> #! /perl/work -w
> print ("\nPerl program running\n ");
> open(mydata,">>filea") || die "Opening filea ... $! ";
> print mydata "abc";
> close(mydata) || die ;
>
D'oh! I obviously didn't look closely enough!...
I would add that by convention, filehandles are all caps so
open (MYDATA, '>>filea') or die "Opening filea ... $!";
print MYDATA "abc";
would have stopped me making the mistake I did in replying to the OP's post.
(not that the points I made aren't relevant, they just dont apply to this
problem). <sheepish grin>
Wyzelli
--
#Modified from the original by Jim Menard
for(reverse(1..100)){$s=($_!=1)? 's':'';print"$_ bottle$s of beer on the
wall,\n";
print"$_ bottle$s of beer,\nTake one down, pass it around,\n";
$_--;$s=($_==1)?'':'s';print"$_ bottle$s of beer on the
wall\n\n";}print'*burp*';
------------------------------
Date: Thu, 27 Sep 2001 10:40:58 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: launching acrobat on Win32
Message-Id: <KUus7.37$ou4.456@wa.nnrp.telstra.net>
"Allan" <clarke__@__hyperformix.com> wrote in message
news:sHrs7.944$bL5.423399@news.uswest.net...
> I have been trying to find a way to launch the Acrobat reader to view
> a PDF file. If I use
>
> system ("test.pdf")
look into exec which runs the external command and never returns (ie your
program ends at that point) rather than system which waits for the external
process to finish.
Wyzelli
--
push@x,$_ for(a..z);push@x,' ';
@z='092018192600131419070417261504171126070002100417'=~/(..)/g;
foreach $y(@z){$_.=$x[$y]}y/jp/JP/;print;
------------------------------
Date: Thu, 27 Sep 2001 08:23:29 +1000
From: "Tintin" <tintin@snowy.calculus>
Subject: Re: MIME::Lite problem
Message-Id: <JAss7.2$aM4.61501@news.interact.net.au>
"bill" <bill02115@hotmail.com> wrote in message
news:9osjgo$rga$1@panix3.panix.com...
>
>
> I'm having a problem with MIME::Lite. I'm using it to send e-mails of
> the form:
>
> Dear Dr. Foo:
>
> Attached please find the schedule for your upcoming visit.
>
> Sincerely,
>
> Dr. Bar
>
> < pdf attachment >
>
> Everything works fine, including the attachment, but, at the receiving
> end, the e-mail (as presented by Eudora) shows an unsightly header of
> directives, like this:
>
> Content-Disposition: inline
> Content-Length: 326
> Content-Transfer-Encoding: binary
> Content-Type: text/plain
>
> Dear Dr. Foo:
>
> < etc. >
>
> Such header do not appear when I send the e-mail (with the same
> attachment) through Eudora.
>
> The code in question looks like this (upper-case variables are pre-set
> constants):
>
> my $msg = new MIME::Lite(From => FROM,
> To => TO,
> Subject => SUBJECT,
> 'Reply-To' => REPLY_TO,
> Type => 'multipart/mixed');
>
> # I got the following settings from inspecting the equivalent mailing
> # as produced by Eudora.
> $msg->attr('content.type' => 'text/plain',
> 'content.charset' => 'us-ascii',
> 'content.format' => 'flowed');
> $msg->attach(Data => SALUTATION . "\n\n" . INTRO);
>
> $msg->attach(Type => 'application/pdf',
> Path => PDF_FILE,
> Disposition => 'attachment');
>
> $msg->send;
>
> Any ideas on how to suppress the first set of headers?
First of all, there are many, many broken mail clients out there. Eudora
just happens to be one of them that doesn't conform to the various MIME
RFC's.
Anyway in the MIME::Lite FAQ, there is the scrub facility to remove non
essential headers.
------------------------------
Date: Thu, 27 Sep 2001 09:36:33 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Net::FTP help for login & script
Message-Id: <slrn9r4pk1.8ai.mgjv@martien.heliotrope.home>
On Wed, 26 Sep 2001 10:43:42 -0400,
David Kowal <ldk006@email.mot.com> wrote:
[article reformatted to fit on a normal screen]
> 1) after successfully logging to a remote server using
> $ftp->login('username','password'), I then to to run a UNIX script
> (basically a version of su) where I need to supply the above password.
> After I have authenticated as this user, I need to do some file
> manipulation using the system 'command'. Any samples or links of
> reference would be helpful.
You can't use the FTP protocol to remotely run programs (not without
non-standard help from the FTP server). I suspect you really want
Net::Telnet.
Martien
--
Martien Verbruggen |
Interactive Media Division | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd. | make a better idiot.
NSW, Australia |
------------------------------
Date: 26 Sep 2001 18:08:59 -0700
From: weiwe1@yeah.net (hugh1)
Subject: Re: ONE QUESTION
Message-Id: <7dcf30ba.0109261708.8c185b7@posting.google.com>
"--Rick" <no_trick@my-de(remove the obvious)ja.com> wrote in message news:<hIos7.9331$WW.920451@bgtnsc05-news.ops.worldnet.att.net>...
> "Martien Verbruggen" <mgjv@tradingpost.com.au> wrote in message
> news:slrn9r2mp8.eug.mgjv@verbruggen.comdyn.com.au...
> | On 25 Sep 2001 21:04:50 -0700,
> | hugh1 <weiwe1@yeah.net> wrote:
> | > IN BOOK <<advanced programming perl >>
> | >
> | > charpe six package auto load .
> |
> | This almost sounds as incomprehensible as the "Big Berta Thing" posts.
> | I've been looking at it for almost a whole minute now, and I still
> | have absolutely no clue what this is supposed to mean. Four of the
> | five words are recognisable, but they make no sense together... Oh
> | well..
> |
>
> Perhaps OP is referring to chapter six which deals with package,
> autoload.
>
> I'm a touch typo-ist myself.. ;)
oh sorry , i not know that "charpe six package auto load ." will
take you so much trouble . very sorry abort it .
it will "chapter six ." page 127 ( chinese << A P P>>)
------------------------------
Date: Wed, 26 Sep 2001 19:22:58 -0600
From: phookie <phookie@xmission.com>
Subject: Re: Pattern Matching
Message-Id: <3BB27F71.182928CA@xmission.com>
Thanks everyone....
Ian Boreham wrote:
> Andrew Cady <please@no.spam> wrote in message news:<871yku7m17.fsf@homer.cghm>...
> > phookie <phookie@xmission.com> writes:
> >
> > > How would one match/sub a string which begins with a "<" with zero
> > > or more"<", ">" alphanumerics, quotes, equal signs, period, commas,
> > > semi-colons, underscores, forward "/" and back "\" slashes, white
> > > space, etc and ends with a ">" character. This does not appear to
> > > work
> > >
> > > $mystring =~ s/^<[A-Z a-z 0-9 "=.,;_/\\\s].+>$/my_new_string/;
>
> In addition to comments already made:
>
> phookie: You haven't included "<" and ">" in the character class.
> "A-Z", "a-z", "0-9" and "_" can all be replaced with "\w". The "/"
> needs to be escaped or you need to use different delimiters for s///.
>
> Bear in mind also that ^ and $ mean the start and end of the
> string/line. Your string cannot include additional text before or
> after the <...> and still match. There doesn't seem to be a lot of
> point in using substitution if you can only ever match the whole
> string or not.
>
> > The ".+" matches one or more instance of any character (except \n),
> > which kind of defeats the purpose of your character class (currently
> > you only require that character class for the first character on the
> > line). Also \s doesn't work in a character class, you have to use
>
> \s does work in a character class, as do \w, \W, \S, \d etc.
>
> > [:space:], which is almost the same. You want:
> >
> > /^<[ [:space:] [:alnum:] "=.,;_/\\ ]+>/
> >
> > Although I have to ask, are you sure those are the only characters you
> > want to include? A negated character class may be more appropriate.
> > If you want to match everything except the closing >, that's very
> > easy:
> >
> > /^<[^>]+>/
>
> phookie did mention allowing "<" and ">" explicitly, but this is
> starting to look rather like a case of HTML/SGML/XML tag-matching,
> which would be better handled by a module, and not (yet again) by a
> necessarily incomplete regex.
>
> Still, following the statement of requirements as given, you could
> try:
>
> #!/usr/bin/perl -w
>
> my $mystring = "<hello123 _<there>.,;\"'=/\\>";
> print "Matched\n" if $mystring =~ m%^<[<>\w\s'"=,.;/\\]*>$%;
>
> Of course, the "etc" would still need to be taken into account.
>
> Regards,
>
> Ian
------------------------------
Date: 26 Sep 2001 20:56:41 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Peek and Poke on Perl?
Message-Id: <9ou10p$gqo$1@charity.cs.utexas.edu>
In article <3BB22129.7C25@mpinet.net>, Gary <gamtci1@mpinet.net> wrote:
>I was responding to a poster who didn't understand the
>question. I realize a device driver is needed to produce this
>functionality. I was looking for a Perl module which was
>already written which provided such functionality.
Such a module almost certainly doesn't exist because it can't be
written on most systems in Perl. The problem is that Perl normally
(almost always) runs as a user-level process and can't use absolute
memory addressing like you're talking about.
So, since there is generally no way to control what appears on the
address bus through Perl, it's really unlikely that someone has written
a module that would require that.
Now, if you'd like to build a version of Perl that can use real (as
opposed to virtual) addressing like that, feel free to do so and then
to use it to access your device. It's not impossible, but I don't
think it has been done. (I could be wrong.)
- Logan
--
"Everybody
Loves to see
Justice done
On somebody else" ( Bruce Cockburn, "Justice", 1981 )
------------------------------
Date: Thu, 27 Sep 2001 10:21:23 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Perl running slow...
Message-Id: <nCus7.36$ou4.619@wa.nnrp.telstra.net>
"Adam" <adcoment@ameritech.net> wrote in message
news:e2768ea2.0109261403.43d42be5@posting.google.com...
> Using some simple benchmarks, I am having problems with Perl 5.6 on a
> cobalt raq3 (running redhat -- not cobalt linux). Using a simple use
> CGI and a print loop, I have yeilded the following:
>
> 1) raq3, P XMHZ, 64MB, perl 5.6.0
> 2) PIII 700MHZ, 128MB, perl 5.6.0
> 3) PII 450MHZ, 256MB, perl 5.005_03
The first obvious difference between the systems is the RAM. What else is
running on the raq3? Are you being forced to use swap because there isn't
enough available RAM for your process because something else is hogging the
memory? This is just a pretty wild guess, but I would throw some more RAM
at it first to see what affect that has.
Wyzelli
--
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass it
around');
for(reverse(1..100)){$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n$_$a$s$b\n$t\n";
$_--;$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n\n";}print"$c*hic*";
------------------------------
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 1826
***************************************