Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: adding ";" to void elements

by poolpi (Hermit)
on Feb 12, 2008 at 15:11 UTC ( [id://667581]=note: print w/replies, xml ) Need Help??


in reply to adding ";" to void elements

#!/usr/bin/perl use strict; use warnings; map { print if s/\A (\w;\d) (?!;\d) / $1; /xms } <DATA>; __DATA__ a;3 b;2;3 c;5;4 d;6
Output : a;3; d;6;
hth,

Poolpi

Replies are listed 'Best First'.
Re^2: adding ";" to void elements
by chromatic (Archbishop) on Feb 12, 2008 at 19:08 UTC
    map { print ... }

    That's worth at least two fifteen-yard penalties right there! I'm sort of horrified and impressed.

      It's for error checking, of course
      any { !$_ } map { print ... } ... and die;
      ;)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-20 09:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found