[8820] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2437 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 28 02:04:08 1998

Date: Mon, 27 Apr 98 23:00:25 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 27 Apr 1998     Volume: 8 Number: 2437

Today's topics:
    Re: Anyone know how to cancel a Perl program? <rjk@coos.dartmouth.edu>
    Re: Anyone know how to cancel a Perl program? <johnnie@holly.colostate.edu>
    Re: cgi-lib.pl or CGI.pm? <rjk@coos.dartmouth.edu>
    Re: Defending Perl (Abigail)
    Re: Defending Perl (Abigail)
    Re: Defending Perl (Abigail)
    Re: Defending Perl (Ilya Zakharevich)
    Re: getting the last element position in multi dimentio (Martien Verbruggen)
    Re: Grabbing a webpage with Perl (Martien Verbruggen)
        help: Install on svr4 ... missing  my_bcopy (Frank Guthrie)
    Re: How do you make delay program? (Gabor)
    Re: http Reg Exp (Abigail)
    Re: http Reg Exp (Martien Verbruggen)
        Insert data into long raw column in oracle table (Athchan)
    Re: My First Print (Abby Franquemont)
    Re: Opening another browser (Mark Waterous)
    Re: PC-based editors for Perl? (Eric Hagen)
    Re: Perl for NT (Mark Waterous)
    Re: QRe: == vs. eq (Greg Bacon)
    Re: QUESTION: How do I print file contents to screen? (Mark Waterous)
    Re: REQ: Win32 POP3 client <ljz@asfast.com>
        Splitting a variable ??? <rudedog@gcnet.com>
        Submit <mikey@in.net>
        using perl as a script phillip@javanet.com
    Re: Why doesn't this work? <uri@sysarch.com>
    Re: XML to HTML conversion <rtietjen@kale.connix.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 27 Apr 1998 23:10:05 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: Anyone know how to cancel a Perl program?
Message-Id: <35454894.9E1722C7@coos.dartmouth.edu>

Bob Trieger wrote:
> 
> > Is there a command or escape code for interrupting a running script?
> 
> ^C
> 
> or in windowspeak "Hold down the Ctrl key and press the letter c"
> 
> I don't know the MAC equivalent.

Command-period is the default 'abort' shortcut on the Mac.  It works in
MacPerl to abort a running script.

-- 
 _ / '  _      /         - aka -             rjk@coos.dartmouth.edu
( /)//)//)(//)/(    Ronald J. Kimball           chipmunk@m-net.arbornet.org
    /                                   http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


------------------------------

Date: Mon, 27 Apr 1998 21:19:16 -0600
From: John Blanco <johnnie@holly.colostate.edu>
To: Bob Trieger <sowmaster@juicepigs.com>
Subject: Re: Anyone know how to cancel a Perl program?
Message-Id: <35454AB4.916D1B89@holly.colostate.edu>

Bob Trieger wrote:

> or in windowspeak "Hold down the Ctrl key and press the letter c"

I am greatly offended by this remark. :)

   - Johnnie B



------------------------------

Date: Mon, 27 Apr 1998 23:02:28 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
To: Yong Huang <yong@shell.com>
Subject: Re: cgi-lib.pl or CGI.pm?
Message-Id: <354546CA.8C63AF4B@coos.dartmouth.edu>

CGI.pm is generally preferred over cgi-lib.pl.


BTW, this is from the CGI.pm documentation:

   COMPATIBILITY WITH CGI-LIB.PL

    To make it easier to port existing programs that use cgi-lib.pl
    the compatibility routine "ReadParse" is provided.  Porting is simple:

    OLD VERSION     require "cgi-lib.pl";     &ReadParse;
                    print "The value of the antique is $in{antique}.\n";

    NEW VERSION     use CGI;     CGI::ReadParse
                    print "The value of the antique is $in{antique}.\n";

    CGI.pm's ReadParse() routine creates a tied variable named %in, which
    can be accessed to obtain the query variables.  Like ReadParse, you
    can also provide your own variable.  Infrequently used features of
    ReadParse, such as the creation of @in and $in variables, are not
    supported.

    Once you use ReadParse, you can retrieve the query object itself this
    way:

        $q = $in{CGI};
        print $q->textfield(-name=>'wow',
                            -value=>'does this really work?');

    This allows you to start using the more interesting features of CGI.pm
    without rewriting your old scripts from scratch. 

-- 
 _ / '  _      /         - aka -             rjk@coos.dartmouth.edu
( /)//)//)(//)/(    Ronald J. Kimball           chipmunk@m-net.arbornet.org
    /                                   http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


------------------------------

Date: 28 Apr 1998 03:36:20 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Defending Perl
Message-Id: <6i3irk$ltl$1@client3.news.psi.net>

Zenin (zenin@archive.rhps.org) wrote on MDCCI September MCMXCIII in
<URL: news:893725518.611954@thrush.omix.com>:
++ Abigail <abigail@fnx.com> wrote:
++ 	>snip<
++ : Uhm, uhm, I find perl one of the hardest things to install. 
++ 
++ 	...Uhm, uhm, what's so hard about:
++ 
++ 	sh Configure
++ 	make
++ 	make install

As I said before. Lots and lots of questions, in an illogical order.



Abigail
-- 
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'


------------------------------

Date: 28 Apr 1998 03:38:03 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Defending Perl
Message-Id: <6i3iur$ltl$2@client3.news.psi.net>

Ilya Zakharevich (ilya@math.ohio-state.edu) wrote on MDCCI September
MCMXCIII in <URL: news:6i3bv8$86g$1@mathserv.mps.ohio-state.edu>:
++ [A complimentary Cc of this posting was sent to Abigail
++ <abigail@fnx.com>],
++ who wrote in article <6i3boi$jmp$2@client3.news.psi.net>:
++ 
++ > ++ > Uhm, uhm, I find perl one of the hardest things to install.
++ > ++ > I'd rather install gcc -- much simpler.
++ > ++ 
++ > ++ what's so hard about
++ > ++ ./configure
++ > ++ make
++ > ++ make install
++ > ++ 
++ > ++ ????
++ > 
++ > Because the questions are quite confusing, and uhm, in an illogical
++ > order. 
++ 
++ What questions?  You get no stinking questions...  Did you try it?
++ 

My fault. Of course, having both configure and Configure makes things
so much easier.

Yes. ./configure calls Configure with the appropriate parameters of
it not asking questions.

That doesn't work in my case; that is, if I want to make it pass the
make install stage.



Abigail
-- 
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-


------------------------------

Date: 28 Apr 1998 03:38:47 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Defending Perl
Message-Id: <6i3j07$ltl$3@client3.news.psi.net>

Jason Gloudon (jgloudon@hyssop.bbn.com.bbn.com) wrote on MDCCI September
MCMXCIII in <URL: news:slrn6kad77.jrt.jgloudon@hyssop.bbn.com>:
++ Abigail <abigail@fnx.com> wrote:
++ .
++ >Installing gcc is easy. You just follow the manual. You don't get
++ >questions which makes you wondering "what the f*ck is it asking me?"
++ 
++ I think the real problem is that the instructions about 'Configure -des' occur
++ too far into the INSTALL file.  This of course is only a problem if you don't
++ read all of INSTALL.

No. That's not the problem.

The problem is Configure -des guesses wrong.



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


------------------------------

Date: 28 Apr 1998 04:59:59 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Defending Perl
Message-Id: <6i3nof$5ek$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Abigail
<abigail@fnx.com>],
who wrote in article <6i3iur$ltl$2@client3.news.psi.net>:
> ++ > ++ what's so hard about
> ++ > ++ ./configure
> ++ > ++ make
> ++ > ++ make install
> ++ > ++ 
> ++ > ++ ????

> That doesn't work in my case; that is, if I want to make it pass the
> make install stage.

Abigail, what happened to you?  If you do not want `make install', do
not type it.

Or did I misparse what you said?

Ilya


------------------------------

Date: 28 Apr 1998 03:47:32 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: getting the last element position in multi dimentional array
Message-Id: <6i3jgk$fl5$1@comdyn.comdyn.com.au>

In article <35416516.955B4D29@salt2.med.harvard.edu>,
	jong <jong@salt2.med.harvard.edu> writes:
> Hi,
> 
> I have a multi dimentional array made by
> assigning values of x y z and put a value
> to it:
> 
> $array[x][y][z] 
> 
> The resulting array @array  has all the assigned
> elements. 
> 
> But I want to know the highest number of each
> dimension. So, I want to know
> 
> what $array[x]
> what $array[x][y]
> what $array[x][y][z]
> 
> in their highest values.
> 
> If the last array element was:
> 
> $array[3][3][9]
> 
> I'like to know how to get the 3, 3, 9 
> in the above. 
> Is there a known way of doing it or impossible??

If all of the arrays are filled with the same number of elements, it
can be done. If not, then you might have a problem:

@ar = (
	[1, 2, 3, 4, 5],
	[1, 2, 3, 4, 5],
	[1, 2, 3, 4]
);

An array like the above is fine in perl, but will not produce the
result you're looking for.

Let's just assume that all arrays are of the same length, meaning you
have an array @aray with x-1 elements, each containing an array
reference with y-1 array refs with z-1 elements.

my @array;

for my $i (0..3)
{
    for my $j (0..3)
    {
        for my $k (0..9)
        {
            $array[$i][$j][$k] = $i + $j + $k;
        }
    }
}

# Base the count on the LAST element of each array
my $x = $#array;
my $y = $#{$array[-1]};
my $z = $#{$array[-1][-1]};

print "$x $y $z\n";

This, of course, gives you the index of the last element, which
normally is 1 less than the number of elements. This, I believe, is
what you asked.

If you want to check if they're all the same length, you can loop over
the arrays one by one, starting at the outside (x), counting the
elements in each.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


------------------------------

Date: 28 Apr 1998 05:17:20 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Grabbing a webpage with Perl
Message-Id: <6i3op0$g0l$2@comdyn.comdyn.com.au>

In article <353F92F1.808876D9@munu.com>,
	Chris <munu@munu.com> writes:
> Does anyone know how to have a Perl program get a web page?  I just need
> for it to grab a url I give it.  Thanks.

You really should take the trouble to read a few of the other posts
in this group. This question comes up weekly, if not more often.

Answer: Install libwww. Get it from CPAN.

http://www.perl.com/CPAN

It comes with a few scripts that do this for you, and a bunch of great
modules in case you want to roll your own stuff.

Once you install it:

# perldoc lwpcook
# perldoc LWP

Have a look at the scripts lwp-request and lwp-rget.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


------------------------------

Date: Mon, 27 Apr 1998 19:42:51 GMT
From: fguthrie@infinitycti.com (Frank Guthrie)
Subject: help: Install on svr4 ... missing  my_bcopy
Message-Id: <3544dde2.50089344@news>

My c compiler does not know about my_bcopy, With the exception of what
is below, I'm very close to having a clean install.

Any ideas / thoughts would be appreciated.

Thanks!

Frank

(See below)

lib/anydbm........dynamic linker: ./perl: symbol not found: my_bcopy
lib/sdbm..........dynamic linker: ./perl: symbol not found: my_bcopy

Failed 2 test scripts out of 153, 95.42% okay.


------------------------------

Date: 28 Apr 1998 04:22:57 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: How do you make delay program?
Message-Id: <slrn6kamhj.78q.gabor@vnode.vmunix.com>

In comp.lang.perl.misc, Seong Y. Kim <seong@cse.bridgeport.edu> wrote :
# This would delay my program for a while
# 
# for ($a=0; $a<100000;$a++){;}

What a total waste of CPU cycles.  Plus how long this delays anything
will depend on the speed of the CPU and the load on the CPU.
Why not try sleep(sec), which is a built in?

# Does anyone know how to make delay without running loops?
# Is there any delay modules or subroutines like delay(10000) in C
# language?

gabor.
--
    echo "Hmmm...you don't have Berkeley networking in libc.a..."
    echo "but the Wollongong group seems to have hacked it in."
        -- Larry Wall in Configure from the perl distribution


------------------------------

Date: 28 Apr 1998 03:53:49 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: http Reg Exp
Message-Id: <6i3jsd$m5l$1@client3.news.psi.net>

Ronald J Kimball (rjk@coos.dartmouth.edu) wrote on MDCCI September
MCMXCIII in <URL: news:35453EE8.48A5EF7D@coos.dartmouth.edu>:
++ Martien Verbruggen wrote:
++ > 
++ > In article <1d83bnv.l44l1a12bskbtN@slip-32-100-246-191.ny.us.ibm.net>,
++ >         kpreid@ibm.net (Kevin Reid) writes:
++ > > 
++ > > $msg =~ s!(ftp|https?)://([^\s]*[^\s>,])!<a href="$1://$2">$1://$2<\/a>!gsi;
++ > >                                ^^^^^^^^
++ > >                                difference here
++ > 
++ > You;d also need to exclude characters like '.;:!?' And other
++ > punctuation characters to satisfy the original problem.
++ 
++ True.  Extend the character class as necessary.
++ 
++ > > As someone else pointed out, commas and >s are legal in a URL, but they are
++ > > not likely to occur at the end of the URL.
++ > 
++ > Maybe not, but what about this URL with a ','  and some '.'s in the middle
++ 
++ I think he was already aware of that possibility....
++ 
++ > http://www.somewhere.com/cgi-bin/bla?important_valu=aa..bb,,cc
++ > 
++ > Your regexp would change the URL value to
++ > 
++ > http://www.somewhere.com/cgi-bin/bla?important_valu=aa..bb
++ > 
++ > discarding the ',,cc'
++ 
++ Not the results I get.
++ 
++   DB<1> $url = 'http://www.somewhere.com/cgi-bin/bla?important_valu=aa..bb,,cc '
++ 
++   DB<2> $url =~ s!(ftp|https?)://([^\s]*[^\s>,])!<a href="$1://$2">$1://$2<\/a>!gsi;
++ 
++   DB<3> x $url
++ 0  '<a
++ href="http://www.somewhere.com/cgi-bin/bla?important_valu=aa..bb,,cc">http://www.somewhere.com/cgi-bin/bla?important_valu=aa..bb,,cc</a> '
++   DB<4>
++ 
++ As you can see, the ',,cc' is included in the URL.


I wonder where in RFC 1738 it was decided that > and , can be part
of an FTP and HTTP URL, but they can't be the last character of the
URL. I must have missed that.

For some reason, if I have
    "http://foo.bar/blah,,"
and
    "http://foo.bar/blah,."

the first URL ends in 'blah,', the second one in 'blah,.'.

And if I have:

    <URL:http://foo.bar/blah>.

the url extracted will end in "blah>."


Abigail
-- 
perl -we '$_ = q ;4a75737420616e6f74686572205065726c204861636b65720as;;
          for (s;s;s;s;s;s;s;s;s;s;s;s)
              {s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'


------------------------------

Date: 28 Apr 1998 05:12:25 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: http Reg Exp
Message-Id: <6i3ofp$g0l$1@comdyn.comdyn.com.au>

In article <354346F0.CCC9CA0@cglis.com>,
	Chris Lambrou <archive@cglis.com> writes:

> $msg =~ s!(ftp|https?)://([^\s]+)!<a href="$1://$2">$1://$2<\/a>!gsi;

You might want to have a look at
http://language.perl.com/all_about/regexps.html 
(search for 'urlify').

This does a pretty good job in the assumptions it makes about what is
part of a URL and what isn't.

Martien

PS. I just KNEW I had seem this somewhere.
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


------------------------------

Date: 28 Apr 1998 03:42:07 GMT
From: athchan@aol.com (Athchan)
Subject: Insert data into long raw column in oracle table
Message-Id: <1998042803420700.XAA19677@ladder03.news.aol.com>

Does anyone has experience use to perl to insert data into a column in a oracle
with datatype long raw. I have tride to pack it with d format, but oralce
reject it with  an error of invalid hex symbol. I tried to avoid muse proc to
do the trip. Please me help. my email address is athchan@aol.com. Thanks. 



------------------------------

Date: 27 Apr 1998 22:10:19 -0700
From: abby@ucan.foad.org (Abby Franquemont)
Subject: Re: My First Print
Message-Id: <6i3obr$r44$1@ucan.foad.org>

In article <3544f64a.0@news.mountain.net>,  <Stanley> wrote:
>I would like to invite you to view  "HANGIN IT UP", a limited addition
>print of an original oil painting.
>You may visit this print at http://www.ovnet.com/~estanley/Working2.html

And here I got trolled into reading this because I was dying
of curiousity about what could be worthy of posting about
using "print" for the first time.

-- 
Abby Franquemont        Nothing cures insomnia like the realization 
J. Random BOFH          that it's time to get up. --Fortune program


------------------------------

Date: Tue, 28 Apr 1998 05:42:34 GMT
From: mark@silas.hypermart.net (Mark Waterous)
Subject: Re: Opening another browser
Message-Id: <3544ef14.16080045@news.bctel.ca>

[ID: <3544B7E6.5628@ameritech.net>] Scott Vetter wrote:

>In HTML I know that I can open another browser session with [<a
>href="http://u.r.l" target="_blank">Some Text</a>, but how can you do it
>within a Perl program?

print "<A href=\"http://u.r.l/\" target=\"_blank\">Some Text</A>";


Mark Waterous

__________________________________
"Your entrance to a world of information..."
                         [http://silas.hypermart.net/]


------------------------------

Date: 28 Apr 1998 04:29:12 GMT
From: ehagen@Hawaii.Edu (Eric Hagen)
Subject: Re: PC-based editors for Perl?
Message-Id: <6i3luo$bci@news.Hawaii.Edu>

I would like to add the recommendation for PFE, "programmers File Editor".

Very nice.

David Boyce (David.Boyce@fmr.com) wrote:
: Jason Gloudon wrote:

: > Go to http://www.dejanews.com/home_ps.shtml, and search for
: > perl and editor and windows or win32. We've had several recommendations
: > for the week.

: Also, there is an online listing of perl editors (win32 and other) at
: http://reference.perl.com.  These recurring suggestions would be better
: directed as patches/additions to the editor of that, IMHO.  (Ideally the
: FAQ would point at it too, so the correct and appropriate answer to this
: frequently asked question could be "read the FAQ").

: -David

--
Eric Hagen                  "Sometimes we get lost in the darkness, 
ehagen@Hawaii.Edu	     the dreamers learn to steer by the stars..."
			    "You fight for something because it is good.
	 				Not because it stands to succeed."


------------------------------

Date: Tue, 28 Apr 1998 05:40:19 GMT
From: mark@silas.hypermart.net (Mark Waterous)
Subject: Re: Perl for NT
Message-Id: <3543e637.38120582@news.bctel.ca>

[Silas Productions Online]-[Wed, 22 Apr 1998 23:20:41 -0500]
	[http://silas.hypermart.net/]

[ID:
<DA3543C230294159.49E2F5504DFB666E.55C453FC96322B9B@library-proxy.airnews.net>]
Nathan Stanford wrote:

>Does Tom Phoenix have to put down everyone when they ask a question. 

	No, he doesn't, and even though a few others have replied to
this, I felt it necessary to add my own. He is one of the most
prominent helpers in this newsgroup, as far as I can see from a month
or two of lurking... ;^) Have you met Abigail? I'm sure you two will
get along just dandy.


Mark Waterous

__________________________________
"Your entrance to a world of information..."
                         [http://silas.hypermart.net/]


------------------------------

Date: 28 Apr 1998 04:05:33 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: QRe: == vs. eq
Message-Id: <6i3kid$j86$2@info.uah.edu>

In article <35453A24.FC967A05@coos.dartmouth.edu>,
	Ronald J Kimball <rjk@coos.dartmouth.edu> writes:
: Yes, a lot of unintelligent posts are made from web browsers.  Perhaps that is
: because so many posts are made from web browsers in general.  Until I see a
: conclusive set of statistics, I refuse to accept this foolish stereotype.

The problem is that your denying the claim doesn't do anything.  The
heuristic is already widely accepted among most of clpmisc's regular
answerers.  (Has anyone yet resorted to killing based on the
son-of-1036 forsaken X-Newsreader: header?)  The claim is yours to 
debunk.  We're reasonable people.

: Note my headers: my newsreader is Netscape Collabra.

 ...and I count five original lines in your followup that are wider than
the seventy-two columns prescribed by news.announce.newuser's periodic
posting entitled ``Rules for posting to Usenet'' which you can retrieve
from rtfm.mit.edu's archive.

5.0 / 7.0 * 100 = 71%

Anything you post can and will be used against you on Usenet. :-)

Greg
-- 
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF


------------------------------

Date: Tue, 28 Apr 1998 05:42:21 GMT
From: mark@silas.hypermart.net (Mark Waterous)
Subject: Re: QUESTION: How do I print file contents to screen?
Message-Id: <3544ea25.14816224@news.bctel.ca>

[ID: <35437731.4933202@nntp.bestweb.net>] Paul wrote:

>Easiest way:
>
>open(FILEH,"whatever.txt");
>while (<FILEH>) {
>	print;
>}
>close(FILEH);
>
>Paul.

	Just thought I'd pop in. An easier way (with error checking
;^)  ) would be to do the following ($file being whatever):

open (FILE, "$file") || die "Can't open $file: $!";
print while <FILE>;
close (FILE);

 ...just thought I'd let you know, as somebody else let me know. :)


Mark Waterous

__________________________________
"Your entrance to a world of information..."
                         [http://silas.hypermart.net/]


------------------------------

Date: 27 Apr 1998 23:54:46 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: REQ: Win32 POP3 client
Message-Id: <lt3eeytxbt.fsf@asfast.com>

ssd.nospam@ticnet.com (Sean Dowd) writes:

> In article <3544a18f.6735615@nntp.best.ix.netcom.com>,
> jmrubin@ix.netcom.com (Joel Rubin) wrote:
> 
> > I'd like to see an example of a POP3 client, written in Perl, which
> > takes mail from mail.mars.edu port 110, user john, pass abcde, and
> > dumps anything which has "cyberpromo.*" anywhere in the header and
> > puts all the other email in mail.txt.
> > 
> > It can work with either of the two free Perl 5 interpreters written
> > for Win32.
> 
> Trivial.

This is indeed quick and trivial.  However, please don't be offended
that I have found a few things that need correcting.  Here's what I
came up with:


> #!/usr/bin/perl
> use Mail::POP3Client;
> $pop = new Mail::POP3Client( 'john', 'abcde', 'mail.mars.edu') ||
>    die $pop->Message();
> open( MAIL, '>>mail.txt' ) || die 'open mail.txt';
> 
> OUTER: for ( $i = 1; $i < $pop->Count(); $i++ )
> {
>    foreach( $pop->Head( $i ) ) {
>       /cyberpromo\./ && do {
>          $pop->delete( $i );
>          last OUTER;
###        ^^^^  this should be `next'
###
>       };
     }    
###  ^--- you need to add this closing brace
###
>    foreach( $pop->HeadAndBody( $i ) {
###                                  ^--- missing close paren here
>       print MAIL $_, "\n";
>    }   
>    print MAIL "\n";
> }
> $pop->Close();
> close MAIL;

-- 
 Lloyd Zusman   ljz@asfast.com
 perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
 $t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
 $x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'


------------------------------

Date: Tue, 28 Apr 1998 00:45:05 -0500
From: "Matthew Wagley" <rudedog@gcnet.com>
Subject: Splitting a variable ???
Message-Id: <6i3qmc$bk6$1@opal.southwind.net>

I am wanting to split an input of a string say

042498a

I want to split that out to 04  24  98  a   into separate variable or an
array.  Can this be done?? I have tried finding it in Learning perl book and
all over the net.  Last resource was here.  I appreciate your help or even a
point in the right direction where this is documented on the net.
Thanks.
Matthew Wagley




------------------------------

Date: Tue, 28 Apr 1998 00:40:57 -0500
From: Mikey Vaughan <mikey@in.net>
Subject: Submit
Message-Id: <354579F9.17E5@in.net>

Hello,

Does somebody have a routine that allows the submit button to be
executed only once??  I have a bunch of people that keep hitting it and
sending multiple forms.  Has someone written a routine to only allow one
form to be submitted??  Sure would appreciate some help on this.

Mikey Vaughan
mikey@in.net



------------------------------

Date: Mon, 27 Apr 1998 23:20:06 -0600
From: phillip@javanet.com
Subject: using perl as a script
Message-Id: <6i3ldp$85c$1@nnrp1.dejanews.com>

Basically what I was wondering is is it possible to make a perl script that
runs and ever 3 ours or so (or even several specified times like 7:30, 9:00,
12:00 and so on) to count how many new messages in the mail spool, and then
in turn send a message to a specified e-mail address formatted like this.
"You currently have # new messages in your inbox." Or would I have to use
another language such as C or something. And if I could do this how would I
go about learning how to do this. I really would like to know how as soon as
possible.

Phillip
phillip@javanet.com

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


------------------------------

Date: 27 Apr 1998 23:29:44 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Why doesn't this work?
Message-Id: <x7bttmd3o7.fsf@sysarch.com>

>>>>> "SH" == Sam Holden <sholden@ug.cs.usyd.edu.au> writes:

  SH> And you both miss <meta name=">"> - which I think is
  SH> significant...

this is absurd for data in a meta tag.

  SH> Surely the obvious thing to do is use a module that does it for
  SH> you...

not necessarily. that would be overkill for this problem. the original
author was just trying to get the meta info out of his own files using a
simple perl construct. if he wanted to do a full blown parse of any
file's meta tags, a module would be better.

there's more than one way to do it. he asked and i answered simple.

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----  8 Years of Perl Experience, Available Immediately
uri@sysarch.com  ---------  Resume and Perl Example at http://www.sysarch.com
Use the Best Search Engine on the Net  --------  http://www.northernlight.com


------------------------------

Date: 27 Apr 1998 23:40:52 -0400
From: Richard Tietjen <rtietjen@kale.connix.com>
Subject: Re: XML to HTML conversion
Message-Id: <87g1iymx4r.fsf@kale.connix.com>

I think it would be interesting to look at the HTML::Parser code (get
it from CPAN if you don't have it) and use that to massage XML files
into HTML

bellings@badlands.NoDak.edu (Brent A Ellingson) writes:

> 
> I am very new to XML, and I have some questions I hope someone
> can help answer.  
> 
> I have a couple of small databases (department directories, course 
> schedules, etc.), that sit behind some of the pages on a website 
> I maintain.  Right now, I am using small "custom" perl scripts 
> to transform this data into HTML tables, blocks of HTML'ized text, 
> or whatever the requirements are for the page that uses the data, 
> and include that HTML in the web page using server-side includes.
> 
> I am certain people do this all the time, and there must be 
> a "standard", "simpler" way to do it.  I've started looking at 
> XML, and it seems a step closer to what I want to do.
> 
> Are there "standard" ways to take XML data, do some simple
> data transforms, and inject the data into HTML?  What I roughly
> imagine doing is take something like the following (again, I am
> very, very new to XML)
> 
> <!-- orinal XML record -->
> <person>
>    <name>Kilroy Jones</name>
>    <url>www.math.ndsu.nodak.edu/faculty/kjones/</url>
>    <university>Sand Hill University</university>
>    <year>1982</year>
>    <title>Assoc Prof</title>
>    <email>kjones@ndsu.nodak.edu</email>
> </person>
> 
> and "automagically" massage it into something like:
> 
> <!-- resulting HTML record -->
> <tr>
>    <td><a href="www.math.ndsu.nodak.edu/faculty/kjones/">Kilroy Jones</a>,
>        Sand Hill University, 1982</td>
>    <td>Associate Professor</td>                   <!-- note expansion -->
>    <td><a href="mailto:kjones@ndsu.nodak.edu">
>        <address>kjones@ndsu.nodak.edu</address></a></td>
> </tr>
> 
> Are "custom" perl scripts the easiest way to do this, or is there
> something better?  I'd like to find something GPL'd (or close to
> GPL'd) if at all possible.  I'd also like to find a system that's
> relatively simple to use.
> 
> (It _doesn't_ have to be simple to setup!  I'll be doing
>  that, and I have a high pain tolerance.  However, I imagine
>  a system that, once setup, many other people can use to stick data 
>  into _their_ web pages...)
> 
> Thanks for any info you can give me,
> Brent Ellingson
> bellings@badlands.nodak.edu
> 


------------------------------

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 2437
**************************************

home help back first fref pref prev next nref lref last post