ASPN ActiveState Programmer Network  
ActiveState, a division of Sophos
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups
Submit Recipe
My Recipes

All Recipes
All Cookbooks


View by Category

Title: test
Submitter: test test (other recipes)
Last Updated: 2002/09/24
Version no: 1.0
Category: Web Services

 

2 stars 10 vote(s)


Description:

test

Usage: Text Source

my @fruits = ("apples", "pears", "oranges");
foreach (@fruits) {
        if ($_ ne "apples") {
                print "I like $_\n";
        }
}

The license for this recipe is available here.

Discussion:

test



Add comment

Number of comments: 3

Or, as a one liner ..., Grant McLean, 2002/10/10

print "I like $_\n" foreach grep $_ ne 'apples', @fruits;

Add comment

Had to vote it down..., T.Rob Wyatt,T.Rob Wyatt, 2002/11/14
It was taking up the top spot in the "Highest rated recipes" section.
Add comment

Or, as another one-liner ... =), Gabriel Knoy, 2003/06/06
map { print "I like $_\n" unless /^apples$/; } ("apples", "pears", "oranges");
Add comment



Highest rated recipes:

1. Breaking down a URI into ...

2. Finding Palindromes

3. Extracting HTML URL Links

4. Removing dangerous ...

5. Matching Royal Mail ...

6. Finding URLs in text -- ...

7. Validating email ...

8. Validate Domain Names

9. Extract the Korean ...

10. Remove any HTML




Privacy Policy | Email Opt-out | Feedback | Syndication
© 2006 ActiveState Software Inc. All rights reserved.