help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Possible bug in M-x perld


From: Harry Putnam
Subject: Possible bug in M-x perld
Date: Mon, 29 Mar 2004 23:30:04 -0600
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

Before posting a bug report, I hoped someone might be able to confirm
if this is just operator error or is some kind of bug.

I'm using M-x perld to debug a perl program.  This program uses the
(%) hash function to override program defaults from the command line.

Program defaults are stored in an onboard %hash

%hash = ( "a" => "something",
          "b" => "something",
          "c" => "something"
         );

One usefull property of hashes is that they only can have uniq keys.
(The first column of single letters are the keys).

So this provides a way to override by adding a new key value pair
that has the same key but different value.

$hash{"b"} = "something_different"
Now the old value of "b" has disappeared and the new one filled its
slot.

So, I'm using a home boy command line technique to override the
defaults like this.

  ./test.pl 'b=new_stuff' file
The script is programmed to split the b=new_stuff into 
  key   = b
  value = new_stuff
and push them into %hash

This works fine from the command line and even from cmdline perl -d.

But if run inside emacs M-x perld it fails to override the default.

It seems the single '' quotes are included into the cmdline arg or
something.

The hash ends up with a new key value pair 'b new_stuff' and retains
                       the old              b something

Note the added quotes.  The perl program run inside emacs, outputs just
like above.  However run from cmdline `perl -d' The same addition from
the command line and the old value of "b" gets overwritten as
expected.

Something inside emacs is causing the new key value pair to be seen
differently. 
I've tried using double quotes "", but get the same result inside
emacs.

The single quotes are necessay since the stuff being passed are regex
and may contain things the shell would expand unexpectedly.

This can be reproduced by creating a perl program like this:

cat test.pl
  #!/usr/local/bin/perl -w
  @clargs = @ARGV;
  @ARGV = ();
  for(@clargs){
    print "$_\n";
  }

and run it from the command line like ./test.pl one two 'three'
Output is:
    one
    two
    three

Now start the debugger inside emacs like this:

M-x perld <RET>
(Edit the default command line to)
  perl -d ./test.pl one two 'three'
Step thru the program and see the ouput:
  one
  two
  'three'
           

 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]