Smart::Comments overwritting?

Discussion in 'Perl Misc' started by Kirby James, Mar 4, 2006.

  1. Kirby James

    Kirby James Guest

    Hi,

    When I run the following programme (under Windows XP Command Prompt;
    ActiveState Perl 5.8.7; Smart::Comments 0.001) I get this output:-

    ### variable: 1234

    : 1234ariable

    I has expected the final line to read '### $variable: 1234' - but it
    appears that the final ': 1234' has been written starting from the
    beginning of the line.

    I've looked at the Command Prompt properties - but can't see anything
    that would change this behaviour.

    Any suggestions appreciated.

    Thanks

    Kirby




    #
    # simple.pl
    #

    use Smart::Comments;
    use strict;

    my $variable = 1234;

    ### variable: $variable
    ### $variable
     
    Kirby James, Mar 4, 2006
    #1
    1. Advertising

  2. Kirby James schrieb:
    > Hi,
    >
    > When I run the following programme (under Windows XP Command Prompt;
    > ActiveState Perl 5.8.7; Smart::Comments 0.001) I get this output:-
    >
    > ### variable: 1234
    >
    > : 1234ariable
    >
    > I has expected the final line to read '### $variable: 1234' - but it
    > appears that the final ': 1234' has been written starting from the
    > beginning of the line.
    >
    > I've looked at the Command Prompt properties - but can't see anything
    > that would change this behaviour.
    >
    > Any suggestions appreciated.
    >
    > Thanks
    >
    > Kirby
    >
    >
    >
    >
    > #
    > # simple.pl
    > #
    >
    > use Smart::Comments;
    > use strict;
    >
    > my $variable = 1234;
    >
    > ### variable: $variable
    > ### $variable


    Seems to me that Smart::Comments does not handle MS line ending
    correctly, as it's obviously keeping the CR as part of the string it
    processes.

    Karlheinz
     
    Karlheinz Weindl, Mar 4, 2006
    #2
    1. Advertising

  3. Kirby James

    Kirby James Guest

    Karlheinz - you are right.

    Following your suggestion I've saved the source of simple.pl in 'UNIX'
    format (using MultiEdit) and it works as advertised.

    I'm not sure whether many Windows editors have this functionality - so
    it is likely to trip up others.

    Thanks again

    Kirby

    >
    > Seems to me that Smart::Comments does not handle MS line ending
    > correctly, as it's obviously keeping the CR as part of the string it
    > processes.
    >
    > Karlheinz
     
    Kirby James, Mar 4, 2006
    #3
  4. Kirby James

    John Bokma Guest

    Kirby James <> wrote:

    > Karlheinz - you are right.
    >
    > Following your suggestion I've saved the source of simple.pl in 'UNIX'
    > format (using MultiEdit) and it works as advertised.
    >
    > I'm not sure whether many Windows editors have this functionality - so
    > it is likely to trip up others.


    TextPad can do this, and several editors I have seen (but can't recall
    their names). And yes, seen this thing before, so I knew the answer :-D.

    --
    John Small Perl scripts: http://johnbokma.com/perl/
    Perl programmer available: http://castleamber.com/
    I ploink googlegroups.com :)
     
    John Bokma, Mar 4, 2006
    #4
  5. Kirby James

    Alan Stewart Guest

    On Sat, 04 Mar 2006 09:44:30 +0000, Kirby James
    <> wrote:

    >Hi,
    >
    >When I run the following programme (under Windows XP Command Prompt;
    >ActiveState Perl 5.8.7; Smart::Comments 0.001) I get this output:-
    >
    >### variable: 1234
    >
    >: 1234ariable
    >
    >I has expected the final line to read '### $variable: 1234' - but it
    >appears that the final ': 1234' has been written starting from the
    >beginning of the line.
    >
    >I've looked at the Command Prompt properties - but can't see anything
    >that would change this behaviour.
    >
    >Any suggestions appreciated.
    >
    >Thanks
    >
    >Kirby
    >
    >
    >
    >
    >#
    ># simple.pl
    >#
    >
    >use Smart::Comments;
    >use strict;
    >
    >my $variable = 1234;
    >
    >### variable: $variable
    >### $variable


    Smart::Comments version 1.02 has this fixed.

    Alan
     
    Alan Stewart, Mar 5, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    1,184
  2. Monk
    Replies:
    10
    Views:
    1,546
    Michael Wojcik
    Apr 20, 2005
  3. MotoK
    Replies:
    59
    Views:
    1,922
    Keith Thompson
    Sep 15, 2006
  4. red floyd

    "Smart Quotes" in comments?

    red floyd, Jun 11, 2006, in forum: C++
    Replies:
    3
    Views:
    564
    SuperKoko
    Jun 11, 2006
  5. Replies:
    4
    Views:
    659
    Dr John Stockton
    Jun 3, 2006
Loading...

Share This Page