Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

My 'perldar' tells me there is a 'better' solution for this list operation

by OfficeLinebacker (Chaplain)
on Nov 03, 2006 at 22:28 UTC ( [id://582186]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @l1=("Date","IndexID","Maturity","OnTheRun","CompositePrice","Compo
    +siteSpread","ModelPrice","ModelSpread","Depth","Heat");
    my @l2=("OnTheRun","CompositePrice","CompositeSpread","Depth");
    
  2. or download this
    foreach my $f (@l1){
            if (join(",",@l2) !~ /\b$f\b/){
              $f='null';
            }
          }
    
  3. or download this
    my @l3= map {(join(",",@l2) =~ /\b$f\b/)?$f:"null"} @l1;
    
    ?
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://582186]
Approved by Corion
Front-paged by Roy Johnson
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-25 21:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found