Re: A very simple example program Comparing Perl, Python and Java

2004-12-24 Thread Paul Johnson
On Fri, Dec 24, 2004 at 08:43:56AM -0600, JupiterHost.Net wrote: > Interesting, here's a couple benchmarks for for() vs. map(): > > for - print "$_\n" for grep length($_) <= 3, @ARGV > map - map "$_\n", grep length() <= 3, @ARGV You don't show your benchmark code or mention which version of perl

Re: A very simple example program Comparing Perl, Python and Java

2004-12-24 Thread JupiterHost.Net
Todd W wrote: "JupiterHost.Net" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] This is an equivalent program: #!/usr/bin/perl print "@ARGV\n"; print "$_\n" for grep length($_) <= 3, @ARGV; Ha Ha even better, nice one Bob! Perl is just way to awesome :) You can even get rid of t

Re: A very simple example program Comparing Perl, Python and Java

2004-12-24 Thread Todd W
"JupiterHost.Net" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > This is an equivalent program: > > > >#!/usr/bin/perl > >print "@ARGV\n"; > >print "$_\n" for grep length($_) <= 3, @ARGV; > > Ha Ha even better, nice one Bob! > > Perl is just way to awesome :) You ca

RE: A very simple example program Comparing Perl, Python and Java

2004-12-22 Thread Richard Monson-Haefel
org Subject: Re: A very simple example program Comparing Perl, Python and Java > This is an equivalent program: > >#!/usr/bin/perl >print "@ARGV\n"; >print "$_\n" for grep length($_) <= 3, @ARGV; Ha Ha even better, nice one Bob! Perl is just

Re: A very simple example program Comparing Perl, Python and Java

2004-12-21 Thread John W. Krahn
Richard Monson-Haefel wrote: Hi, Hello, I'm writing a paper comparing the use of Perl, Python and Java. My Perl is pretty bad (as is my Python), so I thought I would check to see if there is a more efficient way of doing it. Here is the Perl program #!/usr/bin/perl -w @l = @ARGV; print "@l\n"; @r

Re: A very simple example program Comparing Perl, Python and Java

2004-12-21 Thread JupiterHost.Net
This is an equivalent program: #!/usr/bin/perl print "@ARGV\n"; print "$_\n" for grep length($_) <= 3, @ARGV; Ha Ha even better, nice one Bob! Perl is just way to awesome :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: A very simple example program Comparing Perl, Python and Java

2004-12-21 Thread JupiterHost.Net
Richard Monson-Haefel wrote: Hi, Hello, I'm writing a paper comparing the use of Perl, Python and Java. My Perl is pretty bad (as is my Python), so I thought I would check to see if there is a more efficient way of doing it. Here is the Perl program http://www.rafb.net/paste/results/4px8PI74.ht

RE: A very simple example program Comparing Perl, Python and Java

2004-12-21 Thread Bob Showalter
Richard Monson-Haefel wrote: > Here is the Perl program > > http://www.rafb.net/paste/results/4px8PI74.html Here it is: #!/usr/bin/perl -w @l = @ARGV; print "@l\n"; @r = (); foreach $x(@l){ if(length($x) <= 3){ push(@r, $x); } } $y = @r; print $y; foreac

A very simple example program Comparing Perl, Python and Java

2004-12-21 Thread Richard Monson-Haefel
Hi, I'm writing a paper comparing the use of Perl, Python and Java. My Perl is pretty bad (as is my Python), so I thought I would check to see if there is a more efficient way of doing it. Here is the Perl program http://www.rafb.net/paste/results/4px8PI74.html If there is a more ef