Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: Compress me

by toniax (Scribe)
on Nov 07, 2010 at 18:36 UTC ( [id://869936]=note: print w/replies, xml ) Need Help??


in reply to Re: Compress me
in thread Compress me

Hi Ken,
Your code change worked great . I did notice something odd though .
The closing bracket on the qq can not have any spaces between it or the last character or the space is translated to the next line. I do not quite understand why?
Thanks again Ken

Replies are listed 'Best First'.
Re^3: Compress me
by kcott (Archbishop) on Nov 07, 2010 at 19:05 UTC

    That's sort of what my "... you won't need the terminal newline ..." was referring to.

    When you have a quoted string that extends over more than one line, you have embedded newlines - these are the ones you typed at the keyboard (not explicit \n characters).

    Your original last two lines:

    <td> <table><tr><td><br>\n";

    are actually:

    <td>{embedded newline} <table><tr><td><br>\n";

    You could have achieved the same output with:

    <td> <table><tr><td><br> ";

    which is actually:

    <td>{embedded newline} <table><tr><td><br>{embedded newline} ";

    Although I used ellipses, what you see on the screen:

    <table ...> ... };

    is actually:

    <table ...>{embedded newline} ...{embedded newline} };

    I hope that explains it. If not, please show an example of exact output.

    -- Ken

      Hello Ken,
      I understand what you are saying now. my mistake was
      print $out qq{ <FORM METHOD = post ACTION = $script_url name=login> <table border=0 cellpadding=4 cellspacing=4 width=470> <tr> <td> <table><tr><td>Category<br> } <----My mistake should of been print $out qq{ <FORM METHOD = post ACTION = $script_url name=login> <table border=0 cellpadding=4 cellspacing=4 width=470> <tr> <td> <table><tr><td>Category<br> } <----The fix it forced a new line so the line below it was not on the same line as <table><tr><td>Category<br>

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2024-04-18 11:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found