Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Huge simple problem

by dreadpiratepeter (Priest)
on Aug 05, 2009 at 22:43 UTC ( #786247=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @searchTexts = split (/and|or/i,$query);
    foreach my $text (@searchtexts) {
    ...
       $text =~ s/\s+$//;
       print "$text\n";
    }
    
  2. or download this
    foreach (split /and|or/i,$query) {
      s/^\s*(.*?)\s*$/$1/;
      print "$_\n";
    }  
    
  3. or download this
    print join("\n",map {/^\s*(.*?)\s*$/;$1} split(/and|or/i,$query)) . "\
    +n";
    
  4. or download this
    print join("n\",split(/\s*(?:and|or)\s*/,$query)) . "\n";
    
  5. or download this
    $query =~ s/\s*(?:and|or)\s*/\n/g;
    print "$query\n";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://786247]
help
Chatterbox?
and the daffodils sway...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2016-12-07 23:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (133 votes). Check out past polls.