Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement $*PROGRAM_NAME (S28) #777

Closed
p6rt opened this issue Mar 14, 2009 · 4 comments
Closed

implement $*PROGRAM_NAME (S28) #777

p6rt opened this issue Mar 14, 2009 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Mar 14, 2009

Migrated from rt.perl.org#63872 (status was 'resolved')

Searchable as RT63872$

@p6rt
Copy link
Author

p6rt commented Mar 14, 2009

From mberends@autoexec.demon.nl

Just a one liner to copy the full pathname of the running Perl script, or
otherwise '-e' into $*PROGRAM_NAME. (The * twigil does not appear in the
patch).

Chris Dolan (http://rt.perl.org/rt3/Public/Bug/Display.html?id=63228) also
set out to do the same, but then a spec change froze his work.

The patch works on r37407 (2009-03-14). The test suite currently has no
facility for automated testing of command line processing :-(

Inline Patch
diff --git a/src/builtins/guts.pir b/src/builtins/guts.pir
index fd46cb0..125cec4 100644
--- a/src/builtins/guts.pir
+++ b/src/builtins/guts.pir
@@ -341,6 +341,7 @@ first). So for now we just transform multis in user
code like this.   \#\# We're running as main program   \#\# Remove program argument \(0\) and set up @​ARGS global   $P0 = shift args \+ set\_hll\_global '$PROGRAM\_NAME', $P0   args = args\.'Array'\(\)   set\_hll\_global '@​ARGS', args   \#\# run unitmain PROGRAM\_NAME\.diff \(END\)

@p6rt
Copy link
Author

p6rt commented Mar 14, 2009

From @jnthn

On Sat Mar 14 11​:07​:14 2009, mberends@​autoexec.demon.nl wrote​:

Just a one liner to copy the full pathname of the running Perl script, or
otherwise '-e' into $*PROGRAM_NAME. (The * twigil does not appear in the
patch).

Thanks, applied as git 6d97951. Not sure what it should do in -e, but
will leave that for particle who will be doing a larger review of
command line things anyway.

Jonathan

@p6rt
Copy link
Author

p6rt commented Mar 14, 2009

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Mar 14, 2009

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Mar 14, 2009
@p6rt p6rt added the patch label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant