Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: searching for strings

by Zielony (Acolyte)
on Aug 06, 2007 at 16:00 UTC ( [id://630850]=note: print w/replies, xml ) Need Help??


in reply to Re^2: searching for strings
in thread searching for strings

#!/usr/bin/perl use strict; sub simstr { $_ = shift; /([a-z]|\d+)$/i; my $ch = $1; $ch++; $ch =~ s/.*(.)$/$1/ if ($ch =~ /[a-z]/i); substr ($_, -(length $1)) = $ch; $_; } for (<DATA>) { chomp; print "$_;" . simstr ($_) . "\n"; } __DATA__ AAA30 BBC5 SHT12H DAL33B BBC49 AAA31 DAL33A BBC6 SHT12G BBC50 CBG99 WXYZ
Now it works and isn't even a bit funny. ;-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-19 21:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found