On Sat, 5 Aug 2000 09:44:47 -0500, Jonathan Scott Duff wrote:

>Here in my pre-caffiene morning trance it occurs to me that a few of
>the "fringe" features of perl should be removed from the langauge.
>Here's a few things that I would venture to say that none of the
>"perl5 is my first perl" people have probably ever actually used.
>
>       reset           # How often do you clear variables wholesale?

Definitely. You can't even use it to clear a package, which would be one
of it's better uses. Grouping by start of name is a Bad Thing (TM), IMO.

Perlfunc says:

        Generally used in a `continue' block at the end of a loop to
        clear variables 

Oi! Use block scoped lexical variables for that! Oh yes, this is pre
Perl5...

        ... and reset `??' searches so that they work again.

Now, that would have been interesting, if only ?PATTERN? itself was
worth bothering with. I've not ever used it. "last", anyone?

>       dump

Perlfunc says:

        Primarily this is so that you can use the undump program
        (not supplied) to turn your core dump into an executable binary
        after having initialized all your variables at the beginning of
        the program.

Only on Unix, I guess.

        This function is now largely obsolete, partly because it's very
        hard to convert a core file into an executable.

Not even there.

>       study           # never been a win for me.

Me neither. I wouldn't know what it's good for. According to perlfunc,
it serves to speed up searches on a very large string. I don't do that
very often. Instead, I use lots of smallish strings, lines from a file.

>       ?pattern?       # one-time match

I've never used it. I never will. First, I like "last" to jump out of a
loop. Or you can set a variable in the match, like this:

        $test ||= do { /PATTERN/ and ... };

There's also:

        if($temp=(/PATTERN/ .. 0) and $temp==1) {
                print "Hey!, got my first match!\n";
        }

although that is a bit kludgy, not in the least because you can't
localize the temp.

>       split ?pat?     # implicit split to @_

also:
        split           # in a scalar or void context

Dirty. Never ever. I'd rather have that in scalar context, split just
returned a count, without affecting @_.

I have a lot of suggestions of my own... but that will have to wait till
another post.

-- 
        Bart.

Reply via email to