[6750] in Perl-Users-Digest
Perl-Users Digest, Issue: 375 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 25 23:07:10 1997
Date: Fri, 25 Apr 97 20:00:22 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 25 Apr 1997 Volume: 8 Number: 375
Today's topics:
Re: $1 var question (David Alan Black)
Re: $1 var question (Abigail)
Re: *** problem calling zmodem from perl in unix? <rootbeer@teleport.com>
Re: [Q] Converting a string to lower case (Lloyd Zusman)
Re: A simple substitution (Lloyd Zusman)
ASCII Numeric conversion!? <yaw@sunflowr.usd.edu>
Re: Calculating dates (David Stoner)
Re: CGI scripts <jzawodn@bgnet.bgsu.edu>
Re: Day of the week (David Stoner)
Evoke one *.pl in another? <cwzeth2@nis.net>
HELP, Perl/NT Newbie (Tonoman)
How about pipes in Perl for Win32? (HdV)
Re: Implemenation of "Virtual Classes" <kevina@clark.net>
Re: Is there a YACC module? <jake@organic.com>
Re: Need source for calling search engines <rootbeer@teleport.com>
Re: Newbie Q: Slow script <rootbeer@teleport.com>
Re: Notice to antispammers (John Stanley)
Re: Notice to antispammers (John Stanley)
Re: Ousterhout and Tcl lost the plot with latest paper (Jon S Anthony)
Re: Perl as its own metalanguage? (Lloyd Zusman)
Re: PERL Editor (The Man on the Scene)
Perl-Reengineering Tools ? <Vorname.Name@ubs.ch>
Perl-Reengineering Tools ? <Vorname.Name@ubs.ch>
Re: References in foreach loop variable (David Alan Black)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 26 Apr 1997 01:59:10 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: $1 var question
Message-Id: <5jrnhe$9e1@pirate.shu.edu>
Hello -
abigail@fnx.com (Abigail) writes:
>On 25 Apr 1997 16:38:47 GMT, Tom Christiansen wrote in
>comp.lang.perl.misc <URL: news:5jqmmn$16n$1@csnews.cs.colorado.edu>:
>++
>++ It's only reset on a successful match:
>++
>++ The scope of $<digit> (and $`, $&, and $') extends to the end of the
>++ enclosing BLOCK or eval string, or to the next successful pattern
>++ match, whichever comes first. [perlre, v5.003_97, but it's been there
>++ for a long time].
>++
>Which leads to the question:
>if I have:
>my $foo = "foo";
>$foo =~ /(o)/;
># $1 == "o";
>{ my $bar = "bar";
> $bar =~ /(a)/;
> # $1 == "a"
>}
>...
>What is $1 now? Is it "o", or did the scope end because to the
>match in the inclosed block (and hence it's undefined)?
Doesn't your version of Perl have a print() function? :-) Or
is your machine at work Perlless? :-(
The Camel says: "The variables $1, $2, $3 ... are automatically
localized, and their scope [...as above]" (pp. 65-66). Hence,
in your example, once the "bar" block exits, $1 == 'o'.
David Black
dblack@icarus.shu.edu
------------------------------
Date: Sat, 26 Apr 1997 01:51:37 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: $1 var question
Message-Id: <E982I1.1z6@nonexistent.com>
On 25 Apr 1997 21:07:26 GMT, Tom Christiansen wrote in
comp.lang.perl.misc <URL: news:5jr6ee$cva$3@csnews.cs.colorado.edu>:
++ [courtesy cc of this posting sent to cited author via email]
++
++ In comp.lang.perl.misc, abigail@fnx.com writes:
++ :What is $1 now? Is it "o", or did the scope end because to the
++ :match in the inclosed block (and hence it's undefined)?
++
++ Gee, I wonder how you could find out?
You misunderstand me. With 'undefined' I don't mean having the
undef value, but "$1 now has <whatever> but that might be different
in a next version of perl".
Abigail
------------------------------
Date: Fri, 25 Apr 1997 17:16:58 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Jeff Baker <admin@bznet.com>
Subject: Re: *** problem calling zmodem from perl in unix?
Message-Id: <Pine.GSO.3.96.970425171015.29194B-100000@kelly.teleport.com>
On 24 Apr 1997, Jeff Baker wrote:
> I'd recently converted this script from a Kornshell application and have
> had little trouble until this command.
>
> $x = `sz jeff.txt 2>>/var/edi/log/szstatus.txt >/dev/tty`;
>
> Have any of you had this problem?
What problem is it, exactly? Does it do nothing? Does it do the wrong
thing? Does it do the right thing, and then not stop doing it? Does it not
find sz? Does it report a permissions error? Does it send nothing to
/dev/tty? Does it send output to the screen? Does it hang? Does it crash
your system? Does it erase your data? Does it fail to send you any output?
Does it send you the wrong output? Does it invoke emacs instead of sz?
Does it dial collect by merely pressing zero when it should be saving up
to 43 percent? :-)
I suspect that none of us have had exactly _that_ problem. But to help
you, we could use just a little more information. Thanks!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 26 Apr 1997 01:39:51 GMT
From: ljz@asfast.com (Lloyd Zusman)
Subject: Re: [Q] Converting a string to lower case
Message-Id: <slrn5m2lnl.jm.ljz@ljz.asfast.net>
On Tue, 15 Apr 1997 04:41:09 -0600, amas@lhr-sys.dhl.com <amas@lhr-sys.dhl.com> wrote:
>
> Coming from AWK I feel a bit lost without certain of my favourite
> function calls. One of these is the toLower() and toUpper() calls.
> I am still new to this regexp stuff, so could someone show me how
> to do this. A bit more detail might help: specifically I would like
> to take a string that contains any sort of character and only change
> the case of the alpabetic characters and leave the rest alone.
>
> Thanks for any help
Try this (works in newer versions of Perl):
$string2 = lc($string1); # converts to lower case
$string2 = lc($string1); # converts to upper case
This is an older construct that works in all Perl versions:
$string2 = "\L$string1\E"; # converts to lower case
$string2 = "\U$string1\E"; # converts to upper case
--
Lloyd Zusman
ljz@asfast.com
------------------------------
Date: 26 Apr 1997 01:39:44 GMT
From: ljz@asfast.com (Lloyd Zusman)
Subject: Re: A simple substitution
Message-Id: <slrn5m2lgk.jm.ljz@ljz.asfast.net>
On Mon, 14 Apr 1997 22:05:19 GMT, Jeff Yoak <jeff@yoak.com> wrote:
> What is a good way to change the first letter of each word in a string
> to uppercase? I found my self sufficiently confused with s/// and
> tr/// that I ended up with:
>
> @lower = (a..z);
> foreach $letter (@lower) {
> $upper = $letter;
> $upper =~ tr/a-z/A-Z/;
> $line =~ s/\b$letter/$upper/g;
> }
>
> Somehow, this just seems morally wrong. There must be a better way.
What about this?
$upper = "\u$lower";
--
Lloyd Zusman
ljz@asfast.com
------------------------------
Date: Fri, 25 Apr 1997 18:48:03 -0500
From: Her Yaw Seet <yaw@sunflowr.usd.edu>
Subject: ASCII Numeric conversion!?
Message-Id: <Pine.SOL.3.94.970425184051.11301A-100000@sunburst>
Hi,
Does any of you have a good conversion algorithms or written
perl routines to convert the below numeric format:
1,2,3,4,5..... <===> i,ii,iii,iv,v...
1,2,3,....26,27,28... <===> a,b,c,....z,aa,ab..
Yaw
------------------------------
Date: 26 Apr 1997 00:48:54 GMT
From: dstoner@marlin.utmb.edu (David Stoner)
Subject: Re: Calculating dates
Message-Id: <5jrjdn$nln@atlantis.utmb.edu>
Dale Churchett (daleweb@io.com) wrote:
: I'm trying to find out a way of converting a date returned by a call to
: `date` to yesterdays date:
: $todays_date = `date`;
: $todays_date will obviously return the time and date the script
: containing this statement is being run, but I need to know the date in
: the same format and time zone for the previous day.
: I've searched through the man pages and looked at the strftime() command
: in C but can't work out how to do it. I was also told to try changing
: the TZ variable to
: TZ=CST30CDT
: and then call `date` but that didn't work on my system.
: Any pointers would be greatly appreciated.
: Thanks in advance.
: Dale Churchett
See what I've posted in the thread "Puzzle: Count Actual Days from MM,DD,YYY ... "
What you need is the conversion from date to running day number given there,
plus the reverse conversion from running day number to date, which I don't
supply yet. Or you could use the standard module, which I haven't checked
out, but I'd give odds that it's larger and slower. Given those two conversions,
you'd convert today's date to a running day number, subtract 1, and convert
back to date form.
__
UTMB Information Services
David.Stoner@utmb.edu
dms@atlantis.utmb.edu dstoner@marlin.utmb.edu usenet@utmb.edu news@utmb.edu
help@marlin.utmb.edu
------------------------------
Date: Fri, 25 Apr 1997 22:06:45 -0400
From: "Jeremy D. Zawodny" <jzawodn@bgnet.bgsu.edu>
Subject: Re: CGI scripts
Message-Id: <Pine.LNX.3.95.970425220547.7288A-100000@pizza.bgsu.edu>
On Thu, 24 Apr 1997, Paula Chase wrote:
> We use best.com in California, and they let us use whatever CGI's we
> want. And their prices are very reasonable.
<sarcasim>
Hm. Wasn't aware of more than one CGI. I guess I figured that the NCSA
implementation from a few years ago was good enough.
</sarcasim>
Jeremy
---
Jeremy D. Zawodny
http://www.bgsu.edu/~jzawodn/
Computer Science Undergraduate, Bowling Green State University
"Lab-Tech: It's not just a job. It's an attitude!" -- Me
------------------------------
Date: 26 Apr 1997 00:38:30 GMT
From: dstoner@marlin.utmb.edu (David Stoner)
Subject: Re: Day of the week
Message-Id: <5jriq7$nln@atlantis.utmb.edu>
Mark Guz (markguz@sol.co.uk) wrote:
: I have a text file with a field in there which shows the month and
: date(MAR1 or APR2)
: I need to convert this to the day of the week that it was
: I am stumped?
: anyone help?
: Regards
: Mark Guz
: Scotland On Line
See what I've posted in the thread "Puzzle: Count Actual Days from MM,DD,YYY ..."
__
UTMB Information Services
David.Stoner@utmb.edu
dms@atlantis.utmb.edu dstoner@marlin.utmb.edu usenet@utmb.edu news@utmb.edu
help@marlin.utmb.edu
------------------------------
Date: Fri, 25 Apr 1997 23:18:47 -0400
From: Chris Zeth <cwzeth2@nis.net>
Subject: Evoke one *.pl in another?
Message-Id: <33617417.7EFD@nis.net>
Hi All,
How do I run program.1.pl and have this be a simple call to run
program.2.pl?
If this is possible, can I send a query variable as well? For example, I
am calling program.2.pl like this:
/cgi-bin/program.2.pl?QUERY1
How can I included this query variable within the call to this script?
Thanks!
Chris
------------------------------
Date: Sat, 26 Apr 1997 01:51:27 GMT
From: tonz@witty.net (Tonoman)
Subject: HELP, Perl/NT Newbie
Message-Id: <5jrn8k$iv2$2@home.au.ac.th>
Hi, All
I've to port my pl scripts to work under NT-based IIS2 server, so I have some
question. I'm a newbie for both of them, Perl and NT.
- Dose it longer require the line #!/bin/perl ?
- How can I locate file locations on NT server, ms path format or unix format?
For example, I have sendmail prog on "E:\SENDMAIL\SENDMAIL.EXE" Can I do
E:\SENDMAIL\SENDMAL.EXE or E:\\SENDMAIL\\SENDMAIL.EXE or
/ALIAS_E/SENDMAIL/SENDMAIL.EXE?
- Any other thing I have to change from my unix-based scripts?
Thanks,
tonz
------------------------------
Date: Fri, 25 Apr 1997 23:43:34 GMT
From: J.A.deVries@lr.tudelft.nl (HdV)
Subject: How about pipes in Perl for Win32?
Message-Id: <5jrfjp$q8i$1@news.tudelft.nl>
Hi,
I'd really like to know if there's a solution or work-around to the
problem with using pipes in perl scripts that run on a winnt machine.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bees accomplish nothing
save as they work together,
and neither do men.
(Elbert Hubbard)
HdV aka J.A.deVries@lr.tudelft.nl
Delft University of Technology
Faculty of AeroSpace Engineering
------------------------------
Date: Fri, 25 Apr 1997 20:11:18 -0600
From: Kevin Atkinson <kevina@clark.net>
Subject: Re: Implemenation of "Virtual Classes"
Message-Id: <862016730.2499@dejanews.com>
In article <E96trM.2pn@world.std.com>,
swmcd@world.std.com (Steven W McDougall) wrote:
> What if you did a local() on the package variable?
> Then your example
>
> ># sub func1 {
> ># my $frac = virtual Fraction;
> ># $frac->modify_tag('MIXED', 1);
> ># my $frac1 = $frac->new(5,3);
> ># print "$frac1\n"; # Will output "1 2/3"
> ># }
>
> becomes
>
> sub func1
> {
> local $Fraction::MIXED = 1;
> my $frac = new Fraction 5,3;
> print $frac; # Will output "1 2/3"
> }
>
> The old value of $Fraction::MIXED is automatically restored when
> the local() goes out of scope.
>
> If you want to respect encapsulation,
> you could provide a method to return a scalar reference:
>
> sub func1
> {
> local ${Fraction->MIXED} = 1;
> ...
> }
Interesting except I wanted for it to have to scope of my, also there is
no actual varable for MIXED, instead it is part of a tag list.
I didn't know you could do that with local though
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 25 Apr 1997 17:14:52 -0700
From: Jake Donham <jake@organic.com>
Subject: Re: Is there a YACC module?
Message-Id: <wu9g1we7i83.fsf@organic.com>
Steve Fink <sfink@cs.berkeley.edu> writes:
> As another alternative, look at
> http://www.cs.berkeley.edu/~sfink/software.html under #5 (perl bison).
> It's a port of bison 1.25 that accepts a -Lperl flag and creates a perl
> parser. I created it in the first phase of a class project (I wrote a
> visual parser). It's not based on perl-byacc, although the end result is
> very similar. My version parses perl a bit better.
>
> Both perl-byacc and this version of bison have the drawback that they
> generate code which must be preprocessed (i.e., run under perl -P). See
> the release notes for details.
Also see
CPAN/authors/id/JAKE/perl5-byacc-patches-0.5.tar.gz
It's a set of patches to perl-byacc which make it generate a Perl5
module for a parser.
Jake
------------------------------
Date: Fri, 25 Apr 1997 19:49:15 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: fmlysoft@ix.netcom.com
Subject: Re: Need source for calling search engines
Message-Id: <Pine.GSO.3.96.970425194759.8773C-100000@kelly.teleport.com>
On Thu, 24 Apr 1997, Edward F. Hinton wrote:
> I am looking for any Perl example source code that
> can send a request to any of the popular web search engines
There are several modules on CPAN which can do what you want, and they all
come with examples. Enjoy!
http://www.perl.org/CPAN/
http://www.perl.com/CPAN/
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Fri, 25 Apr 1997 17:35:48 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Ashley Roach <aroach@mail2.sas.upenn.edu>
Subject: Re: Newbie Q: Slow script
Message-Id: <Pine.GSO.3.96.970425172504.29194C-100000@kelly.teleport.com>
On 24 Apr 1997, Ashley Roach wrote:
> well, I've been working on this small script in MacPerl to extract the
> first and last filename in a subdirectory on a CD, and then print those
> filenames out to a file.
This is just an exercize, right? (I can't see why you would need those in
the real world.)
> $dirs = MacPerl::Ask("How many subdirectories are there?");
Since you'll later read in the list of subdirectories, you shouldn't have
to ask the user how many there will be. (Especially since they might be
wrong!)
> @subdir = <$list[$i]:*>;
Since you're only interested in the first and last entries, it's much
faster to use readdir; the glob has to sort the list, and you can simply
scan it, one item at a time.
> @first = split(/:/,$subdir[0]); #assigns first value in the
> subdirectory to an array while taking out the :
Since you're only interested in the last element (the actual file or
directory name) there are more efficient ways to do this. (In the real
world, I'd recommend simply using the File::Basename.pm module, which will
work even if you move your code from a Mac to another machine. I _think_
it comes with MacPerl.) In this case, though, you can use this to get the
text after the last colon.
$first = substr $subdir[0], rindex($subdir[0], ':')+1;
Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 26 Apr 1997 00:26:43 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Notice to antispammers
Message-Id: <5jri43$96f@news.orst.edu>
In article <5jr65q$cva$2@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:
It's a shame that you avoided getting the reply to the mail you sent
me. You are wrong in claiming that I am "looking for a spat". I am
looking to keep junk mail out of my mailbox -- whether that is spam
or copies of USENET articles that can wait until I have time to deal
with USENET.
>As I read the specs, a bogus From: line requires a real Sender:
>line. You aren't supposed spoof.
That is incorrect. The RFC actually says:
2.2.2. Sender
This field is present only if the submitter manually enters a "From"
line.
I have not manually entered this From: address, it is generated by
standard news software. The same stuff that thousands of people use.
It accurately represents the user and hostname for the system being
used to write this article.
>:What you will be doing is the spammer's work for them, handing them a
>:list of valid addresses on a platter.
>
>Yes, that's right. I intend to do that. Stop foisting the spam problem
>on others --
What you are complaining about here is someone using filtering to
prevent junk mail from getting to their mailbox. At least, that is what
you complained to my postmaster about. You sent me email from an
address which has a filter set to bounce email replies, so I assume
that you approve of email filters in general.
What I don't understand is how you can complain about a filter that
bounces mail when you run one yourself. Please explain why it is
acceptable for you to have a filter that bounces email, but it is not
acceptable for anyone else to have one.
As I wrote you already:
Now, two strong willed people are arguing. They each know each other's
opinion. Agree to disagree?
------------------------------
Date: 26 Apr 1997 00:42:24 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Notice to antispammers
Message-Id: <5jrj1g$9ij@news.orst.edu>
In article <5jr6rm$lae@fridge-nf0.shore.net>,
Nathan V. Patwardhan <nvp@shore.net> wrote:
>John Stanley (stanley@skyking.OCE.ORST.EDU) wrote:
>: So you will call the administrative contact for a site to complain
>: because someone who works there wants to avoid spam?
>
>Huh? No - you have it totally backwards. I'll do a whois on the spammer's
>domain and call the administrative contact.
Well, Tom was talking about people who use "invalid" From: addresses and
creating a web page giving the real ones. I assumed when you said you
did a whois and told them to knock it off, you meant the people who
use invalid From: addresses.
>: How about this: don't send mail in reply to USENET posts. Think of it
>: this way. If someone had wanted to discuss something with you by mail,
>: they wouldn't have posted to USENET, they would have sent you mail. I
>
>If this was the case, newsreaders would never have been built with
>the functionality to respond via mail / CC + post.
There is a lot of "functionality" built into software that never should
have been, or that is being used for purposes other than what it should
be. One example of such functionality: the Netscape "feature" that
allows people to push the "post" button multiple times without any
changes to the text.
I have no quibble with sending mail in reply to an article that says
"please reply by mail", or with people who reply ONLY by mail, but I
have a quibble with people who both post and mail. They can't wait
until I read news the next time to deal with it. I already get a copy
of almost every c.l.p.m article delivered to my mailbox (via the
digest). My agent already retrieves articles it thinks will be of
interest to me (which includes replies to things I write), so another
copy vieing for immediate attention with mail that might really need
immediate attention is a waste.
------------------------------
Date: 25 Apr 1997 23:30:32 GMT
From: jsa@alexandria (Jon S Anthony)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <JSA.97Apr25193032@alexandria>
In article <E9734v.BFF@research.att.com> ark@research.att.com (Andrew Koenig) writes:
> > I would go further and say this is pretty much the _only_ reason why
> > C++ has such widespread use. But, in the current context, this is
> > really just the same tired old claim that "C++ is better than X,
> > because C++ is more popular than X". A claim that was always dubious
> > and which has certainly long since lost any plausibility that it might
> > have ever had.
>
> Not at all. Rather, it is a claim that programming is a human phenomenon,
> and there can be a huge difference between how useful a tool -- especially
> a language -- is in theory and how useful it is in practice.
Well, OK, but that is exactly tied up in the "chicken/egg" problem of
"popularity". So, under the interpretation you give here, I don't see
how you can say much of anything wrt the issue under the current
context - i.e., what is "technically better or more correct or more
efficacious or etc."
> Several years ago, I was on vacation in Norway and overheard a conversation
> in a hotel between an English woman and a member of the hotel staff. It
> went something like this:
This little story sez a lot more about interoperability requirements
of "less popular" things than it does about what is or isn't popular
or whether that popularity is deserved or anything of the sort. I
don't think anyone would really disagree with any of this, it's just
irrelevant here.
> Now, English is a mess of a language. Its spelling rules are atrocious,
> its grammar is unruly, it has far too many ways to say the same thing,
Well, actually, I very much disagree with this assesment. It's based
on a set of irrelevant criteria. It is a well known fallacy
attempting to draw conclusions about the "correctness/goodness" of
natural languages by comparing them with "formal languages" - or to
even try to judge natural languages with any of the criteria normally
used for formal languages. So, this little bit is really off target.
> So it is also with programming languages. If C++ had not built on C, it
> would never have gotten out of the starting gate.
Here, we are in definite agreement.
/Jon
--
Jon Anthony
Organon Motives, Inc.
Belmont, MA 02178
617.484.3383
jsa@organon.com
------------------------------
Date: 26 Apr 1997 01:39:56 GMT
From: ljz@asfast.com (Lloyd Zusman)
Subject: Re: Perl as its own metalanguage?
Message-Id: <slrn5m2m29.jm.ljz@ljz.asfast.net>
On 23 Apr 1997 17:05:41 -0700, Terrence M. Brannon <brannon@bufo.usc.edu> wrote:
> Tom Christiansen <tchrist@mox.perl.com> writes:
>
> >
> > [courtesy cc of this posting sent to cited author via email]
> >
> > In comp.lang.perl.misc, michaeli@dra.com writes:
> > :Can you elaborate on this? In C++, at least, you can't overload based on
> > :return type. I'm having trouble thinking of a construct in C that would
> > :act differently based on a 'singular' or 'plural' context.
> >
> > int i = (1,2);
> is this C syntax? what does it mean?
It means the same as ...
int i = 2;
In C, the comma operator returns what's on its right.
--
Lloyd Zusman
ljz@asfast.com
------------------------------
Date: 25 Apr 1997 16:38:04 GMT
From: shaug@callamer.com (The Man on the Scene)
Subject: Re: PERL Editor
Message-Id: <5jqmlc$p4l$2@zinger.callamer.com>
In article <erich-2304970652480001@ppp-207-104-16-39.snrf01.pacbell.net>,
erich@powerwareintl.com (Eric Harley) writes:
> In article <335DFEF3.3F89@unl.ac.uk>, a.aitken@unl.ac.uk wrote:
>
>> Kyzer wrote:
>> >
>> > Dick Barker of dickb@eskimo.com wrote in comp.lang.perl.misc:
>> > : Real perl programmers use cat >fname to write their stuff.
>> > Actually they use emacs.pl :)
>>
>> I use twenty six half potatoes. I'm working on puntuation now but kanji
>> scares the hell out of me :-)
>>
>> vi anyone?
>
> vi is for amatuers. I use ed.
Vim has a farsi mode. A globally-consious True Perl Programmer would
write all his code in farsi.
------------------------------
Date: Fri, 25 Apr 1997 11:05:24 +0200
From: Vorname Name <Vorname.Name@ubs.ch>
Subject: Perl-Reengineering Tools ?
Message-Id: <336073D4.6F5E@ubs.ch>
I am quite new in using perl. As I have
a few perl modules to analyze I am looking
for a help in the sense of a code analyzer
or any reengineering tool for perl.
Especially I am looking for a tool which gives
me in a graphical way (tree) the calling order of all
functions in and between modules.
Actually I am using Version 4.036
May somebody give me some hints ?
Thanks
--
Paolo
paolo.decarli@ubs.ch
-------------------------------------------------------------------------
OE-SYNE/SYDI Zurich,VA315 Tel. 6 16 14 / +41 (0)1 236 16 14
Union Bank of Switzerland, Zurich
------------------------------
Date: Fri, 25 Apr 1997 11:09:15 +0200
From: Vorname Name <Vorname.Name@ubs.ch>
Subject: Perl-Reengineering Tools ?
Message-Id: <336074BB.7161@ubs.ch>
I am quite new in using perl. As I have
a few perl modules to analyze I am looking
for a help in the sense of a code analyzer
or any reengineering tool for perl.
Especially I am looking for a tool which gives
me in a graphical way (tree) the calling order of all
functions in and between modules.
Actually I am using Version 4.036
May somebody give me some hints ?
Thanks
--
Paolo
paolo.decarli@ubs.ch
-------------------------------------------------------------------------
OE-SYNE/SYDI Zurich,VA315 Tel. 6 16 14 / +41 (0)1 236 16 14
Union Bank of Switzerland, Zurich
------------------------------
Date: 26 Apr 1997 01:43:10 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: References in foreach loop variable
Message-Id: <5jrmje$83r@pirate.shu.edu>
Hello -
Keith Arner <kraven@keystone.westminster.edu> writes:
>I wrote the following code:
>foreach $$i (1..3) {
> print $$i;
>}
>But when I tried to run it, perl complained:
>Can't use an undefined value as a symbol reference at - line 1.
>So I wrote:
>$i = \$foo;
>foreach $$i (1..3) {
> print $$i;
>}
>And when I tried to run this, perl complained:
>Not a GLOB reference at - line 2.
>I finally tried:
>$i = 'foo';
>foreach $$i (1..3) {
> print $i;
>}
>This gave me what I had expected in the first place. I understand (sort
>of) why the first attempt failed, and why the third attempt was
>successful, but can't figure out why the second attempt failed.
(The following answer is predicated on the assumption that you meant
"print $$i;", not "print $i;", in the third example.)
OK, going at it in a slightly different order (and ... don't take it the
wrong way ... there's a chance you may be surprised at why the third one
succeeded!) -
In foreach $$i (), the expression $$i has to be a scalar lvalue.
If $i doesn't contain anything (your first example), then the expression
$$i is a dereferencing of nothing, which doesn't work.
If $i contains a string, such as 'foo', then $$i can be something.
Specifically, it can be a scalar (as per the initial $) whose name is
the string contained in $i. This is a symbolic reference. This means
that (here) $$i is basically equivalent to $foo. (Think of this: "A
dollar sign, followed by the character string 'foo' or the name of a
variable which contains that character string, being evaluated
as $foo"). (And remember that it doesn't work with my() variables
or under 'use strict'.)
The $$i symbolic reference, in turn, means that in third example, the
values 1,2,3 are assigned successively to $foo. If you replace "print
$$i" with "print $foo", you'll see what I mean. (The reason I suggested
above that you might be surprised by this is that, if you expected the
first one to work, you might not have realized what was going on with
the symbolic reference in the third one.)
If $i contains neither nothing nor a plain string, but, instead, a
hard reference, then Perl checks to see whether it is the right type of
reference for the occasion. In the case of your second example, it
isn't - it's a scalar reference, where only a glob reference will do.
If it were a glob reference:
$i = \*foo;
then you'd get "123" again - but, as in the third example, the
assignment would be to $foo. The effect is the same, but the two
examples actually work differently, and illustrate the difference
between hard and symbolic references.
Hoping this isn't too dense, fuzzy, long, wide....
David Black
dblack@icarus.shu.edu
------------------------------
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 375
*************************************