Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Array manipulation

by 2teez (Priest)
on Nov 04, 2013 at 18:15 UTC ( #1061166=note: print w/ replies, xml ) Need Help??


in reply to Array manipulation

Something like this can do:

use warnings; use strict; while(<DATA>){ chomp; print $_,substr ($_,0,2),$/; } __DATA__ 1234 5678 1000 1233


NOTE:I updated the code, since I was testing on an old Perl version before now.
If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me


Comment on Re: Array manipulation
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (12)
As of 2015-07-31 10:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (276 votes), past polls