[24908] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7158 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 21 21:18:15 2004

Date: Tue, 21 Sep 2004 18:16:54 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 21 Sep 2004     Volume: 10 Number: 7158

Today's topics:
        distributing perl applications (buildmorelines)
    Re: distributing perl applications <bob@bwalton.com>
    Re: distributing perl applications <usenet@morrow.me.uk>
    Re: distributing perl applications <brundlefly76@hotmail.com>
    Re: distributing perl applications off@mailinator.com
        Entering HTTPS web page (Mahaan)
    Re: Entering HTTPS web page <dwilga-MUNGE@mtholyoke.edu>
        Formatting cells as numbers in Spreadsheet::ParseExcel: <michaelp@hio.no>
        Help with my brute force method <jeff.gilbertson@gmail.com>
    Re: Help with my brute force method <someone@example.com>
    Re: Help with my brute force method (Anno Siegel)
    Re: Help with my brute force method <jeff.gilbertson@gmail.com>
    Re: How can I measure web hits from my web browser/end  <Joe.Smith@inwap.com>
    Re: How can I measure web hits from my web browser/end  <usenet@morrow.me.uk>
    Re: How can I measure web hits from my web browser/end  <jurgenex@hotmail.com>
        How is this Perl Script encrypted? i6033162556-signup1@yahoo.com.cn
    Re: How is this Perl Script encrypted? <james.keasley@gmail.invalid>
    Re: How is this Perl Script encrypted? (Malcolm Dew-Jones)
    Re: How is this Perl Script encrypted? <tim@vegeta.ath.cx>
        how to decode ldap package?? <sonet@msa.hinet.net>
    Re: how to decode ldap package?? <vetro@online.no>
    Re: how to decode ldap package?? <sonet@msa.hinet.net>
    Re: how to decode ldap package?? <Joe.Smith@inwap.com>
        How to invoke a javascript function using Perl? <rosyling2004@yahoo.com>
    Re: How to invoke a javascript function using Perl? <sbryce@scottbryce.com>
    Re: How to invoke a javascript function using Perl? <spamtrap@dot-app.org>
    Re: How to invoke a javascript function using Perl? <jurgenex@hotmail.com>
    Re: How to invoke a javascript function using Perl? <wolf@code-wizards.com>
    Re: How to invoke a javascript function using Perl? <rosyling2004@yahoo.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 18 Sep 2004 12:18:02 -0700
From: bulk88@hotmail.com (buildmorelines)
Subject: distributing perl applications
Message-Id: <ee659c69.0409181118.2e1e5e5e@posting.google.com>

I have a perl script I wrote for win32, and I want it to be the
quality of a typical C windows program. I have read about the bytecode
compiler and the perl2exe and AS perlapp programs. I dont want the end
user to ever have to know they are running perl under the hood
(shortcuts cant be "perl myscript.pl"), and I dont want them to have
to install perl seperatly (maybe a stripped version of perl would be
ok, but cant be a long install). I also want it to be pre compiled so
there is no pause at compilation. I think bytecode does that but I may
be wrong. I dont care about space or number of files really. What
should I use and any ideas?


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

Date: Sat, 18 Sep 2004 17:34:54 -0400
From: Bob Walton <bob@bwalton.com>
Subject: Re: distributing perl applications
Message-Id: <414CA9FE.7080509@bwalton.com>

buildmorelines wrote:

 > I have a perl script I wrote for win32, and I want it to be the
 > quality of a typical C windows program. I have read about the bytecode

--^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
That bad??

 > compiler and the perl2exe and AS perlapp programs. I dont want the end
 > user to ever have to know they are running perl under the hood
 > (shortcuts cant be "perl myscript.pl"), and I dont want them to have


You can rename the interpreter to anything you want.  And Perl doesn't
care about the filename extension, so you can make it anything you want.


 > to install perl seperatly (maybe a stripped version of perl would be
 > ok, but cant be a long install). I also want it to be pre compiled so
 > there is no pause at compilation. I think bytecode does that but I may
 > be wrong. I dont care about space or number of files really. What
 > should I use and any ideas?

I assume you're using ActiveState Perl.  If so, check out wperl.exe (it's

on your hard drive along with perl.exe).  It's claim to fame is the
elimination of the "ugly black window" (the command prompt window).
There is a downside, though: STDOUT goes to the bit bucket by default,
so debug your program first using perl.exe .  Then use Tk; to get a GUI
and use it for user interactions.  You can replace Tk's logo with
whatever you want.  You can easily make an autoplay CD that will run
Perl and your application without the user ever having to anything other
than insert the CD (talk about easy install!).  Or the whole CD may be
copied to any directory on the user's hard drive and run from there if
the user wants additional speed -- and nothing ever need get "installed"
other than that -- and removing that directory does a complete uninstall.

Regarding compilation:  even the hugest Perl program compiles in
milliseconds on modern PCs.  You're wasting your effort in that regard
-- it will take longer to read the interpreter than it will to compile
the program.  And even if it's byte code, the interpreter still has to
be read.  Even if you make a .exe out of it.  So you might as well use
straight Perl.

Is you next question going to be "but I want to hide my source code"?
If so, read:

     perldoc -q hide


-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl



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

Date: Sun, 19 Sep 2004 00:14:27 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: distributing perl applications
Message-Id: <j3su12-lu4.ln1@osiris.mauzo.dyndns.org>


Quoth bulk88@hotmail.com (buildmorelines):
> I have a perl script I wrote for win32, and I want it to be the
> quality of a typical C windows program. I have read about the bytecode
> compiler and the perl2exe and AS perlapp programs. I dont want the end
> user to ever have to know they are running perl under the hood
> (shortcuts cant be "perl myscript.pl"), and I dont want them to have
> to install perl seperatly (maybe a stripped version of perl would be
> ok, but cant be a long install). I also want it to be pre compiled so
> there is no pause at compilation. I think bytecode does that but I may
> be wrong. I dont care about space or number of files really. What
> should I use and any ideas?

Use pp from the PAR.pm distribution (doesn't compile, it just packages a
perl interpreter, your script and any modules up into a single exe).

Ben

-- 
                Outside of a dog, a book is a man's best friend.
                Inside of a dog, it's too dark to read.
ben@morrow.me.uk                                                  Groucho Marx


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

Date: 20 Sep 2004 00:49:10 -0500
From: "Seth Brundle" <brundlefly76@hotmail.com>
Subject: Re: distributing perl applications
Message-Id: <414e6e9b$0$163$45beb828@newscene.com>

It really depends on the specifications of the project.

If you only need to send it to people in your company who know your email 
address for support, try the perlball options others have mentioned.

If you are releasing commercial software and want a professional Windows 
user experience, take the time to port it to VB at least with a quality 
installer/uninstaller, or C++ if there is a compelling requirement which is 
solved by C++ and not VB.

"buildmorelines" <bulk88@hotmail.com> wrote in message 
news:ee659c69.0409181118.2e1e5e5e@posting.google.com...
>I have a perl script I wrote for win32, and I want it to be the
> quality of a typical C windows program. I have read about the bytecode
> compiler and the perl2exe and AS perlapp programs. I dont want the end
> user to ever have to know they are running perl under the hood
> (shortcuts cant be "perl myscript.pl"), and I dont want them to have
> to install perl seperatly (maybe a stripped version of perl would be
> ok, but cant be a long install). I also want it to be pre compiled so
> there is no pause at compilation. I think bytecode does that but I may
> be wrong. I dont care about space or number of files really. What
> should I use and any ideas? 




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

Date: 20 Sep 2004 08:30:37 -0500
From: off@mailinator.com
Subject: Re: distributing perl applications
Message-Id: <414edb7d_1@corp.newsgroups.com>

> If you are releasing commercial software and
> want a professional Windows user experience,
> take the time to port it to VB at least with a
> quality installer/uninstaller, or C++ if there is
> a compelling requirement which is solved by C++
> and not VB.

Christ on a pogo stick, this is *not* a solution
worth considering for even a nano second.

What is a "professional Windows user experience?" 
Does that mean the blue screen of death (tm) that
happens every third time you run the code? Or 
backdoors that allow taking over your computer when 
displaying JPEG files???


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


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

Date: 20 Sep 2004 01:12:06 -0700
From: mahaan@gmail.com (Mahaan)
Subject: Entering HTTPS web page
Message-Id: <d6c93feb.0409200012.e874b86@posting.google.com>

Hello,

I am trying to enter a HTTPS site -- Google Answers, for example. I
found this simple Google Answers client at Google Answers
(http://answers.google.com/answers/threadview?id=28442).

Here's the code:

++++++++++++ Begin Code ++++++++++++

use LWP;
use HTTP::Request::Common;
use HTTP::Cookies;

$email='mahaan@gmail.com';
$pass='ottffss';

$ua = LWP::UserAgent->new;
$ua->cookie_jar(HTTP::Cookies->new);

$req=$ua->request(POST
'https://answers.google.com/answers/main?cmd=login', ['email'=>$email,
password=>$pass, 'submit'=>'Login']);
if ($req->content=~ /Invalid login/){
    print "invalid login!\n";
}else{
    print "welcome to google answers :)\n";
    $req=$ua->request(GET
'https://answers.google.com/answers/main?cmd=myinvoices');
	print $req->content;
    $req->content=~/<td> Current Earnings \(what you will be paid\)
for Answering Questions: <\/td> <td width="1%">
\$([0-9]+(?:.[0-9]+)?)/;
    $ear=$1;
    $req->content=~/<td> Current Balance \(what you will be charged\)
for Asked Questions: <\/td> <td width="1%"> \$([0-9]+(?:.[0-9]+)?)/;
    $char=$1;
    print "Will be paid: $ear \nWill be charged: $char\n";
}

++++++++++++ End Code ++++++++++++

Every time I run the code, I get a "400 URL missing" error.

Any help would be appreciated.

Thanks.


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

Date: Mon, 20 Sep 2004 14:30:02 -0400
From: Dan Wilga <dwilga-MUNGE@mtholyoke.edu>
Subject: Re: Entering HTTPS web page
Message-Id: <dwilga-MUNGE-C5A7B0.14300220092004@nap.mtholyoke.edu>

In article <d6c93feb.0409200012.e874b86@posting.google.com>,
 mahaan@gmail.com (Mahaan) wrote:

> $req=$ua->request(POST
> 'https://answers.google.com/answers/main?cmd=login', ['email'=>$email,
> password=>$pass, 'submit'=>'Login']);

Try using 'POST' instead of POST, and follow it with a comma.

-- 
Dan Wilga          dwilga-MUNGE@mtholyoke.edu
** Remove the -MUNGE in my address to reply **


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

Date: Mon, 20 Sep 2004 12:13:00 +0200
From: Michael Preminger <michaelp@hio.no>
Subject: Formatting cells as numbers in Spreadsheet::ParseExcel::SaveParser
Message-Id: <cimadn$8ei$1@dolly.uninett.no>

Hello!

I am successfully writing new values into a newly created spreadsheet 
using the a.m. package.

My problem is that my cells are interpreted as text in the worksheet.

Is there a simple way of asking perl to format thosse as numbers (e.g. 
floating point), without referring to an existing cell?

format-numbers different than 0 in AddCell() give me an error message

Thanks

Michael


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

Date: 20 Sep 2004 14:29:53 -0700
From: "Jeff" <jeff.gilbertson@gmail.com>
Subject: Help with my brute force method
Message-Id: <1095715793.375034.285720@k17g2000odb.googlegroups.com>

I have a file (DM.txt) that has the following lines:


spool cr04 ip11 rm22
http web01 web02 web03
mail mail01 mail03


I want to create a variable ($Dis) that looks like this:

cr04|ip11|rm22

I was able to accomplish my goal, but it is ugly.  I'm
sure there is a better way.

Here is my (brute force) code:

use strict;

my (@Lines,$Dis);
my $FILE="/tmp/DM.txt";

open (F, "< $FILE") || die "Can't open $FILE\n";
@Lines=grep /^spool/, <F>;
close(F);

($Dis=$Lines[0]) =~ s/spool //;
$Dis =~ s/ /\|/;
chomp($Dis);

exit;

I know it's ugly.  It seems like I should be able to do something like:

($Dis = (split(grep /^spool/, <F>))[0]) =~ s/spool // =~ s/ /\|/;
But, I can't figure it out.

Please help.



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

Date: Mon, 20 Sep 2004 22:32:35 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Help with my brute force method
Message-Id: <7UI3d.95990$XP3.20117@edtnps84>

Jeff wrote:
> I have a file (DM.txt) that has the following lines:
> 
> spool cr04 ip11 rm22
> http web01 web02 web03
> mail mail01 mail03
> 
> I want to create a variable ($Dis) that looks like this:
> 
> cr04|ip11|rm22
> 
> I was able to accomplish my goal, but it is ugly.  I'm
> sure there is a better way.
> 
> Here is my (brute force) code:
> 
> use strict;
> 
> my (@Lines,$Dis);
> my $FILE="/tmp/DM.txt";
> 
> open (F, "< $FILE") || die "Can't open $FILE\n";
> @Lines=grep /^spool/, <F>;
> close(F);
> 
> ($Dis=$Lines[0]) =~ s/spool //;
> $Dis =~ s/ /\|/;
> chomp($Dis);
> 
> exit;
> 
> I know it's ugly.  It seems like I should be able to do something like:
> 
> ($Dis = (split(grep /^spool/, <F>))[0]) =~ s/spool // =~ s/ /\|/;
> But, I can't figure it out.

Ah, you want to have all the code on one line.

open F, '<', $FILE or die "Can't open $FILE: $!";
my $Dis = join '|', map { my @a = split; /^spool/ ? @a[ 1 .. $#a ] : () } <F>;
close F;



John
-- 
use Perl;
program
fulfillment


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

Date: 21 Sep 2004 10:21:45 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Help with my brute force method
Message-Id: <ciovbp$11j$1@mamenchi.zrz.TU-Berlin.DE>

Jeff <jeff.gilbertson@gmail.com> wrote in comp.lang.perl.misc:
> I have a file (DM.txt) that has the following lines:
> 
> 
> spool cr04 ip11 rm22
> http web01 web02 web03
> mail mail01 mail03
> 
> 
> I want to create a variable ($Dis) that looks like this:
> 
> cr04|ip11|rm22
> 
> I was able to accomplish my goal, but it is ugly.  I'm
> sure there is a better way.
> 
> Here is my (brute force) code:
> 
> use strict;
> 
> my (@Lines,$Dis);
> my $FILE="/tmp/DM.txt";
> 
> open (F, "< $FILE") || die "Can't open $FILE\n";

You should include the error message $! in the text.

> @Lines=grep /^spool/, <F>;

Since you are only expecting one line, this could be

    ( $line) = grep /^spool/, <F>;

> close(F);

That is potentially inefficient.  <f> in list context reads the
whole file into memory, but we need only the first line with /^spool/.
Also, grep() checks all the lines in the file, but again we could
stop at the first /^spool/.

> ($Dis=$Lines[0]) =~ s/spool //;
> $Dis =~ s/ /\|/;

Did you test this?  You need /g on the substitution.

> chomp($Dis);
> 
> exit;

Untested:

    open (F, "< $FILE") || die "Can't read file %FILE: $!";
    my $Dis;
    while ( <F> ) {
        next unless ( $Dis) = /^spool (.*)/;
        $dis s/ /\|/g;
        last;
    }

Anno


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

Date: 21 Sep 2004 14:04:33 -0700
From: "Jeff" <jeff.gilbertson@gmail.com>
Subject: Re: Help with my brute force method
Message-Id: <1095800673.434489.131900@k17g2000odb.googlegroups.com>

Thanks, John.

I'm trying to grasp what's happening in your statement:

my $Dis = join '|', map { my @a = split; /^spool/ ? @a[ 1 .. $#a ] : ()
} <F>;

The join is going to insert the pipe character between each of the
strings returned by the map command.
The map is going to operate on each line in <F>
@a will be set to each element in the line

/^spool/ ? @a[1 .. $#a] : ()

This means that if the line starts with spool, return elements 1
through # elements, otherwise, return an empty array.

Correct?



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

Date: Sat, 18 Sep 2004 09:57:59 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: How can I measure web hits from my web browser/end user perspective....?
Message-Id: <HET2d.3750$wV.3080@attbi_s54>

Chris Nelson wrote:

> I know that for a web server..... there are many ways to measure the
> "hits", when accessing a web page. However, what I need to be able to
> do... is determine that when downloading a web page.... how many
> "hits" comprise that web page.(From an end user perspective)

A non-perl answer is to view the page with Mozilla (or latest Netscape),
then select from the menu View -> Page Info -> Media.  Each image or
background is a hit to the server.  Also include any
<link href="style.css"> or <script src="foo.js"> tags.
Or 'Save As...' and count the number of files MSIE saves.

The perl answer is to use a web mirroring script, but set the recursion
level to 1 (fetch one URL and any <img src=""> tags, but do not
follow any <a href=""> links).

	-Joe


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

Date: Sat, 18 Sep 2004 23:49:41 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: How can I measure web hits from my web browser/end user perspective....?
Message-Id: <5lqu12-lu4.ln1@osiris.mauzo.dyndns.org>


Quoth fimafeng@yahoo.com (Chris Nelson):
> Hello:
> I know that for a web server..... there are many ways to measure the
> "hits", when accessing a web page. However, what I need to be able to
> do... is determine that when downloading a web page.... how many
> "hits" comprise that web page.(From an end user perspective)
> 
> Am I correct in that an accurate # of hits representing a web page
> could be determined by viewing the source of a web page and adding up
> the files that are listed in that code? Is there a piece of
> code/software that does this?

HTML::LinkExtor may do what you need (though I agree with the other
posters that you are almost certainly barking up the wrong tree here...)

Ben

-- 
Heracles: Vulture! Here's a titbit for you / A few dried molecules of the gall
   From the liver of a friend of yours. / Excuse the arrow but I have no spoon.
(Ted Hughes,        [ Heracles shoots Vulture with arrow. Vulture bursts into ]
 /Alcestis/)        [ flame, and falls out of sight. ]         ben@morrow.me.uk


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

Date: Sun, 19 Sep 2004 11:15:26 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: How can I measure web hits from my web browser/end user perspective....?
Message-Id: <iTd3d.3069$PZ4.1698@trnddc06>

Chris Nelson wrote:
> I know that for a web server..... there are many ways to measure the
> "hits", when accessing a web page. However, what I need to be able to
> do... is determine that when downloading a web page.... how many
> "hits" comprise that web page.(From an end user perspective)

What does this have to do with Perl?

> Am I correct in that an accurate # of hits representing a web page
> could be determined by viewing the source of a web page and adding up
> the files that are listed in that code?

No, that number would be bogus at best, think of frames, think of 
client-side caching, think of ISP caching, etc.

> Basically,
> I have a situation where I need to demonstrate to semi-technical
> people that a single web page can be comprised of many hits.

Trivial: just write a page with frames and pictures.

> (And in
> my case more importantly..... hits do not in any way directly
> correlate to time spent an individual web page and or site.

You must be kidding. Do they claim a more hits equals more time spent? Then 
just write one technically complex page with lots of frames and picture 
links, but trivial content. And another technically primitive (single hit) 
but with 100s of lines of plain text.
What do they think which page will generate more hits and which page will be 
viewed longer?

jue 




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

Date: 21 Sep 2004 14:00:03 -0700
From: i6033162556-signup1@yahoo.com.cn
Subject: How is this Perl Script encrypted?
Message-Id: <23d1674e.0409211300.4914c802@posting.google.com>

http://www.c3scripts.com/amazon/release/ae-040531.zip

I am not trying to hack this demo script, but I want to encrypt my own
scripts and distrubate them on the internet.

http://www.c3scripts.com/amazon/docs6.html


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

Date: 21 Sep 2004 21:22:42 GMT
From: James Keasley <james.keasley@gmail.invalid>
Subject: Re: How is this Perl Script encrypted?
Message-Id: <slrncl16t2.aef.james.keasley@athena.homeric.co.uk>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

On 2004-09-21, i6033162556-signup1@yahoo.com.cn <i6033162556-signup1@yahoo.com.cn> wrote:
> http://www.c3scripts.com/amazon/release/ae-040531.zip
>
> I am not trying to hack this demo script, but I want to encrypt my own
> scripts and distrubate them on the internet.

Don't even bother, that "encryption" took all of 7 keystrokes to break.

If you really want to, look at the perldocs for pack and unpack.

- -- 
James					jamesk[at]homeric[dot]co[dot]uk

'I never met a piece of chocolate I didn't like.'
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFBUJuiqfSmHkD6LvoRAjnHAJ0ZbKQo+a8Mzo/tI6qSYyv3raJ/iwCgjgT1
v/QSkDHnmQgJUdTtoTSOQ7g=
=G2fe
-----END PGP SIGNATURE-----


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

Date: 21 Sep 2004 14:42:05 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: How is this Perl Script encrypted?
Message-Id: <4150a02d@news.victoria.tc.ca>

i6033162556-signup1@yahoo.com.cn wrote:
: http://www.c3scripts.com/amazon/release/ae-040531.zip

It isn't encrypted.



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

Date: Tue, 21 Sep 2004 22:51:41 -0000
From: Tim Hammerquist <tim@vegeta.ath.cx>
Subject: Re: How is this Perl Script encrypted?
Message-Id: <slrncl1c1i.o4r.tim@vegeta.saiyix>

i6033162556-signup1@yahoo.com.cn <i6033162556-signup1@yahoo.com.cn> wrote:
>  http://www.c3scripts.com/amazon/release/ae-040531.zip
>  
>  I am not trying to hack this demo script, but I want to encrypt my own
>  scripts and distrubate them on the internet.

As you indicate you have written your own scripts, I suggest examining
the last line of code.  It will tell you how to encode your own scripts
without ever needing to decode the script above.

HTH,
Tim Hammerquist


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

Date: Tue, 21 Sep 2004 19:00:17 +0800
From: "news.hinet.net" <sonet@msa.hinet.net>
Subject: how to decode ldap package??
Message-Id: <cip1q7$rbd$1@netnews.hinet.net>

I need decode LDAP Packages!

LDAP Package

30 34 02 01 01 60 2F 02 01 03 04 22 63 6E
3D 6D 61 6E 61 67 65 72 2C 44 43 3D 50 52
4F 47 4D 2C 44 43 3D 43 4F 4D 80 06 61 62
63 31 32

how to decode asn.1 like that?




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

Date: Tue, 21 Sep 2004 13:13:59 +0200
From: "Vetle Roeim" <vetro@online.no>
Subject: Re: how to decode ldap package??
Message-Id: <opseob5lrb3hk3cf@quickfix.opera.com>

On Tue, 21 Sep 2004 19:00:17 +0800, news.hinet.net <sonet@msa.hinet.net>  
wrote:

> I need decode LDAP Packages!

   I'd recommend using Net::LDAP for accessing LDAP servers.

   <URL:http://ldap.perl.org/>


[...]
-- 
It's not a bug, it's the future.


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

Date: Tue, 21 Sep 2004 22:15:25 +0800
From: "news.hinet.net" <sonet@msa.hinet.net>
Subject: Re: how to decode ldap package??
Message-Id: <cipd2e$nka$1@netnews.hinet.net>

I  know that  i can use Net::LDAP module if want to access ldap server or do
something .
But i just want to decode the package which i got it from a TCP redir
application..



"Vetle Roeim" <vetro@online.no> ??? news:opseob5lrb3hk3cf@quickfix.opera.com
???...
> On Tue, 21 Sep 2004 19:00:17 +0800, news.hinet.net <sonet@msa.hinet.net>
> wrote:
>
> > I need decode LDAP Packages!
>
>    I'd recommend using Net::LDAP for accessing LDAP servers.
>
>    <URL:http://ldap.perl.org/>
>
>
> [...]
> -- 
> It's not a bug, it's the future.




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

Date: Tue, 21 Sep 2004 19:03:56 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: how to decode ldap package??
Message-Id: <wW_3d.132568$3l3.24370@attbi_s03>

news.hinet.net wrote:

> I  know that  i can use Net::LDAP module if want to access ldap server
> But i just want to decode the package

So, have you looked at the source code to see how Net::LDAP does it?
	-Joe


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

Date: Sat, 18 Sep 2004 16:52:07 -0400
From: "Perly" <rosyling2004@yahoo.com>
Subject: How to invoke a javascript function using Perl?
Message-Id: <ab93af08b4d93d042dec6b2147b7be2c@localhost.talkaboutprogramming.com>

Is there a way to call a javascript function such as this using Perl:

function getnextpage(nextpage){
	document.sortForm.next.value = nextpage;
	document.sortForm.submit();
}

what does it do when javascript does a document.submit() ?? How do i
simulate that process in perl?

Any help would be greatly appreciated!!




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

Date: Sat, 18 Sep 2004 15:28:41 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: How to invoke a javascript function using Perl?
Message-Id: <10kpa4a40ejoj49@corp.supernews.com>

Perly wrote:

> Is there a way to call a javascript function such as this using Perl:

Generally on a website, Perl runs on the server and Javascript runs in 
the browser, so one would not call the other, because they are running 
in two different places. There are exceptions, but they aren't all that 
common.

> what does it do when javascript does a document.submit()?

That would depend on what an "it" is.

> How do i
> simulate that process in perl?

On the sever? On the client?

You will get better answers if you ask better questions. What is it that 
you are really trying to do?

This may not be the most appropriate place to post your question. If we 
understood what you were trying to do, perhaps we could point you to a 
better place to find your answers.



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

Date: Sat, 18 Sep 2004 17:36:36 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: How to invoke a javascript function using Perl?
Message-Id: <tvKdnQuV_5H4N9HcRVn-hw@adelphia.com>

Perly wrote:

> Is there a way to call a javascript function such as this using Perl:

No.

> function getnextpage(nextpage){
> 	document.sortForm.next.value = nextpage;
> 	document.sortForm.submit();
> }
> 
> what does it do when javascript does a document.submit() ??

Assuming that "it" is a browser, it will do the same as it does when a 
submit button is clicked - it submits a form. That is, it encodes the 
name/value pairs found in the form's input elements, and sends the 
encoded data to the URL found in the form's "action" attribute.

 > How do i simulate that process in perl?

Have a look at LWP and/or WWW::Mechanize.

You can't run the JavaScript from within Perl, so you'll need to 
simulate what the JS does - i.e. you'll need to set up the appropriate 
form values with Perl code, since you can't call the JS functions that a 
browser would use to do that.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Sat, 18 Sep 2004 23:57:08 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: How to invoke a javascript function using Perl?
Message-Id: <oX33d.3007$PZ4.2866@trnddc06>

Perly wrote:
> Is there a way to call a javascript function such as this using Perl:
>
> function getnextpage(nextpage){
> document.sortForm.next.value = nextpage;
> document.sortForm.submit();
> }

Unfortunately you are not telling us what you really want to do.
Is this a stealth CGI question? Because JavaScript normally is used as part 
of DHTML and executed via a web browser when displaying some HTML while a 
Perl program is typicallyrun as ordinary process from the command line, 
cron, CGI, or whatever.
In other words: Perl and JavaScript live in different universes and normally 
have nothing to do with each other.
Therefore I wonder what problem you want to solve by calling a JavaScript 
function from a Perl program.

I do not know if an interface exists. There are ways to call C functions 
from a Perl program. I'd suggest to check CPAN if there are modules that 
provide a similar interface for JavaScript, but somehow I doubt it. This 
application sounds too wacky, but you never know.

> what does it do when javascript does a document.submit() ??

Well, that would be a question to ask in a JavaScript NG, wouldn't it? But I 
guess it submits the form data back to the HTTP server.

> How do i simulate that process in perl?

Is this by any chance an x-y-problem?
Let me guess: you want to fetch an HTML response from a web server? And 
because you know how to do that in JavaScript you decided that the best way 
to do it from Perl is to call the familiar JavaScript function? And 
therefore you are asking how to call a JavaScript function from Perl?

Well, if that is the case, then you may want to check the FAQ entry "How do 
I fetch an HTML file?" before embarrasing yourself further.

jue
>
> Any help would be greatly appreciated!! 




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

Date: Sun, 19 Sep 2004 11:17:15 +0200
From: Wolfgang Hommel <wolf@code-wizards.com>
Subject: Re: How to invoke a javascript function using Perl?
Message-Id: <cijiqu$ush$07$1@news.t-online.com>

Perly wrote:

> Is there a way to call a javascript function such as this using Perl:

Sure, but it actually depends on the browser (or any other javascript 
interpreter) being used and the scripting interface it offers. Usually 
it's easier to do everything in Perl.

> what does it do when javascript does a document.submit() ?? How do i
> simulate that process in perl?

What happens on a submit() depends on the javascript interpreter 
(usually: the browser). Most likely, it will attempt to submit the form 
and continue command execution.

Of course, you can submit forms directly from Perl (-> LWP) without 
having to call a javascript function first. On the other hand, there 
might be reasons to use javascript and no Perl at all on the client side.

Regards,
Wolfgang


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

Date: Sun, 19 Sep 2004 19:51:36 -0400
From: "Perly" <rosyling2004@yahoo.com>
Subject: Re: How to invoke a javascript function using Perl?
Message-Id: <ad7b7cac1d498ac69da1c3812da86f01@localhost.talkaboutprogramming.com>

I am using Perl LWP to do web extraction on a site.  And this site is
javascript enable.  And LWP does not handle javascript.



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

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


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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


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