Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Perl: porters

EXPR foreach EXPR

 

 

Perl porters RSS feed   Index | Next | Previous | View Threaded


alexchorny at gmail

Nov 17, 2009, 2:25 PM

Post #1 of 3 (211 views)
Permalink
EXPR foreach EXPR

Hello

I'm working on "Perl-MinimumVersion" CPAN dist. It is a tool that
detects minimum Perl version to run a Perl program.

perl5005delta.pod lists "EXPR foreach EXPR" as one of changes in 5.5.
I don't understand what "foreach EXPR" means. I tried several
examples:

print "$_," foreach split //,"asdf";

print "$_," foreach (1,2,3,4);

print "$_," foreach 'asdf';

They all work in perl 5.004_05.

--
Alexandr Ciornii, http://chorny.net


p5p at perl

Nov 17, 2009, 2:36 PM

Post #2 of 3 (196 views)
Permalink
Re: EXPR foreach EXPR [In reply to]

Citeren Alexandr Ciornii <alexchorny [at] gmail>:

> Hello
>
> I'm working on "Perl-MinimumVersion" CPAN dist. It is a tool that
> detects minimum Perl version to run a Perl program.
>
> perl5005delta.pod lists "EXPR foreach EXPR" as one of changes in 5.5.
> I don't understand what "foreach EXPR" means. I tried several
> examples:
>

Using git blame leads me to:

http://perl5.git.perl.org/perl.git/commit/ecca16b0cfe0c7f04ba520f2924946a13507530e?f=pod/perlsyn.pod

[win32] yet another patch
Message-Id: <199709161748.NAA08418 [at] nielsenmedia>
Subject: Tiny but massively cool: C<statement foreach @list>

p4raw-id: //depot/win32/perl [at] 61


Searching the subject with google leads to:

http://markmail.org/message/ns4bpelaplspiqpx#query:%22Tiny%20but%20massively%20cool%3A%20C%3Cstatement%20foreach%20%40list%3E%22+page:1+mid:djtvz2qao4ho64sf+state:results



Best regards,

Bram


abigail at abigail

Nov 17, 2009, 2:46 PM

Post #3 of 3 (196 views)
Permalink
Re: EXPR foreach EXPR [In reply to]

On Wed, Nov 18, 2009 at 12:25:55AM +0200, Alexandr Ciornii wrote:
> Hello
>
> I'm working on "Perl-MinimumVersion" CPAN dist. It is a tool that
> detects minimum Perl version to run a Perl program.
>
> perl5005delta.pod lists "EXPR foreach EXPR" as one of changes in 5.5.
> I don't understand what "foreach EXPR" means. I tried several
> examples:
>
> print "$_," foreach split //,"asdf";
>
> print "$_," foreach (1,2,3,4);
>
> print "$_," foreach 'asdf';
>
> They all work in perl 5.004_05.


5.004_05 was released after 5.005. At that time, (major) releases were
more frequent, and p5p had a different policy when it comes to putting
new features in maint releases. At that time, there were only 'delta'pods
for major releases, not for maint releases.

Also, IIRC, it was Chip who created the "EXPR for(each) EXPR" construct.
And it was Chip who released 5.004_05.

I no longer have 5.004 perls laying around, but I wouldn't be surprised if
your code snippits will not work on 5.004_04.


Abigail

Perl porters RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.