Smart::Comments overwritting?

K

Kirby James

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
 
K

Karlheinz Weindl

Kirby said:
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
 
K

Kirby James

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
 
J

John Bokma

Kirby James said:
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.
 
A

Alan Stewart

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top