# New Ticket Created by Kenneth A Graves # Please include the string: [perl #23346] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=23346 >
I was trying to figure out how to access argv from within parrot code, and didn't see anything in the docs. So I started thinking about how to implement it, only to stumble over the appropriate bit of embed.c. It's already there. Now that I know it's there, I can find appropriate clues in docs/debugging.pod and languages/imcc/docs/running.pod. I think a more explicit mention in docs/running.pod would be good, hence the patch below. Should the word "argv" be explicitly mentioned, or is "command line arguments" clear enough? --kag -- attachment 1 ------------------------------------------------------ url: http://rt.perl.org/rt2/attach/62889/46287/02e16c/running.patch
--- running.pod.~1.15.~ 2003-08-12 11:00:03.000000000 -0400 +++ running.pod 2003-08-16 23:05:06.000000000 -0400 @@ -27,6 +27,14 @@ This creates a bytecode file called C<foo.pbc>, but does not execute it. +Any command line arguments from the filename on are passed into +the program in PMC register P0. For the invocation: + + parrot foo.pbc --foo_arg process_me.foo + +P0 would have three string elements: C<foo.pbc>, C<--foo_arg>, and +C<process_me.foo>. + C<parrot> has four different opcode dispatchers: normal, computed goto, prederef, and JIT. The default mode is normal, or computed goto if that is supported by your compiler (gcc supports it). You may pass