Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: adding ";" to void elements

by lodin (Hermit)
on Feb 13, 2008 at 00:50 UTC ( [id://667708]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @col = split /;/;
    push @col, '' for @col .. 2;
    print join ';', @col;
    
  2. or download this
    my $len = 3;
    print join ';', (split(/;/), ('') x $len)[0 .. $len-1];
    
  3. or download this
    my %foo =
      map { (split /:/, $_, 2)[0, 1] } # Implicit "default" undef.
    ...
              'foo' => 'bar',
              'zip' => 'zap:zoom'
            };
    
  4. or download this
    my %foo = map { split /:/ } ...;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-18 19:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found