[18157] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 325 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 21 06:05:41 2001

Date: Wed, 21 Feb 2001 03:05:12 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <982753511-v10-i325@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 21 Feb 2001     Volume: 10 Number: 325

Today's topics:
        adding a directories files to an array <cliff@intergraphic.com>
    Re: adding a directories files to an array (Rafael Garcia-Suarez)
    Re: Change unknown filenames (BUCK NAKED1)
    Re: chop and chomp (Bernard El-Hagin)
    Re: covert "øY"" (embeded hex) to F89F how? (Mihai N.)
    Re: FAQ 4.49:   How do I permute N elements of a list? <dontspamthewebmaster@webdragon.net>
    Re: Forms Simple Question (David Efflandt)
        Integrating Cybercash with S-Mart shopping cart - doabl (Webmistress)
    Re: Java servlets and CGI <jsmith@cecioni.com>
    Re: Java servlets and CGI <beable@my-deja.com>
    Re: Linda, this is cool! <fredericbonnet@free.fr>
    Re: Linda, this is cool! <fredericbonnet@free.fr>
        mod_perl with apache 1.3.12 in BSD <ulf.sundin@ped.gu.se>
    Re: Need help creating a simple class. <c.manley@chello.nl>
        Need Help HTMP::Toke Parser <bidash@cisco.com>
    Re: New Perl Bulletin Board available <gtoomey@usa.net>
    Re: newbie regex linebreaks problem - my bad <dontspamthewebmaster@webdragon.net>
        parse variable <north@nmpm.com.my>
    Re: parse variable <peter.s@tjgroup.dk>
    Re: parse variable <peter.s@tjgroup.dk>
    Re: perl irc channel <nospam.newton@gmx.li>
    Re: PERL Request <dontspamthewebmaster@webdragon.net>
    Re: PERL Request <bart.lateur@skynet.be>
    Re: PROPOSAL: Graphics::ColorNames <wlkngowl@unix.asb.com>
    Re: PROPOSAL: Graphics::ColorNames (Abigail)
    Re: sending cookies with LWP user agent <inaganmi@email.uc.edu>
        Sendmail NO_SPAM@mail.ru
    Re: Sendmail (Abigail)
        Using a Java class from Perl. Is it possible? <jsmith@cecioni.com>
        what is param? <parks@cs.unc.edu>
    Re: what is param? blah@blah.blah.invalid
    Re: What's wrong with this script? <nospam.newton@gmx.li>
        why does IO::File / new_tmpfile write to '/' filesystem <cmela@email.msn.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 20 Feb 2001 08:16:09 -0500
From: "Cliff Hodges" <cliff@intergraphic.com>
Subject: adding a directories files to an array
Message-Id: <96tqtc$h5t$1@news.utelfla.com>

I need to add a directories files to an array, so I can step through the
files and add code to them.  I have the code to search the individual files
and add the code I just don't know how to add all the files in directory
"messages" to an array.  I am new at perl, any help will be greatly
appreciated.
Cliff




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

Date: Wed, 21 Feb 2001 09:44:58 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: adding a directories files to an array
Message-Id: <slrn9973fr.9qh.rgarciasuarez@rafael.kazibao.net>

Cliff Hodges wrote in comp.lang.perl.misc:
> I need to add a directories files to an array, so I can step through the
> files and add code to them.  I have the code to search the individual files
> and add the code I just don't know how to add all the files in directory
> "messages" to an array.  I am new at perl, any help will be greatly
> appreciated.

To read the contents of a directory, use the opendir / readdir /
closedir functions. They're described in the perlfunc section of the
standard documentation.

-- 
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: Tue, 20 Feb 2001 23:18:53 -0600 (CST)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Re: Change unknown filenames
Message-Id: <22801-3A934FBD-342@storefull-247.iap.bryant.webtv.net>

After screwing with this for 12 hrs... I finally got this to work, even
with a relative URL. Thanks abunch, Bart! I really do appreciate this.

I decided to make a minor change, and change .txt to .txtcgi so I'd know
to change those files back to .pl. Yep, that regex you gave is much
nicer than my mess. 

$tmpdir = "wkdir";
use File::Find;
find sub {-f or return; 
               if((my $new = $_) =~ s/\.(pl|cgi|exe)$/.txtcgi/i) 
{ rename $_, $new; }  }, $tmpdir ;


--the best to ya!
Dennis



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

Date: Wed, 21 Feb 2001 07:19:56 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: chop and chomp
Message-Id: <slrn996qvg.lm5.bernard.el-hagin@gdndev32.lido-tech>

On Tue, 20 Feb 2001 07:33:10 -0800, brian d foy <comdog@panix.com>
wrote:
>In article <slrn994fdl.lgi.bernard.el-hagin@gdndev32.lido-tech>, 
>bernard.el-hagin@lido-tech.net wrote:
>
>> That's not entirely accurate. chomp removes whatever $\ is set to,
>> whether it's a newline or not.
>
>chomp removes whatever $/ ($INPUT_RECORD_SEPARATOR).  

I always get the symbols of those two mixed up. :)

Cheers,
Bernard
--
#requires 5.6.0
perl -le'* = =[[`JAPH`]=>[q[Just another Perl hacker,]]];print @ { @ = [$ ?] }'


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

Date: 21 Feb 2001 10:00:58 GMT
From: nmihai_2000@yahoo.com (Mihai N.)
Subject: Re: covert "øY"" (embeded hex) to F89F how?
Message-Id: <904F13374MihaiN@207.172.3.55>



print unpack 'H*', $str;


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

Date: 21 Feb 2001 09:57:24 GMT
From: "Scott R. Godin" <dontspamthewebmaster@webdragon.net>
Subject: Re: FAQ 4.49:   How do I permute N elements of a list?
Message-Id: <9703e4$dq4$0@216.155.32.245>

In article <3A932196.B434C421@stomp.stomp.tokyo>, "Godzilla!" 
<godzilla@stomp.stomp.tokyo> wrote:

 | You will discover on the final day of your life's Winter, pride
 | is all you will truly have, or not have.

My sense of humor saw this comment and immediately cross-correlated to 
the Ferengi Sacred Rules of Acquisition[1], which I immediately had to 
go look up the proper reference for: 

Ferengi Sacred Rule of Acquisition #109.  
    "Dignity and an empty sack is worth the sack."[2]

:-)

Scott
-=-
[1] Ferengi are a race comprised of roughly the interstellar equivalent 
of theiving snake-oil salesmen, in the Star Trek milieu. (more or less) 
[2] Ferengi are not noted for their altruism. (:

-- 
unmunge e-mail here:
#!perl -w
print map {chr(ord($_)-3)} split //, "zhepdvwhuCzhegudjrq1qhw"; 
# ( damn spammers. *shakes fist* take a hint. =:P )


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

Date: Wed, 21 Feb 2001 05:53:52 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Forms Simple Question
Message-Id: <slrn996lvc.75g.efflandt@efflandt.xnet.com>

On Tue, 20 Feb 2001 08:54:41 +0200, Ofir <ofirb@jdc.org.il> wrote:
>Hi all,
>I'm adding a TEXTARE form field to my html, so users can submit their
>answers.
>I want to use the logged answers later from within Excel, so I'm doing a CSV
>file, delimited with the pipe (|).
>When I got the answers, I realized that when users typed a sentence into the
>TEXTAREA and hit RETURN to write the next sentence (inside the TEXTAREA), it
>results with a CR code.
>This is confusing the data import to Excel.

These are usually carriage return, linefeed pairs, even from Unix
browsers.  But you probably want to convert them to spaces or something if
you don't want words run together.  The following would convert any
normal line endings to spaces and strip any leading or trailing spaces:

s/(\015\012|[\015\012])/ /g;
s/^\s+//;
s/\s+$//;

-- 
David Efflandt  efflandt@xnet.com  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/


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

Date: 21 Feb 2001 03:20:07 -0600
From: webmistress@shreddedheart.com-nospam (Webmistress)
Subject: Integrating Cybercash with S-Mart shopping cart - doable?
Message-Id: <Xns904F244273984webmistressshreddedh@209.189.89.243>

Hello all,
I hope someone can help me.  I am in charge of a website, 
http://www.shattercone.com/ that is currently running S-Mart shopping 
cart.  Even though the site only has 5-6 products that will not be huge 
sellers, my bosses insist that we have to use Cybercash.  We have our 
Cybercash ID, etc., and the MCK was installed by the hosting company 
and the test harness worked.  That's as far as I can get.  I have read 
the documentation that comes with the MCK, but it hasn't helped me 
enough.  S-Mart is a very simple but capable script for what we are 
doing, and I am hoping there is a way to get it to work Cybercash.  I 
know there are other carts out there that have built in cybercash 
modules, but we are trying not to have to spend too much nor get such a 
complicated script for such a simple website.  If anyone has integrated 
Cybercash with S-Mart I would appreciate knowing about it, for 
inspiration if nothing else.  I can send the script if anyone can 
annotate it with where the Cybercash Cash Register modules go.  I know  
about customizing scripts but this has got me stumped.

Thank you so much,
Trisha in Nashville


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


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

Date: Wed, 21 Feb 2001 11:07:01 +0100
From: John Smith <jsmith@cecioni.com>
Subject: Re: Java servlets and CGI
Message-Id: <3A939345.DAAEE5F@cecioni.com>


I think this thread was born unlucky.
I'll start a new one which doesn't mention CGI and doesn't
puzzle your pure Perl-powered minds.

John


Chris Fedde wrote:
> 
> In article <3A928C16.C30CDF50@cecioni.com>,
> John Smith  <jsmith@cecioni.com> wrote:
> >
> >I couldn't find a Servlet newsgroup. Java newsgroups are too generic
> >and this question is probably too different from what CGI people normally
> >do.
> >
> >On the other hand, CGI is mostly done in Perl, so Perl gurus are
> >much more likely to have a valid answer to this question, IMO.
> >
> 
> If want to find people who can answer your questions about CGI I
> think a better group would be comp.infosystems.www.authoring.cgi
>


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

Date: Wed, 21 Feb 2001 10:19:56 GMT
From: Beable van Polasm <beable@my-deja.com>
Subject: Re: Java servlets and CGI
Message-Id: <m366i4jqg1.fsf@beable.van.polasm.bigpond.net.au>

John Smith <jsmith@cecioni.com> writes:
> I couldn't find a Servlet newsgroup. Java newsgroups are too generic
> and this question is probably too different from what CGI people normally
> do.
> 
> On the other hand, CGI is mostly done in Perl, so Perl gurus are
> much more likely to have a valid answer to this question, IMO.

So if CGI is mostly done in Perl, wouldn't there be heaps of
Perl gurus in the CGI newsgroup?

> Now, can you help or do you prefer to keep silent?

Well I prefer to keep silent because my answer is likely to be
crap. But seeing as how you sent me two emails, and all these
posts! I think I will give you my answer and you can decide
for yourself if it's crap.

To wrap up a Java servlet in Perl to use as a CGI, I would
write a Perl program that calls the servlet, and stick the
Perl program in my cgi-bin. The program would look like this:

------------8<-----------------------------------------------
#!/usr/bin/perl -w
use strict;

system "java servlet some parameters for the servlet";
------------8<-----------------------------------------------

See? I told you it would probably be crap. But that's what I
would start with. Good luck!

cheers
Beable van Polasm
-- 
/~~\__/~~\_/~~~~~~~~\__/~~~~~~\_________/~~~~\__/~~~~~~\__/~~~~~~~~\_
_/~~\/~~\__/~~\_______/~~\_______________/~~\__/~~\__/~~\_/~~\_______
__/~~~~\___/~~~~~~\____/~~~~~~\__________/~~\__/~~\__/~~\_/~~~~~~\___
___/~~\____/~~\_____________/~~\_________/~~\__/~~\__/~~\_/~~\_______
___/~~\____/~~~~~~~~\__/~~~~~~\_______/~~~~\____/~~~~~~\__/~~~~~~~~\_


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

Date: Wed, 21 Feb 2001 10:17:14 GMT
From: Frederic BONNET <fredericbonnet@free.fr>
Subject: Re: Linda, this is cool!
Message-Id: <3A939540.19FB5346@free.fr>



"Donal K. Fellows" wrote:
> 
> Hartmann Schaffer wrote:
> > frankly, i doubt this.  most of those spams are so inept that i would be
> > surprised if it generates any sales.  the only thing that seems to generate
> > sales are those spam generators (to clueless idiots)
> 
> Every time I think I've finally discovered just how stupid some people can
> be, I'm unpleasantly surprised by some new asininity...

I think Charles De Gaulle said something like that: "Human intelligence may
have a limit, but believe me, human stupididy hasn't".
-- 
Frédéric BONNET                          fredericbonnet@free.fr
---------------------------------------------------------------
"Theory may inform, but Practice convinces"
                                                    George Bain



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

Date: Wed, 21 Feb 2001 10:19:28 GMT
From: Frederic BONNET <fredericbonnet@free.fr>
Subject: Re: Linda, this is cool!
Message-Id: <3A939613.2A32E483@free.fr>

Oh, and this one, too:

General Massu: "One should eliminate all the idiots"
De Gaulle: "Vast program..."

-- 
Frédéric BONNET                          fredericbonnet@free.fr
---------------------------------------------------------------
"Theory may inform, but Practice convinces"
                                                    George Bain


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

Date: Wed, 21 Feb 2001 12:00:18 +0100
From: Ulf Sundin <ulf.sundin@ped.gu.se>
Subject: mod_perl with apache 1.3.12 in BSD
Message-Id: <3A939FC2.94AC3453@ped.gu.se>

Hey. I installed mod_perl from the OpenBSD 2.8 ports collection
(/usr/ports/www/mod_perl). I had a fully operational apache 1.3.12
server with php and stuff, and from what I could gather during the
installation of mod_perl there wouldn't be any need of reinstalling the
apache server afterwards. To simply run the mod_perl enable thing and
restarting httpd should be enough to get mod_perl up and running. So I
did. But it doesnt seem like the mod_perl stuck. After stopping and
restarting the httpd several times, and even rebooting the whole machine

mod_perl still doesn't seem to be active.
When i enable mod_perl, it says that it has activated it in
/var/www/conf/httpd.conf. But httpd.conf is in /www/conf/..? why
/var/... ?

Best Regards
Ulf Sundin



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

Date: Wed, 21 Feb 2001 10:35:43 GMT
From: Craig Manley <c.manley@chello.nl>
Subject: Re: Need help creating a simple class.
Message-Id: <3A939A92.8156D12F@chello.nl>



egwong@netcom.com wrote:
> 
> Craig Manley <c.manley@chello.nl> wrote:
> > I read the perltoot but it doesn't explain how to access class variables
> > as in my example. I don't want to use accessor methods, but a sort
> > of $dude->{'age'} = 10; thingy just as in the DBI when you say
> > $dbh->{AutoCommit} = 1; Setting $dbh->{AutoCommit} in the DBI causes
> > multiple statements to be executed instead of just setting a class
> > variable.
> 
> Please put your replies *underneath* the quoted text -- it makes
> it easier for people to follow.
> 
> My guess is that you want to read up on tie-ing a hash in perltie.
> If you want to see how DBI does it, just read the source.


I've already read perltoot, perltie, perloo, the DBI source, and tried
expermenting writing a simple class but couldn't get it right. That's
when I posted my first question. So I guess I'm still stuck where I was
then. I was just hoping somebody could quickly put me on the right track
with a short example.


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

Date: Wed, 21 Feb 2001 12:09:11 +0530
From: "Biswajit Dash" <bidash@cisco.com>
Subject: Need Help HTMP::Toke Parser
Message-Id: <982737004.652677@sj-nntpcache-5>

Hi,
I am able to parse  the href  & IMG links using HTML::TokeParser
Can anyone please tell me, How to retrieve a portion of the HTML Page.
Actually what I want to do is, take the content of the page leaving the
Banners on the top
and the menu in the left..

If possible please send me some code to do this.

Thanks
Biswajit bidash@cisco.com




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

Date: Wed, 21 Feb 2001 19:01:18 +1000
From: "Gregory Toomey" <gtoomey@usa.net>
Subject: Re: New Perl Bulletin Board available
Message-Id: <TfLk6.115$v5.173@newsfeeds.bigpond.com>

Nah, I prefer comp.lang.perl.misc.
Lots of helpful peoplem, no spam, ...


(And you posted your message in August 2001,
so it appears at the end of my email reader - what a genius!)

----- Original Message -----
From: "necro" <necrorising@hotmail.com>
Newsgroups: comp.lang.perl.misc
Sent: Saturday, 18 August, 2001 2:56 PM
Subject: New Perl Bulletin Board available


> New Perl Bulletin Board available
>
> The MotherBoard is now available! Get the freedom and versatility of a
> high end bulletin board, at cut rate prices.
>
> http://www.worldwidecreations.com





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

Date: 21 Feb 2001 10:25:04 GMT
From: "Scott R. Godin" <dontspamthewebmaster@webdragon.net>
Subject: Re: newbie regex linebreaks problem - my bad
Message-Id: <970520$dq4$2@216.155.32.245>

In article <96sum1$qgf$1@news.panix.com>, Jason Goodrow 
<"goodrow"@opencity. com> wrote:

 | Regarding regex html
 | 
 | uh ... I'm an idiot -
 | 
 | #!/usr/local/bin/perl5
 | 
 | $aa = $ENV{'QUERY_STRING'};
 | $aa =~s/%0D%0A/<br>/g;
 | 
 | print "Content-type: text/html\n\n<html>$aa</html>";
 | 
 | works fine. I was using cgi.pm which was adding something.
 | 
 | Thanks for the help
 | 

I recently ran across this exact same problem and worked through it 
completely.. look for the article subject "three part form subbmission 
using CGI.pm" 

Basically what I did was this: 
 ...
td({-valign=>'top'}, fix_paragraphs( escapeHTML($UT::credits) ),
 ...

where the fix_paragraphs sub looks like this: 

sub fix_paragraphs () {
    my $fixee = shift;
# contributed by Brad Baxter, c.l.p.m
    $fixee =~ s/(?:[\r\n]{2})+/<br><br>/g;
    $fixee =~ s/[\r\n]/<br>/g;
# my original regexes
#    $fixee =~ s|\n\n|<br><br>|g;
#    $fixee =~ s|\r\r|<br><br>|g;
#    $fixee =~ s/\n|\r/<br>/g;
#    $fixee =~ s/<br><br><br><br>/<br><br>/g;
    return $fixee;
}


see if this works for you, using CGI.pm

-- 
unmunge e-mail here:
#!perl -w
print map {chr(ord($_)-3)} split //, "zhepdvwhuCzhegudjrq1qhw"; 
# ( damn spammers. *shakes fist* take a hint. =:P )


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

Date: Wed, 21 Feb 2001 14:55:19 +0800
From: miss <north@nmpm.com.my>
Subject: parse variable
Message-Id: <3A936657.A69246FF@nmpm.com.my>

hai to all;

in my page have few link,when click on it,will go to location appointed.

how i pass my variable to appointed page.

i know i can use <a href="../program.pl?$pass_variable">

but if use this method,when go to appointed page, location bar will show
out
my pass variable value.

so,what i can do?

Thanks.




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

Date: Wed, 21 Feb 2001 10:13:02 +0100
From: "Peter Søgaard" <peter.s@tjgroup.dk>
Subject: Re: parse variable
Message-Id: <9700la$o7h$1@news.inet.tele.dk>

Use html forms to submit your data, see example below:

<html>

 ...

 ...

<form name=foo action=program.pl method=post>

<input type=text name=pass_variable>

<input type=submit>

</form>

 ...

 ...

</html>

Get the value of pass_variable as you would've done if you had used <a
href="../program.pl">...

Hope this helps

Peter Søgaard





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

Date: Wed, 21 Feb 2001 11:58:08 +0100
From: "Peter Søgaard" <peter.s@tjgroup.dk>
Subject: Re: parse variable
Message-Id: <9706pl$e8s$1@news.inet.tele.dk>

ohh, and if you absolutely want to submit it by clicking a link use

<a href=# onclick=foo.submit();>click here</a>

where foo is the name of the form as given in example above.




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

Date: Wed, 21 Feb 2001 08:02:00 +0100
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.li>
Subject: Re: perl irc channel
Message-Id: <uup69tkv5g0d5rs1329d8b7dq0timq1hq0@4ax.com>

On Tue, 20 Feb 2001 07:30:15 -0800, brian d foy <comdog@panix.com>
wrote:

> In article <slrn994m92.tkb.tjla@thislove.dyndns.org>, 
> tjla@guvfybir.qlaqaf.bet (Gwyn Judd) wrote:
> 
> > I was shocked! How could brian d foy <comdog@panix.com>
> > say such a terrible thing:
> > 
> > >Randal doesn't necessarily work for himself. i think you assume to
> > >much.
> 
> > Well I wouldn't want to speak for him. Nevertheless I thought he was
> > more or less self employed, freelance or something.
> 
> you thought incorrectly, in this case.  however, i know he is
> bound by an NDA not to talk about it because i interviewed with
> the same people. ;)

Randal works for Transmeta? :-)

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
If you're not part of the solution, you're part of the precipitate


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

Date: 21 Feb 2001 10:08:16 GMT
From: "Scott R. Godin" <dontspamthewebmaster@webdragon.net>
Subject: Re: PERL Request
Message-Id: <97042g$dq4$1@216.155.32.245>

In article <qhf69t465042c6m2a5cfeqtmp135pbn97o@4ax.com>, Mindfield 
<mindfield@badgers.emulationnet.com> wrote:

 | 
 | I tried.  Unfortunately the only CGI newsgroup my ISP gets is
 | comp.infosystems.www.authoring.cgi, and that appears to either be a
 | dead group, or a group that has essentially been removed by my ISP,
 | and just hasn't gotten round to disappearing yet, because I posted the
 | same question there, and no new headers showed up for days -- not even
 | my own post.  :-/

 | Remove the badgers before E-Mailing.

^ this might be why -- you get an e-mail sent to you by the moderation 
business on any first post to that group -- since you're spamblocked, 
you cannot get the auto-e-mail. 

comp.infosystems.www.authoring.cgi is a self-moderated newsgroup -- for 
more info, search for the comp.infosystems.www.authoring.cgi FAQ on 
www.dejanews.com

-- 
send mail to webmaster (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: Wed, 21 Feb 2001 10:15:24 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: PERL Request
Message-Id: <ft479t86726jaofom2b12lvn8sq1dr8dok@4ax.com>

Mindfield wrote:

>I tried.  Unfortunately the only CGI newsgroup my ISP gets is
>comp.infosystems.www.authoring.cgi, and that appears to either be a
>dead group, or a group that has essentially been removed by my ISP,
>and just hasn't gotten round to disappearing yet, because I posted the
>same question there, and no new headers showed up for days -- not even
>my own post.  :-/

No, there appears to be a problem with the automoderator bot. There
hardly have appeared any posts since Feb 9.

-- 
	Bart.


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

Date: Wed, 21 Feb 2001 00:06:32 -0500
From: Robert Rothenburg <wlkngowl@unix.asb.com>
Subject: Re: PROPOSAL: Graphics::ColorNames
Message-Id: <3A934CD8.758BA96F@unix.asb.com>



Brad Baxter wrote:
> Personally, I'm fond of data files I can edit with vi.  Since the colors

Good idea! And more portable.

In fact "duh" is a better answer. My current implementation dyanmically
loads simple modules with one function which returns a hash. A text file
may be a lot faster.

> would presumably be read-only, why not a combination of Search::Dict and
> Interpolation?  The data file might look like this:
> 
> black,000000
> blue,0000ff
> green,00ff00
> red,ff0000
> white,ffffff
> 
> Am I crazy?

Hm. Ever hear the joke with the punch line "I may be crazy but I'm not
stupid"? ;)


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

Date: 21 Feb 2001 08:54:48 GMT
From: abigail@foad.org (Abigail)
Subject: Re: PROPOSAL: Graphics::ColorNames
Message-Id: <slrn9970io.7jk.abigail@tsathoggua.rlyeh.net>

Robert Rothenburg (wlkngowl@unix.asb.com) wrote on MMDCCXXXI September
MCMXCIII in <URL:news:3A934CD8.758BA96F@unix.asb.com>:
:} 
:} 
:} Brad Baxter wrote:
:} > Personally, I'm fond of data files I can edit with vi.  Since the colors
:} 
:} Good idea! And more portable.
:} 
:} In fact "duh" is a better answer. My current implementation dyanmically
:} loads simple modules with one function which returns a hash. A text file
:} may be a lot faster.

*shrug* dbm files were suggested to avoid the overhead of loading an
entire text file. Don't forget, this is supposed to run on a system
that has problems finding the memory to hold a thousand integers.

If loading a text file isn't a problem, this entire discussion was moot.


Abigail
-- 
perl -wle'print"Êõóô áîïôèåò Ðåòì Èáãëåò"^"\x80"x24'


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

Date: Wed, 21 Feb 2001 00:07:56 -0500
From: Murali K Inaganti <inaganmi@email.uc.edu>
Subject: Re: sending cookies with LWP user agent
Message-Id: <3A934D2C.FCCC223D@email.uc.edu>

Thanks for the reply,

Actually, the simple auto mail check program which iam writing
will log me into yahoo and download the mails. The problem is
while logging into yahoo with the login and passwd. It sends some
cookies which should be accepted. I wasn't able to do that.
I found that i need to accept cookies by logging in using lynx.
(session cookies).

Actually that's the reason, I could login using netscape and not
through the LWP::Useragent.

Can anyone tell me if I can do that.

Thanks in advance,
Murali

my program

#!/usr/local/bin/perl -w

use LWP;
use LWP::Debug;
use HTTP::Request;
use HTTP::Response;
use HTTP::Cookies;

##dir to store file cookie_jar
$DIR = '/afs/eng/users/ece/grad/minagant/SUN/perl';
##if any one wants to try it please change accordingly.


####Getting the login page from yahoo
$agent = LWP::UserAgent->new;
$agent->agent("$0/0.1".$agent->agent);
$agent->timeout(30);
$request = HTTP::Request->new(GET => 'http://mail.yahoo.com');
$request->header('Accept'=> 'text/html');
$response = $agent->request($request);
if ($response->is_success)
        {
        $cookie_jar = new HTTP::Cookies(ignore_discard => TRUE);
        $cookie_jar->extract_cookies($response);
        $cookie_jar->save("$DIR/cookie_jar");
        }
else{ die "unable to connect to yahoo\n";}
####The above works perfectly fine.


#####constucting the form response.

$loginpage = $response->content;


##########obtaining the url to be posted to
$loginpage =~ /action="([^"]*)"/;   #######method is POST
$baseurl = $1;

$loginpage =~ /".u" value="([^"]*)"/;
$u = $1;

$valuepairs = "&.tries=&.src=ym&.last=&.promo=&.intl=us&.bypass=";
$valuepairs .= "&.partner=&.u=$u&.v=0&hasMsgr=0&.chkp=y&.done=";


######getting login id and passwd to constuct the final value pairs
######The form is sent by POST method
print "Enter your yahoo id:";
chomp($login=<STDIN>);
print "Enter your passwd:";
system "stty -echo";
chomp($passwd=<STDIN>);
system "stty echo";
print "\n";

$fvp = $valuepairs."&login=$login&passwd=$passwd";



##########trying to login into yahoo
##This fails miserably.
##But the same thing works in netscape.
##I mean when i use the generated value pairs
##and use it as generated URLs it logs me in.
## The problem is while logging in yahoo sends
##cookies and iam not able to handle them
######

$request = HTTP::Request->new(POST => $baseurl);
$request->header('Accept'=>'test/html');
$cookie_jar = new HTTP::Cookies( ignore_discard =>TRUE);
$cookie_jar->load("$DIR/cookie_jar");
$cookie_jar->add_cookie_header($request);
$request->content_type('application/x-www-form-urlencoded');
$request->content($fvp);

$response = $agent->request($request);

print  "$response->status_line\n";
################
##I get some thing like
##The document has moved
##<A HREF="http://f95.mail.yahoo.com/ym/login?.rand=42dq1
##3t51srfl">here</A>.<P>
##




Gregory Toomey wrote:

> The following code fragments get web page and store/send a cookie!!
> You can use this code to emulate what a browser.
>
> 1. Open a Web page and store a cookie in a file.
>
> use LWP::UserAgent;
> use HTTP::Cookies;
>
>       $ua = new LWP::UserAgent;
>       $ua->agent("$0/0.1 " . $ua->agent);
>       $ua->timeout(30);
>        $req = new HTTP::Request 'GET' => 'http://www.somesite.com';  #change
> as apprporiate
>       $req->header('Accept' => 'text/html');
>       $res = $ua->request($req);
>
>       if ($res->is_success) {
>               $cookie_jar = new HTTP::Cookies( ignore_discard =>TRUE);
>               $cookie_jar->extract_cookies($res);
>                $cookie_jar->save('/usr/local/cookie_jar);   #change as
> appropriate
>                 #web page is now in the variable$res
> }
>
> 2. Open a Web page and send the stored cookie
>
>                 $ua = new LWP::UserAgent;
>                 $ua->agent("$0/0.1 " . $ua->agent);
>                 $ua->timeout(30);
>                 $req = new HTTP::Request 'GET' =>
> 'http://www.somesite.com/';
>                $req = new HTTP::Request 'GET' =>
> 'http://www.somesite.com/somepage.htm';  #change as apprporiate
>
>                 $req->header('Accept' => 'text/html');
>                 $cookie_jar = new HTTP::Cookies( ignore_discard =>TRUE);
>                 $cookie_jar->load('/usr/local/cookie_jar') #change as
> appropriate
>                 $cookie_jar->add_cookie_header($req);
>                 $res = $ua->request($req);
>
>                 if ($res->is_success) {
>                 #web page is now in the variable $res
>                 }
>
> Enjoy!
> gtoomey
> -----------------------
> "Murali K Inaganti" <inaganami@email.uc.edu> wrote in message
> news:3A91D409.61290686@email.uc.edu...
> > Hi all,
> >
> > I am writing simple a auto mail check program, which gets mail from
> > yahoo id. I was using LWP::Useragent for sending for sending all the
> > login passwd etc,
> > Its returning a 302 Found (redirection) and it never logs me in.
> >
> > but if i input the generated  URL  through netscape, I logs me in.
> >
> > can anyone tell me whats wrong or give  me some pointers to
> > such programs
> >
> > thanking you,
> >
> > Murali
> >
> >
> >
> >



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

Date: Wed, 21 Feb 2001 12:34:43 +0000
From: NO_SPAM@mail.ru
Subject: Sendmail
Message-Id: <ved79tstkqm6na5jnirosgle29qv1tj5r2@4ax.com>

Stupid question maybe:

Where can I find sendmail, on the Internet ?

I don't use perl but would like to see how it's done :-)

Thanks,

Igor


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

Date: 21 Feb 2001 09:46:50 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Sendmail
Message-Id: <slrn9973ka.8cf.abigail@tsathoggua.rlyeh.net>

NO_SPAM@mail.ru (NO_SPAM@mail.ru) wrote on MMDCCXXXI September MCMXCIII
in <URL:news:ved79tstkqm6na5jnirosgle29qv1tj5r2@4ax.com>:
][ Stupid question maybe:
][ 
][ Where can I find sendmail, on the Internet ?
][ 
][ I don't use perl but would like to see how it's done :-)


Sendmail isn't written in Perl.

Your question has absolutely nothing to do with Perl.



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: Wed, 21 Feb 2001 11:09:11 +0100
From: John Smith <jsmith@cecioni.com>
Subject: Using a Java class from Perl. Is it possible?
Message-Id: <3A9393C7.2CDD757B@cecioni.com>


Jallo, assuming I have a Java class or a package, is it possible
to use it from Perl? I'm thinking of some wrapper
or something....
I would like to instantiate objects of that class and invoke their 
methods...

Is there a series of alternatives to choose from?

thank you

John


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

Date: Wed, 21 Feb 2001 00:06:46 -0500
From: "Sungwook Park" <parks@cs.unc.edu>
Subject: what is param?
Message-Id: <96vibt$4c0$1@ashe.cs.unc.edu>

I starting learning Perl.

in this code

use CGI::Carp "fatalsToBrowser";

Main
{
my $a = param('a');

 .......
}

what is "param"? and what is "CGI::Carp"





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

Date: 21 Feb 2001 05:58:13 GMT
From: blah@blah.blah.invalid
Subject: Re: what is param?
Message-Id: <96vldk$3hv4$1@newssvr06-en0.news.prodigy.com>

Sungwook Park <parks@cs.unc.edu> wrote:
> I starting learning Perl.

> in this code

> use CGI::Carp "fatalsToBrowser";

> Main
> {
> my $a = param('a');

> .......
> }

> what is "param"? and what is "CGI::Carp"

from the command line, do
  % perldoc CGI
  % perldoc CGI::Carp



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

Date: Wed, 21 Feb 2001 08:07:17 +0100
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.li>
Subject: Re: What's wrong with this script?
Message-Id: <o3q69tsdgen3t94vo7orhpm5822pe99tcm@4ax.com>

On Tue, 20 Feb 2001 18:26:20 +0200, "Dan" <ge@do.com> wrote:

> Hmm... I would suggest you would start reading the replies (at least the
> replies by the same author as the original post) before replying something
> like that.

Point: You posted your reply at 13:31:10 +0200 (at least if you're
talking about <96tkcr$5vi$1@news.kolumbus.fi> ).

Point: Josef posted his reply at 12:17:42 +0100 (= 13:17:42 +0200) on
the same day.

Please explain how you want him to read your reply before posting his,
without involving a time machine.

Oh, and it's also nice to quote in order to provide some context, and
to provide attributions.

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
If you're not part of the solution, you're part of the precipitate


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

Date: Sat, 17 Feb 2001 11:22:34 -0500
From: "Chris Melaro" <cmela@email.msn.com>
Subject: why does IO::File / new_tmpfile write to '/' filesystem rather than '/tmp'?
Message-Id: <uLh1o4PmAHA.269@cpmsnbbsa07>

use IO::File;
my $tmp_fh = new_tmpfile IO::File;

Why does this create it's tempfile in the root ('/') filesystem rather than
using '/tmp'?  Is there some technical reason why creating an "anonymous"
file can't be done an another filesystem?







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

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 325
**************************************


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