[19357] in Perl-Users-Digest
Perl-Users Digest, Issue: 1552 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 17 14:10:31 2001
Date: Fri, 17 Aug 2001 11:10:13 -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: <998071813-v10-i1552@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 17 Aug 2001 Volume: 10 Number: 1552
Today's topics:
Re: Perl OO needs the opposite of SUPER:: (John Lin)
Re: Perl OO needs the opposite of SUPER:: <comdog@panix.com>
perl with IIS: session.sessionID-object <noone@nowhere.com>
Perl-CGI Latency, from shell executes immediately (Rhugga)
Re: Processing a scalar in the same way of a filehandle (Anno Siegel)
Re: Processing a scalar in the same way of a filehandle <bart.lateur@skynet.be>
Re: Processing a scalar in the same way of a filehandle (Anno Siegel)
Re: Processing a scalar in the same way of a filehandle <bart.lateur@skynet.be>
Re: Processing a scalar in the same way of a filehandle (Anno Siegel)
Re: regexp question with no answer yet (Anno Siegel)
Re: regexp question with no answer yet <lbrtchx@hotmail.com>
Searching Text File tazjrg2
Re: Using manpages?? <miscellaneousemail@yahoo.com>
Re: Using manpages?? <miscellaneousemail@yahoo.com>
Re: Using manpages?? (Tad McClellan)
Re: Using manpages?? (Tad McClellan)
Re: what does this message mean? <mjcarman@home.com>
Re: what does this message mean? (Tad McClellan)
Re: what does this message mean? <Tassilo.Parseval@post.rwth-aachen.de>
Re: what does this message mean? (Anno Siegel)
XML Encoding (Wes Spears)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 Aug 2001 08:35:01 -0700
From: johnlin@chttl.com.tw (John Lin)
Subject: Re: Perl OO needs the opposite of SUPER::
Message-Id: <a73bcad1.0108170735.77d7f3e5@posting.google.com>
Let me show the problem I encountered in real case. (Simplified, of course.)
=================================================================== original
package Report;
sub new { # $self->new(1,5,2,6,4); input a list of numbers
my $self = shift;
bless \@_,ref($self)||$self;
}
sub gen {
my $self = shift;
print "Now generating report for ",ref($self),"(@$self)\n";
$self->report;
print "Done, hope you will like it.\n";
}
sub report {return} # please inherit to override
package EvenReport;
our @ISA = Report;
sub report {
my $self = shift;
my $count = grep {$_%2 == 0} @$self;
print "There are $count even numbers.\n";
}
package OddReport;
our @ISA = Report;
sub report {
my $self = shift;
my $count = grep {$_%2} @$self;
print "There are $count odd numbers.\n";
}
package main;
EvenReport->new(1,5,2,6,4)->gen;
OddReport->new(5,6,1,4,2)->gen;
__END__
Now generating report for EvenReport(1 5 2 6 4)
There are 3 even numbers.
Done, hope you will like it.
Now generating report for OddReport(5 6 1 4 2)
There are 2 odd numbers.
Done, hope you will like it.
=================================================================== original
Originally, the inheritance structure is:
Report <- EvenReport
Report <- OddReport
The base class "Report" provides a slot "sub report" for inheritor-class
to override. Users call new() then gen() to generate a report.
Now I want to extend the Report class by inserting a middle layer.
Report <- ExtendedReport <- EvenReport
Report <- ExtendedReport <- OddReport
================================================================== extending
package Report;
sub new { # $self->new(1,5,2,6,4); input a list of numbers
my $self = shift;
bless \@_,ref($self)||$self;
}
sub gen {
my $self = shift;
print "Now generating report for ",ref($self),"(@$self)\n";
$self->report;
print "Done, hope you will like it.\n";
}
sub report {return} # please inherit to override
package ExtendedReport;
our @ISA = Report;
sub report {
my $self = shift;
print "NOTE: every report will add element counting.\n";
$self->_report;
print "There are @{[scalar @$self]} elements.\n";
}
package EvenReport;
our @ISA = ExtendedReport;
sub _report {
my $self = shift;
my $count = grep {$_%2 == 0} @$self;
print "There are $count even numbers.\n";
}
package OddReport;
our @ISA = ExtendedReport;
sub _report {
my $self = shift;
my $count = grep {$_%2} @$self;
print "There are $count odd numbers.\n";
}
package main;
EvenReport->new(1,5,2,6,4)->gen;
OddReport->new(5,6,1,4,2)->gen;
__END__
Now generating report for EvenReport(1 5 2 6 4)
NOTE: every report will add element counting.
There are 3 even numbers.
There are 5 elements.
Done, hope you will like it.
Now generating report for OddReport(5 6 1 4 2)
NOTE: every report will add element counting.
There are 2 odd numbers.
There are 5 elements.
Done, hope you will like it.
================================================================== extending
Now ExtendedReport inherits Report and tries to change the behavior of
"sub report", so it must be named "sub ExtendedReport::report".
But "ExtendedReport::report" will not be called at all
because "OddReport::report" (or "EvenReport::report") exists.
To solve the problem, I have to rename all the inheritor-class's "sub report"
into "sub _report". Otherwise I have to re-write the base class Report.
Both solutions are not good OO. Ideally, when I insert a middle layer,
the only thing I have to do is re-directing the inheritance link @ISA.
How would you solve this problem?
No matter the OddReport ISA Report or ISA Extended report, its method should
always be "sub report" instead of "report" today and "_report" tomorrow.
Thank you.
John Lin
------------------------------
Date: Fri, 17 Aug 2001 11:57:36 -0400
From: brian d foy <comdog@panix.com>
Subject: Re: Perl OO needs the opposite of SUPER::
Message-Id: <comdog-26D70B.11573617082001@news.panix.com>
In article <a73bcad1.0108170735.77d7f3e5@posting.google.com>,
johnlin@chttl.com.tw (John Lin) wrote:
> Now ExtendedReport inherits Report and tries to change the behavior of
> "sub report", so it must be named "sub ExtendedReport::report".
> But "ExtendedReport::report" will not be called at all
> because "OddReport::report" (or "EvenReport::report") exists.
> To solve the problem, I have to rename all the inheritor-class's "sub report"
> into "sub _report". Otherwise I have to re-write the base class Report.
> Both solutions are not good OO. Ideally, when I insert a middle layer,
> the only thing I have to do is re-directing the inheritance link @ISA.
>
> How would you solve this problem?
i would re-think the design so that classes further up the
@ISA tree don't have to know about classes further down. it
sounds like you're painting yourself into a corner with the
false requirement that the Base class should call methods in
the Derived class. take a step back and see what else you
can come up with.
--
brian d foy <comdog@panix.com>
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html
------------------------------
Date: Fri, 17 Aug 2001 18:36:09 +0200
From: "Rupert M. Hölzl" <noone@nowhere.com>
Subject: perl with IIS: session.sessionID-object
Message-Id: <9ljh4o$951$01$2@news.t-online.com>
hi!
i have the following problem: our company is developing primarily in ASP.
but in our current project we have to merge an ASP page with some perl
scripts (sounds dumb i know, but our customer wants it that way).
therefore i have set up a perl interpreter (activePerl) on our IIS. now my
problem: in our ASP scripts we use the Session.SessionID-object for
authentication, and want to do this in the perl scripts as well.
but how can i get the current IIS-sessionID in a perl program?
i searched the internet a long time, but all i found was tips on using
perlscript in ASP, but this is no option because the perl-scripts are
already finished, and our customer does not want us to change them
significantly.
have you got any tips?
thanks in advance!
Rupert Hoelzl,
Freudenberg IT KG
------------------------------
Date: Fri, 17 Aug 2001 16:55:17 GMT
From: chuckc@clinicomp.com (Rhugga)
Subject: Perl-CGI Latency, from shell executes immediately
Message-Id: <3b7d4b5c.140685104@news.qwest.net>
I have some simple CGI scripts that executer rsh commands to several
remote servers and grab information. Fromt he command line the script
completes in about 10-30 seconds. When executed from a browser, it
takes 5-10 minutes. No apparent reason, nothing is logged, I am at a
loss. I orignally had these scripts written in bash shell but have
since written them in Perl in a lack for other troubleshooting ideas.
I have tried Apache 1.3.20 and have now reverted back to 1.3.19.
./httpd -l
Compiled-in modules:
http_core.c
mod_env.c
mod_log_config.c
mod_mime.c
mod_negotiation.c
mod_status.c
mod_info.c
mod_include.c
mod_autoindex.c
mod_dir.c
mod_cgi.c
mod_asis.c
mod_imap.c
mod_actions.c
mod_userdir.c
mod_alias.c
mod_access.c
mod_auth.c
mod_so.c
mod_setenvif.c
mod_ssl.c
mod_php4.c
suexec: disabled; invalid wrapper /usr/local/apache/bin/suexec
The script is a little garbled now in my attempt to troubleshoot this,
I have been playing with the http-equiv="refresh" tag.
Here is the script:
$| = 1;
$grep = '/usr/bin/grep';
$cat = '/bin/cat';
$awk = '/usr/bin/awk';
$hostfile = '/etc/hosts';
$hostcmd = "$cat $hostfile | $grep -v '#' | $grep 'hosp' | $awk
'{print \$2}'";
my @HOSTS = `$hostcmd`;
<HTML output removed>
my $index = 1;
foreach $host (@HOSTS) {
# if (($index % 5) == 0) {
# print STDOUT "<META http-equiv=\"refresh\">";
# }
chomp($host);
$rshcmd = "rsh -l cci $host uname -R";
$versions = `$rshcmd`;
chomp($versions);
@version = split(/\s+/, $versions);
printf "%-10s %-8s\n", $host, $version[1];
$index++;
}
<HTML output removed>
exit 0;
------------------------------
Date: 17 Aug 2001 15:14:03 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Processing a scalar in the same way of a filehandle
Message-Id: <9ljcbr$c4g$1@mamenchi.zrz.TU-Berlin.DE>
According to Bart Lateur <bart.lateur@skynet.be>:
> Miguel Manso wrote:
>
> >I've a scalar with a bunch of text. I'd like to process it on the
> >"paragraph" way. It I has a filehandle, I would do this:
> >
> >$/ = "";
> >while(<FH>) {
> > my $p = $_;
> >}
> >
> >perl is wonderful :)
> >
> >Now, I've $cnt and I'd like to be able to do the same thing. Is it possible?
>
> In principle, yes. The TIEHANDLE mechanism allows you to do this. And
> you don't even have to roll your own, as IO::Scalar (see IO::Stringy on
> CPAN) provides several interfaces.
>
> But it looks like a hard module to use, I couldn't make this work right
> in under a few minutes.
The code below works for recent Perls. It also shows that $/ is *not*
respected by IO::Scalar, so this is no solution to the OP's problem.
(I haven't looked if there is another way of specifying paragraph mode.)
Anno
use IO::Scalar;
my $SH = IO::Scalar->new_tie( \ <<EOF);
some lines
of text.
two paragraphs
in all
EOF
my $para_count;
{ local $/ = ''; $para_count++ while <$SH> }
print "count: $para_count\n";
------------------------------
Date: Fri, 17 Aug 2001 15:22:21 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Processing a scalar in the same way of a filehandle
Message-Id: <thdqnt019us3duamv7pkqan9tjo16ruc0u@4ax.com>
Anno Siegel wrote:
> It also shows that $/ is *not*
>respected by IO::Scalar, so this is no solution to the OP's problem.
>(I haven't looked if there is another way of specifying paragraph mode.)
From the docs that come with IO::Scalar:
$SH->use_RS(1); ### perlvar's short name for $/
Oh damned. It's that simple. You have to ACTIVATE it first. If you
insert this line after creating $SH and before reading any data from it,
it works. At least, your test script then says:
count: 2
--
Bart.
------------------------------
Date: 17 Aug 2001 15:50:33 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Processing a scalar in the same way of a filehandle
Message-Id: <9ljeg9$dk6$1@mamenchi.zrz.TU-Berlin.DE>
According to Bart Lateur <bart.lateur@skynet.be>:
> Anno Siegel wrote:
>
> > It also shows that $/ is *not*
> >respected by IO::Scalar, so this is no solution to the OP's problem.
> >(I haven't looked if there is another way of specifying paragraph mode.)
>
> From the docs that come with IO::Scalar:
>
> $SH->use_RS(1); ### perlvar's short name for $/
Well, mine (V 1.119) didn't say so. After upgrading to 2.104, it
still doesn't say so, instead:
"use_RS is deprecated and ignored; $/ is always consulted..."
> Oh damned. It's that simple. You have to ACTIVATE it first. If you
No more. IO::Scalar seems to be a fast-moving target :)
> insert this line after creating $SH and before reading any data from it,
> it works. At least, your test script then says:
>
> count: 2
...as it does now without that line. Conclusion: IO::Scalar is indeed a
solution (if perhaps overkill) to the original problem, as it should.
Anno
------------------------------
Date: Fri, 17 Aug 2001 17:41:06 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Processing a scalar in the same way of a filehandle
Message-Id: <3plqnt0nor4bg44qto31s0cd99gqgj88si@4ax.com>
Anno Siegel wrote:
>> Oh damned. It's that simple. You have to ACTIVATE it first.
>
>No more. IO::Scalar seems to be a fast-moving target :)
My version came from CPAN this afternoon. It can't be moving THAT
fast... Uh... version is 1.126?!? What is going on?!?
--
Bart.
------------------------------
Date: 17 Aug 2001 17:59:16 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Processing a scalar in the same way of a filehandle
Message-Id: <9ljm1k$j75$2@mamenchi.zrz.TU-Berlin.DE>
According to Bart Lateur <bart.lateur@skynet.be>:
> Anno Siegel wrote:
>
> >> Oh damned. It's that simple. You have to ACTIVATE it first.
> >
> >No more. IO::Scalar seems to be a fast-moving target :)
>
> My version came from CPAN this afternoon. It can't be moving THAT
> fast... Uh... version is 1.126?!? What is going on?!?
Got my 2.104 from ftp://ftp.uni-hamburg.de/pub/soft/lang/perl/CPAN/
also this afternoon (and with a .be account your afternoon would be
my afternoon).
Anno
------------------------------
Date: 17 Aug 2001 16:32:02 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: regexp question with no answer yet
Message-Id: <9ljgu2$g78$1@mamenchi.zrz.TU-Berlin.DE>
According to Albretch <lbrtchx@hotmail.com>:
> I have been searching for an answer to the following problem:
>
> Knowing all possible outputs given a regexp and the maximal length of the
> string results.
Many regexes don't have a maximal length they can match, the most common
example being /.*/.
> I am concretely thingking about a method call that would expand into an
> array of possible strings of charaters.
I don't see why it would have to be a method.
> It could be mathematically demostrated that given the possible maximal
> length of the result strings, there is a finite number of them.
> Intuition could be squarely wrong, but I have the very strong feeling that
Of course there are only finitely many strings of a given length.
> there should be something like that. Well, maybe I am getting to these
> issues from another perspective and I am wishfully thinking (and lazyly
> wanting :-), for there to be something like that.
If you *have* a maximal length, the solution is trivial: Generate
all strings of that or smaller length and apply the regex. Print
if match. Now, to do so efficiently...
Anno
------------------------------
Date: Fri, 17 Aug 2001 13:54:21 -0400
From: "Albretch" <lbrtchx@hotmail.com>
Subject: Re: regexp question with no answer yet
Message-Id: <998071752.773763@zver>
> If you *have* a maximal length, the solution is trivial: Generate
> all strings of that or smaller length and apply the regex. Print
> if match. Now, to do so efficiently...
_ We both know this is the "monkey way" and an incredible and irrealistic
waste. I wasn't asking for that.
Matter of factly, I found the reverse of what I am looking for
http://www.netch.se/~hakank/makeregex/
So my need is not such an "odd" one.
So, again given a regexp and the possible maximal lenght of the result
strings, how could you expand all the possible "plain (no metacharacters)"
Strings?
------------------------------
Date: 17 Aug 2001 10:35:09 -0500
From: tazjrg2
Subject: Searching Text File
Message-Id: <86eqntk1dhhtf0vjpajdgf30pm4n65b3pp@4ax.com>
I am trying to search a Text File using PERL.
The text file is a common Compaq File called SURVEY.TXT. It has a
setup like this:
========================
Operating System ....................(+) Microsoft Windows NT Server
4.0
(build 1381) Service Pack 6
(-) Microsoft Windows NT Server
4.0
(build 1381) Service Pack 1
EISA Configured Primary OS ............ Windows NT 4.0
========================
I currently have a subroutine that works great, but is limited. The
current code:
========================
@startstring = ("Operating System");
@startlength = (41);
@stoplength = (36);
$long = @startstring;
sub chkfile {
print OUTFILE "$srvrname;";
$srvrfile = "\\\\$srvrname\\c$\\compaq\\survey\\survey.txt";
open( fileinput1, "$srvrfile" ) || warn "Unable to open input
file $srvrfile";
@infile = ( <fileinput1> );
close( fileinput1 );
for ($loop = 0; $loop < $long; $loop++) {
$flag = "init";
foreach $line (@infile) {
if ($line =~ /^$startstring[$loop]/) {
$flag = "begin";
}
if ($flag eq "init") {
next;
}
if ($flag eq "end") {
next;
}
elsif ($flag eq "begin") {
$getvalue = substr($line,
$startlength[$loop], $stoplength[$loop]);
chomp($getvalue);
print OUTFILE "$getvalue;";
$flag = "init";
next;
}
}
}
print OUTFILE "\n";
}
==========================
The problem is, what this returns to me is "Microsoft Windows NT
Server 4.0 " - IT DOES NOT READ the next lines of the file.
Does anyone know how I could modify this so that it would take all of
the information, "Microsoft Windows NT Server 4.0 (build 1381)
Service Pack 6"??
Any Help is greatly appreciated!
Thanks!
--Jim
------------------------------
Date: Fri, 17 Aug 2001 15:46:18 GMT
From: Carlos C. Gonzalez <miscellaneousemail@yahoo.com>
Subject: Re: Using manpages??
Message-Id: <MPG.15e6ea51829e530a989778@news.edmonton.telusplanet.net>
In article <slrn9nq10q.a9h.tadmc@tadmc26.august.net>, Tad McClellan at
tadmc@augustmail.com says...
> Power has its price.
I am just now beginning to understand this statement.
> If it was easy, anyone could do it and they wouldn't have to pay us
> the big bucks :-)
I like that. I am beginning to realize that learning to program in Perl
might be good for me financially and not just as a great thing to do for
my web site. I had been under the assumption that since Perl was free
and that there were suppossedly so many people who knew how to use it
that the average pay for a Perl programmer would be pretty low. I think
I am seeing a bigger picture as I mentioned on another post.
It would seem that the more Perl is promoted the more work there will be
for those who survive the learning curve. Work that in part comes from
those who give it up but want the benefits.
Another reason for more work possibly resulting from more Perl promotion
is that few people are likely to have the time to learn things as one
MUST learn them. As a result many people might dabble into Perl but
never become Perl masters.
---
Carlos
www.internetsuccess.ca
*NOTE*: Internet Success is NOT yet fully operational so although you are
welcomed to visit and take a look, trying to subscribe will only be a
frustration for you as your data will not be saved at this time.
------------------------------
Date: Fri, 17 Aug 2001 15:59:26 GMT
From: Carlos C. Gonzalez <miscellaneousemail@yahoo.com>
Subject: Re: Using manpages??
Message-Id: <MPG.15e6ed257917f5e989779@news.edmonton.telusplanet.net>
In article <3B7D188C.E9D5649A@home.com>, Michael Carman at
mjcarman@home.com says...
> Carlos, you've been doing pretty well at fitting in here. Don't let
> Godzilla lead you down the path of darkness. She's a troll. While there
> is on rare occasions something of value in her postings, it is not
> (IMHO) worth wading through the plethora of crap she produces. You would
> do well to ignore her.
Thanks Michael. I had pretty much figured on that. I guess this is my
first personal experience with a troll (a term I first learned about at
www.grc.com where trolls seem to frequent) and in responding like I
normally do I wrongly thought I could reason somewhat with Godzilla. I
don't understand what would drive such a person to come at me with a
battering ram of speech. I mean what purpose does it serve other than to
rile people up?
Oh well. I am learning. Godzilla has indeed helped me to get thicker in
the skin and for that I am thankful to him (her?). Just a few weeks ago
I left this newsgroup when someone came at me. Not any more. I can't
let folks like Godzilla trap me into useless arguments or discourage me.
Your right about that. This is all well and good since I must learn this
lesson well if my newsletter is to become a great success. I can't let
unwarranted personal attacks get me off track.
---
Carlos
www.internetsuccess.ca
*NOTE*: Internet Success is NOT yet fully operational so although you are
welcomed to visit and take a look, trying to subscribe will only be a
frustration for you as your data will not be saved at this time.
------------------------------
Date: Fri, 17 Aug 2001 11:53:56 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Using manpages??
Message-Id: <slrn9nqfgk.avo.tadmc@tadmc26.august.net>
Carlos C. Gonzalez <miscellaneousemail@yahoo.com> wrote:
>I mean what purpose does it serve other than to
>rile people up?
^^^^^^^^^^^^^^
That is what a troll's purpose _is_, to get a rise out of folks.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 17 Aug 2001 11:58:51 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Using manpages??
Message-Id: <slrn9nqfpr.avo.tadmc@tadmc26.august.net>
Carlos C. Gonzalez <miscellaneousemail@yahoo.com> wrote:
>In article <slrn9nq10q.a9h.tadmc@tadmc26.august.net>, Tad McClellan at
>tadmc@augustmail.com says...
>
>> Power has its price.
>
>I am just now beginning to understand this statement.
>
>> If it was easy, anyone could do it and they wouldn't have to pay us
>> the big bucks :-)
>
>I like that. I am beginning to realize that learning to program in Perl
>might be good for me financially and not just as a great thing to do for
>my web site. I had been under the assumption that since Perl was free
>and that there were suppossedly so many people who knew how to use it
>that the average pay for a Perl programmer would be pretty low.
A few (3, I think) years ago there was a survey that showed
2/3 of Perl programmers charging in the $40-90/hour range.
See also:
http://www.realrates.com
Janet has even posted in clpmisc a couple of times, if I remember correctly.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 17 Aug 2001 10:13:57 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: what does this message mean?
Message-Id: <3B7D34B5.BBE3DEF7@home.com>
Samneric wrote:
>
> Tassilo von Parseval wrote:
> > Samneric wrote:
> >
> > > The module docs say: use lib LIST
> > > Not: use lib SCALAR
> >
> > But this can't be the reason.
> >
> > And I am very positive that I often write:
> >
> > use lib "..";
> > with no obvious misfunction.
>
> Guess I should have read more closely the error that meow
> reported, which shows that perl found IO::Tty.pm (so lib isn't
> the problem):
Correct.
> > Can't locate loadable object for module IO::Tty in @INC
> > (@INC contains: /$path1 /$path2 $path3 .)
> > at /$path1/Tty.pm line 26
>
> IO::Tty.pm uses these modules:
> use IO::Handle;
> use IO::File;
>
> Maybe they aren't installed?...
It's good that you want to help, Samneric, but please, *don't
speculate*. If IO::File wasn't installed, perl would have said that it
couldn't find IO::File.
-mjc
------------------------------
Date: Fri, 17 Aug 2001 12:02:29 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: what does this message mean?
Message-Id: <slrn9nqg0l.avo.tadmc@tadmc26.august.net>
Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de> wrote:
>Anno Siegel wrote:
>
>> DWIM is Perl's "Do What I Mean", which is the work of the DWIMmer in the
>> Perl core :)
>
>Ah, thanks! Perl's doing that all the time in my scripts. :-)
>
>> As I said in a direct followup, I am likewise not sure what Tad is
>> kvetching about. In my view, the same mild DWIMery takes place in both
>> "use lib $x" and "print $x": a single scalar works like a one-element
>> list.
>
>Yes. Yet, there might be some super-subtlety on the inside of Perl that
>he was referring to. Let us what for his explanation.
I must be spacey today. That was my second screwup this morning.
I was thinking of "list assignment":
my(@stuff) = 'foo';
Where the RHS (a scalar) is DWIMed into a list, because list
assignment demands a list on each side of the equals.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 17 Aug 2001 19:09:14 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: what does this message mean?
Message-Id: <3B7D4FBA.9010900@post.rwth-aachen.de>
Tad McClellan wrote:
>>Yes. Yet, there might be some super-subtlety on the inside of Perl that
>>he was referring to. Let us what for his explanation.
>>
>
>
> I must be spacey today. That was my second screwup this morning.
>
> I was thinking of "list assignment":
>
> my(@stuff) = 'foo';
>
> Where the RHS (a scalar) is DWIMed into a list, because list
> assignment demands a list on each side of the equals.
Ah, ok! Now the world's again in perfect order for me. :-)
Tassilo--
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};
------------------------------
Date: 17 Aug 2001 17:23:41 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: what does this message mean?
Message-Id: <9ljjut$ho5$1@mamenchi.zrz.TU-Berlin.DE>
According to Tad McClellan <tadmc@augustmail.com>:
> Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de> wrote:
> >Anno Siegel wrote:
> >
> >> DWIM is Perl's "Do What I Mean", which is the work of the DWIMmer in the
> >> Perl core :)
> >
> >Ah, thanks! Perl's doing that all the time in my scripts. :-)
> >
> >> As I said in a direct followup, I am likewise not sure what Tad is
> >> kvetching about. In my view, the same mild DWIMery takes place in both
> >> "use lib $x" and "print $x": a single scalar works like a one-element
> >> list.
> >
> >Yes. Yet, there might be some super-subtlety on the inside of Perl that
> >he was referring to. Let us what for his explanation.
>
>
> I must be spacey today. That was my second screwup this morning.
>
> I was thinking of "list assignment":
>
> my(@stuff) = 'foo';
>
> Where the RHS (a scalar) is DWIMed into a list, because list
> assignment demands a list on each side of the equals.
Not to belabor the point, but even that I read as a case of a single
scalar, finding itself in list context. It does what all scalars do
in that situation.
Of course, the point is moot to a degree, because it is about human
perception of Perl programs. I see the same rule at work, but if you
have a different taxonomy of rules, who is to say which is right?
There is more than one way to see it :)
Anno
------------------------------
Date: 17 Aug 2001 08:55:58 -0700
From: jspears@weston.com (Wes Spears)
Subject: XML Encoding
Message-Id: <b0a0707d.0108170755.1c7d7e4c@posting.google.com>
I realize this must be a basic and stupid question. I have looked all
over the place and either can not see the answer to the question or
can not find it. I have a set of text that has less than, greater
than and other characters in it. I want to use a perl library, and I
beleive there is one, to do what I would call encoding to be <, >,
etc.
Where I am stuck is even getting started on this. What is this kind
of transformation called? That would be helpful for future research
or finding reference code. Also, what is the perl library that
facilitates this?
I apologize for the rudimentary nature of the question, but this one
has stumped me and after serveral hours of trying to figure this out I
thought I would punt and see if I can get some help.
Thanks in advance.
Wes Spears
jspears@weston.com
------------------------------
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 1552
***************************************