Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Confusing grep behavior

by dextius (Monk)
on Dec 04, 2007 at 21:09 UTC ( [id://654950]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use Data::Dumper;
    ...
    
    my @res2 = grep { $_ } split(",", "a,b,c,d,,f,,h");
    print Dumper(\@res2);
    
  2. or download this
    $VAR1 = [
              'a',
    ...
              'f',
              'h'
            ];
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://654950]
Approved by grep
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-25 10:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found