[8381] in Perl-Users-Digest
Perl-Users Digest, Issue: 1998 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 1 19:15:29 1998
Date: Sun, 1 Mar 98 16:00:26 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 1 Mar 1998 Volume: 8 Number: 1998
Today's topics:
Re: "PERL" puzzle. (Andy Lester)
About the foreach statement (Odie Deth)
Access Databases <nymig@worlnet.att.net>
Re: Access Databases (Jim Michael)
Re: Conflict in this Newsgroup <sowmaster@juicepigs.com>
Re: Conflict in this Newsgroup (I R A Aggie)
Re: Conflict in this Newsgroup (Nathan V. Patwardhan)
gethostbyaddr(ADDR,ADDRTYPE) <geoff@acr.net.au>
Re: gethostbyaddr(ADDR,ADDRTYPE) (Michael Fuhr)
Re: Getting name of script without absolute path. <andrewbrown@acm.org>
Re: Getting system() to recognize localized STDOUT <andrewbrown@acm.org>
Re: Home Page Click. <camerond@mail.uca.edu>
Re: How do you put a string into a array? (Andrew M. Langmead)
Re: local $/ (Bart Lateur)
Re: many ways but i can not find one <star@sonic.net>
Re: need help (Martin Vorlaender)
Re: need help (Andrew M. Langmead)
Never want to work there again. (SPAM but please read a (RonaldWS)
perl tutorial <lespin03@solix.fiu.edu>
Re: Problem with "goto" in Perl (Andrew M. Langmead)
Re: Random Link Script for NT Server? (Martin Vorlaender)
Stripping (Most) HTML tags <tarcher@csu.edu.au>
Re: Upgrading from Perl 4 to Perl 5 - Differences? (I R A Aggie)
Re: use system or backticks?? <dmeyers@panix.com>
Re: What does this one-liner do? <metcher@spider.herston.uq.edu.au>
Win32::NetAdmin::UserCreate qn <mark@wnmeds.ac.nz>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 1 Mar 1998 18:57:35 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Re: "PERL" puzzle.
Message-Id: <6dcb2v$d0j$1@usenet55.supernews.com>
: ###########################################
: #!/usr/bin/perl
: &lv($i,my($self));
: $want=&lv($u,$me);
It's "I Touch Myself" by the Divinyls.
xoxo,
Andy
--
--
Andy Lester: <andy@petdance.com> http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com> http://ChicagoMusic.com/
------------------------------
Date: Sun, 01 Mar 1998 22:09:53 GMT
From: odie@algonet.seREMOVE (Odie Deth)
Subject: About the foreach statement
Message-Id: <34f9db86.8229492@194.213.69.148>
Hello.
Given a statement such as:
foreach (@variable ) {
print $_;
}
Is there a way to find out what $variable it's at?
I am currently using statements such as:
$i = 0;
foreach (@variable) {
print "$_ ($i)";
$i++;
}
And I would really like to lose the $i, it's not very handsome code.
I don't know if I'm clear enough, but I would be grateful for some
help.
---
Odie Deth - odie@algonet.se - http://www.algonet.se/~odie
------------------------------
Date: Sun, 01 Mar 1998 11:25:43 -0800
From: Joseph Migliore <nymig@worlnet.att.net>
Subject: Access Databases
Message-Id: <6dccvq$3qj@bgtnsc03.worldnet.att.net>
I'm a CGI newbie who needs information about Microsoft Access queries!
Any help would be greatly appreciated!
------------------------------
Date: Sun, 1 Mar 1998 20:18:02 GMT
From: genepool@netcom.com (Jim Michael)
Subject: Re: Access Databases
Message-Id: <genepoolEp5pq2.AG@netcom.com>
Try comp.databases.ms-access. When you get there you might want
to actually state the kind of information you need so someone
might have a clue how to help you. HTH.
Cheers,
Jim
Joseph Migliore (nymig@worlnet.att.net) wrote:
: I'm a CGI newbie who needs information about Microsoft Access queries!
: Any help would be greatly appreciated!
------------------------------
Date: Sun, 01 Mar 1998 14:06:26 -0500
From: Bob Trieger <sowmaster@juicepigs.com>
To: "V. Chandrasekhar" <shaker@netusa1.net>
Subject: Re: Conflict in this Newsgroup
Message-Id: <34F9B1B2.23DC@juicepigs.com>
V. Chandrasekhar wrote:
--> Snip preface <--
>
> 2. Two types of interactions may be identified in people relations:
> Master - Disciple (MD) (Rare in msot places)
> Consumer - Producer (CP) (Very common)
>
> Some Perl masters want this newsgroup (NG) to operate MD. Some
> 'disciples' are perfectly willing to do this, because of what they
> are able to learn. They also feel that this is how this NG should
> function. Some feel that this is how it functioned - pre 1993.
> Disciple is expected to show a lot of self-discipline, not ask
> anything that will anger the master, only ask things that provide
> the master at least some measure of amusement, in general let the
> master dictate, make sure that they don't piss him off, [walk at
> least three steps behind the master, genuflect at least three times
> a day :) ]etc.
Those that kneel to the snobs are the minority. I expect most are like
myself and respect the knowledge of the snobs and learn by the
documentation they have written. But, don't have the time to be bothered
by their of anti-microsoft crap in the newsgroup and could really care
less who they killfile.
> At least some posters come expecting a measure of the CP
> relationship. They expect not to be insulted when they ask
> questions (after all, they are asking questions on Perl not Rig
> Veda). Some of them are long term users in other NGs where many of
> the attempted strictures of this NG (for instance, what e-mail
> addresses will be tolerated, whether address munging may be used as
> a form of spam control or not) are not present.
Here is where I somewhat agree with the snobs. There are far too many
questions asked that shouldn't be. Most enjoy helping those that help
themselves. When it is obvious that someone hasn't done an ounce of
research for themselves, why should anyone do it for them? For the
mostpart, the replies are not insults, they are constructive criticism,
explaining the errors in their ways and even pointing them in the right
direction to find the answer. There are way too many welfare cases that
are expecting someone to take them by the hand and walk them through
life for free.
> 3. When the Perl masters teach courses, almost certainly a CP
> relationship applies; nobody's head is bitten off when the students
> ask a FAQ or a CGI question in a Perl class.
They are also getting paid to act social. Nobody is getting a dime to
post to c.l.p.m
> 4. When the Perl masters publish books, again a CP relationship is
> evident. The various animal books go to considerable trouble to
> create an air of friendliness and an including / accepting
> community.
See above, they ain't writing those books for the fun of it.
> 5. Between a poster and his ISP, there is a CP relationship. The
> ISP gives each subscriber the right to post in all groups. The ISP
> takes care of the necessary infrastructure, upstream feed,
> downstream feed, whatever. DejaNews provides this too as a free
> service.
I have no clue why this matters.
> 6. This NG is where the two cultures clash. Do the Perl masters and
> their supporters have the right to allow only MD interactions,
> chasing the other group away by insults, whatever ? How are they
> going to do it ? By making this a moderated NG ? Otherwise, the
> battle may continue. (Note, I am NOT saying I am going to fight
> continue the battle; I am NOT going to.) New folks are going to be
> coming in all the time and do things like other newcomers in the
> past.
If folks are weak and easily swayed by a little constructive criticism
then perhaps they should leave. If they really need or want an answer to
their question they will take the advice given to them, no matter how
harsh they think it is.
> 7. I don't see commercialism on the part of Perl masters in this NG
> at all. Perhaps this is a part of the problem. Maybe this is an
> interest not being served at the present time. Supporting Perl
> masters, developers and implementors (by buying their products and
> services)
----> snip <---
c.l.p.m is not a commercial newsgroup.
> 8. What about the interests of the newcomers to Perl ? How about
> setting up another newsgroup where atmosphere is definitely not so
> MD ? The masters need not respond to posts here at all, other than
> promoting their products, unless they want to. Something like
> 'comp.lang.perl.intro'.
Unneeded. If people would learn to read the FAQs first and then if their
question still isn't answered, post their question clearly with a
descriptive subject line. They'd be amazed at how fast somebody would
either answer them or point them to the answer.
> 9. I also suggest that the mini-FAQ be beefed up describing the
> ground rules better, in a polite tone. For instance, the following
> may be added:
>
> . Perl5 is the only focus of clpm (and not Perl4; sorry this has
> been discussed and agreed upon)
>
> . Posters ARE expected to have made the expected effort via books,
> Dejanews, and man pages before posting
>
> . Top 10 most commonly asked questions included in the miniFAQ
> itself along with brief answers.
Great ideas but what difference would it make when so many people don't
bother to read a FAQ?
--> snip Rodney King can't we all just get along comment <--
--
Bob Trieger
sowmaster@juicepigs.com
------------------------------
Date: Sun, 01 Mar 1998 14:25:49 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Conflict in this Newsgroup
Message-Id: <fl_aggie-0103981425500001@aggie.coaps.fsu.edu>
In article <01bd4536$0f8707a0$7eaa8bcd@space.netusa1.net>, "V.
Chandrasekhar" <shaker@netusa1.net> wrote:
+ 9. I also suggest that the mini-FAQ be beefed up describing the
+ ground rules better, in a polite tone.
This, of course, presumes that the posters who ask FAQs are going to be
bothered to read this mini-FAQ.
Given their track record, I don't see this helping any time soon. Moderation
is the way to go.
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: 1 Mar 1998 21:40:31 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Conflict in this Newsgroup
Message-Id: <6dckkf$p7j@fridge.shore.net>
V. Chandrasekhar (shaker@netusa1.net) wrote:
<< This is an interesting post. I don't agree with many of the
sentiments, but I'm glad that you wrote it. >>
: Disciple is expected to show a lot of self-discipline, not ask
: anything that will anger the master, only ask things that provide
: the master at least some measure of amusement, in general let the
Disciple or not, people should show some discipline. Most people do
not.
: At least some posters come expecting a measure of the CP
: relationship. They expect not to be insulted when they ask
: questions (after all, they are asking questions on Perl not Rig
Most posters come here looking for answers. I could swear that it
didn't used to be this way. It doesn't just bring insults, but does
open the person up to get corrected. Most people who get corrected
feel insulted, so we keep having discussions like this.
So, what's the problem? All together now: anomie.
: 3. When the Perl masters teach courses, almost certainly a CP
: relationship applies; nobody's head is bitten off when the students
: ask a FAQ or a CGI question in a Perl class.
Are you sure about that? :-)
: 4. When the Perl masters publish books, again a CP relationship is
: evident. The various animal books go to considerable trouble to
: create an air of friendliness and an including / accepting
: community.
I'd rather read a friendly book than an unfriendly one or another dry
one. The writer wants to engage you in the context of the book; I
think that concluding that this is an invitation to join an
"inviting" community is more than a little sweeping.
: 5. Between a poster and his ISP, there is a CP relationship. The
: ISP gives each subscriber the right to post in all groups. The ISP
Oy. There's no right to post in all newsgroups (or newsgroups for
that matter) from what I recall. #5 doesn't seem to fit here,
anyways.
: 6. This NG is where the two cultures clash. Do the Perl masters and
: their supporters have the right to allow only MD interactions,
: chasing the other group away by insults, whatever ? How are they
I think that people would be more peaceful if other people were
more courteous before posting same-old/same-old and expecting an
answer for it. I can recall that MDs didn't used to be in a lather
all the time over a FAQ being asked here and there. Why? Because
most people did their homework and came to this NG to *discuss*
things. This isn't an afterschool math or programming tutorial, you
know. The people who want to discuss have started to choose other
means for doing so, like mailing lists, irc, etc. I've noticed that
folks who used to be a major presence in this NG now appear in other
places much, much, much more frequently.
: 7. I don't see commercialism on the part of Perl masters in this NG
: at all. Perhaps this is a part of the problem. Maybe this is an
: interest not being served at the present time. Supporting Perl
This NG is free. Why should commericialism be an issue? If we air
one product, do we air them all? I try not to think about it,
although I *have* bought books written by key players in this NG
because of the way they present themselves.
People don't seem to read FAQs, btw.
: 8. What about the interests of the newcomers to Perl ? How about
: setting up another newsgroup where atmosphere is definitely not so
: MD ? The masters need not respond to posts here at all, other than
Won't happen. Beginners won't gravitate towards beginners. They're
looking for the people with the answers. If another NG appears, it
should be moderated. Period.
: 9. I also suggest that the mini-FAQ be beefed up describing the
: ground rules better, in a polite tone. For instance, the following
: may be added:
People don't read FAQs and when auto-FAQ'ed get really pissed off and
*still* won't read it. People won't read weekly FAQ postings or other
stuff, so I think that this is a non-factor. PLUS, keeping up a FAQ
takes an awful lot of work and people probably don't want to be
responsible for doing this, since most people will fail to read it.
: . Top 10 most commonly asked questions included in the miniFAQ
: itself along with brief answers.
Putting anything into a FAQ seems about as effective as sending it
right into the void or a black hole or something.
: 10. What exactly am I saying here in this whole post ? Instead of
: resorting to insults and abuses (which utterly destroy the spirit
: of bonhomie the cute animal books go to so much trouble to create),
The fact is that the experts have tried really, really hard to
preserve the Usenet culture that many of us were a part of in its
"hey day" and are probably burned out from having done so. I don't
remember Tom or Randal or anyone else freaking out *at all* four
or five years ago.
I guess that I disagree that books and Usenet and Perl and community
are all wrapped up into one neat, little package. Maybe in the old
days, but clearly not today. And yes, I *do* think that there's a
place for win32 but there needs to be a reeducation of the people who
are using it as to how help is given and under what circumstances.
And no, I don't think that this is a trivial task.
Usenet is not and has never been a point-and-click way to supplement
the Windows help system or Solaris Answerbook.
--
Nathan V. Patwardhan
------------------------------
Date: 1 Mar 1998 22:10:54 GMT
From: "Geoff Terry" <geoff@acr.net.au>
Subject: gethostbyaddr(ADDR,ADDRTYPE)
Message-Id: <01bd455e$8e3f5700$74ec16cb@geoffp200mmxdev.acr.net.au>
Can anybody give me the correct syntax and examples for calling (and
assigning variables returned by)
gethostbyaddr(ADDR,ADDRTYPE)
Thanks Geofft
------------------------------
Date: 1 Mar 1998 16:37:44 -0700
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: gethostbyaddr(ADDR,ADDRTYPE)
Message-Id: <6dcrg8$i8c@flatland.dimensional.com>
"Geoff Terry" <geoff@acr.net.au> writes:
> Can anybody give me the correct syntax and examples for calling (and
> assigning variables returned by)
>
> gethostbyaddr(ADDR,ADDRTYPE)
See the perlipc and Socket manual pages.
--
Michael Fuhr
http://www.dimensional.com/~mfuhr/
------------------------------
Date: Sun, 1 Mar 1998 11:48:06 -0800
From: "Andrew T. Brown" <andrewbrown@acm.org>
Subject: Re: Getting name of script without absolute path.
Message-Id: <6dce4s$1uq$1@brokaw.wa.com>
You could use the module File::Basename from the standard Perl distribution
to parse out the filename in an OS independent manner:
#!/usr/bin/perl
use File::Basename;
print basename($0);
sebu wrote in message ...
>Is there a variable (besides $0) which contains the name of the script
being
>executed? $0 shows the absolute pathname, and sometimes just the name is
>preferred. Example:
>
>$ cat ~/bin/try
>#!/usr/bin/perl
>print "$0\n";
>$ try
>/home/me/bin/try
>$
>
>In other words, what I'm really looking for is the Perl equivalent of C's
>argv[0].
>
> Thanks,
> sebu
------------------------------
Date: Sun, 1 Mar 1998 12:09:30 -0800
From: "Andrew T. Brown" <andrewbrown@acm.org>
Subject: Re: Getting system() to recognize localized STDOUT
Message-Id: <6dcfd1$1g1$1@brokaw.wa.com>
Reposting this question... Thanks, Andrew
Andrew Brown wrote in message <6d7rhs$gg4$1@brokaw.wa.com>...
>I have a script in which I wish to *temporarily* redirect STDOUT to a
>file. However, I have found that system() does not honor a localized
>*STDOUT on my system (Perl 5.003 build 3?? on WinNT 4.0 SP3). Please see
>the script at the end of this message.
>
>I can easily get around this, but my question is: why does system() not
>pick up the localized STDOUT? I looked at the FAQ, perlsub (for info on
>system), and perlfunc (for info on local), and found no answers....
>
>Thanks,
>Andrew Brown
>
>__BEGIN__
>select STDOUT;
>$| = 1;
>&mysub;
>
>sub mysub { # 1
> local *STDOUT; # 2
> open (STDOUT, ">logfile"); # 3
> print "--- Text ---\n"; # 4 : Gets sent to 'logfile'....
> system("blah.bat"); # 5 : If line 2 is not commented out,
> # the 'blah.bat's output is printed
> # to the screen, not 'logfile' )-:
> &mysub2; # 6 : Gets sent to 'logfile'....
>} # 7
>
>sub mysub2 {
> print "--- Text ---\n"; # 8 : Gets sent to 'logfile'....
>}
>__END__
>
------------------------------
Date: Sun, 01 Mar 1998 14:05:04 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
To: Martien Verbruggen <mgjv@comdyn.com.au>
Subject: Re: Home Page Click.
Message-Id: <34F9BF70.5D5E090D@mail.uca.edu>
Martien Verbruggen wrote:
>
> In article <3508cad5.125802635@news.cent.com>,
> me@here.com (steve) writes:
> > yes you can
>
> Not in perl.
Sure you can, if _their_ home page is on _your_ server.
(Let's at least get this out of clp.modules, anyway, one less cluttered
NG.)
Cameron
camerond@mail.uca.edu
------------------------------
Date: Sun, 1 Mar 1998 20:33:25 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: How do you put a string into a array?
Message-Id: <Ep5qFp.7D8@world.std.com>
stanley@skyking.OCE.ORST.EDU (John Stanley) writes:
>In article <Ep1MnA.KHK@world.std.com>,
>Andrew M. Langmead <aml@world.std.com> wrote:
>>(Perl's arrays start counting at zero, not one. I know that perl is
>>supposed to have more than one way of doing most things, but zero
>>based arrays are so ingrained, fighting perl may not be worth it.)
>Perl's arrays start counting at whatever you want them to start counting
>at. Try perldoc perlvar.
You're right. I should have mentioned that $[ was an available, but
severely deprecated method of changing the lower array bound.
"Perl's arrays default to start counting at zero, not one. I know that
perl is supposed to have more than one way of doing most things, but
zero based arrays are so ingrained, fighting perl may not be worth
it. If you have a real need for arrays based on something other than
zero, use the depricated $[ variable to change the lower bound, rather
than just ignoring the first element."
--
Andrew Langmead
------------------------------
Date: Sun, 01 Mar 1998 19:41:15 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: local $/
Message-Id: <34f9f9c7.15985262@news.tornado.be>
rick@marinweb.com (Rick Freeman) wrote:
>Is this safe within a subroutine:
>
>local $/;
>undef $/;
>
>Will it do what I want, which is to undefine the input record
>separator, but only for this sub?
Yup. For this subroutine and any subs you call from here.
You don't even need the "undef" statement. Just "local $/" will make it
undef.
HTH,
Bart.
------------------------------
Date: Sun, 01 Mar 1998 14:56:25 -0800
From: ~arthur <star@sonic.net>
Subject: Re: many ways but i can not find one
Message-Id: <34F9E799.3E2E@sonic.net>
Thanks Martin,
i did look but being a newbe at programing --one may look but one may
not c, especially in Perl-- Ha-Ha (little humour).
Thanks again,
~arthur
------------------------------
Date: Sun, 01 Mar 1998 21:27:41 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: need help
Message-Id: <34f9c4bd.524144494f47414741@radiogaga.harz.de>
crlin@hotmail.com wrote:
: There's a input file contain many lines with format like: name value,
[...]
: Now I want to creat an output file with the format like:
: name value_adds times
: the name is the same as input file's first field but this name
: will be unique in output file.value_add is the value add on all
: the input files's second field if their first field are the same.
: adn times is the number of times that have been added on.
[...]
: How could I achieve ?
Iterating over the input file, you read each line into $line.
Then you split() it into $name and $value (don't forget to chomp()
it first). What you want then is
$value_add{$name} += $value;
++$times{$name};
Then you iterate over the keys of %value_add (or %times),
and print() the key and the corresponding values from %value_add
and %times to the output file.
To implement this should really be easy.
cu,
Martin
--
| Martin Vorlaender | VMS & WNT programmer
Ceterum censeo | work: mv@pdv-systeme.de
Redmondem delendam esse. | http://www.pdv-systeme.de/users/martinv/
| home: martin@radiogaga.harz.de
------------------------------
Date: Sun, 1 Mar 1998 21:06:20 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: need help
Message-Id: <Ep5ryK.4z4@world.std.com>
crlin@hotmail.com writes:
> Now I want to creat an output file with the format like:
> name value_adds times
> the name is the same as input file's first field but this name
>will be unique in output file.value_add is the value add on all
>the input files's second field if their first field are the same.
>adn times is the number of times that have been added on.
Loop around the input file, split the line into two elements on the
whitespace between them.
If you feel comfortable with Perl's references and multidimentional
data structures, the the first item be a key in a hash that points to
a two element array. In one of the elements, add the second item from
the line in the file, in the other element of the array, increment the
count of the number of times the key has been accessed.
If you aren't comfortable with references, use the first item as a key
in two different hashes. One hash has the sum, the other keeps count
of the number of times the key has been found.
When you are done reading the input file, loop around the keys of the
hash (If you use the two parallel hashes, either one should do.) print
out the key and the two calculated values.
For more about references and multidimensional data structures, take a
look at the perlref, perldsc, and perllol man pages. They should have
come with the perl interpreter that you are using. If not, take look
at:
<URL:http://www.perl.com/CPAN/doc/manual/html/pod/perlref.html>
<URL:http://www.perl.com/CPAN/doc/manual/html/pod/perldsc.html>
<URL:http://www.perl.com/CPAN/doc/manual/html/pod/perllol.html>
These types of functions are really basic hash (associative array)
features. (and hashes are one of the most fundamental features of
perl.) If this question was a real stumbling block, maybe you should
look into a perl tutorial like "Learning Perl"
<URL:http://www.oreilly.com/catalog/lperl2/>
--
Andrew Langmead
------------------------------
Date: 1 Mar 1998 19:01:01 GMT
From: ronaldws@aol.com (RonaldWS)
Subject: Never want to work there again. (SPAM but please read anyway)
Message-Id: <19980301190100.OAA16161@ladder02.news.aol.com>
Sorry to trouble you all. I once worked on a contract at the Merrill Lynch
corporation. I fled for the corporate campus in fear for my safety and my
sanity. Since then my life has gone to pieces and I hold them generally
responsible. I have helped some people on this newsgroup and hope to keep
helping if I can. I like perl and hope to keep learning it but do not think I
will have much of a chance. Keep well and program well.
Ronald Schmidt.
------------------------------
Date: 1 Mar 1998 23:46:56 GMT
From: "Luis Espinal" <lespin03@solix.fiu.edu>
Subject: perl tutorial
Message-Id: <01bd456c$63ce7060$0f02000a@luisespi>
Hi guys,
I'm looking for a free, downloadable tutorial on Perl. I would prefer if it
is
in TeX, PostScript, HTML or some other markup language (a plain-vanela
text file would be "digestable", too:) I've got several tutorials in Awk
and
Sed but none on Perl.
If you know of any, please let me know.
Luis Espinal.
--
What does not kill us, makes us stronger.
Nietzsche.
L^3 = Long Live Linux
------------------------------
Date: Sun, 1 Mar 1998 20:43:36 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Problem with "goto" in Perl
Message-Id: <Ep5qwo.Cp4@world.std.com>
Angy <angyny@interport.net> writes:
>I have a problem with goto in Perl. It looks alike perl can only "goto"
>back to previous lines, but not afterwards lines (correct me if I'm
>wrong).
This does not seem to be the case. But if you look at the perltrap man
page, it documents that you can't goto into a block that has been
optimized away.
<URL:http://www.perl.com/CPAN/doc/manual/html/pod/perltrap.html>
>My perl code has 3 parts. In 1st part, I check some error
>conditions, and if true, I need to exit 1st part. Actually I'd rather
>use "goto" to exit 1st part and directly go into 2nd part.
Is there some reason why you can't use a more structured form of flow
control? If the first part is a loop, maybe using "last". If not,
maybe a conditional like "if" to skip over the rest of the first
section. Maybe you could make part1 a subroutine unto itself and you
would just have to return to start on part2.
If goto is the answer, its probably a poor question.
--
Andrew Langmead
------------------------------
Date: Sun, 01 Mar 1998 11:00:29 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Random Link Script for NT Server?
Message-Id: <34f931bd.524144494f47414741@radiogaga.harz.de>
Carl (carlt@dial.pipex.com) wrote:
: Do you know of a random link script for NT IIS4?
It's as easy as
#!perl -w
srand();
# ToDo: Get the list of links from somewhere and put it into @links
print "Location: $links[rand @links]\n\n";
This should work even with Micro$oft's IIS...
cu,
Martin
P.S.: The ToDo part is left to the reader as an exercise.
--
| Martin Vorlaender | VMS & WNT programmer
Ceterum censeo | work: mv@pdv-systeme.de
Redmondem delendam esse. | http://www.pdv-systeme.de/users/martinv/
| home: martin@radiogaga.harz.de
------------------------------
Date: Fri, 27 Feb 1998 14:42:20 +1100
From: Tim Archer <tarcher@csu.edu.au>
Subject: Stripping (Most) HTML tags
Message-Id: <34F6361C.380E2C18@csu.edu.au>
Hi all.
I am looking for a perl script that will strip all tags except for a
given list from a document.
It is to check messages posted to a forum, and only a certain number of
HTML tags are going to be allowed.
I would also like to check to see that each of the tags used are
terminated before the end of the message. But this is les important
than removing all the 'bad' tags.
I know that have seen a script somewhere that does this, but for the
life of me I can't recall where. *sigh*, and I would rather use existing
code than write something (probably wildly inefficient and buggy)
myself.
Would someone please be able to help?
Many Thanx,
Tim
--
Tim Archer - tarcher@csu.edu.au
WWW Programmer @ Charles Sturt University,
New South Wales, Australia.
------------------------------
Date: Sun, 01 Mar 1998 14:31:50 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Upgrading from Perl 4 to Perl 5 - Differences?
Message-Id: <fl_aggie-0103981431510001@aggie.coaps.fsu.edu>
In article <34f926a1.0@newsread1.dircon.co.uk>, "Tan"
<tan@jettech.dircon.co.uk> wrote:
+ Could anyone tell me what the main differences are between perl 4 and perl
+ 5. I have a written a lot of scripts under Perl 4 and would like to know
+ whether they will work under Perl 5.
There should (better?? :) be a CHANGES document in the perl 5 distribution.
Someone wrote a "gotcha" list of things between 4 and 5, which should be in
the CPAN and somewhere on http://www.perl.com
+ Are there specific syntactical differences?
The most obvious one is the "@" in quoted strings. Things like email
addresses:
$address="tan@jettech.dircon.co.uk"; # ok in v4 but not in v5
$address="tan\@jettech.dircon.co.uk"; # ok in v4 and v5
v5 would look at '@jettech' as an array. Running with the -w switch will
warn you about these gotcha's.
On the bright side, you can run v4 and v5 side-by-side, if you want, and
can test your scripts as you can/want/need to basis.
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: 1 Mar 1998 16:19:55 -0500
From: David Meyers <dmeyers@panix.com>
Subject: Re: use system or backticks??
Message-Id: <yob4t1i2jnw.fsf@panix.com>
Tom Christiansen <tchrist@mox.perl.com> writes:
> In comp.lang.perl.misc, mshavel@erols.com (Michael Shavel) writes:
> :explain the difference between the backticks and using "system".
>
> The explanation for that is in the standard perlfaq8 manpage, distributed
Also, in the Llama book, there is a very handy little chart
comparing various alternatives (``, system, open(,"|"), etc)
and the inheritance of filehandles and such.
--
dmeyers@panix.com
"Any technology distinguishable from magic
is insufficiently advanced."
------------------------------
Date: Mon, 02 Mar 1998 09:21:35 +1100
From: Jaime Metcher <metcher@spider.herston.uq.edu.au>
Subject: Re: What does this one-liner do?
Message-Id: <34F9ED7F.6F7737B2@spider.herston.uq.edu.au>
Abigail wrote:
>
>
> Nope. ($a) = (7, 8, 9) is *not* a scalar assignment. It's a list
> assignment. It just happens to have a side effect, setting $a to 7.
> The result of the assignment is the list (7, 8, 9).
>From the Blue Camel p. 93:
"In all cases, the value of the assignment is the new value of the
variable".
How does this map to what you just said? Isn't the value of the first
(i.e. rightmost) assignment (7)? In the example:
($a, $b, $c) = (7, 8, 9);
what is "the variable"? If I do:
perl -e "print (join (':', ($a, $b) = (7, 8, 9)))"
I get:
7:8
which seems to imply that the "variable" is the LHS, which becomes
(7,8). I've added $b to make it completely clear that the assigment is
evaluating to a list, and that it evaluates to the list on the LHS.
I understand the "list assignment in a scalar context" rule and why it
is so useful. What I don't understand is whether the list assignment
rule is being claimed as being consistent with the "In all cases" rule I
quoted above, or if it is an exception. Something like:
"The value of an assignment is the the value that gets assigned to the
LHS, except where the assignment is a list assignment in a scalar
context. In this case, the value of the assignment is the value of the
RHS."
--
Jaime Metcher
------------------------------
Date: Mon, 02 Mar 1998 10:02:45 +1300
From: _Admin <mark@wnmeds.ac.nz>
Subject: Win32::NetAdmin::UserCreate qn
Message-Id: <34F9CCF5.85F@wnmeds.ac.nz>
hi
The documentation on Win32::NetAdmin::UserCreate doesn't seem to include
an option to assign a drive letter to a user's home directory. Am i
missing something here?
I am using NT 4.0 by the way.
ta
Mark
------------------------------
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 1998
**************************************