in reply to Re^4: Direct to spreadsheet
in thread Direct to spreadsheet
If that's the case, something like this should do it:
for (@data) { chomp; $_ =~ s| \\- # Start of a commented section [^(-/)]+ # Anything that isn't the end of a comment -/ # End of commented section ||gx; }
However, I suspect that you'll still have problems. In your original code you were setting the input record separator ($/) to "BOR". In your current code, this really has no effect as you're no longer reading from a filehandle. And so the "/nBOR" that you're inserting into each @data element is no longer having the effect you think it is. I guess you need to do all your processing as you iterate through the SQL result set.
But even then, you're building a list where each element is basically another list, and then later splitting the inner list out. I think you really should think about building a LoL in the first place (or perhaps a LoH). You could then get rid of that $aa = $rec[0]; $bb = $rec[1]; nonsense ;)
Cheers,
Darren :)
|
|---|