[22966] in Perl-Users-Digest
Perl-Users Digest, Issue: 5186 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 7 00:05:45 2003
Date: Sun, 6 Jul 2003 21:05:06 -0700 (PDT)
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, 6 Jul 2003 Volume: 10 Number: 5186
Today's topics:
Re: Alternative to use vars <ben.goldberg@hotpop.com>
Re: file opening <grazz@pobox.com>
javascript cookies? and data mining project. (Douglas Johnosn)
Re: Module of sending http 1.1 and/or 1.0 requests <bdonlan@bd-home-comp.no-ip.org>
Re: naming hash using a variable name. <uri@stemsystems.com>
Re: naming hash using a variable name. <flavell@mail.cern.ch>
Re: naming hash using a variable name. <uri@stemsystems.com>
Re: naming hash using a variable name. <nanae@perusion.com>
Re: Net::POP3 <s.patterson@freeuk.com>
Re: pipe - non blocking read? (fork/Win32) <ben.goldberg@hotpop.com>
Re: pipe - non blocking read? (fork/Win32) (Bryan Castillo)
Re: Problem with counter CGI script <noreply@gunnar.cc>
Using a variable within a tr// <ineverreadanythinsenttome@hotmail.com>
Re: Using a variable within a tr// (Sam Holden)
Re: Using a variable within a tr// <ineverreadanythinsenttome@hotmail.com>
Re: Using a variable within a tr// <bdonlan@bd-home-comp.no-ip.org>
Re: Using a variable within a tr// <REMOVEsdnCAPS@comcast.net>
Re: Using a variable within a tr// (Tad McClellan)
Re: Using a variable within a tr// (Sam Holden)
Re: Using a variable within a tr// <ineverreadanythinsenttome@hotmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 06 Jul 2003 23:05:36 -0400
From: Benjamin Goldberg <ben.goldberg@hotpop.com>
Subject: Re: Alternative to use vars
Message-Id: <3F08E380.84F3C5D4@hotpop.com>
Bart Lateur wrote:
>
> Martien Verbruggen wrote:
>
> >> You are not the only one trying to grasp that. The concept of
> >> lexically scoped global (that is, dynamic) variables truely escapes
> >> me. The only advantage I see is that you can introduce new global
> >> variables everywhere easily like so:
> >
> >You can limit (with our) where that global variable is accessible:
>
> The part that makes no sense to me, is how use of these var now
> crosses package boundaries...
>
> $Bar::x = 123;
> package Foo;
> our $x = "abc";
> package Bar;
> print $x;
>
> Guess what that'll print?
The same thing as:
$Bar::x = 123;
package Foo;
my $x; Devel::LexAlias::lexalias(0, '$x', \$Foo::x);
$x = "abc";
package Bar;
print $x;
Or:
$Bar::x = 123;
package Foo;
use Perl6::Binding;
my $x := $Foo::x;
$x = "abc";
package Bar;
print $x;
[both untested]
You could even leave out either or both of the "package Foo;" and
"package Bar;" lines, and get the exact same effect.
--
$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}
------------------------------
Date: Sun, 06 Jul 2003 23:41:19 GMT
From: Steve Grazzini <grazz@pobox.com>
Subject: Re: file opening
Message-Id: <zs2Oa.4682$19.588@nwrdny03.gnilink.net>
Darren Dunham <ddunham@redwood.taos.com> wrote:
> grazz@pobox.com wrote:
> > j <john62@electronmail.com> wrote:
> >> is there some way to try to open a file in perl such that it will
> >> fail if the file exists?
>
> > $ perldoc -f sysopen
>
> > You'd need the O_CREAT and O_EXCL flags, something like:
>
> > sysopen(FH, $path, O_WRONLY|O_CREAT|O_EXCL)
> > or die "sysopen: $path: $!";
>
> Note that this depends entirely on the cooperation of the OS and the
> filesystem. This is almost always guaranteed to work on a local
> filesystem of a UNIX machine. It is not guaranteed to work over NFS.
Yep.
The relevant FAQ (which I should have cited as well) makes this clear:
% perldoc -q "why can't i just open"
By the way: sorry for posting this old ("postponed" in tin) article;
managed to squash just the right combination of keys with the heel of
my hand and sent it out by mistake.
--
Steve
------------------------------
Date: 6 Jul 2003 18:51:00 -0700
From: douglasmj1@comcast.net (Douglas Johnosn)
Subject: javascript cookies? and data mining project.
Message-Id: <70b5eca2.0307061751.1b14cfd1@posting.google.com>
Does anyone have any idea how to catch javascript cookies with perl?
This has been driving me crazy for a week or so and I just though that
maybe someone with a little more experience had tackeled this problem
before.
I am also looking for a data mining project to follow/contribute to.
All I could find on source forge was ht://check which was written in
c/php neitherr of these languages are attractive to me. Any Comments
would be much appreciated.
-Douglas Marshall Johnson
------------------------------
Date: Sun, 06 Jul 2003 20:09:36 -0400
From: "bd" <bdonlan@bd-home-comp.no-ip.org>
Subject: Re: Module of sending http 1.1 and/or 1.0 requests
Message-Id: <pan.2003.06.26.21.57.31.213904@bd-home-comp.no-ip.org>
On Thu, 26 Jun 2003 01:54:45 +0000, Abigail wrote:
> bd (bdonlan@bd-home-comp.no-ip.org) wrote on MMMDLXXXVI September
> MCMXCIII in <URL:news:pan.2003.06.26.01.27.16.347494@bd-home-comp.no-ip.org>:
> %% On Wed, 25 Jun 2003 18:25:24 -0700, Yuchung Cheng wrote:
> %%
> %% > Anybody knows what perl module I can use to specify the http request as
> %% > http 1.1 or 1.0? It seems I can't do that with http::request. Thank you.
> %%
> %% Have you taken a look at LWP?
>
>
> Considering that HTTP::Request is part of the LWP bundle, what do you
> think the answer to your question is?
Ah, didn't know that.
--
Freenet distribution not available
In real love you want the other person's good. In romantic love you
want the other person.
-- Margaret Anderson
------------------------------
Date: Mon, 07 Jul 2003 00:12:45 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: naming hash using a variable name.
Message-Id: <x765mfdwjn.fsf@mail.sysarch.com>
>>>>> "Ph" == Perusion hostmaster <nanae@perusion.com> writes:
>> my $tmp1 = $rand[rand @rand];
>>
>> that is the classic select a random element from an array idiom.
Ph> With luck I will remember that next time and flag it as
Ph> authoritative. 8-)
>>
Ph> $hash{$tmp1} = {};
>> no need to initialize that. autovivification will handle it for
>> you.
Ph> I do know that. I am not a big fan of autovivification, and almost
Ph> always explicitly instantiate anonymous refs. In fact, I would
Ph> like to see:
Ph> use strict qw/no_autovivify/;
autoviv is good for you in general. if you had to manually do it each
time, it would be a major pain to dynamically generate deep
structures. you couldn't just push into a hash slot, you would have to
check and then initialize it each time:
push( @{$self->{'foo'}}, $stuff ) ;
push( @{$self->{'foo'} ||= [] }, $stuff ) ;
and that gets worse with each level.
Ph> for(my $i = 0; $i < @ARGV; $i++) { $hash{$tmp1}{$ARGV[$i]} = $i;
>>
>> @{$hash{$tmp1}}{@ARGV} = 0 .. $#ARGV ;
>>
Ph> Done that way to try and talk to the less-experienced on their
Ph> level.
and you can even talk lower level that your code. you have to write code
to some level of skill and not below that. i prefer to use hash slices
as they are not complex, obscure and are teachable. look at my paper on
them at
http://www.sysarch.com/perl/tutorials/hash-slices.txt
Ph> If you insist on the tired Perl 4 way:
>> no, he doesn't insist upon it. you shouldn't even show how symrefs
>> can be done. go with your correct instincts and not show it at all.
Ph> You are probably right.
s/probably// ;
:-)
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Mon, 7 Jul 2003 02:20:57 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: naming hash using a variable name.
Message-Id: <Pine.LNX.4.53.0307070219340.21085@lxplus011.cern.ch>
On Mon, Jul 7, Uri Guttman inscribed on the eternal scroll:
> http://www.sysarch.com/perl/tutorials/hash-slices.txt
404 not found!
Google found it at
http://www.sysarch.com/perl/tutorials/hash_slices.txt
(underscore instead of minus)
------------------------------
Date: Mon, 07 Jul 2003 00:47:04 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: naming hash using a variable name.
Message-Id: <x7y8zbcgdz.fsf@mail.sysarch.com>
>>>>> "AJF" == Alan J Flavell <flavell@mail.cern.ch> writes:
AJF> On Mon, Jul 7, Uri Guttman inscribed on the eternal scroll:
>> http://www.sysarch.com/perl/tutorials/hash-slices.txt
AJF> 404 not found!
AJF> Google found it at
AJF> http://www.sysarch.com/perl/tutorials/hash_slices.txt
AJF> (underscore instead of minus)
i pasted it. but i have a VERY EVIL mod to my emacs which toggles _ and
- on input. so it did that on the paste. as to why i flip those chars,
in perl (and in c when i first did it) i typed -> so often, that now i
can type it shifted. and i used _ with tokens so often, that now i can
type it unshfted with the rest of the alphas.
as i said, VERY EVIL. i wouldn't wish this on anyone who wasn't as lazy
as i am. :)
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Mon, 7 Jul 2003 02:43:29 +0000 (UTC)
From: Perusion hostmaster <nanae@perusion.com>
Subject: Re: naming hash using a variable name.
Message-Id: <slrnbghnir.atn.nanae@ns.valuemedia.com>
On Mon, 07 Jul 2003 00:12:45 GMT, Uri Guttman <uri@stemsystems.com> wrote:
>>>>>> "Ph" == Perusion hostmaster <nanae@perusion.com> writes:
> >>
> Ph> $hash{$tmp1} = {};
> >> no need to initialize that. autovivification will handle it for
> >> you.
>
> Ph> I do know that. I am not a big fan of autovivification, and almost
> Ph> always explicitly instantiate anonymous refs. In fact, I would
> Ph> like to see:
>
> Ph> use strict qw/no_autovivify/;
>
> autoviv is good for you in general. if you had to manually do it each
> time, it would be a major pain to dynamically generate deep
> structures. you couldn't just push into a hash slot, you would have to
> check and then initialize it each time:
>
> push( @{$self->{'foo'}}, $stuff ) ;
> push( @{$self->{'foo'} ||= [] }, $stuff ) ;
>
> and that gets worse with each level.
I have used it where appropriate. In general with the type of simple
data that my rather pedestrian application uses, it is not needed.
AFAIK, explicit instantiation is not a performance penalty, and it helps
the code better document itself.
--
Perusion Hostmaster
"Being against torture ought to be sort of a bipartisan thing."
-- Karl Lehenbauer
------------------------------
Date: 6 Jul 2003 23:11:19 GMT
From: Stephen Patterson <s.patterson@freeuk.com>
Subject: Re: Net::POP3
Message-Id: <slrnbghb45.vg.s.patterson@localhost.localdomain>
On Sun, 06 Jul 2003 17:38:05 GMT, Lev Altshuler wrote:
> Now I am aware that I need a different module, the one that reads messages
> from Outlook Inbox. If you know which one, please share with me.
Search for Outlook on search.cpan.org I saw one last week but can't
remember the name.
--
Stephen Patterson http://www.lexx.uklinux.net http://patter.mine.nu
steve@SPAM.lexx.uklinux.net remove SPAM to reply
Linux Counter No: 142831 GPG Public key: 252B8B37
Last one down the pub's an MCSE
------------------------------
Date: Sun, 06 Jul 2003 22:51:13 -0400
From: Benjamin Goldberg <ben.goldberg@hotpop.com>
Subject: Re: pipe - non blocking read? (fork/Win32)
Message-Id: <3F08E021.3882852D@hotpop.com>
Greg Bacon wrote:
>
> In article <3F04BDBD.9633257@hotpop.com>,
> Benjamin Goldberg <ben.goldberg@hotpop.com> wrote:
>
> : Greg Bacon wrote:
> :
> : [snip]
> : > my @ready = $sel->can_read(0);
> : > foreach my $fh (@ready) {
> : [snip]
> : > if (my $input = <$fh>) {
> :
> : Don't do that.
>
> Why not?
The readline (aka <>) operator does the following:
1a/ It scans it's internal buffer for the $/ string, and if
it finds it,
1b/ Removes (and returns) everything in it's buffer up to and
including the $/. Anything after the $/ remains in the buffer.
2/ After we looked for and didn't find $/, it uses the C read()
function to get data from the filedescriptor and adds it to it's
internal buffer.
3/ Go back to step 1.
The can_read method of IO::Select tells us whether or not the file
descriptor has more bytes available... that is, whether or not calling
the C read() function on that fd would block.
Now, let's suppose that the other end of the pipe sends us data faster
than we read it... e.g., suppose that it sends us three lines in the
time it took us to process one.
What happens?
Select's can_read says the pipe is ready to read from, then we call
readline(), which read()s *all* of the bytes that are in the pipe (in
the file descriptor) into the internal byffer. Then, we remove one $/
delimited line from that buffer, leaving two in the buffer. Then, we
call can_read again... and there are no bytes in the pipe! There are
bytes in the buffer, but none to be read from the file descriptor.
Alas, can_read knows nothing of the filehandle's internal buffer, it can
only examine the filedescriptor.
As a result, we won't call <> the extra two times that we should, and
thus those two lines never get read and printed out.
Well, maybe they'll get printed the *next* time a line gets printed to
the other end of the pipe... but that could be quite a long while after
those two lines were sent. It wouldn't be a good thing if we were only
able to read data many minutes after it was sent, would it?
Further, consider if we're doing two-way communication, not just
one-way... suppose the process on the other end of the pipe wants to
read something from us, before it will send anything else to us. We're
in trouble... we can't see what it sent, until it sends us "extra", and
it won't send us extra, until we see and respond to what it sent. This
is known of as deadlock.
--
$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}
------------------------------
Date: 6 Jul 2003 20:53:11 -0700
From: rook_5150@yahoo.com (Bryan Castillo)
Subject: Re: pipe - non blocking read? (fork/Win32)
Message-Id: <1bff1830.0307061953.4ed79135@posting.google.com>
gbacon@hiwaay.net (Greg Bacon) wrote in message news:<vgh1oclf4ht56a@corp.supernews.com>...
> In article <3F04BDBD.9633257@hotpop.com>,
> Benjamin Goldberg <ben.goldberg@hotpop.com> wrote:
>
> : Greg Bacon wrote:
> :
> : [snip]
> : > my @ready = $sel->can_read(0);
> : > foreach my $fh (@ready) {
> [snip]
> : > if (my $input = <$fh>) {
> :
> : Don't do that.
>
> Why not?
perldoc -f select
<snip>
WARNING: One should not attempt to mix buffered I/O (like "read"
or <FH>) with "select", except as permitted by POSIX, and even
then only on POSIX systems. You have to use "sysread" instead.
>
> Greg
------------------------------
Date: Mon, 07 Jul 2003 01:17:53 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Problem with counter CGI script
Message-Id: <beaaq0$2h6o4$1@ID-184292.news.dfncis.de>
T Stewart wrote:
> I downloaded a free counter CGI from http://www.htmlgoodies.com/
> and it works fine on my server with one exception.
>
> It has a feature where if someone else is detected using it without
> permission, you can create a .LOCK file in the counter directory
> that will always cause it to return 0 to the caller.
>
> But I'm finding it will create the .LOCK file after the first call,
> causing subsequent calls to return 0.
I think you have misunderstood what the script does. If I'm
interpreting it correctly, the lock has nothing to do with using the
script without "permission" (permission to update a counter file??).
This is what I believe is happening:
- If a lock file exists, i.e. if the counter file is currently being
updated by somebody else, the script waits until the file has been
removed.
- Then it creates a new lock file, preventing others from accessing
the counter file while you are updating it.
- When the counter file has been updated, the lock file is removed.
If you are interested in a text based counter script option, resulting
in the info displayed at http://www.gunnar.cc/quotes.html, you can get
it at ftp://ftp.gunnar.cc/pub/gunnar/counter.pl
It displays only the most current hits (up to 30 days), and it would
possibly pass the critical eyes of the regulars in this group. ;-)
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sun, 06 Jul 2003 22:33:16 GMT
From: "David Filmer" <ineverreadanythinsenttome@hotmail.com>
Subject: Using a variable within a tr//
Message-Id: <Ms1Oa.21787$I8.13027@rwcrnsc53>
I can't seem to do:
$vowels = 'aeiou'; $VOWELS = 'AEIOU';
tr/$vowels/$VOWELS/; #make all vowels uppercase
Perl doesn't see '$vowels' as a variablename, but as a 7-byte string
literal.
Of course, it works fine if I say
tr/aeiou/AEIOU/;
but I would like to know the proper syntax to do it with variablenames.....
TIA
------------------------------
Date: 6 Jul 2003 22:48:20 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: Using a variable within a tr//
Message-Id: <slrnbgh9pk.l6i.sholden@flexal.cs.usyd.edu.au>
On Sun, 06 Jul 2003 22:33:16 GMT,
David Filmer <ineverreadanythinsenttome@hotmail.com> wrote:
> I can't seem to do:
>
> $vowels = 'aeiou'; $VOWELS = 'AEIOU';
> tr/$vowels/$VOWELS/; #make all vowels uppercase
>
> Perl doesn't see '$vowels' as a variablename, but as a 7-byte string
> literal.
>
> Of course, it works fine if I say
>
> tr/aeiou/AEIOU/;
>
> but I would like to know the proper syntax to do it with variablenames.....
Which part of the documentation (perldoc perlop - the section on tr//) that
describes this do you find hard to understand. It has a code example
that does exactly what you want; how do you think that can be fixed so
that you can understand it?
Or did you not bother to read the documentation, and instead practice
"programming by guess"?
Is it obvious I haven't slept for far too long? :)
--
Sam Holden
------------------------------
Date: Sun, 06 Jul 2003 23:46:53 GMT
From: "David Filmer" <ineverreadanythinsenttome@hotmail.com>
Subject: Re: Using a variable within a tr//
Message-Id: <Mx2Oa.21918$Ix2.10689@rwcrnsc54>
> Which part of the documentation (perldoc perlop - the section on tr//)
that
> describes this do you find hard to understand. It has a code example
> that does exactly what you want; how do you think that can be fixed so
> that you can understand it?
Thanks for your response; this led me down the path of enlightnment.
The part of the documentation that I didn't understand was WHERE the blasted
'tr' operation was documented. I didn't know it was in 'perlop.' I tried
'perldoc tr' and got nothing. Since you were kind enough to ask, the docs
could be fixed (such that even MY limited understanding could grasp it) by
linking each and every reserved Perl expression such that if I type 'perldoc
tr' then I actually GET the 'tr' docs (whether they're in 'perlop' or
'foobar' or whereever). Or prehaps there's already a method to do this that
I'm unaware of...
------------------------------
Date: Sun, 06 Jul 2003 20:09:35 -0400
From: "bd" <bdonlan@bd-home-comp.no-ip.org>
Subject: Re: Using a variable within a tr//
Message-Id: <pan.2003.07.07.00.09.26.30289@bd-home-comp.no-ip.org>
On Sun, 06 Jul 2003 23:46:53 +0000, David Filmer wrote:
>> Which part of the documentation (perldoc perlop - the section on tr//)
> that
>> describes this do you find hard to understand. It has a code example
>> that does exactly what you want; how do you think that can be fixed so
>> that you can understand it?
>
> Thanks for your response; this led me down the path of enlightnment.
>
> The part of the documentation that I didn't understand was WHERE the blasted
> 'tr' operation was documented. I didn't know it was in 'perlop.' I tried
> 'perldoc tr' and got nothing. Since you were kind enough to ask, the docs
> could be fixed (such that even MY limited understanding could grasp it) by
> linking each and every reserved Perl expression such that if I type 'perldoc
> tr' then I actually GET the 'tr' docs (whether they're in 'perlop' or
> 'foobar' or whereever). Or prehaps there's already a method to do this that
> I'm unaware of...
Did you try 'perldoc -f tr'? It gives me:
tr/// The transliteration operator. Same as "y///". See perlop.
perldoc (non-option) is mostly for the perl* pages and modules. perldoc -f
is for built-in functions and operators.
--
Freenet distribution not available
Your fly might be open (but don't check it just now).
------------------------------
Date: Sun, 06 Jul 2003 19:16:22 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Using a variable within a tr//
Message-Id: <Xns93B0CE2DFDD64sdn.comcast@206.127.4.25>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
"David Filmer" <ineverreadanythinsenttome@hotmail.com> wrote in
news:Ms1Oa.21787$I8.13027@rwcrnsc53:
> I can't seem to do:
>
> $vowels = 'aeiou'; $VOWELS = 'AEIOU';
> tr/$vowels/$VOWELS/; #make all vowels uppercase
>
> Perl doesn't see '$vowels' as a variablename, but as a 7-byte string
> literal.
Arguably, this is a bug. Well, not really a bug, but a design problem that
probably "should" be fixed someday.
I see no rational reason why one should not be permitted to do the tr///
the way it occurred to you do to it. It's a very natural thing to want to
do.
Unfortunately, the only way to do it in current versions of perl is to wrap
the darn thing in an eval:
eval "tr/$vowels/$VOWELS/";
which strikes me as sort of lame, but hey it works.
- --
Eric
$_ = reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA+AwUBPwi7w2PeouIeTNHoEQJz1gCguIQuqObLU2vvPN8Os8dwskxbl9IAmL5q
dD5JVXQuX4xSyGumIZMLWrg=
=0wm2
-----END PGP SIGNATURE-----
------------------------------
Date: Sun, 6 Jul 2003 19:17:24 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Using a variable within a tr//
Message-Id: <slrnbghf0k.hpm.tadmc@magna.augustmail.com>
David Filmer <ineverreadanythinsenttome@hotmail.com> wrote:
> The part of the documentation that I didn't understand was WHERE the blasted
> 'tr' operation was documented. I didn't know it was in 'perlop.' I tried
^^^^^^^^^
You know it is an "operation" but you didn't think to look where
the operators are documented?
> 'perldoc tr' and got nothing.
perldoc -f tr
would have told you where the docs are.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 7 Jul 2003 01:06:59 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: Using a variable within a tr//
Message-Id: <slrnbghhtj.5n2.sholden@flexal.cs.usyd.edu.au>
On Sun, 6 Jul 2003 19:17:24 -0500, Tad McClellan <tadmc@augustmail.com> wrote:
> David Filmer <ineverreadanythinsenttome@hotmail.com> wrote:
>
>> The part of the documentation that I didn't understand was WHERE the blasted
>> 'tr' operation was documented. I didn't know it was in 'perlop.' I tried
> ^^^^^^^^^
>
>
> You know it is an "operation" but you didn't think to look where
> the operators are documented?
>
>
>> 'perldoc tr' and got nothing.
>
> perldoc -f tr
>
> would have told you where the docs are.
That's how I found them :)
I actually expected the posted code to work, and was surprised when it
didn't. It took me all of 20 seconds to find the answer in the docs
(and most of that was forgetting to use '^' when searching for
the appropriate section in perlop...
Just shows that you can program in perl for years and not even know
the most basic of things... Or maybe it shows I'm amazingly dim.
--
Sam Holden
------------------------------
Date: Mon, 07 Jul 2003 03:30:57 GMT
From: "David Filmer" <ineverreadanythinsenttome@hotmail.com>
Subject: Re: Using a variable within a tr//
Message-Id: <RP5Oa.22913$I8.14288@rwcrnsc53>
I did not know that there was even such a section as perlop. Most
'operations' are pretty self-evident and don't require documentation to use,
at least for basic tasks. I've never before needed docs for an operation.
Thanks to those who educated me about the '-f' flag. I was unaware of this
functionality, as I've always been successful at finding docs on whatever
I'm looking for with the simple 'perldoc whatever' command (because I happen
to have sought info only on standalone topics - just lucky, I guess). I was
quite surprised when I found nothing under 'perldoc tr'
"Tad McClellan" <tadmc@augustmail.com> wrote in message
news:slrnbghf0k.hpm.tadmc@magna.augustmail.com...
> David Filmer <ineverreadanythinsenttome@hotmail.com> wrote:
>
> > The part of the documentation that I didn't understand was WHERE the
blasted
> > 'tr' operation was documented. I didn't know it was in 'perlop.' I
tried
> ^^^^^^^^^
>
>
> You know it is an "operation" but you didn't think to look where
> the operators are documented?
>
>
> > 'perldoc tr' and got nothing.
>
> perldoc -f tr
>
> would have told you where the docs are.
>
>
> --
> Tad McClellan SGML consulting
> tadmc@augustmail.com Perl programming
> Fort Worth, Texas
------------------------------
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 5186
***************************************