[8608] in Perl-Users-Digest
Perl-Users Digest, Issue: 2225 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 1 13:23:15 1998
Date: Wed, 1 Apr 98 10:00:27 -0800
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, 1 Apr 1998 Volume: 8 Number: 2225
Today's topics:
Re: A SSI question :-) <uri@sysarch.com>
Re: ANNOUNCE: /bin/sh to Perl translator finally availa (Stuart McDow)
Bezier Perl code needed: have C source johnvv@earthling.net
Bezier Perl code needed: have C source johnvv@earthling.net
Can I prevent MSIE 4 from erasing all fields when Back larrymcp@hotmail.com
file uploading and encrypting with perl+HTML eddie@zigzaguk.demon.co.uk
Re: HELP !!! - Templates within Perl <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: HELP !!! - Templates within Perl <jdporter@min.net>
Help with Password <G.W.Lewis@cs.cf.ac.uk>
Re: Help with small program <rootbeer@teleport.com>
Re: How to generate a Cartesian product of a varying nu <jdporter@min.net>
Re: How to read from keyboard without enter? (Stuart McDow)
Re: Identifying how a perl program was called <jdporter@min.net>
integer or string ? <byte@lmn.pub.ro>
Re: integer or string ? <jdporter@min.net>
Re: Is there a "Newsgroup" for Newbies to Perl? (Vance Fields)
perl -mCPAN -eshell exits silently ??? <guenter@arithmos.com>
Re: PERL Far Eastern Language Support <amr@nospam.miyako.japanologie.kultur.uni-tuebingen.de>
Re: problematic pattern matching spamfree@yahoo.com
Re: Question on one of Abigail's obfuscated sigs (Abigail)
Re: Question on one of Abigail's obfuscated sigs (just another $wanna{$be} perl hacker)
Re: readdir/grep/map <sakalauk@coam.usm.edu>
Re: readdir/grep/map (Mike Stok)
Reading Mail <hblanek@sabre.com>
Re: small letters into capital letter <schotten@teefax.ert.rwth-aachen.de>
undefine variables <kelby@mplx.com>
undefine variables <kelby@mplx.com>
undefine variables <kelby@mplx.com>
undefine variables <kelby@mplx.com>
undefine variables <kelby@mplx.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 01 Apr 1998 11:08:22 -0500
From: Uri Guttman <uri@sysarch.com>
To: John Goerzen <jgoerzen@southwind.net>,"Ben" <ben@wallroyds.demon.co.uk>
Subject: Re: A SSI question :-)
Message-Id: <x7ogylr0cp.fsf@sysarch.com>
>>>>> "JG" == John Goerzen <jgoerzen@southwind.net> writes:
JG> "Ben" <ben@wallroyds.demon.co.uk> writes:
>> Hello Alan ...
>>
>> Thank you very much for the reply :-)
>>
>> You described it perfectly.
>>
>> I thought that - But, there's a major disadvantage, the search
>> engines, of course ... won't search CGI scripts :-)
>>
>> Or, can they?
JG> There's no reason that they couldn't unless the CGI scripts
JG> require some sort of input (from a form, a cookie, or something).
JG> However, I don't know if any search engines as a matter of policy
JG> ignore /cgi-bin URLs; if so, it is, IMO, a major shortcoming in
JG> the search engine.
i agree but as i write below it is not worth doing.
JG> Given a plain URL, there is no general way to detect that it is
JG> CGI or not.
having written a major search engine (see northernlight below) i
understand the problems you both address. we decided (and other engines
agree) that you can't index cgi url's since the content of the cgi
output is variable. so searching for keywords in that output will often
get you a bogus url (and there are too many bogus url's in search
engines). there is no easy way around this problem. as a rule we just
discarded any url's with cgi-bin or .cgi suffixes.
if you could describe a method to search them, then tell me and i will
forward that to NL. no one we know can figure out a clean method that
won't produce junk results. many sites are totally cgi driven and you
can't do an external search on them because of that design. they hide
all their files as they are not linked to by any visible files and you
click on links which are cgi's with arguments to find the desired
file. but you can't tell that from a cgi which generates a form input
and which would be very foolish to index. so the problem is real and
complex and the common solution is to skip indexing of cgi url's.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---- 8 Years of Perl Experience, Available Immediately
uri@sysarch.com --------- Resume and Perl Example at http://www.sysarch.com
Use the Best Search Engine on the Net -------- http://www.northernlight.com
------------------------------
Date: 1 Apr 1998 16:21:20 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: ANNOUNCE: /bin/sh to Perl translator finally available!
Message-Id: <6ftpi0$ibp$1@ns1.arlut.utexas.edu>
Randal Schwartz <merlyn@stonehenge.com> writes:
>
> Yes! Finally! The long-awaited "Shell to Perl" translator is now available!
Damn!! I fell for it!! Forgot to check the date. D'oh!!! Very cute.
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"It is obvious that about 750,000 people ago, Austin was a wonderful City."
------------------------------
Date: Wed, 01 Apr 1998 10:24:25 -0600
From: johnvv@earthling.net
To: paul@bourke.gen.nz
Subject: Bezier Perl code needed: have C source
Message-Id: <6ftphl$51u$1@nnrp1.dejanews.com>
Hello All,
I am doing performance statistics for server and network operations.
I have been making graphs for forcasting problems very successfully with
linear regression. Since I now have a full year of data in a persistant
object I will have to switch over to a bezier curve since systems forcasting
is usable only in the 2-4 week range.
I have ( part of ) the C source code minus header but I am a perl/shell coder
and would be ~very~ grateful if one of us netters could help me with the
translation to perl. This is in:
<http://www.mhri.edu.au/~pdb/geometry/bezier/>
I am implementing everything in OO modules and will redo my stats module away
from tradional libraries so it will parallel the CPAN modules. While I am not
too interested in the flame and glory of CPAN, I will make the code available
on my "website" - http://members.tripod.com/~johnvv.
In fact I am going to fix the darn thing right now; I planned to mirror my
internal site but they won't let have more than one sub directory.
By way of details, after starting with the usual CPU, MEM, DSK, NET % charts I
moved on to delays and other exceptions, finally planning and partially
implementing a messaging and triggering system which invariably brings out
specific problems using the typical thresholds and also exceptions. While
analysis requires a variety of different types of stats, my strongest hope is
in observing the correlation of exceptions generated by the remote devices
(servers) to time, then alerting operators with string based messages
prioritized with a formula combining severity and the number of alerts reduced
with a logarithmic fall off with respect to time. The census "seasonal" cycle
concept should also play into the picture on a weekly and monthly basis.
First written in shell, I went to perl using stored hashes of hashes in a
berkeley db. Despite predictions to the to contrary the perfomance has been
fairly high. I built a revolving OO front end but I retreated to procedural
to compensate for some odd bugs ( more on them later when I get a chance to
recheck. )
I created a single 1 year graph with perl's GIFgraph out of 4,000,000 points;
it was a mile wide... ...I really wish I had a bezier curve.
Thanks 1000k ( in advance ), John van V. aka johnvv@earthling.net
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 01 Apr 1998 10:23:21 -0600
From: johnvv@earthling.net
To: paul@bourke.gen.nz
Subject: Bezier Perl code needed: have C source
Message-Id: <6ftpg8$4v9$1@nnrp1.dejanews.com>
Hello All,
I am doing performance statistics for server and network operations.
I have been making graphs for forcasting problems very successfully with
linear regression. Since I now have a full year of data in a persistant
object I will have to switch over to a bezier curve since systems forcasting
is usable only in the 2-4 week range.
I have ( part of ) the C source code minus header but I am a perl/shell coder
and would be ~very~ grateful if one of us netters could help me with the
translation to perl. This is in:
<http://www.mhri.edu.au/~pdb/geometry/bezier/>
I am implementing everything in OO modules and will redo my stats module away
from tradional libraries so it will parallel the CPAN modules. While I am not
too interested in the flame and glory of CPAN, I will make the code available
on my "website" - http://members.tripod.com/~johnvv.
In fact I am going to fix the darn thing right now; I planned to mirror my
internal site but they won't let have more than one sub directory.
By way of details, after starting with the usual CPU, MEM, DSK, NET % charts I
moved on to delays and other exceptions, finally planning and partially
implementing a messaging and triggering system which invariably brings out
specific problems using the typical thresholds and also exceptions. While
analysis requires a variety of different types of stats, my strongest hope is
in observing the correlation of exceptions generated by the remote devices
(servers) to time, then alerting operators with string based messages
prioritized with a formula combining severity and the number of alerts reduced
with a logarithmic fall off with respect to time. The census "seasonal" cycle
concept should also play into the picture on a weekly and monthly basis.
First written in shell, I went to perl using stored hashes of hashes in a
berkeley db. Despite predictions to the to contrary the perfomance has been
fairly high. I built a revolving OO front end but I retreated to procedural
to compensate for some odd bugs ( more on them later when I get a chance to
recheck. )
I created a single 1 year graph with perl's GIFgraph out of 4,000,000 points;
it was a mile wide... ...I really wish I had a bezier curve.
Thanks 1000k ( in advance ), John van V. aka johnvv@earthling.net
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 01 Apr 1998 10:25:47 -0600
From: larrymcp@hotmail.com
Subject: Can I prevent MSIE 4 from erasing all fields when Back is pressed?
Message-Id: <6ftpk8$59f$1@nnrp1.dejanews.com>
-
Hi all. I just noticed something that occurs in MSIE version 4
that could annoy customers who are trying to buy something online.
Here's what happens: When I detect a data entry error (for example,
he forgot to enter his ZIP code), I display a screen with the error
message. I ask the user to press his Back button and correct the
error.
That worked great up until today when I noticed the MSIE thing. Under
version 4, and only when running in Secure (SSL) mode, all the fields
get cleared out when you press the Back button!
So, suppose you're a slow typer and you just finished entering your
name, E-mail address, mailing address, credit-card info etc; and you
made a mistake. Well if you're using MSIE 4 in Secure mode then you
lose *all* that typing when you press the Back button.
Bum deal huh! So what I'm asking is for all you MSIE 4 experts out
there to counsel me. I'm aware that I could modify my scripts to
re-display the screen with the fields filled in, but I feel like I
shouldn't have to do that. Netscape, and MSIE 3, do not contain this
unfortunate quirk, so I'm hoping somebody will tell me to "just
include HTTP header xxx, or META tag zzz, and all will be fine with the
world."
Thanks for any thoughts or comments on this situation. If you need
an example (but I think it happens with any secure forms in MSIE 4),
you can look at our highest-volume customer at http://www.cherrycity.com .
The Perl source code is at http://www.cherrycity.com/shop.txt , but
again I don't think it's anything in my specific program.
- Larry McPhillips
CCI Marketing Group
-
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 01 Apr 1998 10:27:29 -0600
From: eddie@zigzaguk.demon.co.uk
Subject: file uploading and encrypting with perl+HTML
Message-Id: <6ftpo7$59v$1@nnrp1.dejanews.com>
Hello Perl People,
My basic problem at the moment is that i am trying to find either a script or
pointers on writing a script to do the following task.
i am trying to provide a facility where people will be able to go into an
area on my server set aside for them and protected with htaccess and examine
or download sreadsheet files(.xls Excel). They must also have the facility
to upload new versions of the files into a holding area (they aint getting to
alter the actual files on the server) where i can check and then implement
the new files. What i need from perl is an uploading script that can have
the directory it is to upload to and the file it is to upload both specified
in an HTML form and passed in (multiple files would be helpful too).
I would like to be able to encrypt the files as they are uploaded as the
spreadsheets contain delicate financial information, but i realise that that
might be a totally separate issue(pointers would be appreciated).
Many thanks in advance
EddieH
=============================================================================
You can run kid, but you cant hide. - Jester
=============================================================================
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 01 Apr 1998 18:43:51 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: HELP !!! - Templates within Perl
Message-Id: <7xhg4dfq60.fsf@beavis.vcpc.univie.ac.at>
Re: HELP !!! - Templates within Perl, T <tkonink@horizon.nl>
said:
T> Hi, I'm looking for a way of using HTML templates within
T> Perl CGI-scripts, so I can isolate HTML-code (for
T> script-output) from the script-source. The problem is
T> that the (html-)output contains some variables, which are
T> used inside the script.
The standard CGI module has lots of HTML short-cuts.
http://www-genome.wi.mit.edu/ftp/pub/software/WWW/
On CPAN
http://www.perl.com/CPAN/
there are some HTML::* modules for constructing HTML
objects.
hth
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | http://www.vcpc.univie.ac.at/
"Everything I am, I learned on the back of cereal boxes" ~ RJ, "Over the Hedge"
------------------------------
Date: Wed, 01 Apr 1998 12:10:20 -0500
From: John Porter <jdporter@min.net>
Subject: Re: HELP !!! - Templates within Perl
Message-Id: <352274FC.551B@min.net>
T. de Konink wrote:
>
>[...]
> Do you know how to do this (if there is any way of using templates
> within Perl) ?
Any string can be a "template".
$template = q{<title>$title</title>}; # single-quoted!
$title = q{John's House O' Habaneros};
eval qq{\$html = "$template"};
print $html;
# prints: <title>John's House O' Habaneros</title>
Of course, there's also the modules on CPAN which make using
templates easier, such as Text::Template.
hth,
John Porter
------------------------------
Date: Wed, 01 Apr 1998 17:02:12 -0800
From: Gerald <G.W.Lewis@cs.cf.ac.uk>
Subject: Help with Password
Message-Id: <3522E394.617B@cs.cf.ac.uk>
I have been having a bit of a problem getting my password page to Work this is what i
have got at the moment
&PrintHeader
&ReadParse(*input);
$usrname = $input{'usname'};
$pass = $input{'pass'};
# open password file
$found = 0 ;
open(PASSWD,"/home/scm7gwl/public_cgi-bin/password.dat")
|| &CgiDie("Error","Cant open password file");
# Check username
while ($line=<PASSWD>) {
$line =~ s/[\r\n]//g;
# chomp($input);
($username,$password) = split(/:/,$input);
if ($username eq $usrname) {
if ($password eq $pass) {
$found=1;
print <<"end";
&PrintHeader
&HtmlTop("WELCOME")
<h2>You are now able to edit and delete</h2>
&HtmlBot
end
}
}}
The problem is that it comes up with an internal server error 500
------------------------------
Date: Wed, 1 Apr 1998 08:21:58 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Brian Charles <brian.charles@orst.edu>
Subject: Re: Help with small program
Message-Id: <Pine.GSO.3.96.980401081335.3644D-100000@user1.teleport.com>
On Tue, 31 Mar 1998, Brian Charles wrote:
> Subject: Help with small program
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> It doesn't alphabetize and it only returns two strings.
> The input file is simple a string of data separated by a '|'
> I want to be able to return just a portion of it alphabetized by name.
> while(<DB>) {
> chomp; #remove newline
> ($type, $org, $district, $resp, $t1, $t2, $name, $address, $city,
> $b1,$b2,$b3,$p
> hone,$n1,$n2,$n3,$country) = split /\|/; #splits the string to arrays
> $hash{$type} = {name => $name, t1 => $t1, t2 => $t2};
This is a good place for some print statements for debugging.
print "got type: $type name: $name and whatever...\n";
Does that report anything useful? Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 01 Apr 1998 11:42:38 -0500
From: John Porter <jdporter@min.net>
Subject: Re: How to generate a Cartesian product of a varying number of sets?
Message-Id: <35226E7E.4EDD@min.net>
Christian Wetzel wrote:
>
> I re-wrote your example for a function which returns an
> array of arrays with the desired cartesian product (instead
> of just printing them):
>[...]
I would be wary of doing that unless absolutely necessary,
because of the potentially huge amount of memory it would
take.
But if you needed to, here's how it would be done using my
version of the function:
my @results; # array of arrays
ccp( \@i, sub { push @results, [ @_ ]; } );
# and here's my function, posted again for your convenience:
sub ccp { # cartesian cross product
my( $dims, $subref, @vector ) = @_;
my @remaining = @$dims;
if ( @remaining ) {
# not at end yet
my $dim = shift @remaining;
my $x;
for $x ( @$dim ) {
# recurse, appending $x to vector:
ccp( \@remaining, $subref, @vector, $x );
}
}
else {
# at leaf (got all dims)
$subref->( @vector );
}
}
John Porter
------------------------------
Date: 1 Apr 1998 16:01:23 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: How to read from keyboard without enter?
Message-Id: <6ftocj$eli$1@ns1.arlut.utexas.edu>
UCE-trap_synic@omen.net.au (Peter Caffin) writes:
>
> The Camel Book really ought to carry an update on the atmosphere of this
> newsgroup now that it's become all snooty and information-lazy *sigh*.
Too true. There *are* a lot of information-lazy people in here asking
FAQs, and then becoming snooty when their questions are not answered.
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"It is obvious that about 750,000 people ago, Austin was a wonderful City."
------------------------------
Date: Wed, 01 Apr 1998 12:12:08 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Identifying how a perl program was called
Message-Id: <35227568.38D@min.net>
Miss WILKINS wrote:
>
> wouldn't HTTP_Referer do the trick
No. And trim your quotes down, please.
John Porter
------------------------------
Date: Wed, 01 Apr 1998 19:07:01 +0300
From: Laurentiu Badea <byte@lmn.pub.ro>
Subject: integer or string ?
Message-Id: <35226625.74C8E597@lmn.pub.ro>
What am I missing here (I expected 141 and got 041):
$string = "141 255";
$string =~ /([0-9]+)\s+([0-9]+)/i;
($a,$b) = ($1,$2);
$c = $a & $b;
print "$c\n";
Do I really have to add 0 to tell perl it's integers there, can't
it figure it out since I'm using a bitwise logic operation on them ?
--
Laurentiu Badea
mailto:byte@lmn.pub.ro
http://www2.lmn.pub.ro/~byte/
------------------------------
Date: Wed, 01 Apr 1998 11:56:58 -0500
From: John Porter <jdporter@min.net>
Subject: Re: integer or string ?
Message-Id: <352271DA.1F8A@min.net>
Laurentiu Badea wrote:
>
> What am I missing here (I expected 141 and got 041):
> $string = "141 255";
> $string =~ /([0-9]+)\s+([0-9]+)/i;
> ($a,$b) = ($1,$2);
> $c = $a & $b;
> print "$c\n";
>
> Do I really have to add 0 to tell perl it's integers there,
Yes. (Or any other way to force conversion to numeric.)
> can't
> it figure it out since I'm using a bitwise logic operation on them ?
No, since the & operator also works on strings. As you noticed,
1 & 2 = 0
4 & 5 = 4
1 & 5 = 1
hth,
John Porter
------------------------------
Date: 1 Apr 1998 16:28:49 GMT
From: fieldva@ml.com (Vance Fields)
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <6ftq01$af3$1@news.ml.com>
In article {...}, "smitty77" stunned me by saying:
>>
>>smitty77> My first experience with perl was in a class at Silicon
>>smitty77> Graphics taught by Randall Schwartz. It was a pretty good
>>smitty77> class, but even then I could tell that Randall had no
>>smitty77> patience for people who asked what he felt were 'stupid
>>smitty77> questions'. To each his own, I guess.
To which Randal replied:
>>I'm a bit flabberghasted by this...
...as is everyone besides Dave, I would imagine.
I, myself, have had the extraordinary good fortune
to have participated in two Perl classes which were
led by Randal. I can't even begin to imagine what
in the world caused Dave to perceive that Randal's
classes were anything but clear, concise, informative,
and helpful to the 'nth' degree.
I'm happy to serve as a reference for Randal, to anyone
who would feel better having another opinion.
Hey Dave, by the way, was it Randal who charactized the
questions you mention as being "stupid"? If not, why
have you portrayed them as such? Hopefully, your ability
to deal with technical topics is superior to your comm-
unication skills. If not, I think I can see how you came
to your original conclusion.
Vance
--
/***************************************************************/
/* Vance R. Fields Unix System Administrator */
/* Merrill Lynch World Financial Center */
/* fieldva@dats.ml.com NYC, NY 10080 (South Tower) */
/* (212) 236-3989 (voice) (212 236-1039 (fax) */
/***************************************************************/
------------------------------
Date: Wed, 01 Apr 1998 09:09:09 -0800
From: Guenter Steinbach <guenter@arithmos.com>
Subject: perl -mCPAN -eshell exits silently ???
Message-Id: <352274B5.A35EDAB@arithmos.com>
Hello out there:
I just tried for the first time to use the perl -mCPAN method to download a
module. First as a normal user it went through its questions, ending up with
errors like:
--------------
Use of uninitialized value at /opt/perl5/lib/CPAN.pm line 1542.
Your is not correctly protected.
--------------
(note the double blank between 'Your' and 'is')
and
--------------
GOT y/sources/authors/id/ANDK/CPAN-1.36.tar.gz
y/sources/authors/id/ANDK/CPAN-1.36.tar.gz: No such file or directory
Tar: blocksize = 0; broken pipe?
Could not open >y/build/ANDK000/Makefile.PL at /opt/perl5/lib/CPAN.pm line 2887
Could not open >y/build/ANDK000/Makefile.PL at /opt/perl5/lib/CPAN.pm line 2887
...propagated at /opt/perl5/lib/CPAN.pm line 368.
----------------
Several times. Thinking it may be because I don't have root permissions, I
tried again as root, using a different directory as base, and it never got to
actually trying to download, ending instead in
---------------
Your no_proxy?
commit: wrote /opt/perl5/lib/CPAN/Config.pm
-----------
and after that, the shell prompt. Since then it just silently exits whenever I
try the perl -mCPAN again, whether as root or as myself.
What got messed up here?
Thank you.
--
Guenter Steinbach, Arithmos Inc., guenter@arithmos.com
------------------------------
Date: Wed, 01 Apr 1998 19:13:30 +0200
From: Riechert <amr@nospam.miyako.japanologie.kultur.uni-tuebingen.de>
Subject: Re: PERL Far Eastern Language Support
Message-Id: <352275B9.1BC7@nospam.miyako.japanologie.kultur.uni-tuebingen.de>
There are two ways to use Japanese with Perl.
(1) You can use JPerl
But if you use JPerl you leave the territory of the Perl you
know!
CPAN: authors/Hirofumi_Watanabe: jperl5.004 (UNIX)
http://www.yk.rim.or.jp/~hizumi/perl/bin300.htm (Win32)
http://world.std.com/~habilis/macjperl/ (Mac)
(2) You use the normal distribution of Perl and japanize your
scripts. If you will use this (recommended) method, you will have
to know a lot of Japanese-encoding Methods.
E.g.-- Shift-JIS encoded Japanese will have the byte which represents
"@" in their 2-byte characters.
-- Some Japanese Characters will be 2-byte characters others will
will have just 1-byte. So if you wan't to match a Japanese string
you must find out which characters are 1-byte and which are
2-byte
-- much more
If you need to understand Japanese encodings, I can recommend the book:
Ken Lunde: "Understanding Japanese Information Processing".
O'Reilly, 1993.
The Perl-specific ftp-side for this book is:
ftp.ora.com/pub/examples/nutshell/ujip/perl/
Here you find some scripts, and a manuscript called "perl97.pdf" which
will give you some hints what kind of problems you get and how to solve
them, if you process Japanese with Perl.
Anyway, If you cannot read Japanese (and cannot test your output) I
won't
recommend any of this approaches. For debbuging you will need an a
person who has seen Japanese-characters before.
Sorry for the bad English usage.
HTH,
Andreas Marcel
Christian wrote:
>I am attempting to convert an application from English into Japanese. This
>application seems to make very heavy use of Perl, which I admit I don't know
>much about. I would like to know if Perl supports the use of double byte
>character systems (i.e. EUC) or Unicode. I couldn't find anything in the
>FAQs, except something about locale support which does not mention double
>byte languages.
------------------------------
Date: Wed, 01 Apr 1998 10:35:50 -0600
From: spamfree@yahoo.com
Subject: Re: problematic pattern matching
Message-Id: <6ftq7t$5pr$1@nnrp1.dejanews.com>
In article <6fs49a$o86$1@nnrp1.dejanews.com>,
umesh@intertrust.com wrote:
>
> How can I match a pattern of [it doesn't matter what he said here]
You may be wondering why this is the case. The author provides the answer:
> I do not read this newsgroup regularly.
Q: How do I match a pattern of [...]?
A: Read this newsgroup regularly.
A2: Lurk and learn; post and burn.
Dave
--
Yes, that really is my address
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 1 Apr 1998 16:10:57 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Question on one of Abigail's obfuscated sigs
Message-Id: <6ftouh$qvs$1@client2.news.psi.net>
Joel Coltoff (joel@wmi0.wmi.com) wrote on MDCLXXIV September MCMXCIII in
<URL: news:6ftiu2$s9u@netaxs.com>:
++ In article <Pine.GSO.3.96.980331203247.13245J-100000@user1.teleport.com>,
++ Tom Phoenix <rootbeer@teleport.com> wrote:
++ >On Tue, 31 Mar 1998, Just Another $wanna{$be} Perl Hacker wrote:
++ >
++ >> s/(..)z?/qq'print chr 0x$1 and \161 ss'/ee;
++
++ I had no problem understanding the script and applaud her creativity.
++ The second line I saw looked a bit different but the above serves as a
++ good starting place for my question.
++
++ Why doesn't it work when the last pair of quote delimters are
++ semicolon and not 's'?
++
++ s/(..)z?/qq'print chr 0x$1 and \161 ;;'/ee;
That has to be a bug. The following works:
s/(..)z?/qq'print chr 0x$1 and \161 ;;;'/ee;
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle 'print +(HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET", "http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content)) =~ /(.*\))[-\s]+Additional/s) [0]'
------------------------------
Date: Wed, 01 Apr 1998 16:13:26 GMT
From: root@127.0.0.1 (just another $wanna{$be} perl hacker)
Subject: Re: Question on one of Abigail's obfuscated sigs
Message-Id: <35224f9d.508942310@client1.news.psi.net>
On Tue, 31 Mar 1998 20:34:38 -0800, Tom Phoenix
<rootbeer@teleport.com> wrote:
>On Tue, 31 Mar 1998, Just Another $wanna{$be} Perl Hacker wrote:
>
>> s/(..)z?/qq'print chr 0x$1 and \161 ss'/ee;
>
>> I do not understand the quoting in the last line.
>
>The qq'' is a double-quoted string (with alternate syntax).
>
>> I realize the right side is evaluated twice as an EXPR, but am
>> confused as to what exactly is occurring.
>
>The first /e evaluates that expression to see what results. The second
>evaluates _that_ to see what results.
>
>Does that make it any clearer? Good luck with it!
#original: perl -we '$_ =
"4a75737420616e6f74686572205065726c204861636b65720as";
# for (s;s;s;s;s;s;s;s;s;s;s;s)
# {s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'
my rewrite:
#!/usr/bin/perl -w
$_ = "4a75737420616e6f74686572205065726c204861636b65720az";
for (/z/;/z/;/z/) {
s/(..)z?/"print chr 0x$1 and \161 bb"/ee;
}
Yes, I understand the quoting now. The q's were throwing me.
The second eval yields for example:
print chr 0x4a and q bb
My problem is I don't understand what the "and q bb" is doing.
I found that it doesn't matter what the two letters are after the q as
long as they are the same letter and case (ie "and q ab" produces use
of ununit val error). BAM! it hit me so hard, I just about fell out of
my seat. Sometimes I feel like a true idiot. Anyone else ever feel
like this or just me?
Well, that's two down (Abigail's obfuscated sigs) and God knows how
many to go.
------------------------------
Date: Wed, 01 Apr 1998 10:29:47 -0600
From: Peter Sakalaukus <sakalauk@coam.usm.edu>
Subject: Re: readdir/grep/map
Message-Id: <35226B7B.4A7B7C1D@coam.usm.edu>
Ok, I should have included what I've tried ...
# Problem: read in the contents of a directory, skipping . .. and
# the file region, and map the directory path to the filenames.
# This skips . .. and region
@files = grep !/^\.\.?$|region/, readdir THISDIR;
# This one skips the region file but includes . and .. when mapping is
# done (requiring me to code an extra step).
@files2 = grep !/^\.\.?$|region/,map "$dir/$_", readdir THISDIR;
So my question is, how do I make example #2 skip . and ..
Thanks in advance ...Pete
sakalauk@coam.usm.edu
------------------------------
Date: 1 Apr 1998 16:51:28 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: readdir/grep/map
Message-Id: <6ftrag$s5h@news-central.tiac.net>
In article <35226B7B.4A7B7C1D@coam.usm.edu>,
Peter Sakalaukus <sakalauk@coam.usm.edu> wrote:
># This one skips the region file but includes . and .. when mapping is
># done (requiring me to code an extra step).
>
>@files2 = grep !/^\.\.?$|region/,map "$dir/$_", readdir THISDIR;
>
>So my question is, how do I make example #2 skip . and ..
The flow of information in this case can be thought of as right to left,
the list returned by readdir has "$dir/" prepended to each entry and is
then fed to the grep which is looking for . or .. at the beginning of the
list elements, all of which now start with whatever was in $dir. So you
need to grep the output of readdir before feeding it to map (well, that's
one way to do it)
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: Wed, 01 Apr 1998 10:12:13 -0600
From: Harry Blanek <hblanek@sabre.com>
Subject: Reading Mail
Message-Id: <3522675D.3221A8A1@sabre.com>
--------------043DA3ACF1A0FFB5DE2F2B60
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Can someone help me with what I hope is a pretty easy problem? I am
playing with Graham Barr's mail filtering scripts from the Spring 96
issue of TPJ. How do I tell my script to periodically glance at
/var/mail/me and do something if there is a new message there. I am
using the Mail::Internet Module and it works on creating a message.
Then Mr. Barr suggests getting mail from stdin which doesn't seem to be
to useful for a filter. What am I missing here. Thanks
Harry
#!/bin/perl5 -w
require Mail::Internet;
require Mail::Address;
$mail = Mail::Internet->new( \*STDIN ); ## Shouldn't this point to my
mail directory?
$sender = $mail->get('From');
print "$sender \n\n";
blah blah blah
.
.
.
--
Harry Blanek
The Sabre Group
UNIX System Administrator
hblanek@sabre.com
817-963-1168
--------------043DA3ACF1A0FFB5DE2F2B60
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
Can someone help me with what I hope is a pretty easy problem? I
am playing with Graham Barr's mail filtering scripts from the Spring 96
issue of TPJ. How do I tell my script to periodically glance at /var/mail/me
and do something if there is a new message there. I am using the
Mail::Internet Module and it works on creating a message. Then Mr.
Barr suggests getting mail from stdin which doesn't seem to be to useful
for a filter. What am I missing here. Thanks
<P>Harry
<BR>
<BR>
<P>#!/bin/perl5 -w
<P>require Mail::Internet;
<P>require Mail::Address;
<P>$mail = Mail::Internet->new( \*STDIN ); ## Shouldn't this
point to my mail directory?
<P>$sender = $mail->get('From');
<P>print "$sender \n\n";
<P>blah blah blah
<BR>.
<BR>.
<BR>.
<BR>
<PRE>--
Harry Blanek
The Sabre Group
UNIX System Administrator
hblanek@sabre.com
817-963-1168</PRE>
</HTML>
--------------043DA3ACF1A0FFB5DE2F2B60--
------------------------------
Date: 01 Apr 1998 18:46:50 +0200
From: Claus Schotten <schotten@teefax.ert.rwth-aachen.de>
Subject: Re: small letters into capital letter
Message-Id: <7hafa5a3r9.fsf@ert.rwth-aachen.de>
abigail@fnx.com (Abigail) writes:
> ++ aw hell:
> ++ $word =~ tr/a-z/A-Z/;
> ++ is what you want.
>
> No, it's not. That doesn't take locale into account.
>
> $word = uc $word;
or (since he posts from a .de domain) even
$word = uc $word;
$word =~ s/_/SS/g;
Ciao, Claus schotten@ert.rwth-aachen.de
------------------------------
Date: Wed, 1 Apr 1998 11:30:06 -0500
From: "Kelby Valenti" <kelby@mplx.com>
Subject: undefine variables
Message-Id: <6ftq7d$28n@aaron.hamilton.edu>
Does anyone know if there is a way to undefine all variables that are used
within the program. I have looked in the man pages, but couldn't find any
references.
Thanks,
Kelby
------------------------------
Date: Wed, 1 Apr 1998 11:30:06 -0500
From: "Kelby Valenti" <kelby@mplx.com>
Subject: undefine variables
Message-Id: <6ftq4q$28m@aaron.hamilton.edu>
Does anyone know if there is a way to undefine all variables that are used
within the program. I have looked in the man pages, but couldn't find any
references.
Thanks,
Kelby
------------------------------
Date: Wed, 1 Apr 1998 11:30:06 -0500
From: "Kelby Valenti" <kelby@mplx.com>
Subject: undefine variables
Message-Id: <6ftqnm$28q@aaron.hamilton.edu>
Does anyone know if there is a way to undefine all variables that are used
within the program. I have looked in the man pages, but couldn't find any
references.
Thanks,
Kelby
------------------------------
Date: Wed, 1 Apr 1998 11:30:06 -0500
From: "Kelby Valenti" <kelby@mplx.com>
Subject: undefine variables
Message-Id: <6ftr6q$290@aaron.hamilton.edu>
Does anyone know if there is a way to undefine all variables that are used
within the program. I have looked in the man pages, but couldn't find any
references.
Thanks,
Kelby
------------------------------
Date: Wed, 1 Apr 1998 11:30:06 -0500
From: "Kelby Valenti" <kelby@mplx.com>
Subject: undefine variables
Message-Id: <6ftqv8$28v@aaron.hamilton.edu>
Does anyone know if there is a way to undefine all variables that are used
within the program. I have looked in the man pages, but couldn't find any
references.
Thanks,
Kelby
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 2225
**************************************