Re: How to handle "\" indicating next line



Khairul Azmi wrote:
> I am writing a code that would check line by line content of a line before
> Problem occurs when there are lines that has character "\"
> indicating a new line.

Would something like this help?

#!/usr/bin/perl

local $/; #slurp mode
local $_ = <DATA>;
s!/\n\s*!!g;
print;

__DATA__
this /
is /
some stuff
this is more stuff

### OUTPUT ################
this is some stuff
this is more stuff

.



Relevant Pages

  • Is FFLL still alive?
    ... Writing an own ... library from scratch is always an option, but there's no doubt someone must ... Best regards, ... Prev by Date: ...
    (comp.ai.fuzzy)
  • Re: Selecting hole positions for wind instruments
    ... makers since the ancient Greeks started writing about it. ... See Pythagoras ... Pete ... Prev by Date: ...
    (rec.music.makers.builders)
  • Code cannot debug.
    ... I'm writing a small program. ... to debug by select, I got the following ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vc)
  • Classical Music Theory
    ... out for him on a macroscopic level. ... But I've been also been told that music theory didn't really exist back ... structures generated were subconciously derived as he was writing it. ... Prev by Date: ...
    (rec.music.compose)
  • Stange Reboot issues
    ... much writing, followed by rebooting. ... which isnt really a solution. ... Prev by Date: ...
    (microsoft.public.windowsxp.perform_maintain)