all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Possible bug in M-x perld
@ 2004-03-30  5:30 Harry Putnam
  0 siblings, 0 replies; only message in thread
From: Harry Putnam @ 2004-03-30  5:30 UTC (permalink / raw)


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'

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-03-30  5:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-30  5:30 Possible bug in M-x perld Harry Putnam

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.