Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: tagging question

by beable (Friar)
on Jul 23, 2004 at 23:14 UTC ( [id://377029]=note: print w/replies, xml ) Need Help??


in reply to tagging question

#!/usr/bin/perl use strict; use warnings; # read in the data line by line while (my $line = <DATA>) { # chomp off the newline chomp $line; # see if we have a match of two letters at the start # of the line if ($line =~ m|^(\w{2})|) { # if it matched, add tags my $tag = $1; print "<$tag> $line <$tag>\n"; } else { # if it didn't match, just print the line print "$line\n"; } } __DATA__ il yadayadayada df yadayadayada

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-20 02:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found