HDTenEightyP/NetNews huggingface dataset:
From: cameron@cs.unsw.oz.au
Subject: tell me this is a feature ...
Reply-To: cameron@cs.unsw.oz.au
Organization: CS&E Computing Facility, Uni Of NSW, Oz
Errors-To: cameron@cs.unsw.oz.au
Date: Tue, 15 Dec 1992 03:45:15 GMT
Return-Receipt-To: cameron@cs.unsw.oz.au

For the record, this is using perl-4.034.

Intending to check out a particular semantic of Perl I wrote the following
(broken) script, which uncovered another semantic I had never encountered.

	$hdrs{'foo'}='fooval';

	{ local(%hdrs);

	  $hdrs{'foo'}='subfooval';

	  print "foo=$hdrs{'fooval'}\n";

	  undef $hdrs{'foo'};

	  print "foo=$hdrs{'fooval'}\n";

	  undef %hdrs;

	  print "foo=$hdrs{'fooval'}\n";
	}

	print "foo=$hdrs{'fooval'}\n";

What I was intending was to check that the original %hdrs got restored outside
the block but the script doesn't check that because I mistyped the key in the
print statements. I was, however, surprised by what the script did do, which
was this:
	foo=
	foo=
	foo={'fooval'}
	foo=

Notice the third line. This suggests that when resolving
	$thing{index}
inside double quotes perl looks for %thing being defined before snarfing the
curly portion. Weird, eh?
	- Cameron Simpson
	  cameron@cs.unsw.oz.au, DoD 0743
--
"The engine purrs beneath me with a purpose,
 ready for the pleasure of my hand upon the throttle." - Peter Smith
Newsgroups: comp.lang.perl
From: lwall@netlabs.com (Larry Wall)
Subject: Re: In search of good idioms.
Organization: NetLabs, Inc.
Date: Thu, 17 Dec 1992 21:26:50 GMT

In article <BzCw1H.H24@NeoSoft.com> claird@NeoSoft.com (Cameron Laird) writes:
: The natural expressions of this problem involve an
: abstract data type, "collection of (sub)permutations",
: or its proceduralization by way of a parametrized re-
: cursion.

Uh, did I just hear you say something about "natural"?

:-)

Definitional problems are generally better solved in a functional
language, but Perl can pass lists around and do recursion, and can
emulate sets with associative arrays, for what it's worth.  You can
also do rudimentary data hiding with packages.  If you want more
abstraction than that, you have to wait for Perl 5.

Larry
Newsgroups: comp.lang.perl
From: rahardj@ccu.umanitoba.ca (Budi Rahardjo)
Subject: Re: Thanks to all of you that bought camel books!
Organization: University of Manitoba, Winnipeg, Canada
Date: Sun, 13 Dec 1992 17:40:15 GMT

merlyn@ora.com (Randal L. Schwartz) writes:
...
>And be watching *soon* for Learning Perl (which would be getting done
>faster if there wasn't ten new inches of snow on Mt. Hood today....
>ackcckck!) appearing on OR&A shelves around the world.

I hope, real soon. I am having a hard time answering questions 
from local perl users. (I am not even a perl expert, just a normal
perl user).

How about "Learning Perl Video" ?  or "perl scripts/packages CD-ROM" ?
I am serious.

-- budi
Newsgroups: comp.lang.perl
From: mcook@fendahl.dev.cdx.mot.com (Michael Cook)
Subject: Re: Is this a bug...
Organization: Motorola Codex, Canton, Massachusetts
Date: Wed, 16 Dec 1992 17:50:46 GMT

mbeattie@black.ox.ac.uk (Malcolm Beattie) writes:

>In article <1gi84dINNhcv@armory.centerline.com> thomaso@centerline.com (Thomas Andrews) writes:
>>I posted this "bug" but I didn't get any response.  Here it is again.
>>Anybody want to comment/explain.  I checked the Camel book, and there
>>is no explanation there...
>>
>>It appears that calling a subroutine with no argument list is not the
>>same as calling the subroutine with an empty argument list.  That is,
>>	&foo();
>>is different from
>>	&foo;
>>I could not find documentation for this in the camel book.  Is this
>>a bug or a feature?
>>
>[example deleted]
>>It would print a blank line...

>RTFM.

RTFB, you mean. :-)
First, he probably has to GBTFB (Go Buy The Fine Book :-).

>Camel book, index on p.452: subroutine invocation, 135
>p.135:
>As an alternate (and preferred) form, you may call a subroutine by
>prefixing the name with an ampersand: &foo(@args). If you aren't
>passing arguments, you don't have to use parentheses. If you omit
>the parentheses, no @_ array is passed to the subroutine.

>--Malcolm
From: mark@coombs.anu.edu.au (Mark)
Newsgroups: comp.lang.perl
Subject: Re: Thanks to all of you that bought camel books!
Date: 14 Dec 92 14:22:19 GMT
Organization: Australian National University
NNTP-Posting-Host: 150.203.76.2
Organisation: Wassat?!

barr@pop.psu.edu (David Barr) writes:

>merlyn@ora.com (Randal L. Schwartz) writes:
>>(Coming soon... "Perl: the Motion Picture" :-)

>And the sequel: "The Perl Hacker Strikes Back"  The 8th in a 12 part
>trilogy about the adventures of young Larry Wallker and his quest to
>use the Source to defeat the Evil Csh Empire.   :-)

With his dog 'Patch'? :)

j/k
Mark
Newsgroups: comp.lang.perl
From: henkp@cs.ruu.nl (Henk Penning)
Subject: Re: In 5.0, are we gonna get...
Date: Fri, 18 Dec 1992 14:01:12 GMT
Organization: Utrecht University, Dept. of Computer Science

In <7246288358-314904@dec4.wu-wien.ac.at> neumann@dec4.wu-wien.ac.at (Gustaf Neumann) writes:

> [ ... ] how about 
>
>	    $sum = eval join('+ ',1,34,$x,45,-8,0.1);
>
>ok, the string conversion could be avoided, but you can do it now...

>Gustaf Neumann          neumann@dec4.wu-wien.ac.at, neumann@awiwuw11.bitnet

  I would like to write:

    $max = reduce { $a >  $b ? $a : $b } @row
  
-- Another idea would be to have a reduce in array-context,
   for example to squeeze out adjacent equal elements:

     @uniq = reduce { ($a eq $b) ? ($a) : ($a,$b) } @row
   
   Here the ab-sub is evaluated in array-context. The first time
   $a is the first element of @row, later on the last element
   of the partial result.

-- Computing the difference of adjacent elements diff[i]=row[i+1]-row[i]

     @diff = reduce { ($b-$a,$b) } @row ; pop @diff ;

-- Range compression: 1,3,4,5,7,22 -> 1,3..5,7,22

   sub compress
     { if ( $a =~ /^(\d+)\.\.(\d+)$/ )
	 { ( $b == $2 + 1 ) ? ("$1..$b") : ($a,$b) ; }
       else
	 { ( $b == $a + 1 ) ? ("$a..$b") : ($a,$b) ; }
     }

   @compress = reduce compress @row ;

-- The examples have not been tested (;-) but the code looks nice.
   The scalar-reduce is much more important to have than the
   array-reduce, but I think there is a case for the latter too.

				===  HenkP  ===

Newsgroups: comp.lang.perl
From: Tom Christiansen <tchrist@convex.COM>
Subject: Re: system() vs exec()
Originator: tchrist@pixel.convex.com
Date: Fri, 18 Dec 1992 12:01:00 GMT
Reply-To: tchrist@convex.COM (Tom Christiansen)
Organization: Convex Computer Corporation, Colorado Springs, CO
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.

:Besides, you've used @_ after you used local().  That's a Perl no-no.

:sub a {local($d); print @_;}
:&a($a="Just ",$b="another ",$c="Perl ",$d="system ",$e="hacker,");

Nice JAPH!  Read it and weep.

--tom
-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist
On Monday mornings I am dedicated to the proposition that all men are
created jerks.
                -- H. Allen Smith, "Let the Crabgrass Grow"
Newsgroups: comp.lang.perl
From: chip@tct.com (Chip Salzenberg)
Subject: Re: system() vs exec()
Date: Thu, 17 Dec 1992 22:30:43 GMT
Organization: TC Telemanagement, Clearwater, FL

Aargh!  I myself posted:

>    sub system {
>        local($pid) = fork;
>        return undef unless defined($pid);
>        $pid ? wait : exec @_;
>    }

I stupidly failed to account for exec failure!

Try this instead:

   sub system {
       local($pid) = fork;
       unless (defined($pid)) { return undef; }
       unless ($pid) { exec @_; die "can't exec $_[0]: $!\n"; }
       waitpid($pid, 0);
   }

-- 
Chip Salzenberg at Teltronics/TCT  <chip@tct.com>, <73717.366@compuserve.com>
  "you make me want to break the laws of time and space / you make me
   want to eat pork / you make me want to staple bagles to my face /
   and remove them with a pitchfork" -- Weird Al Yankovic, "You Make Me"
From: mbeattie@black.ox.ac.uk (Malcolm Beattie)
Newsgroups: comp.lang.perl
Subject: Re: Is this a bug...
Date: 18 Dec 92 12:09:52 GMT
Organization: Oxford University Computing Service, 13 Banbury Rd, Oxford, U
Originator: mbeattie@black

In article <mcook.724528246@fendahl.dev.cdx.mot.com> mcook@fendahl.dev.cdx.mot.com (Michael Cook) writes:
>mbeattie@black.ox.ac.uk (Malcolm Beattie) writes:
>
>>In article <1gi84dINNhcv@armory.centerline.com> thomaso@centerline.com (Thomas Andrews) writes:
>>>I posted this "bug" but I didn't get any response.  Here it is again.
>>>Anybody want to comment/explain.  I checked the Camel book, and there
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>is no explanation there...
   ^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>
>>>It appears that calling a subroutine with no argument list is not the
>>>same as calling the subroutine with an empty argument list.  That is,
>>>	&foo();
>>>is different from
>>>	&foo;
>>>I could not find documentation for this in the camel book.  Is this
>>>a bug or a feature?
>>>
>>[example deleted]
>>>It would print a blank line...
>
>>RTFM.
>
>RTFB, you mean. :-)
>First, he probably has to GBTFB (Go Buy The Fine Book :-).

Please read the marked sentence above. He *had* `checked' the
Camel book. I apologise, though, that my response was so curt.

>
>>Camel book, index on p.452: subroutine invocation, 135
>>p.135:
>>As an alternate (and preferred) form, you may call a subroutine by
>>prefixing the name with an ampersand: &foo(@args). If you aren't
>>passing arguments, you don't have to use parentheses. If you omit
>>the parentheses, no @_ array is passed to the subroutine.
>
>>--Malcolm



-- 
Malcolm Beattie <mbeattie@black.ox.ac.uk> | I'm not a kernel hacker
Oxford University Computing Services      | I'm a kernel hacker's mate
13 Banbury Road, Oxford, OX2 6NN (U.K.)   | And I'm only hacking kernels
Tel: +44 865 273232 Fax: +44 865 273275   | 'Cos the kernel hacker's late
From: hugh@slee01.srl.ford.com (Hugh Fader)
Newsgroups: comp.lang.perl
Subject: Patches 1-3
Date: 17 Dec 1992 16:14:23 GMT
Organization: Ford Motor Company Research Laboratory
Reply-To: hugh@slee01.srl.ford.com
NNTP-Posting-Host: slee06.srl.ford.com
X-Newsreader: Tin 1.1 PL5

Can somebody mail me patches 1-3 or tell me an archive where I can get
them? I can't find them anywhere and need them so I can install
patches 4-34.

Thanks in advance.

--
Hugh Fader
Ford Research Laboratory
hugh@slee01.srl.ford.com

Newsgroups: comp.lang.perl
From: mcook@fendahl.dev.cdx.mot.com (Michael Cook)
Subject: Re: programming challenge
Organization: Motorola Codex, Canton, Massachusetts
Date: Sun, 13 Dec 1992 01:04:20 GMT

Mike Stramba <stramba@zooid.guild.org> writes:

>Ok, all you perl wizards out there.

>This out'a be a snap for ya.

> If I have the string :

>          Exxxxppppppprrrrrrreeeeesssssiiiiiiiiioooooonnnnnnnnnsssssssss

> and I want to kill the duplicated letters and end up with:

>          Expressions

You mean "Expresions", right?

> Lets' see some of your elegant solutions !

> Btw, this problem came up as a result of trying to edit a formatted man
> page ... for guess what program ?  (starts with 'P ... ends with 'l')

> Why am I editing a man page? ... because my computer, an Atari doesn't know
> about them.

> I'm interested in seeing solutions to the above, anyway.

>Mike

Okay--Here's a non-general solution:

  s/x+|p+|r+|e+|s+|i+|o+|n+/substr($&,0,1)/eg

Michael.
Newsgroups: comp.lang.perl
From: peter@cujo.curtin.edu.au (Peter N Lewis)
Subject: Re: Wanted: Perl script to convert file names from Unix to DOS
Organization: Curtin University of Technology
Date: Sun, 13 Dec 1992 07:17:18 GMT

jfh@netcom.com (Jack Hamilton) writes:

>>It would be nice if the algorithm used can be
>>inverted, so that the Unix filenames can be extracted back from their
>>DOS translation.

>In general, I don't think that will be possible unless the Unix filenames
>are already in 8x3 format with no unacceptable characters.   The only way 
>you could do it reliably would be to save a table and use it for the
>conversion back.

I did more or less the same thing for converting Mac file names in to
unix file names.  I wanted to guarentee that each unique Mac name was
converted to exactly one unix name (and thus could be inverted back to
the Mac file name).  I did this by using an associative array thing,
using the ndbm features in Perl, the code looks like this:

$filenamelen = 25;

sub fixname {
        local ($macname) = @_[0];
        local ($name);
        return $name if ($name = $MACNAMES{$macname});
        $name = $macname;
        $name = substr($name,0,$filenamelen);
        $name =~ tr/A-Z/a-z/; # lower case
        $name =~ tr/a-z0-9_./_/c; # improve this...
        $name =~ s/^\./_/;
        $name = ":" . $name;
        if ($MACNAMES{$name}) {
                $name .= "~";
                $extra = "aa";
                while ($MACNAMES{$name . $extra}) { $extra++; }
                $name .= $extra;
        }
        $MACNAMES{$name} = $macname;
        $name = substr($name,1);
        $MACNAMES{$macname} = $name;
# it'd be nice to reset the cache now, but I don't want to reset
# everything starting with an M :-(
        $name;
}

dbmopen(MACNAMES,"macnames",0600) || &mydie("DBMOpen failed");
while ($line=<STDIN>) {
        print $line, " ", &fixname($line), "\n";
}
dbmclose(MACNAMES);


Note: The above is just a fragment of the code, it probably won't work
on its own, but might give you some ideas.

Note2: The associative array has two kinds of mappings:
:unixname --> macname
macname --> unixname
So it can map the names in either direction.

Note3: Because Mac names don't traditionally have extensions, I didn't
make any attempt to convert extensions, but with unix->msdos
translation, you'd probably want to do that.  All that requires is a
slight change to the fixname subroutine...  The latter half of fixname
will guarentee uniqueness and invertability.

Have fun all,
   Peter.
Just a newbie Perl hacker :-)

-- 
_______________________________________________________________________
Peter N Lewis <peter@ncrpda.curtin.edu.au>           Ph: +61 9 368 2055
Newsgroups: comp.lang.perl
From: Rick Emerson <rick@ssg.com>
Subject: File age - how?
Reply-To: rick@ssg.com
Organization: The Internet
Date: Tue, 15 Dec 1992 18:52:38 GMT

(I suspect this is only marginally a perl question)  I'm writing a script to
list archived messages along with some additional notes.  I want to display
the file's creation date (-C?) but the file's age isn't adequate here.  I
need either a better way to extract this information or a "12.34 days from
now was sometime on 3 Dec" routine.  The final table (excluding formatting)
is something like this:
   file_name file_size file_created message_subject
with some additional comments about the table.  

I looked at ctime.pl but that works forward from a reference date.

Replies directly to rick@ssg.com will be appreciated as I'm a little pushed
for time on this puppy.  I'll summarize replies here.

Rick


| Richard B. Emerson     | Replies may be sent to:                         |
| System Support Group   |                        rick@ssg.com             |
| 940 Delaware Avenue    |-------------------------------------------------+
| Lansdale, PA 19446 USA | "When you ski, you dance with the mountain --   |
| Voice: 215.855.1607    |  and the mountain always leads."                |
From: ram@eiffel.com (Raphael Manfredi)
Newsgroups: comp.lang.perl
Subject: Re: copy() primitive?
Date: 17 Dec 92 21:45:36 GMT
Organization: Interactive Software Engineering, Santa Barbara CA

Quoting aahz@hal.COM (Tom Wylie) from comp.lang.perl:
>Is there some reason there isn't a primitive for copying files?
>(along the lines of unlink and rename).  firing off backticked /bin/cp's
>seems amazingly inefficient, and while yes I could use filehandles, it
>seems to me that a primitive that just horks in the file and spits it
>out somewhere else would be much faster.  I can't imagine that this
>hasn't come up, so I figure there must be a good reason why there isn't
>a copy() primitive, just wondering what it is.

I would say that unlink and rename are system primitives, so they need
to be provided by perl if you want to get the functionality. Ok, rename
is not exactly a primitive since it can be emulated by a serie of link/unlink
but that's close enough to reality.

For instance, 'unlink' can offer me something 'rm' will never be able to
provide, namely the ability to "unlink" directories. If I wanted to write
an fsck in perl, I would have to use 'unlink' and not 'rm'. So clearly it
has to be part of perl. (Reality is a bit more complex, this is only for
illustration purpose.)

Copying files is another matter. Since it is possible to write a function
based on other language constructs, adding it as a primitive should be
carefully weighed in terms of benefits vs the added complexity. If that
primitive was able to copy files 10 times faster than a library function, then
yes, I would say it should be part of the language. But this is not going to
happen (I'm assuming you are writing an optimal copy function, of course).

Therefore, a copy() primitive has not really its place in Perl. Perhaps a
copy.pl library file could be added to the distribution, but it would have
to do complete error checking to report errors accurately.
-- 
Raphael Manfredi <ram@eiffel.com>
Interactive Software Engineering Inc.
270 Storke Road, Suite #7                      / Tel +1 (805) 685-1006 \
Goleta, California 93117, USA                  \ Fax +1 (805) 685-6869 /
Newsgroups: comp.lang.perl
From: lwall@netlabs.com (Larry Wall)
Subject: Re: Package & Namespace Question
Organization: NetLabs, Inc.
Date: Thu, 17 Dec 1992 21:02:21 GMT

In article <BzD4Hw.AG8@da_vinci.it.uswc.uswest.com> rray@lookout.it.uswc.uswest.com (Randy J. Ray) writes:
: Why is it that: when calling subroutines defined in the main namespace from
: within some package, you must explicitly refer to main? Why is there not some
: syntactical rule that says, "If this routine is not defined at this level,
: look for it in main before reporting an error"? I can understand specifying
: &main'phred() when you want to use that instead of a package-defined &phred.
: Is it that main is not necessarily above other packages in hierarchy, and
: therefore it is not the natural progression to look for those routines
: elsewhere?

There is no namespace hierarchy in Perl4.  There is likely to be one in
Perl5, but I think you'd have to explicitly declare something like
"package main'foo" to place package foo under package main.  The
primary motivation for nesting packages would be to provide inheritance
of object methods, and I don't see the need offhand for every class to
derive from package main.  If you've got a good reason to do so, now is
the time to let me know.  I may be hubristic, but I'm not proud.  :-)

I'll go so far as to claim that in certain fortuitous ways, I'm kinda
stupid.  I'm not particularly proud of being stupid, but that's why Perl
is understandable to the huddled masses.  Call it the Pooh Approach.

Larry
Newsgroups: comp.lang.perl
From: mcook@fendahl.dev.cdx.mot.com (Michael Cook)
Subject: Re: system() vs exec()
Organization: Motorola Codex, Canton, Massachusetts
Date: Thu, 17 Dec 1992 20:29:17 GMT

chip@tct.com (Chip Salzenberg) writes:

>According to tchrist@convex.COM (Tom Christiansen):
>>    sub system { fork ? wait : exec @_ }

>What if fork fails?  Try instead:

>    sub system {
>        local($pid) = fork;
>        return undef unless defined($pid);
>        $pid ? wait : exec @_;
>    }

If you won't grant me that system() is broken, then you must grant me that the
manpage is broken.  That was my point.

Besides, you've used @_ after you used local().  That's a Perl no-no.

Michael.

--
sub a {local($d); print @_;}
&a($a="Just ",$b="another ",$c="Perl ",$d="system ",$e="hacker,");
Newsgroups: comp.lang.perl
From: mab@wdl39.wdl.loral.com (Mark A Biggar)
Subject: Re: programming challenge
Organization: Loral Western Development Labs
Date: Mon, 14 Dec 1992 18:58:22 GMT

This looks like a job for s.... oops he's dead, oh well how about the 
's' modifier of the tr command like so:

perl -pie 'tr///cs/;' <files>

which zaps all consecutive chars in the files.  
To limit it to just letters use:

perl -pie 'tr/a-zA-Z//s;' <files>

but of course this doesn't really solve the 'Goofy' problem which doesn't
have a general solution even with the addition of dictionary lookup because
word pairs like 'met' vs 'meet'.  That problem looks like it take a full
English understanding AI to solve.

--
Perl's Maternal Uncle
Mark Biggar
mab@wdl1.wdl.loral.com
From: merlyn@ora.com (Randal L. Schwartz)
Newsgroups: comp.lang.perl
Subject: Re: Feature request for perl V
Date: 17 Dec 92 01:24:47 GMT
Article-I.D.: romulus.MERLYN.92Dec16172442
Organization: Stonehenge Consulting Services; Portland, Oregon, USA

In article <62887@mimsy.umd.edu> folta@cs.umd.edu (Wayne Folta) writes:
   Could grep have an added option/mode that would allow me to get an array
   of indices instead of an array of items? I want to read a file into an
   array, then do some greps in the array, some calculations, and then if
   everything is right, make a couple of changes in the array, then write it
   back out to the file. If I could do this:

      @line_numbers = grepi (/IN A/, @lines) ;

   I'd be pretty happy. How's it sound?

@line_numbers = grep($lines[$_] =~ /IN A/, $[ .. $#lines);

Be happy.

And stop asking for Perl 5 features!  Larry has a full plate as it is!

print grep(!/!/,"Just another Perl hacker,")
--
Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
merlyn@ora.com (semi-permanent) merlyn@reed.edu (for newsreading only)
factoid: "Portland, Oregon, home of the California Raisins and Lone-Star Beer!"
Newsgroups: comp.lang.perl
From: mcook@fendahl.dev.cdx.mot.com (Michael Cook)
Subject: Re: C comment parser?
Organization: Motorola Codex, Canton, Massachusetts
Date: Sun, 13 Dec 1992 00:54:54 GMT

meb4593@galileo.rtn.ca.boeing.com (Michael Bain) writes:

>I'm having difficulty developing the regular expression to remove C
>comments from a variable (say $_) that contains a C function.  (I'm
>hacking a McCabe metric and am reading in a function at a time)  

>What I have so far seems to work *most* of the time, but oftentimes it
>misses an ending C comment delimiter (*/) and ends up removing a lot of
>code until it reaches the last delimiter.

>Here's the RE:
>	s?/\*(.*\n)*.*\*/??; # remove comments

>Does somebody have a better one that works?

Remember that RE's are maximally matched (in Perl, and most Unix tools).  If
$_ has two or more comments in it, that s/// is going to delete them all in
one swoop, and it'll also delete everything between the comments.

I can give you an RE that'll work.  Here:

 s%/\*([^*]|\*+[^/*])*\*+/%%g

But RE's are really the way to go.  The if comment is very big, Perl will dump
core.  (I tried it.)

You can do it with index():

  $pos = 0;
  while (($pos = index($_, "/*", $pos)) >= 0)
  {
    $end = index($_, "*/", $pos + 2);
    $end >= 0 || die "unterminated comment";
    substr($_, $pos, $end - $pos + 2) = '';
  }

Michael.
Newsgroups: comp.lang.perl
From: chip@tct.com (Chip Salzenberg)
Subject: Re: grep() vs. for(;;){} (was Re: In 5.0...)
Date: Tue, 15 Dec 1992 00:15:05 GMT
Organization: TC Telemanagement, Clearwater, FL

According to tchrist@convex.COM (Tom Christiansen):
>Usually grep works like mapcar; you could this:
>
>    grep (push(@retlist, /(\d+)/g), "asdf 23fjk4", "qwerty", "123 ")

No, no... don't use grep in this case!  It's just going to build a
return value that you'll never use.  Better in every way is:

     for ("asdf 23fjk4", "qwerty", "123 ") { push(@retlist, /(\d+)/g); }

-- 
Chip Salzenberg at Teltronics/TCT  <chip@tct.com>, <73717.366@compuserve.com>
  "you make me want to break the laws of time and space / you make me
   want to eat pork / you make me want to staple bagles to my face /
   and remove them with a pitchfork" -- Weird Al Yankovic, "You Make Me"
Newsgroups: comp.lang.perl