[16397] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3809 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 26 14:09:09 2000

Date: Wed, 26 Jul 2000 11:05:21 -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: <964634721-v9-i3809@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 26 Jul 2000     Volume: 9 Number: 3809

Today's topics:
    Re: Advanced Perl Programming -- Dated? <uri@sysarch.com>
    Re: Advanced Perl Programming -- Dated? <uri@sysarch.com>
    Re: Advanced Perl Programming -- Dated? (Nobody)
    Re: Advanced Perl Programming -- Dated? <uri@sysarch.com>
    Re: autoresponder with customised message drdementor@my-deja.com
    Re: autoresponder with customised message drdementor@my-deja.com
    Re: Capturing info accross multiple pages in one form <andybarlow70NOanSPAM@hotmail.com.invalid>
    Re: Capturing info accross multiple pages in one form <wmonk@documentsolutions.com>
    Re: CGI passing parameters <six4eight@NOSPAMhotmail.com>
        Critiques, please (BUCK NAKED1)
    Re: exactly WHEN will PP-3rd be in bookstores, etc?  An (Nobody)
    Re: exactly WHEN will PP-3rd be in bookstores, etc?  An <hartleh1@westat.com>
    Re: find.pl & error_log nobull@mail.com
        Getting the text between html-comments from a file. (th <jimmy.lantz@ostas.lu.se>
        Help! <simon@nospam.simonwebdesign.com>
    Re: Help! <sariq@texas.net>
    Re: Help! <simon@nospam.simonwebdesign.com>
    Re: Help! <tony_curtis32@yahoo.com>
    Re: HELPME: Cookies for Client. <gregory_griffiths@cargill.com>
    Re: HELPME: Cookies for Client. <sivix@libero.it>
    Re: How to handle command application on unix (Rafael Garcia-Suarez)
    Re: How to handle command application on unix <kevin@vailstar.com>
    Re: How to print the thousands comma for financial numb nobull@mail.com
    Re: Include a source in another one nobull@mail.com
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 26 Jul 2000 15:07:00 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Advanced Perl Programming -- Dated?
Message-Id: <x71z0h7wx7.fsf@home.sysarch.com>

>>>>> "WK" == W Kemp <bill.kemp@wire2.com> writes:

  >> object oriented perl is a must if you do any OO stuff. it is extremely
  >> well written and you will learn much from it. it is for intermediate to
  >> advanced hackers.


  WK> Is this the one with the bloke in a pre- 18th century costume on
  WK> the Front and by Damian Conway?

yep. a must have.

  >> if you do apache/mod_perl then the writing apache modules with perl and
  >> c is a great book to have. well written and in depth.

  WK> This does have a little SQL stuff in it too, including command line MySQL
  WK> stuff.

i don't have it but the dbi book is supposed to be decent. the
msql/mysql one is not so good. having one of its authors be an avowed
perl hater doesn't do it any good.

  WK> In risk of getting the wrath of the greeat blow torch.  Have you found a
  WK> review of the Laura Lemay book yet?

is that the 21 day book? it sucks in all editions. the 24 hour book was
written by a known perl hacker and is a good intro/intermediate book. it
doesn't talk down to the reader and it is factually accurate. 

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Wed, 26 Jul 2000 15:38:13 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Advanced Perl Programming -- Dated?
Message-Id: <x7ya2o7vh7.fsf@home.sysarch.com>

>>>>> "TW" == The WebDragon <nospam@nospam.com> writes:

  TW>  | get effective perl programming. i call it idiomatic perl. it has many
  TW>  | style and technique points which are not always obvious.

  TW> sounds like useful information, plus I'm a sucker for tricky stuff :) 

it is not all tricky stuff. just ways to write better perl snippets. 

  TW>  | mastering regular expressions is a must even if it is somewhat
  TW>  | dated. the recent good news i heard is friedl has agreed to work on a
  TW>  | new edition.

  TW> THAT is good news indeed. I've been hesitant to purchase this one,
  TW> as much as I knew I needed it, simply for that reason. I sincerely
  TW> hope that friedl can get some of the hardcore regex folks working
  TW> with him to help speed the process and get it to print sooner.

as that won't be out for some time, get the first edition. its datedness
does not detract from its general quality (though others have fought me
on that point). you can pick up the new regex features it doesn't cover
from the docs in most cases. but its explanations on how regexes work,
the comparisons of different regex flavors and how best to use perl
regexes are invaluable.

  TW> Scott

whoa, a real name. watch it there. all the scott's in the world will get
spam now!

:-)

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: 26 Jul 2000 16:07:41 GMT
From: nobody@contract.East.Sun.COM (Nobody)
Subject: Re: Advanced Perl Programming -- Dated?
Message-Id: <8ln2cd$3ko$1@eastnews1.east.sun.com>

In article <x71z0h7wx7.fsf@home.sysarch.com>,
Uri Guttman  <uri@sysarch.com> wrote:
>
>i don't have it but the dbi book is supposed to be decent. the
>msql/mysql one is not so good. having one of its authors be an avowed
>perl hater doesn't do it any good.
>

I agree on both counts.  I found the DBI book invaluable in getting
a DBI::Proxy configuration working.  It's nice to have all that info 
wrapped in a book so I don't have to keep running back to the docs :-)

The mySQL/mSQL one wasn't very useful to me, since the Perl coverage in
it was miniscule and I could rarely find the information I was looking
for.  I expected more, considering the size and detail of the online manual. 

Anita


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

Date: Wed, 26 Jul 2000 16:44:00 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Advanced Perl Programming -- Dated?
Message-Id: <x7snsw7sfj.fsf@home.sysarch.com>

>>>>> "N" == Nobody  <nobody@contract.East.Sun.COM> writes:

  N> The mySQL/mSQL one wasn't very useful to me, since the Perl
  N> coverage in it was miniscule and I could rarely find the
  N> information I was looking for.  I expected more, considering the
  N> size and detail of the online manual.

there is another book (not by o'reilly) called mysql (by dubois) which
has gotten better reviews.

i found a sams teach yourself mysql in 21 days. heh!!

bookpool has all 3.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Wed, 26 Jul 2000 15:35:16 GMT
From: drdementor@my-deja.com
Subject: Re: autoresponder with customised message
Message-Id: <8ln0fl$n6a$1@nnrp1.deja.com>

In article <397EE721.EEFDF1D4@whitehouse.gov>,
  president@whitehouse.gov wrote:
> drdementor@my-deja.com wrote:
>
> > I want to make an auto responder in perl.
> >
> > I know how to send mail but i dont know how to rexieve it.
> >
> > I know I will need a domain name. What kind of server support do i
need?
> > What is the code for this? will it just go into a bin and the perl
code
> > reads it like a file almost?
> >
> > I need somewhere to start.
> >
> > If someone sends an email to the autoresponding address i would
like to
> > do something like,,, take the info from the email sent then
manipulate
> > it and send it back to them..
> >
> > I am not familiar with mail proticals i know that there are 2 main
ones
> > and a total of maybe 4.
> >
> > I need suggestions of a webserver to use, what do i need?
> > I know i need perl cgi capabilitiess but im talking mainly email
wise...
> >
> > thanks in advance
> >
> > Jim
>
> There are about a million ways to go about this, so give some idea
what
> you're resources and constraints are and we'll work from there. For
example,
> what kind of environment is this script going to run in? On your
Win98 PC at
> home, picking up your mail instead of Outlook? Or on a Solaris 8 SMTP
> server, with Sendmail running it directly?
>
> Oh, and there's only 1 main email protocol and that's SMTP. About
99.9% of
> the world's email goes through SMTP at some point. The others are
chicken
> feed.
> ---
> Nick
>
>
im not running it on my pc, i will run it on a web server,
i do not have any servers but i will pay for a virtual server with
solaris 8 on it if you think that is what i need,

do i need unlimited pop3 email accounts on the server, or can i just
use hotmail accounts and use the server to retreve the emails and reply
back to them,

i will look at cpan, im new to perl, i know c++ vb html javascript and
such and did a crash course in perl...

if i want a perl program running on the server whats that called, i
mean, whats the executable named? does it need ot be compiled?

what type of web hosting would you reccomend for this project?

i will spend today lookign at  cpan and seeing what i can do,
currently i have free webspace at hypermart and it has perl 5 on iti
think. I dont know if it lets you run programs 24/7

i was hoping to use them to test the script then pay for webspace
somewhere once i have the working swcript and when im ready to recieve
lots of mail.
i have my own domain at hypermert but all emails are just fwded to an
account from my isp.

I dont want to do run any perl on my pc i want this done on a web
server, I think that is the better way of doing it.

I hope this answered some of what you want to know....

thanks for your help JIm



Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 26 Jul 2000 15:44:38 GMT
From: drdementor@my-deja.com
Subject: Re: autoresponder with customised message
Message-Id: <8ln115$nk2$1@nnrp1.deja.com>

wise...
>
> *web*  <--------------> *mail*
>
thankd for your help!

> My email never goes near a web server and perl has far greater uses
than
> just as a CGI script language.
>

if your mail does not go to your web server where does it go?
I was going to own y own domain and thought  i could let the mail just
go to the server, but using hotmail accoutns or whatever is ok too.

Where does it do other than the server, if i to have an email address
called me@mysite.com does it get scored on the server? if its pop3 does
it get scored on the server..

if i sound to novice i would be happy if you linked me to resources
that eaplained the email process...

also when you said perl is more than a cgi scripting language. i know
what you mean, i know you can run continous programs, but how are they
set up and executed and how do i know if my host supports it

im using hypermart for now, it supports perl...
I will contact them...

I am prepaired to pay for more capable webspace or pay for a virtual
server or whatever is demed nessesary. i expect to recieve and reply to
possibly a few thousand emails a day.

Jim


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 26 Jul 2000 09:05:37 -0700
From: Andy Barlow <andybarlow70NOanSPAM@hotmail.com.invalid>
Subject: Re: Capturing info accross multiple pages in one form
Message-Id: <138115fb.cc6205b9@usw-ex0107-055.remarq.com>

Cheers Wes.

Could you explain in more detail.  You sound like you know a
hell of a lot more than me.

Cheers

Andy


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

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com



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

Date: Wed, 26 Jul 2000 09:36:26 -0700
From: "Monk" <wmonk@documentsolutions.com>
Subject: Re: Capturing info accross multiple pages in one form
Message-Id: <snu4qejh3j1148@corp.supernews.com>


"Andy Barlow" <andybarlow70NOanSPAM@hotmail.com.invalid> wrote in message
news:138115fb.cc6205b9@usw-ex0107-055.remarq.com...
> Cheers Wes.
>
> Could you explain in more detail.  You sound like you know a
> hell of a lot more than me.
>
> Cheers
>
> Andy
>
>
Andy,
    I can not say it any better than the man himself.  Here is an article
that Randal Schwartz wrote for Webtechniques.

http://www.webtechniques.com/archives/1999/08/perl/

This is where I learned the technique.

Good luck
wes
> -----------------------------------------------------------
>
> Got questions?  Get answers over the phone at Keen.com.
> Up to 100 minutes free!
> http://www.keen.com
>




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

Date: Wed, 26 Jul 2000 15:53:56 GMT
From: "Eelke Kleijn" <six4eight@NOSPAMhotmail.com>
Subject: Re: CGI passing parameters
Message-Id: <oQDf5.3222$Gd1.32655@Typhoon.bART.nl>

instead of using:
/cgi-bin/GETFILE
you could use:
/cgi-bin/GETFILE?file=$file&num=$num;

The the GETFILE (supposing it is a cgi file) could retrieve the parameters
bij using the url_param() function, which is used in the same way as the
param() function.

Hope this helps,
Eelke Kleijn

"Mouse" <glodalec@yahoo.com> schreef in bericht
news:397ED6FF.4BF@yahoo.com...
> Hi !
>
> I have main CGI script called MAIN. It receive two parameters,
> file and num (/cgi-bin/MAIN?file=myfile&num=100)
>
> #!/usr/local/bin/perl
> use CGI qw/:standard/;
> $file=param('file');
> $num=param('num');
> ...
> @ARRAY=`/cgi-bin/GETFILE';
> foreach $X (@ARRAY)
>

>   print $X;
> }
> ...
>
> As you have noticed, I call another perl program called GETFILE.
> How can I pass parameters from MAIN to GETFILE ?
> I don't like
>     '/cgi-bin/GETFILE ' . $file . ' ' . $num
>     and then asking for ARGV[]
> If its possible, I would like to use the same param('<name>') in
> GETFILE.
>
> Any hints ?
>
>
> Alex




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

Date: Wed, 26 Jul 2000 12:23:16 -0500 (CDT)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Critiques, please
Message-Id: <22695-397F1E84-52@storefull-248.iap.bryant.webtv.net>

Is it "soup" yet? workable? perfect? as good as most counters? Critiques
and constructive suggestions desired.

#!/usr/local/bin/perl -w 
use strict; 
use Fcntl qw/:flock :DEFAULT/; 
my $counter = 'counter.dat'; 
sysopen(COUNT, $counter, O_RDWR|O_CREAT) or die "Can't OPEN data file
for READING and WRITING: $!"; flock(COUNT, LOCK_EX) or die "Cannot get
an EXCLUSIVE LOCK on data file: $!"; my $num = <COUNT> || 0; 
$num++; 
seek(COUNT, 0, 0) or die "can't REWIND to beginning of data file: $!";
truncate(COUNT, 0) or die "can't TRUNCATE data file: $!"; print COUNT
"$num\n"; 
1 while $num =~ s/(.*\d)(\d\d\d)/$1,$2/; 
for($num) {s/(1[123]|[4-90]$)/$1th/ or s/(1$)/$1st/ or s/(2$)/$1nd/ or
s/(3$)/$1rd/;};
print "Content-type: text/html\n\n"; print("You are the $num visitor to
this webpage");
close COUNT or warn $!; 
## END SCRIPT

Regards,
Dennis



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

Date: 26 Jul 2000 15:57:35 GMT
From: nobody@contract.East.Sun.COM (Nobody)
Subject: Re: exactly WHEN will PP-3rd be in bookstores, etc?  Anyone know?
Message-Id: <8ln1pf$3cf$1@eastnews1.east.sun.com>

In article <397E4D31.E39E7890@attglobal.net>,
Drew Simonis  <care227@attglobal.net> wrote:
>Abigail wrote:
>> 
>> David Combs (dkcombs@netcom.com) wrote on MMDXXI September MCMXCIII in
>> <URL:news:8llfrs$tkg$1@slb7.atl.mindspring.net>:
>> ~~ I saw something from Larry that the book was going to
>> ~~ be ready for TPC -- but that's over by now (true?) --
>> ~~ and O'Reilly's site is still saying "July".
>> 
>> I got my courtesy copy on Monday.
>
>*grumble* I _paid_ for the darn thing and I still don't have it!

I saw it in SoftPro in Burlington, MA last Saturday...didn't have 
time to check it out, though, since I just got an XML/Java project
dumped in my lap and needed to do some serious crash-coursing :-)

Anita



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

Date: Wed, 26 Jul 2000 13:54:32 -0400
From: Henry Hartley <hartleh1@westat.com>
Subject: Re: exactly WHEN will PP-3rd be in bookstores, etc?  Anyone know?
Message-Id: <397F25D8.4B269F5A@westat.com>


David Combs wrote:
> 
> I wasn't at TPC -- *were* copies available there?

readmedoc.com has it listed.  They don't say anything about availability
but they do have this useful description:

"This book is not just a book about Java. It is also a unique
introduction to the language and its culture."

 ..chuckle..

Henry Hartley


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

Date: 26 Jul 2000 17:49:49 +0100
From: nobull@mail.com
Subject: Re: find.pl & error_log
Message-Id: <u9u2dcj0pe.fsf@wcl-l.bham.ac.uk>

Ralf Weber <weberr2202@my-deja.com> writes:

> Subject: Re: find.pl & error_log

A better subject would have been: find.pl & Apache+mod_perl

> in a perl file I use require find.pl

Bad idea. The Perl4-style find.pl interface to the File::Find module
is provided for legacy code.  New code should use the File::Find
module directly.

One problem with the find.pl kludge is that if your program consits of
serveral packages (modules) and more than one of theses packages
requires find.pl then your program will fail because only the first
package will actually get the symbols from File::Find imported.

> This works fine under windows, but under linux (SUSE 6.3) I get the
> following error
> in the error_log:
> Fri Jul 14 19:01:51 2000] [error] Undefined subroutine
> &Apache::ROOT::cgi_2dbin::cgiuebungen::searchindex::sicherhomepage::rfin
> dex_2epl::find called at
> /apache/cgi-bin/cgiuebungen/searchindex/sicherhomepage/rfindex.pl line
> 27.
> 
> I absolutely don't understand ;-)

Under Apache+mod_perl your CGI scripts don't really run as separate
scripts in separate instances of the Perl interpreter.  Instead they
are loaded as packages in a single instance of the Perl interpreter.
You therefore fall foul of the problem with find.pl mentioned above.

Either run the scripts as real CGI scripts or stop requiring old
Perl4-style libraries and start using Perl5-style modules.

You may also want to read the Apache+mod_perl docs to learn what other
things that are safe in stand-alone CGI are no longer safe.  There are
not all that many but I pays to be aware of them.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Wed, 26 Jul 2000 18:12:44 +0200
From: Jimmy Lantz <jimmy.lantz@ostas.lu.se>
Subject: Getting the text between html-comments from a file. (this is darn slow,  is there a quicker way?)
Message-Id: <397F0DFC.4CEA8C6C@ostas.lu.se>

Hi guys,
as usual I have an optimizing problem, it seems that I just  succeds in
creating working scripts and not fast working ones.
I wonder if there's some pointers to smart "perling", 
and if there's someone who as a better Idea to extract  the info between
2 html-comments or has a quicker way or good pointers  how to get the
script below more effective thats also welcome.
Cheers.
Jimmy L. 


open(INFO, $filadress) || die "Failed to open $filadress...$!";
@lines = <INFO>;
close(INFO);

foreach $line (@lines)
{
if ($line =~ /<!--START -->/)
{
$start = 1;
}

if ($line =~ /<!--SLUT -->/)
{
last;
}

if ($start == 1)
{

$line =~ s/<br>/\n/g;
$line =~ s/<p>/\n/;
###################### Is there a way to erase the rest of htmltags,
just erase everything between <> ?
$line =~ s/<span>//g;
$line =~ s/<\/span>//g;
$line =~ s/<span class="graybg">//g;

push (@results, $line);
next;
}

}


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

Date: Wed, 26 Jul 2000 15:48:49 GMT
From: "Simon" <simon@nospam.simonwebdesign.com>
Subject: Help!
Message-Id: <BLDf5.201$07.15690@news3.cableinet.net>

Hi there,

I'm new to this NG and am looking for some help!  I have a form to e-mail
script that I wrote a while back, I need to add the ability to attach a file
to the e-mail, does anyone have any idea how to do this?

May be able to offer a reward for this....

Thanks in anticipation

Simon
http://simonwebdesign.com





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

Date: Wed, 26 Jul 2000 11:26:03 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Help!
Message-Id: <397F111B.487AA68E@texas.net>

Please read this useful information on Choosing Good Subject Lines:

http://www.perl.com/CPAN-local/authors/Dean_Roehrich/subjects.post

Simon wrote:
> 
> I'm new to this NG and am looking for some help!  I have a form to e-mail
> script that I wrote a while back, I need to add the ability to attach a file
> to the e-mail, does anyone have any idea how to do this?

This question gets asked about 37 times a day here.  Did you put forth
*any* effort to find the solution on your own?

Use the MIME::Lite module, available on the CPAN.

- Tom


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

Date: Wed, 26 Jul 2000 16:54:03 GMT
From: "Simon" <simon@nospam.simonwebdesign.com>
Subject: Re: Help!
Message-Id: <LIEf5.286$07.24822@news3.cableinet.net>

Thanks for the pointers Tom!

I searched the web for hours today, looking for a script that would help me
achieve my goals, after that I looked for tutorials!  Now I thought I would
check out some news groups and see if anyone could help me, I'm not a
developer so I tend to struggle a bit with Perl.

Have you used this module before?  I need to have an HTML form with the
following tag <INPUT TYPE="file" NAME="attachment"> then have this module or
one similar take the file and attach it to an e-mail!

do you have any idea how to write teh perl to accomplish this?

Thanks in anticipation

Simon
http://simonwebdesign.com




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

Date: 26 Jul 2000 11:57:21 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Help!
Message-Id: <87k8e8bzim.fsf@limey.hpcc.uh.edu>

>> On Wed, 26 Jul 2000 16:54:03 GMT,
>> "Simon" <simon@nospam.simonwebdesign.com> said:

> Have you used this module before?  I need to have an
> HTML form with the following tag <INPUT TYPE="file"
> NAME="attachment"> then have this module or one similar
> take the file and attach it to an e-mail!

http://search.cpan.org/search?mode=module&query=MIME

looks fruitful, MIME::Lite is probably what you want.

hth
t
-- 
"With $10,000, we'd be millionaires!"
                                           Homer Simpson


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

Date: Wed, 26 Jul 2000 15:53:11 +0100
From: "Greg Griffiths" <gregory_griffiths@cargill.com>
Subject: Re: HELPME: Cookies for Client.
Message-Id: <8lmu0s$87m$1@mercury.cargill.com>

Sivix,
    not sure if this is the best way to do it, why do you want to trap the
data ? If you want to get the next URL value so you can get into Livelink
you'll need to trim out and then clean the data - try using escape and
substr for this, a quicker way of redirecting is to return something like :

<html>
<body>
<script language="javascript">
document.location='http://www.msn.com';
</script>
</body>
</html>

drop me a note as I do a faire bit of work with the Livelink app.

Sivix <sivix@libero.it> wrote in message
news:8lm57f$3s7$1@nntp.weblinea.it...
> Hello,
> This is my first post.
> I'm trying to do a script in perl for UNIX to get a web pages from a
server
> that use the Cookies to Login.
> I have done a script to get the response from the webserver and catch the
> Cookies, now my (...little...) problem is to use the redirection and the
> Cookies to retrive the final HTML page from the Server.
> this is My little script n perl used to get and save the cookies:
>
> --------------------------------------------------------------------------
--
> -------------------------------
> use HTTP::Cookies;
> require LWP::UserAgent;
> $cookie_jar = HTTP::Cookies->new (
>                                    File => "/tmp/cookies",
>                                    autosave => TRUE,
>                                    ignore_discard => FALSE
>                                    );
> $ua = LWP::UserAgent->new;
> $request =
>
HTTP::Request->new('GET','http://XXX.XXX.XXX/Livelink/livelink.exe?func=ll.l
> ogin&NextURL=%2FLivelink%2Flivelink%2Eexe&Username=guest&Password=guest');
>
> $response = $ua->request($request);
> $cookie_jar->add_cookie_header($request);
> if ($response->is_success) {
>    $cookie_jar->extract_cookies($response);
>    $cookie_jar->save();
>    print $response->headers_as_string;
>    print $response->content;
>
>   } else
>   {
>      print $response->error_as_HTML;
>     }
> --------------------------------------------------------------------------
--
> ----------------------------------------------------
>
>
> This is the Output:
>
> --------------------------------------------------------------------------
--
> -------------------------------------------------------------
> Date: Wed, 26 Jul 2000 07:46:09 GMT
> Server: Microsoft-IIS/4.0
> Content-Type: text/html
> Client-Date: Wed, 26 Jul 2000 07:46:22 GMT
> Client-Peer: 151.92.249.132:80
> Refresh: 0; URL=/Livelink/livelink.exe
> Set-Cookie: LLInProgress=%2FE1MT4pMj4iNTE%2BIjI4Nz8vIA; path=/Livelink/
> Set-Cookie: LLCookie=%2FE1MT4pMj4iNTE%2BIjI4NzxHTUAwPydldWN0fydldWN0cA;
> path=/Livelink/
> Set-Cookie: LLTZCookie=0; path=/Livelink/
> Title: Livelink - Redirection
> <HTML>
> <!-- File: redirectmeta.html -->
> <HEAD>
> <TITLE>Livelink - Redirection</TITLE>
> <META HTTP-EQUIV="Refresh" CONTENT="0; URL=/Livelink/livelink.exe">
> </HEAD>
> </HTML>
> --------------------------------------------------------------------------
--
> ---------------------------------------------------------------
>
> Now what is the simplest  method to send back cookies to the webserver and
> get the web pages?
> I haven't found some example on How to use the POST method.... I am a
> beginner, please Help me.
>
>
> Thanks,
>
> Andrea.
>
>




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

Date: Wed, 26 Jul 2000 17:21:04 +0200
From: "Sivix" <sivix@libero.it>
Subject: Re: HELPME: Cookies for Client.
Message-Id: <8lmvml$5po$1@nntp.weblinea.it>

Thanks for your Answer,
I don't want really to save the cookies, I have save it only for check &
test....
I don't know more about LiveLink, but I guessed that it send me some cookies
after the Login (as you see in the output), so I would like to do the next
step and get the final HTML page.
I'am a newbie, could you please tell me an example on how to do it? (with
the best method you think...)

Thanks in advice,

Andrea.

Greg Griffiths wrote in message <8lmu0s$87m$1@mercury.cargill.com>...
>Sivix,
>    not sure if this is the best way to do it, why do you want to trap the
>data ? If you want to get the next URL value so you can get into Livelink
>you'll need to trim out and then clean the data - try using escape and
>substr for this, a quicker way of redirecting is to return something like :
>
><html>
><body>
><script language="javascript">
>document.location='http://www.msn.com';
></script>
></body>
></html>
>
>drop me a note as I do a faire bit of work with the Livelink app.
>
>Sivix <sivix@libero.it> wrote in message
>news:8lm57f$3s7$1@nntp.weblinea.it...
>> Hello,
>> This is my first post.
>> I'm trying to do a script in perl for UNIX to get a web pages from a
>server
>> that use the Cookies to Login.
>> I have done a script to get the response from the webserver and catch the
>> Cookies, now my (...little...) problem is to use the redirection and the
>> Cookies to retrive the final HTML page from the Server.
>> this is My little script n perl used to get and save the cookies:
>>
>> -------------------------------------------------------------------------
-
>--
>> -------------------------------
>> use HTTP::Cookies;
>> require LWP::UserAgent;
>> $cookie_jar = HTTP::Cookies->new (
>>                                    File => "/tmp/cookies",
>>                                    autosave => TRUE,
>>                                    ignore_discard => FALSE
>>                                    );
>> $ua = LWP::UserAgent->new;
>> $request =
>>
>HTTP::Request->new('GET','http://XXX.XXX.XXX/Livelink/livelink.exe?func=ll.
l
>>
ogin&NextURL=%2FLivelink%2Flivelink%2Eexe&Username=guest&Password=guest');
>>
>> $response = $ua->request($request);
>> $cookie_jar->add_cookie_header($request);
>> if ($response->is_success) {
>>    $cookie_jar->extract_cookies($response);
>>    $cookie_jar->save();
>>    print $response->headers_as_string;
>>    print $response->content;
>>
>>   } else
>>   {
>>      print $response->error_as_HTML;
>>     }
>> -------------------------------------------------------------------------
-
>--
>> ----------------------------------------------------
>>
>>
>> This is the Output:
>>
>> -------------------------------------------------------------------------
-
>--
>> -------------------------------------------------------------
>> Date: Wed, 26 Jul 2000 07:46:09 GMT
>> Server: Microsoft-IIS/4.0
>> Content-Type: text/html
>> Client-Date: Wed, 26 Jul 2000 07:46:22 GMT
>> Client-Peer: 151.92.249.132:80
>> Refresh: 0; URL=/Livelink/livelink.exe
>> Set-Cookie: LLInProgress=%2FE1MT4pMj4iNTE%2BIjI4Nz8vIA; path=/Livelink/
>> Set-Cookie: LLCookie=%2FE1MT4pMj4iNTE%2BIjI4NzxHTUAwPydldWN0fydldWN0cA;
>> path=/Livelink/
>> Set-Cookie: LLTZCookie=0; path=/Livelink/
>> Title: Livelink - Redirection
>> <HTML>
>> <!-- File: redirectmeta.html -->
>> <HEAD>
>> <TITLE>Livelink - Redirection</TITLE>
>> <META HTTP-EQUIV="Refresh" CONTENT="0; URL=/Livelink/livelink.exe">
>> </HEAD>
>> </HTML>
>> -------------------------------------------------------------------------
-
>--
>> ---------------------------------------------------------------
>>
>> Now what is the simplest  method to send back cookies to the webserver
and
>> get the web pages?
>> I haven't found some example on How to use the POST method.... I am a
>> beginner, please Help me.
>>
>>
>> Thanks,
>>
>> Andrea.
>>
>>
>
>




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

Date: Wed, 26 Jul 2000 15:26:42 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: How to handle command application on unix
Message-Id: <slrn8nu12u.7nn.rgarciasuarez@rafael.kazibao.net>

jing111@my-deja.com wrote in comp.lang.perl.misc:
>
>   I tried to automate sqlplus command on unix server. The code is as
>follows:
>
>   open(HD, "| sqlplus userid/passwd") || die "$!";
>   print HD "spool filename";
>   print HD "select * from tablename"
>   print HD "/";
>   close HD;
>
>   open command works, but rest of the code do not work. why?
>
>   I know ther is module called IPC open2() for interactive programming.
>In this simple situation, i don't want to make complicated.

I don't know about sqlplus, but didn't you forgot a \n at the end of
your strings?

-- 
Rafael Garcia-Suarez


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

Date: Wed, 26 Jul 2000 13:46:14 -0400
From: Kevin Michael Vail <kevin@vailstar.com>
Subject: Re: How to handle command application on unix
Message-Id: <kevin-AEDA81.13461426072000@news.his.com>

In article <8lmsg6$ka5$1@nnrp1.deja.com>, jing111@my-deja.com wrote:

>    I tried to automate sqlplus command on unix server. The code is as
> follows:
> 
>    open(HD, "| sqlplus userid/passwd") || die "$!";
>    print HD "spool filename";
>    print HD "select * from tablename"
>    print HD "/";
>    close HD;
> 
>    open command works, but rest of the code do not work. why?
> 
>    I know ther is module called IPC open2() for interactive programming.
> In this simple situation, i don't want to make complicated.
> 
>    Any hints or help, really appreciated.

You need a new line at the end of each print statement.  Otherwise 
you're just sending one long line.
-- 
Kevin Michael Vail | a billion stars go spinning through the night,
kevin@vailstar.com | blazing high above your head.
 . . . . . . . . .  | But _in_ you is the presence that
 . . . . . . . . . | will be, when all the stars are dead.  (Rainer Maria Rilke)


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

Date: 26 Jul 2000 17:51:15 +0100
From: nobull@mail.com
Subject: Re: How to print the thousands comma for financial numbers ( $ 12,8292.75)
Message-Id: <u9og3kj0n0.fsf@wcl-l.bham.ac.uk>

"Louis Banens" <louis.banens@xs4all.nl> writes:
 
> I cannot find out how to print the thousands comma for financial
> numbers

I you "cannot find out how to" do things that are explained in the FAQ
then perhaps Perl isn't for you.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 26 Jul 2000 17:52:29 +0100
From: nobull@mail.com
To: gvoc@my-deja.com
Subject: Re: Include a source in another one
Message-Id: <u9n1j4j0ky.fsf@wcl-l.bham.ac.uk>

Please include only relevant parts of the message you are replying to
and do so in a logical order.  Failure to do this is considered very
rude.

gvoc@my-deja.com writes updside down:
> 
> In article <u9d7k2cft7.fsf@wcl-l.bham.ac.uk>,
>   nobull@mail.com wrote:
> > gvoc@my-deja.com writes:

> > > How can I include a Perl source in another one, es. the way the C
> > > #include directive works ?

> > Ignoring the fact that you _can_ use C preprocessor for Perl because
> > nobody really does this these days the nearest thing is "do".
> >
> > Actually "require" or "use" is probably better.  For details RTFM.

> I tried both with "use" and with "eval" but the first one only accepts a
> module name as argument and mine is not a module. About "eval" I
> discovered it after sending this e-mail and (of course) it works.

"use" and "eval" are two opposite extreems.  Between them there is
"require" and "do".  The documentation of the "do" function explains
why it is almost certainly better than "eval" for your purposes.  The
documentation of "require" explains why it may be better still.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

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 V9 Issue 3809
**************************************


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