OT: Anybody using Xemacs to edit Perl Code?

R

Ronny

(This article was originally posted in comp.emacs.xemacs, as this is
the place
where it belongs to, but I didn't get any response there. Hopefully
there are
some Perl programmers using Xemacs who can help me here...)

I'm using Xemacs "right out of the box" to edit Perl code. Xemacs
correctly switches on CPerl mode automatically. However, it seems to
have
a very particular idea, how a Perl program should be laid out: Suppose
I write
a function definition like this:

sub myfunc($)
{

As soon as I type the {, Xemacs positions it exactly under the "$"
sign:

sub myfunc($)
{

(i.e. it places the brace under the $ sign, which is silly IMO).

I suspect that CPerl mode does not properly recognize this as the
start of a function definition at all...

Is this a known problem and does someone have a solution for it?

Ronald
 
S

Salvador Fandino

Ronny said:
I'm using Xemacs "right out of the box" to edit Perl code. Xemacs
correctly switches on CPerl mode automatically. However, it seems to
have
a very particular idea, how a Perl program should be laid out: Suppose
I write
a function definition like this:

sub myfunc($)
{

As soon as I type the {, Xemacs positions it exactly under the "$"
sign:

sub myfunc($)
{
(i.e. it places the brace under the $ sign, which is silly IMO).

If I recall correctly this is a bug already solved in latest versions of
CPerl. It was caused by the prototype not being correctly parsed, and
"$)" got interpreted as a scalar variable.

A work around is to add an space between the "$" and the ")", for instance:

sub my func ($ )
{
....


Cheers,

- Salva
 
U

Uri Guttman

SF> If I recall correctly this is a bug already solved in latest versions
SF> of CPerl. It was caused by the prototype not being correctly parsed,
SF> and "$)" got interpreted as a scalar variable.

SF> A work around is to add an space between the "$" and the ")", for
SF> instance:

SF> sub my func ($ )
SF> {
SF> ...

beyond that, i would ask why the OP is using prototypes? he sounds like
a perl newbie and prototypes are not what most newbies think they
are. they are not needed nor useful in most programs so just drop them
and cperl will be nice to you as well. :)

uri
 

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

Forum statistics

Threads
474,297
Messages
2,571,529
Members
48,250
Latest member
Bette22B13

Latest Threads

Top