[15485] in Perl-Users-Digest
Perl-Users Digest, Issue: 2895 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 28 14:20:36 2000
Date: Fri, 28 Apr 2000 11:20:27 -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: <956946027-v9-i2895@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 28 Apr 2000 Volume: 9 Number: 2895
Today's topics:
Re: Remove all empty spaces at the end of a string <ppi@searchy.net>
Re: Remove all empty spaces at the end of a string <gellyfish@gellyfish.com>
Re: Remove all empty spaces at the end of a string <jeff@vpservices.com>
Re: Remove all empty spaces at the end of a string <andrew.mcguire@walgreens.com>
Re: Remove all empty spaces at the end of a string <aqumsieh@hyperchip.com>
Re: Remove all empty spaces at the end of a string <flavell@mail.cern.ch>
Re: Remove all empty spaces at the end of a string nobull@mail.com
Re: Security: why no '.' in path? <lr@hpl.hp.com>
Re: Security: why no '.' in path? <rootbeer@redcat.com>
String to scalar schnurmann@my-deja.com
Re: String to scalar <rootbeer@redcat.com>
Re: String to scalar <rhomberg@ife.ee.ethz.ch>
Re: String to scalar <DNess@Home.Com>
Re: String to scalar <jonny@jonnysoft.co.uk>
Re: substitution question <iltzu@sci.invalid>
Re: trying to access elements of a scalar variable <iltzu@sci.invalid>
Re: URI-1.06 broken under Perl 5.6.0 on NT <randy@theoryx5.uwinnipeg.ca>
Re: using CPAN: what's all this junk!? (Tad McClellan)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 28 Apr 2000 17:12:58 +0200
From: Penpal International <ppi@searchy.net>
Subject: Re: Remove all empty spaces at the end of a string
Message-Id: <3909AA7A.4F1E0E1E@searchy.net>
It's to hard to find a question in the perlfaq's. It waste of time to
read all question to find one which could give an answer to your
question... They have perl, but nowhere on the internet to search
through the HTML pod documents.......
Alex Rhomberg wrote:
>
> Penpal International wrote:
> >
> > How can I remove all spaces at the the end of string?
>
> Strange. This question comes up about every two weeks in this ng. One
> might think that this is often enough to warrant a faq entry.
> probably in perlfaq4?
>
> - Alex
--
Penpal International
http://ppi.searchy.net/
ppi@searchy.net
------------------------------
Date: Fri, 28 Apr 2000 15:25:04 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Remove all empty spaces at the end of a string
Message-Id: <k3iO4.1511$fT4.151829@news.dircon.co.uk>
On Fri, 28 Apr 2000 17:12:58 +0200, Penpal International Wrote:
> Alex Rhomberg wrote:
>>
>> Penpal International wrote:
>> >
>> > How can I remove all spaces at the the end of string?
>>
>> Strange. This question comes up about every two weeks in this ng. One
>> might think that this is often enough to warrant a faq entry.
>> probably in perlfaq4?
>>
>
> It's to hard to find a question in the perlfaq's. It waste of time to
> read all question to find one which could give an answer to your
> question...
Its a waste of *our* time for you to be asking questions that are answered
well and answered in the FAQ that is distributed with Perl. If you think
your time is more valuable than mine then fine - but I can guarantee you
will get no more help from me.
> They have perl, but nowhere on the internet to search
> through the HTML pod documents.......
>
So what precisely do you get when you type :
perldoc -q space
at some command prompt on your system ?
Bye Bye.
/J\
------------------------------
Date: Fri, 28 Apr 2000 08:48:53 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Remove all empty spaces at the end of a string
Message-Id: <3909B2E5.A47FD5@vpservices.com>
Penpal International wrote:
>
> It's to hard to find a question in the perlfaq's.
Is it? In addition to perldoc, there are many other ways, for example
using grep or, for windoze "find".
> It waste of time to
> read all question to find one which could give an answer to your
> question
Right, you might accidently stumble on somtheing that you will need next
week instead of today and it would be such a waste of time to read it
now. And if you have the slightest knowledge of any text searching
tools, there is no need to read all the questions anyway.
> ... They have perl, but nowhere on the internet to search
> through the HTML pod documents.......
Umm, nowhere except every CPAN site in the world. Just open
http://www.perl.com/CPAN-local/doc/FAQs/FAQ/PerlFAQ.html
in a browser and use the browser's find function to search the entire
text of all the FAQs at once. Searching for the word "space" in that
document gives the appropriate FAQ question for your subject line on the
first hit.
--
Jeff
------------------------------
Date: Fri, 28 Apr 2000 10:52:10 -0500
From: "Andrew N. McGuire" <andrew.mcguire@walgreens.com>
Subject: Re: Remove all empty spaces at the end of a string
Message-Id: <3909B3AA.DC85A02F@walgreens.com>
Penpal International wrote:
>
> It's to hard to find a question in the perlfaq's. It waste of time to
> read all question to find one which could give an answer to your
> question... They have perl, but nowhere on the internet to search
> through the HTML pod documents.......
[ snip ]
Help you I can, yes mmmm.
vi = ESC + : + /
netscape = Alt + F or Cntl + F (depending on platform)
pico = Cntl + w
www = www.google.com
files = grep
emacs = Cntl + s
xedit = Cntl + s
perl = perldoc
unix = man
Many ways, there are, to find what you seek.
Hmm. Seek www.perl.com you do, much documentation there is.
Click on documentation link, you must.
Regards,
anm
--
Andrew N. McGuire
andrew.mcguire@walgreens.com
------------------------------
Date: Fri, 28 Apr 2000 16:00:59 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Remove all empty spaces at the end of a string
Message-Id: <7aitx2rz9h.fsf@Merlin.i-did-not-set--mail-host-address--so-shoot-me>
Penpal International <ppi@searchy.net> writes:
> It's to hard to find a question in the perlfaq's. It waste of time to
> read all question to find one which could give an answer to your
> question... They have perl, but nowhere on the internet to search
> through the HTML pod documents.......
Each of your statements above is false:
1) It is not hard to find questions in the PerlFAQs.
2) It is definitely NOT a waste of time to read all questions in the
PerlFAQs. In fact, I advise you to do so at least once, especially
around the early stages of your Perl learning.
3) There are ways to search the FAQs easily. You should have inquired
about them instead of complaining.
If you are browsing the HTML version (yuck!) of the perlFAQs, then
your browser should be equipped with a 'find' fucntion that allows you
to search for keywords. You can definitely use that.
But, the recommended way is to use 'perldoc', which is a program that
comes with every Perl distribution. Once you learn how to use perldoc
(which is very simple), then you should have no more excuses for
asking FAQs.
--Ala
------------------------------
Date: Fri, 28 Apr 2000 17:50:42 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Remove all empty spaces at the end of a string
Message-Id: <Pine.GHP.4.21.0004281746310.18513-100000@hpplus01.cern.ch>
On Fri, 28 Apr 2000, Penpal International turned usenet upside down
and shook this out into the world miasma of bogosity:
> It's to hard to find a question in the perlfaq's. It waste of time to
> read all question to find one which could give an answer to your
> question...
On the contrary - reading FAQs often brings good answers to questions
you didn't realise that you needed to ask. And perldoc -q can search
out the specific Perl FAQ that you need.
> They have perl, but nowhere on the internet to search
> through the HTML pod documents.......
Scorefile adjusted, killfile poised for action. Bye.
------------------------------
Date: 28 Apr 2000 17:13:31 +0100
From: nobull@mail.com
Subject: Re: Remove all empty spaces at the end of a string
Message-Id: <u9k8hi19w4.fsf@wcl-l.bham.ac.uk>
[ Please put your comments following the quoted text that you
are commenting on. Jeopardectomy performed. ]
Penpal International <ppi@searchy.net> whines:
> Alex Rhomberg wrote:
> > Strange. This question comes up about every two weeks in this ng. One
> > might think that this is often enough to warrant a faq entry.
> > probably in perlfaq4?
> It's to hard to find a question in the perlfaq's.
It doesn't matter how hard it is. Being prepared to read the FAQ is
part of the entry fee for asking questions in a newsgroup - especially
a technical one.
Failure to do this will get you flamed. If you can't stand the heat
stay out of the kitchen.
Actually I think a better metaphor is "If you can't follow basic
hygiene protocols stay out of the kitchen."
> It waste of time to
> read all question to find one which could give an answer to your
> question...
Even with no automation and a slow reading speed it wastes less than 5
minuites to read all the questions in the Perl FAQ and consider the
relevance of each one (of course with automation or if you read the
more relevant FAQ sections first it's a lot quicker). That is an
order of magnitude less time than is wasted by the comp.lang.perl.misc
readership as a whole everytime some slob posts a frequently asked
question.
By valuing your time so much more than ours you are being very rude
and insulting. I'll say that again just in case it passed you by:
"you are being very rude and insulting". You may feel that some
people here are being rude or insulting towards you but you must
remeber you insulted us first.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 28 Apr 2000 09:51:07 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Security: why no '.' in path?
Message-Id: <MPG.13736151bef95ec598a9a1@nntp.hpl.hp.com>
In article <8ebbto$3v8$1@orpheus.gellyfish.com> on 28 Apr 2000 07:43:04
+0100, Jonathan Stowe <gellyfish@gellyfish.com> says...
...
> True but there are servers where the 'directory in which the script is
> located' is not a meaningful concept and I guess the looseness came from
> trying to deal with them.
I wonder. Can there possibly exist operating systems nowadays that do
not support the concept of 'set the current directory to the directory
in which the script is located'?
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 28 Apr 2000 10:35:35 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Security: why no '.' in path?
Message-Id: <Pine.GSO.4.10.10004281032590.21722-100000@user2.teleport.com>
On Fri, 28 Apr 2000, Larry Rosler wrote:
> I wonder. Can there possibly exist operating systems nowadays that do
> not support the concept of 'set the current directory to the directory
> in which the script is located'?
I'd say yes: Programs don't have to be stored in files; they can be
generated by other programs and exist only in memory, for example. But
let's not get into weird operating systems in a newsgroup about a totally
non-weird language. :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 28 Apr 2000 16:22:40 GMT
From: schnurmann@my-deja.com
Subject: String to scalar
Message-Id: <8ecdrs$5gh$1@nnrp1.deja.com>
I know this is a really dumb question, but how does one get from a
string that contains a number to a scalar?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 28 Apr 2000 09:58:25 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: String to scalar
Message-Id: <Pine.GSO.4.10.10004280956240.21722-100000@user2.teleport.com>
On Fri, 28 Apr 2000 schnurmann@my-deja.com wrote:
> I know this is a really dumb question, but how does one get from a
> string that contains a number to a scalar?
It's zennish: Once you think of the question, you've already got the
answer. :-)
In Perl, a string value is a scalar value. Did you mean something else?
You would probably benefit from an introductory text on Perl, such as the
oft-recommended "Learning Perl" from O'Reilly. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 28 Apr 2000 18:58:58 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: String to scalar
Message-Id: <3909C352.ADBC6962@ife.ee.ethz.ch>
schnurmann@my-deja.com wrote:
>
> I know this is a really dumb question, but how does one get from a
> string that contains a number to a scalar?
a string is a scalar.
Strings are automagically converted to numbers and vice-versa, depending
on the context
- Alex
------------------------------
Date: Fri, 28 Apr 2000 17:11:52 GMT
From: David Ness <DNess@Home.Com>
Subject: Re: String to scalar
Message-Id: <3909C660.7F5CAC59@Home.Com>
Tom Phoenix wrote:
>
> On Fri, 28 Apr 2000 schnurmann@my-deja.com wrote:
>
> > I know this is a really dumb question, but how does one get from a
> > string that contains a number to a scalar?
>
> It's zennish: Once you think of the question, you've already got the
> answer. :-)
>
Is that because the `sound of one hand clapping' is a metaphor for the
`sound of one zero adding'?
------------------------------
Date: Fri, 28 Apr 2000 18:43:18 +0100
From: Jonathan Barker <jonny@jonnysoft.co.uk>
Subject: Re: String to scalar
Message-Id: <3909CDB5.78413230@jonnysoft.co.uk>
One of the delights of Perl is that you can treat a scalar like a
number, or text, whenever you need to!
schnurmann@my-deja.com wrote:
> I know this is a really dumb question, but how does one get from a
> string that contains a number to a scalar?
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: 28 Apr 2000 17:38:40 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: substitution question
Message-Id: <956941109.20596@itz.pp.sci.fi>
In article <3907A499.4C609706@geocities.com>, borg wrote:
>I am looking for a way to rename all the text files in a dir to html. ie
>I want to change their extensions. Normally when I want to replace
>something in a file I use:
TIMTOWTDI, here's one:
perl -e '$new =~ s/\.txt$/.html/ and rename $old, $new while $new = $old = shift' *
Although usually if I need to do something like that it somehow
involves find:
find . -print0 | perl -ln0e '$old = $_; s/\.txt$/.html/ and rename $old, $_'
Checking the return value of rename is also advisable, particularly if
you're not absolutely certain which files will be affected:
find . -print0 | perl -ln0e '$old = $_; s/\.txt$/.html/ and print "$old -> $_ .. ", rename($old, $_) ? "ok" : "failed: $!"'
Also note that this will still silently overwrite any existing file
named foo.html if foo.txt also exists, so you may wish to check for
that yourself.
find . -print0 | perl -ln0e '$old = $_; s/\.txt$/.html/ and print "$old -> $_ .. ", -e $_ ? "file exists" : rename($old, $_) ? "ok" : "failed: $!"'
Sorry for the long lines.
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: 28 Apr 2000 16:36:14 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: trying to access elements of a scalar variable
Message-Id: <956939530.19650@itz.pp.sci.fi>
In article <MPG.1370c3dbb4d9765298a986@nntp.hpl.hp.com>, Larry Rosler wrote:
>But he could also do 'chop reverse $scalar', as he doesn't seem to mind
>using 'chop several times'. One chop will do it. :-)
$ perl -le 'print chop reverse "foo"'
Can't modify reverse in chop at -e line 1, at EOF
Execution of -e aborted due to compilation errors.
>I recall from some benchmarks posted here a while ago that that was the
>fastest approach of all, believe it or not!
#!/usr/bin/perl -w
use strict;
use Benchmark;
use vars qw/$str/;
print "String = '", ($str = shift), "'\n";
timethese 1 << (shift || 0),
{ chop => 'my $c = chop (my $x = reverse $str)',
substr => 'my $c = substr $str, 0, 1',
split => 'my ($c) = split // => $str, 2',
regex => 'my ($c) = $str =~ /(.)/s',
};
__END__
String = 'foo'
Benchmark: timing 1048576 iterations of chop, regex, split, substr...
chop: 3 wallclock secs ( 2.30 usr + -0.01 sys = 2.29 CPU)
regex: 5 wallclock secs ( 5.34 usr + 0.02 sys = 5.36 CPU)
split: 6 wallclock secs ( 6.79 usr + 0.00 sys = 6.79 CPU)
substr: 1 wallclock secs ( 1.32 usr + 0.00 sys = 1.32 CPU)
String = 'abcdefghijklmnopqrstuvwxyz'
Benchmark: timing 1048576 iterations of chop, regex, split, substr...
chop: 3 wallclock secs ( 2.75 usr + 0.00 sys = 2.75 CPU)
regex: 6 wallclock secs ( 5.47 usr + 0.00 sys = 5.47 CPU)
split: 8 wallclock secs ( 7.29 usr + 0.00 sys = 7.29 CPU)
substr: 2 wallclock secs ( 1.33 usr + 0.00 sys = 1.33 CPU)
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: 28 Apr 2000 17:37:33 GMT
From: Randy Kobes <randy@theoryx5.uwinnipeg.ca>
Subject: Re: URI-1.06 broken under Perl 5.6.0 on NT
Message-Id: <8eci8t$no2$1@canopus.cc.umanitoba.ca>
In comp.lang.perl.misc, ajmayo@my-deja.com wrote:
> Building URI-1.06 (latest version) having built Perl 5.6.0 cleanly on
> WinNT4 SP6,
> nmake test fails with
> bless( do{\(my $o = 'file://C:/TEMP/')}, 'URI::file' )], 'URI::URL' );
> Test Failed at t\old-base.t line 22
> URI::URL::_expect('file://C:/TEMP/', 'as_string',
> 'file:C%3A/TEMP/') called at t\old-base.t line 675
> This looks worryingly like something to do with the new Unicode stuff.
> Last version of Perl I built URI on was 5.005_03, where there were no
> problems. This has brought my mod_perl install on NT to a screeching
> halt.
Hi,
This failure I also found with perl-5.005_03 on a Win98
machine, so I don't think it's something specific to 5.6.0.
I installed URI anyway, and so far haven't run into any
problems; in particular, mod_perl built fine and passed
all its tests.
best regards,
randy kobes
------------------------------
Date: Fri, 28 Apr 2000 09:20:52 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: using CPAN: what's all this junk!?
Message-Id: <slrn8gj41k.2io.tadmc@magna.metronet.com>
On Thu, 27 Apr 2000 21:24:42 GMT, jlamport@calarts.edu <jlamport@calarts.edu> wrote:
>In article <slrn8gbmrp.5pk.tadmc@magna.metronet.com>,
> tadmc@metronet.com (Tad McClellan) wrote:
>>
>> That might imply that your Question is Asked Frequently.
>>
>> perldoc -q module
>>
>> "How do I keep my own module/library directory?"
>>
>
>perldoc doesn't understand the -q switch on my system. Can you point me
>to some other resource for locating relevant entries in the FAQ? I spent
>nearly twenty minutes trying to find something useful in that rat's nest
>they call a FAQ over at www.perl.com -- to no avail. I, of all people,
>would *much* rather RTFM than post questions to a newsgroup, but first I
>need to *find* TFM...
How to find TFM on a properly installed perl:
type:
perl -V
If that doesn't work, type
perl -e 'print "$_\n" for @INC'
That gives a list of the directories in your "include path".
Under one of those dirs is a subdir named "pod/" containing the docs.
Now use grep (or perl) to word search to your heart's content :-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 2895
**************************************