Re: How to find all the strings in a long that are at most of n different characters of a test string?



On Nov 20, 9:06 pm, Jürgen Exner <jurge...@xxxxxxxxxxx> wrote:
Peng Yu <PengYu...@xxxxxxxxx> wrote:
On Nov 20, 3:46 pm, "A. Sinan Unur" <1...@xxxxxxxxxxxxxxxxxxx> wrote:
Peng Yu <PengYu...@xxxxxxxxx> wrote innews:8f31f2be-e332-4d6d-a5ad-337e18208809@xxxxxxxxxxxxxxxxxxxxxxxxxxx:
It seems that the perldoc is not easy to understand by a newbie.

It is a reference, concise and accurate (as much as possible), it is not
and never will be a tutorial.

While
it explains @-, the perldoc keeps on referring to others things that I
don't understand. Can somebody help explain @- for me with more
examples?

Then you will have to look for a tutorial or dig down into those other
things. Very often it is not possible or not desirable to explain
something without making references to other concepts. And @- is
certainly not the right place to explain grouping in regular
expressions.

I looked at the perldoc perlvar page to remind myself what it said. I am
unable to figure out how one could make it clearer:
Thank you the example. I see what it means. In general, I think the
document can be made easier to read with more examples.

But there are examples in that section:
<quote>
            After a match against some variable $var:

            "$`" is the same as "substr($var, 0, $-[0])"
            "$&" is the same as "substr($var, $-[0], $+[0] - $-[0])"
            "$'" is the same as "substr($var, $+[0])"
            "$1" is the same as "substr($var, $-[1], $+[1] - $-[1])"
            "$2" is the same as "substr($var, $-[2], $+[2] - $-[2])"
            "$3" is the same as "substr $var, $-[3], $+[3] - $-[3])"
</quote>

I didn't understand the above examples because it refers to $-[0],
which was exactly what I wanted to understand.

I agree that adding more examples would make the manual to long to be
read by experts. But I think that this can be solved by having two
sets of document---one is with examples, the other is without
examples.

Go ahead and write the fivehundredandnintysecond tutorial about Perl.
You will find that either you are repeating yourself all over the place
or you start using references all over the place because Perl's concept
are so intertwined and cannot be explained stand-alone.

Not to mention the ensuing maintenance nightmare when you have to fix
something all over the place.

I agree your points. But I think that the perldoc shall have as less
cyclic references as possible. If the example that you mentioned in
the perldoc is not cyclic referred, it would easier to read.

Thanks,
Peng
.



Relevant Pages

  • Re: Creating Perl Modules
    ... Maybe I should exclude any references to perldoc as well. ... No tutorials that teach how to use exporter for new modules. ... No Book references. ...
    (comp.lang.perl.modules)
  • Re: Using lock_keys with strict and bless
    ... I will try to get my hands on the OO perl book by ... code work by reading the various references and tutorials. ... perldoc perlref - Reference about references ... > further I am guessing that I it is because I am using a hash of hashes ...
    (comp.lang.perl.misc)
  • Re: casting question
    ... Well - keep in mind first, that dereferencing the array reference is ... The most commonly used method of dereferencing a reference in Perl is ... Most objects are blessed hash references, ... perldoc perlreftut ...
    (comp.lang.perl.misc)
  • Re: hash table
    ... my %username =; ... because references are also scalars. ... perldoc perlreftut ...
    (perl.beginners)
  • Re: Slabinski and Mingst/Stowe disagree in Pushing Gravity
    ... Now provide the references to the postthat contain any ... Slabinki does a much more concise job than that page. ... absorbing energy at a rate that would be sufficient to vaporize the ... Earth in a fraction of a second. ...
    (sci.physics.relativity)