[13852] in Perl-Users-Digest
Perl-Users Digest, Issue: 1262 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 3 00:07:24 1999
Date: Tue, 2 Nov 1999 21:05:12 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <941605511-v9-i1262@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 2 Nov 1999 Volume: 9 Number: 1262
Today's topics:
Re: * Robust NEWS Application needed ASAP *** (Abigail)
Re: -w (Abigail)
Re: -w <ltl@rgsun40.viasystems.com>
Re: -w (Abigail)
about perl/tk chao98@my-deja.com
Re: Capturing data returned after a POST <lr@hpl.hp.com>
Re: chdir (perl v4) (Kragen Sitaker)
ctime/date weirdness? <jeep@rahul.net>
Re: ctime/date weirdness? (Martien Verbruggen)
Re: Extract string (Kragen Sitaker)
Re: getting a file size <lr@hpl.hp.com>
Re: getting a file size <bwalton@rochester.rr.com>
Re: Hiding Perl Scripts? (Kragen Sitaker)
How can I set reg. expresion to anchor at the end of a <jong@ebi.ac.uk>
Re: How can I set reg. expresion to anchor at the end o (Sam Holden)
Re: How can I set reg. expresion to anchor at the end o <lr@hpl.hp.com>
Re: How can I set reg. expresion to anchor at the end o <vincent.murphy@cybertrust.gte.com>
Re: How can I set reg. expresion to anchor at the end o (Abigail)
Re: How can I store/print a variable containing a DISPL <maurice.maltbia@intel.com>
Need to remove url and keep file crackbaby1@my-deja.com
Need to remove url and keep file crackbaby1@my-deja.com
Re: Perl and Excel Charting (Kragen Sitaker)
Re: perl JS interpreter? counting keywords? (Kragen Sitaker)
Perl Unicode Support mehkriakram@my-deja.com
Re: Perl's hashing algorithm <bwalton@rochester.rr.com>
Re: Problem With Delimited Field Sort (Kragen Sitaker)
Re: speeding up split() <r28629@email.sps.mot.com>
Re: speeding up split() <r28629@email.sps.mot.com>
Re: speeding up split() (Ilya Zakharevich)
Re: Sybperl problems mehkriakram@my-deja.com
Re: Why doesn't this work? (Abigail)
Win32, DBD, Oraperl and Personal Oracle <wellsshammout-NoSpam@msn.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 2 Nov 1999 21:05:51 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: * Robust NEWS Application needed ASAP ***
Message-Id: <slrn81v9j9.tjn.abigail@alexandra.delanet.com>
Mick Knutson (mknutson@baselogic.com) wrote on MMCCLIV September MCMXCIII
in <URL:news:381EEAC3.76078185@baselogic.com>:
;; I need a robust way to manage news on my web site.
;; I have multiple columnists, and want to manage the news via a web page.
Good for you! Now, why don't you make a pot of coffee, and start writing?
Abigail
--
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 2 Nov 1999 21:28:28 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: -w
Message-Id: <slrn81vatl.tjn.abigail@alexandra.delanet.com>
David H. Adler (dha@panix.com) wrote on MMCCLIV September MCMXCIII in
<URL:news:slrn81ukl5.7mh.dha@panix.com>:
@@
@@ *I* was lucky enough to be of legal drinking age at 18... for about 3
@@ months. Then they changed the law on me. Scum. :-/
It's weird. 18 is old enough to use one of the most dangerous weapons
(a car), old enough to vote one of the most important people of the
planet (the US president), die for the country in some jungle on the
other side of the world - but 3 years too young to taste alcohol.
Say, is 18 years already old enough to see a movie that shows a nipple?
Or do you still have to be satisfied with basic blood and gore?
Abigail
--
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
|perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
|perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
|perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 3 Nov 1999 04:08:24 GMT
From: lt lindley <ltl@rgsun40.viasystems.com>
Subject: Re: -w
Message-Id: <7vocfo$5fv$1@rguxd.viasystems.com>
Abigail <abigail@delanet.com> wrote:
:>It's weird. 18 is old enough to use one of the most dangerous weapons
:>(a car),
The young potential soldier can use Perl and you think a car is a
dangerous weapon?
And what exactly was your Perl question anyway?
--
// Lee.Lindley /// I used to think that being right was everything.
// @bigfoot.com /// Then I matured into the realization that getting
//////////////////// along was more important. Except on usenet.
------------------------------
Date: 2 Nov 1999 22:52:31 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: -w
Message-Id: <slrn81vfr9.tjn.abigail@alexandra.delanet.com>
lt lindley (ltl@rgsun40.viasystems.com) wrote on MMCCLV September
MCMXCIII in <URL:news:7vocfo$5fv$1@rguxd.viasystems.com>:
%% Abigail <abigail@delanet.com> wrote:
%% :>It's weird. 18 is old enough to use one of the most dangerous weapons
%% :>(a car),
%%
%% The young potential soldier can use Perl and you think a car is a
%% dangerous weapon?
%%
%% And what exactly was your Perl question anyway?
Perl runs on alcohol, doesn't it? Or just in Brazil?
Abigail
--
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 03 Nov 1999 04:36:02 GMT
From: chao98@my-deja.com
Subject: about perl/tk
Message-Id: <7voe3j$4nb$1@nnrp1.deja.com>
Hi,
I have heard about Perl/Tk. It is said can be
used for GUI programming like Tcl/Tk. When I look
it up in www.perl.com/CPAN, I can't find the
module with exactly the same name. Could any one
tell me which module should I download?
BR / Joseph
1999.11.3
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 2 Nov 1999 18:25:30 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Capturing data returned after a POST
Message-Id: <MPG.12893cec62f9ff0098a199@nntp.hpl.hp.com>
In article <381F8EF6.D539BB06@cisco.com> on Tue, 02 Nov 1999 17:25:11 -
0800, Makarand Kulkarni <makkulka@cisco.com> says...
...
> you should do
>
> @names = $query->param
> foreach ( @names )
> {
> print "value of ", $_, " is ", $query->param( $_), "\n" ;
> }
It works better with a semicolon after the first line. Or you could
simply use $query->param as the foreach argument.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 03 Nov 1999 03:08:32 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: chdir (perl v4)
Message-Id: <QGNT3.23309$23.1201835@typ11.nn.bcandid.com>
In article <012072c6.81e80413@usw-ex0109-069.remarq.com>,
JRC <jim.chappellNOjiSPAM@tivoli.com.invalid> wrote:
>we use
>chdir ("/etc/blahblah")
>at the begining of a program. Later a
>system("xyz");
>returns incorrect results.
You must have a bug, then.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: 3 Nov 1999 03:15:33 GMT
From: Jeff Lacki <jeep@rahul.net>
Subject: ctime/date weirdness?
Message-Id: <7vo9cl$cat$1@samba.rahul.net>
Im kinda new to perl. I am using a subroutine to return
the current date and print it, however it seems to 'drop'
the day every now and then, ie Tues Nov , 1999
Here's the code:
#!/usr/local/bin/perl -w
use POSIX;
sub getdate
{
@d = split(/\s+/,&ctime(time));
$date = "$d[0] $d[1] $d[2], $d[4]";
return $date;
}
$dat = &getdate();
print "$dat\n";
Any ideas?
TIA
------------------------------
Date: Wed, 03 Nov 1999 03:52:34 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: ctime/date weirdness?
Message-Id: <6kOT3.262$ky4.6936@nsw.nnrp.telstra.net>
On 3 Nov 1999 03:15:33 GMT,
Jeff Lacki <jeep@rahul.net> wrote:
> Im kinda new to perl. I am using a subroutine to return
> the current date and print it, however it seems to 'drop'
> the day every now and then, ie Tues Nov , 1999
>
> Here's the code:
>
> #!/usr/local/bin/perl -w
>
> use POSIX;
>
> sub getdate
> {
> @d = split(/\s+/,&ctime(time));
> $date = "$d[0] $d[1] $d[2], $d[4]";
> return $date;
> }
>
> $dat = &getdate();
>
> print "$dat\n";
>
> Any ideas?
no, but it's a mighty ugly way of doing what you want :)
use POSIX;
sub getdate
{
strftime("%a %b %e, %Y", localtime);
}
print getdate(), "\n";
or if you really want to get rid of that extra space:
use POSIX;
sub getdate
{
my $date = strftime("%a %b %e, %Y", localtime);
$date =~ tr/ //s;
$date;
}
print getdate(), "\n";
Martien
--
Martien Verbruggen |
Interactive Media Division | The world is complex; sendmail.cf
Commercial Dynamics Pty. Ltd. | reflects this.
NSW, Australia |
------------------------------
Date: Wed, 03 Nov 1999 03:04:29 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Extract string
Message-Id: <1DNT3.23303$23.1201208@typ11.nn.bcandid.com>
In article <381E5793.C249CE1E@inprise.com>,
Adrian Chin <Achin@inprise.com> wrote:
>vol1/extract/inst/sum.C:1:2:3
>vol2/extract/algo.h:2:3:4
>vol3/extr/rol/rojak/bunga/fungi.sh:1:2:3
>
>in a file call file.txt. How do I extract the colored string out to a
>variable in per
Which string is colored? And what is "per"?
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 2 Nov 1999 18:16:52 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: getting a file size
Message-Id: <MPG.12893af267f2470998a198@nntp.hpl.hp.com>
In article <381F8D9C.E8EBE400@yahoo.com> on Wed, 03 Nov 1999 01:05:43
GMT, n.thiyagarajan <jazz108@yahoo.com> says...
> i'm new to perl...
Everyone has been, at some time or other.
> i'm trying to get the size of a file by using the file test -s
>
> $filesize = -s $filename;
>
> when i try to print the file size nothing is printed.
> any thoughts???
Most likely the file named by $filename doesn't exist. If it is a
relative filename, you may be in the wrong directory. Or it may have
extraneous characters such as a trailing newline.
Try this (and similarly for all 'system calls' -- function calls that
are handled by the operating system):
defined($filesize = -s $filename) or
die "Couldn't get size of '$filename'. $!\n";
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 02 Nov 1999 21:46:04 -0500
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: getting a file size
Message-Id: <381FA1EC.B7EBD202@rochester.rr.com>
"n.thiyagarajan" wrote:
>
> i'm new to perl...
>
> i'm trying to get the size of a file by using the file test -s
>
> $filesize = -s $filename;
>
> when i try to print the file size nothing is printed.
> any thoughts???
>
> jazz108@yahoo.com
Hmmm...when I run the following:
$filename='junk73.pl';
$filesize=-s $filename;
print "filesize=$filesize\n";
I get:
H:\Bob\junk>perl junk73.pl
filesize=80
H:\Bob\junk>
What version of Perl are you using? What is your OS? What is your
platform? Does the variable $filename actually contain the name
of a file that exists in your current directory?
--
Bob Walton
------------------------------
Date: Wed, 03 Nov 1999 03:35:49 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Hiding Perl Scripts?
Message-Id: <p4OT3.23374$23.1207199@typ11.nn.bcandid.com>
In article <slrn81v5gh.tjn.abigail@alexandra.delanet.com>,
Abigail <abigail@delanet.com> wrote:
>LorainCounty.com Webmaster (webmaster@LorainCounty.com) wrote on MMCCLIV
>September MCMXCIII in <URL:news:381F0086.C07A440B@LorainCounty.com>:
>\\
>\\ How could I hide the source code of a Perl Script so
>\\ it can't be modified or viewed?
>
>
> $ > script
>
>HTH. HAND.
In case it's not clear to you, the $ in the above example is the Bourne
Shell prompt. If you don't normally run the Bourne Shell, you can run
it by typing 'sh'.
This will hide the source code of the script so it cannot be modified
or viewed, even by you or the Perl interpreter.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Wed, 03 Nov 1999 02:22:58 +0000
From: Jong <jong@ebi.ac.uk>
Subject: How can I set reg. expresion to anchor at the end of a string?
Message-Id: <381F9C82.13A9D120@ebi.ac.uk>
Hi,
I have a string :
123424
I'd like to match it to produce:
(12, 3424)
rather than (1234, 24)
by @elements=$string=~/(....)/g;
How can I tell the reg. exp. that I want to anchor the
match from at the back?
Thanks a lot.
Jong
-- Jong Park : a Biology student -Tel work: +44 1223 494613
FAX: +44 (0)1223 494468
Structural Genomics Group, EMBL-EBI, CB10 1SD Cambridge, UK
http://cyrah.ebi.ac.uk:1111/Users/Jong/
------------------------------
Date: 3 Nov 1999 03:09:55 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: How can I set reg. expresion to anchor at the end of a string?
Message-Id: <slrn81v9s5.qii.sholden@pgrad.cs.usyd.edu.au>
On Wed, 03 Nov 1999 02:22:58 +0000, Jong <jong@ebi.ac.uk> wrote:
>Hi,
>
>I have a string :
>
> 123424
>
>I'd like to match it to produce:
>
> (12, 3424)
>
>rather than (1234, 24)
>
>by @elements=$string=~/(....)/g;
That doesn't match what you say it does anyway...
>
>
>How can I tell the reg. exp. that I want to anchor the
>match from at the back?
By reading the documentation that comes with perl and explains how
to use regexes.
The answer shows up on the third screen of output for me... Assuming
you only want the last four characters, and not a list of all the groups
of four starting from the back.
If you don't want to read the documentation but have other people
spoon feed you the answer then here is an answer :
If you want to do what you say you want:
@elements = reverse map {scalar reverse $_} (reverse $string)=~/(..?.?.?)/g;
If you want to do what your code does but backwards :
@elements = reverse map {scalar reverse $_} (reverse $string)=~/(....)/g;
Of course there may be more efficient way of doing it ;)
--
Sam
------------------------------
Date: Tue, 2 Nov 1999 19:29:35 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: How can I set reg. expresion to anchor at the end of a string?
Message-Id: <MPG.12894bf93102e28098a19a@nntp.hpl.hp.com>
In article <381F9C82.13A9D120@ebi.ac.uk> on Wed, 03 Nov 1999 02:22:58
+0000, Jong <jong@ebi.ac.uk> says...
> Hi,
Grrmph.
> I have a string :
>
> 123424
>
> I'd like to match it to produce:
>
> (12, 3424)
>
> rather than (1234, 24)
>
> by @elements=$string=~/(....)/g;
When I tested that statement, it produced only one element, 1234. What
did it do when you tested it? Oh, you posted a conjecture without
testing it? Grrmph.
> How can I tell the reg. exp. that I want to anchor the
> match from at the back?
This 'one-liner' solution is surprisingly baroque. But it works. I
tested it.
#!/usr/local/bin/perl -w
use strict;
my $string = '123424';
my @elements = reverse map {scalar reverse}
(reverse $string) =~ /(.{1,4})/g;
print "@elements\n";
I remember some discussion about a '/r' regex modifier. Wouldn't that
be nice?
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 03 Nov 1999 04:05:13 GMT
From: Vincent Murphy <vincent.murphy@cybertrust.gte.com>
Subject: Re: How can I set reg. expresion to anchor at the end of a string?
Message-Id: <xjgu2n4fceg.fsf@gamora.ndhm.gtegsc.com>
>>>>> "Jong" == Jong <jong@ebi.ac.uk> writes:
Jong> Hi,
Jong> I have a string :
Jong> 123424
Jong> I'd like to match it to produce:
Jong> (12, 3424)
Jong> rather than (1234, 24)
Jong> by @elements=$string=~/(....)/g;
Simply
Jong> How can I tell the reg. exp. that I want to anchor the
Jong> match from at the back?
reverse it first. I am assuming you want four digits but the regx would
work fine if you substituted "." for "\d".
Simply do:
perl -e '$string="123424";$tmp=reverse $string; @stnemele=$tmp=~/(?:(\d{4}|\d+))/g; \
@elements= map { $n=reverse($_); $n } @stnemele; print join(", ", @elements), "\n";'
:-)
Jong> Thanks a lot.
HTH
--Vinny
------------------------------
Date: 2 Nov 1999 22:58:56 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: How can I set reg. expresion to anchor at the end of a string?
Message-Id: <slrn81vg79.tjn.abigail@alexandra.delanet.com>
Jong (jong@ebi.ac.uk) wrote on MMCCLV September MCMXCIII in
<URL:news:381F9C82.13A9D120@ebi.ac.uk>:
Why is this a followup to a posting, when you are not replying at all to
said posting, or that thread in general? Please don't do that; threaded
newsreaders will sort your article in the wrong spot - giving the users
of said readers a reason to killfile you.
If you don't know what the buttons are on your newsreader: DON'T PUSH THEM!
\\ by @elements=$string=~/(....)/g;
\\
\\ How can I tell the reg. exp. that I want to anchor the
\\ match from at the back?
You would look in the perlre manpage, and look up the appropriate
character(s).
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 2 Nov 1999 19:36:32 -0800
From: "Maurice Maltbia" <maurice.maltbia@intel.com>
Subject: Re: How can I store/print a variable containing a DISPLAY IP address?
Message-Id: <7voajc$h1n@news.or.intel.com>
No, but that still doesn't solve my problem.
>> $IP_address = '111.222.333.64;
>
>Do you really want just one quote mark there? Cheers!
>
------------------------------
Date: Wed, 03 Nov 1999 03:46:21 GMT
From: crackbaby1@my-deja.com
Subject: Need to remove url and keep file
Message-Id: <7vob6e$2o2$1@nnrp1.deja.com>
I have a program that will let users upload a file by letting them
browse through their hard drive and hitting upload. All I need to do is
when the form is submitted I need to remove, ie. (C:\WINNT\.....\)
but keep the file name, ie.(go.gif)
Any ideas?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 03 Nov 1999 03:46:01 GMT
From: crackbaby1@my-deja.com
Subject: Need to remove url and keep file
Message-Id: <7vob5p$2nr$1@nnrp1.deja.com>
I have a program that will let users upload a file by letting them
browse through their hard drive and hitting upload. All I need to do is
when the form is submitted I need to remove, ie. (C:\WINNT\.....\)
but keep the file name, ie.(go.gif)
Any ideas?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 03 Nov 1999 03:37:07 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Perl and Excel Charting
Message-Id: <D5OT3.23382$23.1207339@typ11.nn.bcandid.com>
>Hope this helps, and thanks for any help anyone might have on this
>SaveAs("filename:=whatever.xls")?!? issue,
'filename' => 'whatever.xls', perhaps?
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Wed, 03 Nov 1999 03:07:18 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: perl JS interpreter? counting keywords?
Message-Id: <GFNT3.23308$23.1201979@typ11.nn.bcandid.com>
In article <381E5943.E6203019@klab.caltech.edu>,
Laurent Itti <itti@klab.caltech.edu> wrote:
>does anybody know of an interpreter for JavaScript in perl?
No.
>I am trying to write an exhaustive web bot in perl, which would go
>through
>most of the classical hoops used to keep bots away.
Maybe if people don't want your web bot crawling their site, you
shouldn't make your web bot crawl their site. After all, it *is* their
web server, not yours, isn't it?
I think Lynx includes an ECMAscript interpreter.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Wed, 03 Nov 1999 03:19:50 GMT
From: mehkriakram@my-deja.com
Subject: Perl Unicode Support
Message-Id: <7vo9kk$1kk$1@nnrp1.deja.com>
Hi. Hope to find u in great health
I am writing a cgi script which is supposed to take in user input and
convert it to pdf format.
I am using Image::Magick for the conversion to pdf.
The script works fine with english (iso-8859-1)(basic latin) but when
the user inputs non english language data string then the output is just
junk.
I was informed that perl 5.00562 has some support for unicode. I am a
newbie to 2 byte/multibyte data manipulation. I have with me compiled
and installed Unicode modules from CPAN, I18n and other related stuff
Can any body please tell me in simple terminology how it has to be done.
Examples will be welcomed.
Also please if u can forward this message to any body who can help, It
will be great
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 02 Nov 1999 22:02:21 -0500
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Perl's hashing algorithm
Message-Id: <381FA5BD.8FBE233C@rochester.rr.com>
Ran Shoham wrote:
>
> Where can I find out more information about the Hashing algorithm that
> Perl has built into it?
> I would like to know more about the algorithm used, as well as the hash
> table is accessed everytime I call upon it.
> (that is, does the entire hash table get called? or just a small part at
> a time?)
From perlguts:
The hash algorithm is defined in the PERL_HASH(hash, key, klen) macro:
hash = 0;
while (klen--)
hash = (hash * 33) + *key++;
The general idea is that a hash element will be found very quickly,
hopefully on the first lookup most of the time. So I think it is
fair to say that only a small part at a time is accessed. I'm not
sure what you are trying to get at.
...
> Ran
>
> (rshoham@acs.ucaltgary.ca)
...
--
Bob Walton
------------------------------
Date: Wed, 03 Nov 1999 03:31:10 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Problem With Delimited Field Sort
Message-Id: <20OT3.23363$23.1206512@typ11.nn.bcandid.com>
In article <KbMT3.28481$m4.101918295@news.magma.ca>,
Samuel Kilchenmann <skilchen@swissonline.ch> wrote:
>But i have a followup question:
>Joseph N. Hall writes:
> my $sortfunc = eval "sub { " . join (" or ", @sortcode) . " } ";
> my $splitfunc = eval 'sub { (split /$sep/o, $_)[@col] } ';
>
>while i would write that as:
> my $sortfunc = sub { eval join (" or ", @sortcode) };
> my $splitfunc = sub { eval '(split /$sep/o, $_)[@col]' };
>
>Are there any semantic differences between these two versions?
There's at least one. This code:
#!/usr/bin/perl -w
use strict;
use vars '$variable';
$variable = 8;
my $sub1;
my $sub2;
{
my $variable = 112;
$sub1 = sub { eval '$variable' };
$sub2 = eval 'sub { $variable }';
}
print "got ", $sub1->(), " and ", $sub2->(), "\n";
. . . produces the following output:
Use of uninitialized value at tmp.x line 14.
got and 112
sub2 is able to capture a reference to the lexical $variable. I don't
know what the heck is going on with sub1; I thought it would surely
return 8, which is the value of the package $variable, but instead it
returns undef.
I suspect that each time you eval the //o thing, you'll get a separate
RE, too. Here, let me try.
#!/usr/bin/perl -w
use strict;
my $pat = 'foo';
my @things = qw(foobar foobaz boobar moobaz foo);
my $sub1 = sub { eval '/$pat/o' };
my $sub2 = eval 'sub { /$pat/o }';
for my $sub ($sub1, $sub2) {
print join (' ', grep {$sub->()} @things), "\n";
}
$pat = 'bar';
for my $sub ($sub1, $sub2) {
print join (' ', grep {$sub->()} @things), "\n";
}
This does indeed show just what I thought it would:
foobar foobaz foo
foobar foobaz foo
foobar boobar
foobar foobaz foo
At first, they are equivalent, but after $pat changes, only $sub1 notices.
There are, of course, efficiency differences; reparsing the body of the
subroutine every time you want to run it can't be the best way to solve
any problem.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 02 Nov 1999 12:09:07 -0600
From: TK Soh <r28629@email.sps.mot.com>
Subject: Re: speeding up split()
Message-Id: <381F28C3.FFB72E5E@email.sps.mot.com>
Tom Phoenix wrote:
>
> On Mon, 1 Nov 1999, TK Soh wrote:
>
> > I am trying to speed up the split() statement in my program that has
> > to split a tab-delimited file in to arrays of about 1200 elements for
> > each line.
>
> Wow, that's a lot of elements. My guess is that it's slow to allocate 1200
> scalars like that.
>
> > BTW, my home brewed split function with XSUB, though works, was too
> > slow to mention.
>
> You're probably allocating 1200 scalars there, too. :-)
Thanks for the advice. Unfortunately I do need all the 1200 scalars at
this moment. I will need to look into my program's design to see if I
can somehow squeeze a few more grams out of it :-)
-TK
------------------------------
Date: Tue, 02 Nov 1999 12:13:10 -0600
From: TK Soh <r28629@email.sps.mot.com>
Subject: Re: speeding up split()
Message-Id: <381F29B6.C8F9695A@email.sps.mot.com>
Ilya Zakharevich wrote:
>
> [A complimentary Cc of this posting was sent to Tom Phoenix
> <rootbeer@redcat.com>],
> who wrote in article <Pine.GSO.4.10.9911020858350.29670-100000@user2.teleport.com>:
> > > BTW, my home brewed split function with XSUB, though works, was too
> > > slow to mention.
> >
> > You're probably allocating 1200 scalars there, too. :-)
> >
> > Here's a technique to consider. It may be faster or slower, but don't test
> > it by itself - it's whether it's faster or slower as you use it that
> > matters. (More about this in a moment.)
>
> Or alternatively, support my patch which introduced a pragma to kill
> this splitting-to-$@ bug.
I would really like to try it out. where can I find this patch? I looked
up the CPAN but couldn't quite locate it (or have I taken it too
literally ? :) :
http://www.perl.com/CPAN-local/authors/id/ILYAZ/patches/
Also, Is it possible to turn it into an XS module, instead of patching
perl?
-Tk
------------------------------
Date: 3 Nov 1999 04:42:19 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: speeding up split()
Message-Id: <7voefb$cfe$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to TK Soh
<r28629@email.sps.mot.com>],
who wrote in article <381F29B6.C8F9695A@email.sps.mot.com>:
> > Or alternatively, support my patch which introduced a pragma to kill
> > this splitting-to-$@ bug.
>
> I would really like to try it out. where can I find this patch? I looked
> up the CPAN but couldn't quite locate it (or have I taken it too
> literally ? :) :
It was something like use explicit 'split' or somesuch.
> Also, Is it possible to turn it into an XS module, instead of patching
> perl?
Yes, of course. Copy the contents of pp_split to .xs, apply my patch
to *this*, then make changes to convert PP stuff to XSUB interface (minimal).
Ilya
------------------------------
Date: Wed, 03 Nov 1999 03:49:45 GMT
From: mehkriakram@my-deja.com
Subject: Re: Sybperl problems
Message-Id: <7vobcq$2p8$1@nnrp1.deja.com>
Why dont u just use ct_sql option
it works fine.
In article <7vo1oq$s4v$1@nnrp1.deja.com>,
jds7717@my-deja.com wrote:
> I am having trouble getting the Sybperl module to work on my
> configuration. I have the following Sybase components installed via
> RPMS on RH 6.1:
>
> sybase-doc-11.9.2-1
> sybase-ase-11.9.2-1
> sybase-common-11.9.2-1
> sybase-openclient-11.1.1-1
> sybase-sqlremote-6.0.2-1
> sybase-monserver-11.9.2-1
>
> I have rebuilt perl as described in the README.linux without any
> problems and I have also built sybperl-2.11 without any errors. I
have
> a simple script that I am trying to run and I keep getting the same
> error. Here is the script:
>
> #!/usr/bin/perl
>
> use Sybase::DBlib;
>
> $dbh = new Sybase::DBlib 'sa', PASSWORD, SERVERNAME;
>
> $dbh->dbuse('master');
> $sql = "select * from sysprocesses";
> $dbh->dbcmd($sql);
>
> $dbh->dbsqlexec;
> $dbh->dbresults;
>
> Where PASSWORD and SERVERNAME are set to their appropriate values.
Upon
> running this script I get the following error:
>
> DB-Library error:
> Name too long for loginrec field.
> Can't call method "dbuse" on an undefined value at ./test.pl line 7.
> Exit 115
>
> I can use isql without any problems but I have yet to be able to
connect
> using the Sybperl module. Any help would be greatly appreciated.
>
> Jeromy
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 2 Nov 1999 22:49:29 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Why doesn't this work?
Message-Id: <slrn81vflj.tjn.abigail@alexandra.delanet.com>
Tony (010101@technologist.com) wrote on MMCCLIV September MCMXCIII in
<URL:news:381F380A.19372B56@technologist.com>:
// I have a form that goes:
[ 200+ lines of HTML and Javacrud ]
// and a cgi script that goes:
[ 144 lines of Perl code without -w, -T, use strict; use CGI; or
checking the status of system calls ]
// Can anyone explain to me why this is isn't working?
You probably have a bug.
You post gigantic quantities of bad code, yet you fail to indicate what
went wrong, and you still expect someone to dive in and debug it for you?
Get real.
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 2 Nov 1999 23:17:07 -0500
From: "Wells" <wellsshammout-NoSpam@msn.com>
Subject: Win32, DBD, Oraperl and Personal Oracle
Message-Id: <umpeOJbJ$GA.247@cpmsnbbsa03>
Hello,
Does anyone know if it is possible to get DBI/Oraperl to work on windows98
with personal Oracle?
If so, what needs to be done?
Thank you.
------------------------------
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 1262
**************************************