in reply to Re: String concatenation issues with 00?
in thread String concatenation issues with 00?

Hi James, thanks for that. It would seem that, in my attempt at redacting some of the data used (manually, rather than doing it properly and doing up some real test data), I accidentally fixed my issue.

Now to go back over my real code and see what's different between that and what I posted here... I actually spent quite a bit of time trying different options with the concatenation, chomp, etc. and just couldn't get it right. Seems all I needed to do was give up ;)

  • Comment on Re^2: String concatenation issues with 00?

Replies are listed 'Best First'.
Re^3: String concatenation issues with 00?
by james28909 (Deacon) on Nov 19, 2015 at 07:36 UTC
    Heres another way to do it, which seems more legible:
    use strict; use warnings; while (<DATA>){ chomp; my @line = split /:/; print "$line[0]:$line[1]00:$line[2]:$line[3]:$line[4]00\n"; } __DATA__ o:200806050852:b7199767:b24211012077030:200902232359 o:201103251457:b6235734:b2421100997663:201204022359 o:201403101021:b8015840:b24211013181843:201404072359 o:201407291225:b8759124:b24211001018862:201408262359
    Output:
    o:20080605085200:b7199767:b24211012077030:20090223235900 o:20110325145700:b6235734:b2421100997663:20120402235900 o:20140310102100:b8015840:b24211013181843:20140407235900 o:20140729122500:b8759124:b24211001018862:20140826235900