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

Re^4: Retain first 4 characters of a string

by Anonymous Monk
on Aug 24, 2012 at 10:14 UTC ( #989479=note: print w/ replies, xml ) Need Help??


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

Its even simpler than that , append

say "BUT YOU CAN USE LESS OF THEM :) OR LEARN FROM s/// "; $trim = join '-', $orig =~ m{(\w{1,4})\w*}g; say Dumper $want, $trim ;

and get extra output

BUT YOU CAN USE LESS OF THEM :) OR LEARN FROM s/// $want = 'Appl-iPho-4-Blac-Cove'; $trim = 'Appl-iPho-4-Blac-Cove';


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2014-08-01 02:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (256 votes), past polls