Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^5: Retain first 4 characters of a string

by johngg (Abbot)
on Aug 24, 2012 at 19:00 UTC ( #989617=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Retain first 4 characters of a string
in thread Retain first 4 characters of a string

$ perl -Mstrict -Mwarnings -E ' > open my $inFH, q{<}, \ <<EOF or die $!; > baby blue > baby pink > black > dark blue > brown > dark purple > green > orange > hot pink > light purple > red > white > yellow > light powder blue > EOF > > say for > map { > @$_ > 1 > ? join q{}, map { substr $_, 0, 1 } @$_ > : $_->[ 0 ] > } > map { [ split ] } > <$inFH>;' bb bp black db brown dp green orange hp lp red white yellow lpb

Cheers,

JohnGG


Comment on Re^5: Retain first 4 characters of a string
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2014-12-25 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (161 votes), past polls