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

Re^4: Formatting Input

by akwe-xavante (Novice)
on Jun 15, 2012 at 15:48 UTC ( #976452=note: print w/replies, xml ) Need Help??


in reply to Re^3: Formatting Input
in thread Formatting Input

Adding the code $Contents =~ s/\n/<br>/m; has no effect at all i'm afraid

White space and new lines are lost

Adding the code $Contents =~ s/\n/<br>/m; does have an effect in that looking at the source code printed to the browser on the first newline only <br> is added but not on any other newline after that

Using the code $Contents =~ s/\n/<br>/mg; works a treat

Replies are listed 'Best First'.
Re^5: Formatting Input
by ww (Archbishop) on Jun 15, 2012 at 17:24 UTC
    Yup.

    My fault for gorfetting the /g.   :)

    However, your post above says:

    "Adding the code $Contents =~ s/\n/<br>/m; has no effect at all i'm afraid"

    but one line later you state the opposite:

    "Adding the code $Contents =~ s/\n/<br>/m; does have an effect in that looking at the source code printed to the browser on the first newline only is added but not on any other newline after that"

    You can't have it both ways!

    You may have noted above (at Re^5: Formatting Input) that I objected to use of pronouns that are "(u)nclear, ambiguous, lacking a clear antecedent.... Please add "posts with mutually contradictory statements" to the list of modes that make good help harder to provide.

    So, please, next time you have a question to post, consider this:
    to help effectively we need to know the details of what you're doing... and the details of what's going wrong (errors messages, warnings, output that isn't what you want and so on). The third para of your latest node pretty much satisfies that, albeit with narrative description rather than samples. But we could have gotten to this apparently satisfactory solution at "Re: Formatting Input" had you provided a clear, complete SOPW.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://976452]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2018-04-24 07:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?