[18872] in Perl-Users-Digest
Perl-Users Digest, Issue: 1040 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 1 21:05:46 2001
Date: Fri, 1 Jun 2001 18:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <991443908-v10-i1040@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 1 Jun 2001 Volume: 10 Number: 1040
Today's topics:
Re: Accessing Oracle via Perl through HTML Framset <rereidy@indra.com>
Flame,help or killfile ? <buggs@geekmail.de>
Re: Frustrated people (not) answering questions <ryantate@OCF.Berkeley.EDU>
Re: Help slim down Perl code (Sweth Chandramouli)
Re: HTTP::Request GET <m.astrakhanskaya@gte.net>
Re: Installing CGI.PM with FTP client <der.prinz@gmx.net>
Re: Installing CGI.PM with FTP client (David Efflandt)
Re: Installing CGI.PM with FTP client <godzilla@stomp.stomp.tokyo>
Re: IPC:Shareable vs mod_perl ipcs not dying (Konstantinos Agouros)
Re: Komodo <mitia.nospam@northwestern.edu.invalid>
Re: parsing an output of httpQ <daniel304@planet.nl>
Re: parsing an output of httpQ <godzilla@stomp.stomp.tokyo>
Re: Posting Etiquette (Tad McClellan)
Re: Posting Etiquette (Tad McClellan)
Re: reading records which *start* with some constant st (Craig Berry)
Re: Rounding <skilchen@swissonline.ch>
Stepping through with tr/// <lmoran@wtsg.com>
Re: Stepping through with tr/// (Tad McClellan)
Re: vestale.pl ascii animation <llizard_ejm@yaSPITOUTTHATGUMhoo.com>
Re: Why this substitution doesn't work? <cadmcse@hotmail.com>
Re: Why this substitution doesn't work? <krahnj@acm.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 01 Jun 2001 16:23:08 -0600
From: Ron Reidy <rereidy@indra.com>
Subject: Re: Accessing Oracle via Perl through HTML Framset
Message-Id: <3B1815CC.DB381943@indra.com>
Mark Phillips wrote:
>
> Hello All
>
> I am using a Windows NT workstation to access an Oracle 8 database which is
> situated on a Windows
> NT server.
>
> I am trying to connect remotely to Oracle 8 on the server. Accessing the
> database with perl scripts in a web browser is not a problem, however
> accessing the database using perl scripts called through a HTML frameset is
> a problem. When I look at the Oracle db logs on the server, the username
> that appears is a single "/". Normally I would expect to see my NT
> username (we are using Oracle NT authentication).
>
> Is their a way in oracle whereby I can set my username to "/".
>
> Thank you
>
> Mark
I am not familiar with the term HTML frameset, but it should not matter
for connection purposes. You can use a "/", but it is not a wise thing
to do. This type of login invokes Oracle's OS authenication mechanism
which means you (read your DBA) will need to create the user (nobody?)
and maintain access privs for this account. I know I wouldn't be too
keen on this.
Since you didn't say how you are connecting (DBI or ODBC) I really can't
give any advice. You should use a username and password your DBA has
set up for this type of activity.
--
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.
------------------------------
Date: Sat, 2 Jun 2001 02:57:08 +0200
From: buggs <buggs@geekmail.de>
Subject: Flame,help or killfile ?
Message-Id: <9f9dok$nbm$03$1@news.t-online.com>
Considering the recent discussions on this topic
you migth be interested in the following.
See Simons article:
http://www.perl.com/pub/2001/05/29/tides.html
Reactions on the article:
http://use.perl.org/article.pl?sid=01/06/01/048204&mode=flat&threshold=
And a new site mentioned in the article:
http://learn.perl.org
Buggs
------------------------------
Date: Fri, 1 Jun 2001 23:33:55 +0000 (UTC)
From: Ryan Travis Tate <ryantate@OCF.Berkeley.EDU>
Subject: Re: Frustrated people (not) answering questions
Message-Id: <9f98p3$1a35$1@agate.berkeley.edu>
brian d foy <comdog@panix.com> wrote:
| you mean as an adjective?
i was reading 'programming' as a transitive verb ... but i am no
grammatical whiz myself ...
| it is not his style that is in question. his code creates
| severe and serious security issues whereever it is installed.
| these are not new issues.
and yet the world is a better place for his code :-) sort of like
Outlook ...
cheers
r
------------------------------
Date: Fri, 01 Jun 2001 22:07:32 GMT
From: sweth+perl@gwu.edu (Sweth Chandramouli)
Subject: Re: Help slim down Perl code
Message-Id: <EmUR6.43587$G5.9522729@news1.rdc1.md.home.com>
In article <x7hey0ym86.fsf@home.sysarch.com>,
Uri Guttman <uri@sysarch.com> wrote:
> SC> . Is that also evil symref abuse? If so, what would be
> SC> a better way to accomplish the task?
>
>that cries out for a straight dispatch table. it has one major win
>(beyond no symrefs), it can be used to check that the name is valid.
>
>look, as i have said, symrefs have their purpose. but data structures is
>not one of them and what you have there is basically a data structure
>disguised as a set of get_foo() subs.
I guess the piece that I'm not getting is how to
dynamically build the dispatch table in a way that doesn't use symrefs.
Every example of dispatch tables in Perl that I've seen "composes" them
manually, rather than generating them automatically from, say, a list or
a hash.
-- Sweth.
--
Sweth Chandramouli ; <sweth+perl@gwu.edu>
------------------------------
Date: Fri, 01 Jun 2001 19:28:20 GMT
From: "Maya" <m.astrakhanskaya@gte.net>
Subject: Re: HTTP::Request GET
Message-Id: <o1SR6.7593$mp4.338464@paloalto-snr1.gtei.net>
Basically, it contains user information selected from the database in which
I have to send to the given URL
this is the part of the code that does the sending:
$XMLReq = new HTTP::Request;
$TheAgent = new LWP::UserAgent;
$BaseURL =
'http://172.27.12.228/IBCMEntitlements/ESNICreateAppAccount.asp?MetaData=';
$Value = '$XML_string';
$XMLReq->method(GET);
$XMLReq->url($BaseURL);
$XMLReq->content('first=$Value');
$Resp = $TheAgent->request($XMLReq);
if ($Resp->is_success)
{ print $Resp->content; }
else
{ print "script failed\n"; }
I am getting this responce :
<?xml version="1.0"?>^M
<?xml-stylesheet type="text/xsl" href="ESNICreateAppAccount.xsl" ?>^M
<Response><Request>CreateAppAccount</Request><Status>Incompete
Request</Status><
/Response>^M
What am I doing wrong?
~
~
<nobull@mail.com> wrote in message news:u97kyww42n.fsf@wcl-l.bham.ac.uk...
> "Maya" <m.astrakhanskaya@gte.net> writes:
>
> > Hi, what is the maximum length of the XML string I can send with a GET
> > method?
>
> Is this XML string to become part of the URL?
>
> AFAIK the Perl LWP, HTTP and CGI modules do not impose any length
> limits on URLs.
>
> Of course other things like web servers may impose a limit but that
> has nothing to do with Perl.
>
> --
> \\ ( )
> . _\\__[oo
> .__/ \\ /\@
> . l___\\
> # ll l\\
> ###LL LL\\
------------------------------
Date: Sat, 2 Jun 2001 01:47:23 +0200
From: "Stefan Weiss" <der.prinz@gmx.net>
Subject: Re: Installing CGI.PM with FTP client
Message-Id: <3b18296a$1@e-post.inode.at>
Shalayla <shalayla@usa.com> wrote:
> Unfortunately, I don't have any kind of terminal (Telnet, SSH, etc.)
> access to my web hosting account. All I have is an FTP client to
> access my CGI-BIN.
>
> Can I still install and use CGI.PM?
>
> How?
CGI.pm is usually bundled with perl, so you should be able to use it
right away. If it's not installed, chances are there's something
wrong with your provider's perl installation, and you should talk to
them about it.
Try to upload a minimal test script that uses CGI.pm, such as
#!/pathto/perl -w
use CGI qw/:cgi/;
print header()."hooray!\n";
and see what happens.
cheers,
stefan
------------------------------
Date: Sat, 2 Jun 2001 00:26:49 +0000 (UTC)
From: see-sig@from.invalid (David Efflandt)
Subject: Re: Installing CGI.PM with FTP client
Message-Id: <slrn9hgcm9.qe1.see-sig@typhoon.xnet.com>
On 1 Jun 2001 13:02:40 -0700, Shalayla <shalayla@usa.com> wrote:
> Unfortunately, I don't have any kind of terminal (Telnet, SSH, etc.)
> access to my web hosting account. All I have is an FTP client to
> access my CGI-BIN.
>
> Can I still install and use CGI.PM?
>
> How?
First, unless your server is Windows, case does matter. It is CGI.pm.
I was on one server where the installed version was so old (2.36) that it
did not have function method.
Since this module is essentially just a script, you can put it anywhere
and point to the full system path of the dir containing it with a use lib
statement before you access it:
use lib '/path_to/mymodules'; # unshifts to @INC during precompile
use CGI; # or whatever if you want functions
Since the use lib puts your path on the front of the @INC search list, it
will look there first before other default paths.
--
David Efflandt (Reply-To is valid) http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
------------------------------
Date: Fri, 01 Jun 2001 17:51:41 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Installing CGI.PM with FTP client
Message-Id: <3B18389D.614D477C@stomp.stomp.tokyo>
Shalayla wrote:
(snipped)
> All I have is an FTP client to access my CGI-BIN.
> Can I still install and use CGI.PM?
Here is a thought for you. You don't need Stein's
CGI.pm module. In almost all cases, you can write
your own code which is very short, very quick and
runs program circles around Stein's module, without
all the problems.
How do you suppose real programmers coded for many
years before CGI.pm came along and became a highly
worshipped Cargo Cult icon?
Godzilla!
------------------------------
Date: 2 Jun 2001 01:38:18 +0200
From: elwood@news.agouros.de (Konstantinos Agouros)
Subject: Re: IPC:Shareable vs mod_perl ipcs not dying
Message-Id: <elwood.991438636@news.agouros.de>
In <sODR6.39270$V6.2039614@typhoon.mn.mediaone.net> "Daniel Berger" <djberg96@hotmail.com> writes:
>"Konstantinos Agouros" <elwood@news.agouros.de> wrote in message
>news:elwood.991164106@news.agouros.de...
>> Hi,
>>
>> I created a small server that shares an array via IPC::Shareable. There
>are
>> two CGI-Scripts called with the mod_perl-Handler from apache that use this
>> array. One of these erases elements from the shared array with something
>> like
>> @SHARED_ARRAY = grep ($_ != $element_to_destroy), @SHARED_ARRAY. This is
>> enclosed by a shlock/shunlock.
>> The whole stuff is working (meaning after the cgi the element is missing),
>> but I see a growing number of shared memory segments and semaphores (I
>take
>> it the tie allocates on of each).
>> At the end of the script I do an untie but I am not really sure that is
>enough.
>> Anybody has an opinion since ipcrm'ing gets a little annoying.
>>
>> Konstantin
>> --
>> Dipl-Inf. Konstantin Agouros aka Elwood Blues. Internet: elwood@agouros.de
>> Otkerstr. 28, 81547 Muenchen, Germany. Tel +49 89 69370185
>> --------------------------------------------------------------------------
>--
>> "Captain, this ship will not sustain the forming of the cosmos." B'Elana
>Torres
>Sorry if this is a re-post. Doesn't look like my first post showed up.
>Anyway, at the end of your program (probably within an END block), do
>IPC::Shareable->clean_up().
Would that destroy all or just the possibly temporary assigned additional
space? The server should keep running and should keep the rest of the array.
Konstantin
--
Dipl-Inf. Konstantin Agouros aka Elwood Blues. Internet: elwood@agouros.de
Otkerstr. 28, 81547 Muenchen, Germany. Tel +49 89 69370185
----------------------------------------------------------------------------
"Captain, this ship will not sustain the forming of the cosmos." B'Elana Torres
------------------------------
Date: Fri, 01 Jun 2001 19:29:41 -0500
From: Dmitry Epstein <mitia.nospam@northwestern.edu.invalid>
Subject: Re: Komodo
Message-Id: <3B183375.3059A22F@northwestern.edu.invalid>
Jerry wrote:
>
> Hello,
> I installed ActivePerl-5.6.1.626-MSWin32-x86-multi-thread.msi
> and
> Komodo-1.0.0-18562.msi and the license file for Komodo. If I start
> Komodo and immediately close it without opening a file my computer shuts
> down correctly. If I start Komodo and open a Perl source file and then
> close Komodo my computer will not shut down correctly even after killing
> mozilla, w9xpopen, and winoldapp. Please help.
> I have uninstalled Komodo and Perl and reinstalled them.
> There are some errors reported in the diagnostic files.
> diagnostic files included below.
> win98 se on a 450 MHz pentium with 384 MB RAM
> Mcafee antivirus, Netscape, acrobat reader, usually running
You should always disable ativirus programs when you install software -
that is perhaps the most common reason for installation problems. Also
shut down all other applications. But I don't know if that's what
caused the problems in your case.
I am running Commodo on Win NT. There were no installation problems,
but it is very sluggish and buggy. I think I'll wait for new versions.
--
Dmitry Epstein
Northwestern University, Evanston, IL. USA
mitia(at)northwestern(dot)edu
------------------------------
Date: Sat, 2 Jun 2001 00:12:09 +0200
From: "Daniel van den Oord" <daniel304@planet.nl>
Subject: Re: parsing an output of httpQ
Message-Id: <9f93qq$7g4c0$1@reader01.wxs.nl>
sorry started on the wrong foot with you !!!
I'm neither a newbie or troll..
The source code is generated on the fly so it isn't exactly a file you can
open.
when you go to the url a page is being send with just that info... I don't
know how I can open to read that... that's the problem... when I'm able to
read it I can create an array and stuff like that by myself...
And yes it took me about 10 months to get this far with that page...
after 3 months I started all over because I thought I could do better then
what I had..
I don't know all the modules of perl also not all the function of it. So I
don't quite know yet what the power of it is... I know what I want to know
for now.. but this piece of information I can't find in either the perl
documents on perl.net or at devdaily.com/perl
"Godzilla!" <godzilla@stomp.stomp.tokyo> schreef in bericht
news:3B180F3E.2F44B4A2@stomp.stomp.tokyo...
> Daniel van den Oord wrote:
>
>
> > scuse me the problem is not splitting this thing up...
>
> Then why did you ask how to create an array?
>
>
> > the problem is to be able to read it...
>
> What problem? Obviously you can read it; you posted
> it here.
>
>
> > because it isn't text that commes from a file but it is
> > generated on demand !!!!
>
> Looks like text to me and, I don't find it quite
> as exciting as you do.
>
>
> > This way I can not treat it as a file and open and read it like one !!!
>
> Reads to me your brains are on the verge of exploding.
>
>
> > I'm not a newbie in cgi/perl.
>
> If you are not a Perl newbie, then you are a troll.
>
>
> > I have my own homepage that is being build up
> > according the used client using 3 or 4 different files
> > (this includes cookies and 2 mysql databases)
>
> Boy Howdy, you are some wingdinger for sure.
> Bet this homepage of yours took years to build.
>
>
> You say you are not a Perl newbie. Why are you not
> using LWP Simple to fetch this song list?
>
> So which are you, Perl newbie or troll?
>
>
> Godzilla!
------------------------------
Date: Fri, 01 Jun 2001 15:53:35 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: parsing an output of httpQ
Message-Id: <3B181CEF.3ECB46F8@stomp.stomp.tokyo>
Daniel van den Oord wrote:
(snipped)
> sorry started on the wrong foot with you !!!
You didn't. You started off with your foot
in your mouth.
> I'm neither a newbie or troll..
Either I have tiny blue monkeys flying out of
my big butt or I am Aphrodite Pandemos.
Godzilla! A Living Legend.
------------------------------
Date: Fri, 1 Jun 2001 16:58:03 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Posting Etiquette
Message-Id: <slrn9hg0er.a05.tadmc@tadmc26.august.net>
nobull@mail.com <nobull@mail.com> wrote:
>"Jürgen Exner" <jurgenex@hotmail.com> writes:
>
>> "Rob" <"relaxedrob@optushome.com.au"> wrote in message
>> news:S0ER6.5468$25.19644@news1.eburwd1.vic.optushome.com.au...
>> > > I did not threaten you.
>> > > What is threatening in the above?
>> > > Do you know what "killfile" means?
>> > >
>> > > >If my style is not acceptable to you, do not reply to my posts.
>> > >
>> > > I (and I expect, many others) will not be seeing any of your posts.
>> > > That is what "killfile" means.
>> >
>> > That is what 'threat' means.
>>
>> Excuse me???
>
>He's abolutely right you know.
I don't think so.
>The statement "if you alienate me I'm
>not listen to your requests for help you in future" _is_ a threat.
Sure it is. But I didn't do anything like that. There was no "if"
or "warning" in what I said:
...from becoming killfile entries, as you have.
^^^^^^^^^^^
The definitions at dictionary.com all have some aspect of "future"
in them.
I did not mention killfiling in the future. I mentioned killfiling
in the past. It was a fait accompli.
He was killfiled before I mentioned anything about killfiling.
>> Do you seriously demand that everyone must listen to your poor manners?
>
>No, he appears to demand that he should be killfiled _without_
>_warning_.
That is what I did.
I did not give an opportunity to avoid (warn) becoming killfiled.
>It's not the sanction that he objects to, it is the
>warning that he objects to.
As there was no warning in what he objected to, that can't be it...
Perhaps it was the public announcement that he objected to?
>Where do we find these trolls?
Seems that they find us.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 1 Jun 2001 17:32:51 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Posting Etiquette
Message-Id: <slrn9hg2g2.a05.tadmc@tadmc26.august.net>
Chris Stith <mischief@velma.motion.net> wrote:
>nobull@mail.com wrote:
>> Where do we find these trolls?
>
>For once, nobull, I actually disagree with you, and this is fairly
>rare. I don't think Rob is a troll, and I think calling him such
>is a bit of an overstatement.
His insistence on redefining the term "threat" makes him one
in my book. I did not threaten him. I took a sanction against
him, but there was no threat or ultimatum, only a statement
of what has already occured.
>Why do we (yes, "we" -- I've been known to do it too)
>publicly announce killfiling people on such a regular basis?
The reason for my followup to Rob was so that he could avoid
landing in _other_ people's killfiles without knowing the
consequences of his decision to warp the flow of time.
He is certainly free to choose his own quoting style. I just got
the impression that he did not have enough information to weigh
the pros and cons of the choice, so I provided the info that
folks get killfiled for Jeopardy quoting.
>I mean,
>if someone has been so blatantly rude that they deserve a slap in
>the face along with being ignored, that's one thing. Often, though,
>people get a public *plonk* for things which seem a trifle.
^^^^^^^^^^^^^
And how will the uninitiated *know* that such trifles earn
killfile entries?
Since they seem trifling, they are unlikely to divine that the
readership of all of their future articles will be diminished
as a result.
Telling them (or *much* more importantly, telling the lurkers) which
particular (seeming) trifles will "cost them" allows them to
make an informed decision.
>he did alter his quoting style
>to match the preference of the group.
Since I don't see his writings, I did not know that. :-)
But once you go in, you don't come out. Yet another reason for
public plonk announcements. Getting clued the day after becoming
killfiled is too late to avoid it.
>That should be good for
>something.
It would have been even better if the style switch had happened
before passing through the one-way check valve on the killfile though.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 01 Jun 2001 23:04:54 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: reading records which *start* with some constant string
Message-Id: <thg7sm2v5e48f6@corp.supernews.com>
Timur Shtatland (timur@lbri.lionbioscience.com) wrote:
: I have a large file from which consists entirely of records which all
: start (rather than end) with some constant string, for example
: "some_header". I would like to read and process all records. The best
: solution I came up with seems too clumsy, because it uses the string
: as input record separator ($/), then strips this string from the end
: and adds it to the beginning of each record:
:
: cat file | perl -ne 'BEGIN{$/="some_header"} s|$/||; next unless $_;
: $_ = $/ . $_; process_record($_)'
:
: Is there a way to make it less ugly? Thank you!
If your file will fit comfortably in memory, I'd suggest
cat file | perl -0777ne 'print "#$_#" foreach split /(?=some_header)/'
(with my demo print call replaced with your file processor call, of
course.)
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "God becomes as we are that we may be as he is."
| - William Blake
------------------------------
Date: Sat, 2 Jun 2001 02:59:49 +0200
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: Rounding
Message-Id: <9f9dvb$30htf$1@ID-13368.news.dfncis.de>
"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> schrieb im
Newsbeitrag news:9f7gbb$1v$1@mamenchi.zrz.TU-Berlin.DE...
>
> In particular, they don't bear out your suggestion that printf
> variously uses rounding and truncation. It doesn't. Detailed
> explanations and pointers to the pertinent FAQ appear elsewhere
> in this thread.
>
The rounding behavior of Perls printf is inherited from Cs printf.
AFAIK this rounding behavior is not specified in the C language
specification. In C99 (the current ISO C standard) you fill find the
following sentence in the description of the f and e conversion
specifiers of fprintf: "The value is rounded to the appropriate number
of digits." Please note the difference to many other places in C99
where a "correctly rounded result" is required. This term has the
following specific meaning:
a representation in the result format that is nearest in
value, subject to the effective rounding mode, to what the
result would be given unlimited range and precision
However C99 specifies a family of round() functions as follows:
the round functions round their argument to the nearest
integer value in floating-point format, rounding halfway
cases away from zero, regardless of the current rounding
direction.
Some C runtime libraries use "round to nearest even" (Un*x and its
relatives) and some use "round away from zero" (Microsoft) as the
default rounding mode in the printf functions.
Therefore you get different rounding behavior depending on the C
runtime library in use. This is a portability problem. And this is the
reason why Perl should have a builtin round() function similar to the
ones required in C99.
You need to use numbers exactly representable in binary floating-point
to make the difference evident. The following example will indeed
print different results on Un*x like systems and on Win32 systems
using the MS C library:
for my $i (0.125, 0.375, 0.625, 0.875, 1.125, 1.375) {
printf("%.17f %.2f\n", $i, $i);
}
My current recommendation is to use the Math::Round module from CPAN
to round numbers in Perl (if you don't care about the binary
floating-point anomalies) or to use the Math::BigFloat module which
lets you specify the desired rounding mode.
Maybe something like:
use Math::BigFloat;
sub round_big_float {
my $number = shift;
my $digits = shift;
if (substr($number,0,1) eq "-") {
$Math::BigFloat::rnd_mode = "-inf";
} else {
$Math::BigFloat::rnd_mode = "+inf";
}
my $result = Math::BigFloat::ffround($number, -$digits);
$result = Math::BigFloat->new($result);
return $result;
}
------------------------------
Date: Fri, 01 Jun 2001 19:12:34 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Stepping through with tr///
Message-Id: <ma6ghtc9esm17l9cmrmk5pqki075hved7i@4ax.com>
consider:
my $j = "5888 2668437 7375 422537," ;
$j =~ tr [22233344455566677788899900]
[abcdefghiJklmnoPqrstuvwxyz] ;
print "$j\n" ;
which produces:
Jsss ammsgdP PdPJ gaaJdP,
some of you may have guessed the output desired is:
Just another Perl hacker,
What would you do to "step through*" the transliteration above to get
the desired results?
*the way you step through letters on a phone keypad from whence the
tr/// is derived?
PS-I also couldn't come up with a good way to make characters 1 & 12
capital (I'm thinking perldoc -f split... but perldoc disagrees)
--
BSOD? In my day we didn't have 0000FF!
lmoran@wtsg.com
------------------------------
Date: Fri, 1 Jun 2001 19:52:51 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Stepping through with tr///
Message-Id: <slrn9hgamj.a4u.tadmc@tadmc26.august.net>
Lou Moran <lmoran@wtsg.com> wrote:
>consider:
>
>my $j = "5888 2668437 7375 422537," ;
>$j =~ tr [22233344455566677788899900]
> [abcdefghiJklmnoPqrstuvwxyz] ;
>print "$j\n" ;
>
>which produces:
>
>Jsss ammsgdP PdPJ gaaJdP,
The same as using an equivalent tr/// without all the redundant
stuff (that gets ignored anyway):
$j =~ tr [234567890]
[adgJmPsvy] ;
>some of you may have guessed the output desired is:
>
>Just another Perl hacker,
I would never have guessed that, as it is obvious (if you know
what tr/// does) that the 2nd, 3rd and 4th characters must be
the same character, because they are all an "8" originally.
>What would you do to "step through*" the transliteration above to get
>the desired results?
I wouldn't be able to step through, as it is impossible.
tr/// ain't gonna get that job done.
>*the way you step through letters on a phone keypad from whence the
>tr/// is derived?
The mapping from letter->number is one-to-one. No problem.
The mapping from number->letter is one-to-three. Problem.
How are you to decide which of the 3 it should be?
Generate all possible combinations?
Then how do you decide which combination it should be?
Phone dial encoding only works well in one direction.
You could encode each letter as _two_ digits: first is keypad
number, second is 1|2|3 indicating which of the 3 letters:
----------------------------
#!/usr/bin/perl -w
use strict;
my $j = "51838182 21626382423273 71327353 422123523273," ;
my %decoder = (
2 => [qw/a b c/],
3 => [qw/d e f/],
4 => [qw/g h i/],
5 => [qw/J k l/],
6 => [qw/m n o/],
7 => [qw/P q r/],
8 => [qw/s t u/],
9 => [qw/v w x/],
0 => [qw/y z/],
);
$j =~ s/(\d)(\d)/$decoder{$1}[$2-1]/g;
print "$j\n" ;
----------------------------
But that is not satisfyingly obfuscated...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 01 Jun 2001 18:45:06 -0400
From: llizard <llizard_ejm@yaSPITOUTTHATGUMhoo.com>
Subject: Re: vestale.pl ascii animation
Message-Id: <j35ght0b0sfdjbh20f9hfihomu3sf0vc1b@4ax.com>
In article <3b168ff7.22981689@news.onemain.com>, shedragon@lycos.com
(ldb) wrote:
>On 31 May 2001 08:06:07 -0700, alain_s75@hotmail.com (Alain) wrote:
>
>>One more time
>>(we gone celebrate)
>>alain_s75@hotmail.com (Alain) wrote in message news:<329469e4.0105300339.65010060@posting.google.com>...
>>> Trying again ...
>>>
>>> alain_s75@hotmail.com (Alain) wrote in message news:<329469e4.0105250016.56b597eb@posting.google.com>...
>>> > Hello all,
>>> >
>>> > I am looking for an ascii animation that was posted here around 94/95,
>>> > it was in the form of a simple VT file and of a self compressed 3 or 4
>>> > pages perl program.
>>> > The title of the animation was "vestale sous contraintes, exercice
>>> > ludique en courier 10", and the name of the perl program "vestale.pl".
>>> > I am the author of it and somehow I lost the files in the mess of my
>>> > disks !!!
>>> >
>>> > If someone still has it, I would really be greatful if they could
>>> > forward it to me.
>>> > Thanks in advance.
>>> > alain_s75@hotmail.com
>
>We're reading your message. No one is answering because no one seems
>to have an answer.
>
Alain, like you, I did a search in Google archives
http://groups.google.com/advanced_group_search?q=&hl=en&lr=&safe=off
and used the keywords "ascii animation vestale". As you know, there is
a thread dated sometime in 1996 entitled "vestale.vt.z, part 1/1" It
looks like the file was in the uuencoded part that has been deleted.
However, perhaps you can find something or someone from those messages
to retrieve the actual file. Sadly, 1995 is considered to be eons ago
in computer terms. Sorry to hear that you lost the file. I feel your
pain. (Somewhere in the cybersmoke that was created a couple of years
ago when our computer harddrive suddenly and inexplicably packed in,
there was a newly created (foolishly unbacked up) javascript
ascii-animation of skiers climbing a hill and skiing downhill - I
never had the heart to recreate it.)
obascii-art: when I saw this, it reminded me of the catch phrase "Save
Early; Save Often"
____________________ _____________
| | | || ||
| | _ | || ||
|------| | `-._|\ || ||
| | | \ ||___________||
| | | _ / | _______ |
|------|------.---|_.-' |/ | | __ | |
| | | | | | |__|| |
|______|______|______| '--|_______|--' Bateau
-llizard
--
___ llizard aka ejm llizard@idirec+.ca
_/ | ,^%---
|_____| __<_ \ Thanks, Bateau, for the disc.
--- == >/
[_____] __>,^
ejm| | //| | http://llizard.crosswinds.net/ascii-art/
NOTE: I never pick up my mail from the yahoo address. If you
are e-mailing and hit the reply button, add an "e" to "idirct";
its absence is to stop the torment of automatic mailers.
------------------------------
Date: Fri, 1 Jun 2001 17:01:22 -0700
From: "cadfei" <cadmcse@hotmail.com>
Subject: Re: Why this substitution doesn't work?
Message-Id: <9f99tv$dda$1@taliesin.netcom.net.uk>
Oh!~ I see, thanks for instruction again.
I have another little problem is to remove the whole line contain $ARGV[0]
($ARGV[0] is user input argument),
I am witing this but looks not useful,, is that becuase line contain \t
,therefore
doesn't work?
while(<IN>){
if(s/.*\$ARGV[0]\s.*//){
chomp;
}
print;
}
"John W. Krahn" <krahnj@acm.org> wrote in message ;
> Perl reads the character sequence '$[' as the special variable $[ and
> interpolates it so you have to escape the dollar sign. Next the regex
> engine sees [po] and interprets it as a character class so you have to
> escape the '[' to get a literal [ character.
>
> s/(\S+) \$\[po]/\$[po]/;
>
>
------------------------------
Date: Sat, 02 Jun 2001 00:28:44 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Why this substitution doesn't work?
Message-Id: <3B18335F.84433BCF@acm.org>
cadfei wrote:
>
> Oh!~ I see, thanks for instruction again.
>
> I have another little problem is to remove the whole line contain $ARGV[0]
> ($ARGV[0] is user input argument),
>
> I am witing this but looks not useful,, is that becuase line contain \t
> ,therefore
> doesn't work?
>
> while(<IN>){
> if(s/.*\$ARGV[0]\s.*//){
> chomp;
> }
> print;
> }
Try experimenting with the qr// operator to see how Perl interprets your
regular expressions.
my $regex = qr/.*\$ARGV[0]\s.*/;
print "$regex\n";
Also have a look at the quotemeta funtion
perldoc -f quotemeta
John
--
use Perl;
program
fulfillment
------------------------------
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.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 1040
***************************************