Skip Menu |
 
Report information
Id: 89704
Status: resolved
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: masak <cmasak [at] gmail.com>
Cc:
AdminCc:

Severity: (no value)
Tag: testneeded
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [BUG] Cannot assign to $*PROGRAM_NAME in Rakudo
Date: Mon, 2 May 2011 21:11:33 +0200
To: rakudobug [...] perl.org
From: Carl Mäsak <cmasak [...] gmail.com>
Download (untitled) / with headers
text/plain 708b
<dukeleto> how does one change the current process name in Perl 6? Is that in the spec somewhere, or is it still implementation-dependent? * masak goes a-lookin' <PerlJam> I'd guess the latter though <PerlJam> I wonder if you could search for "$0" or "the old $0" and find something useful. <masak> $*PROGRAM_NAME <dukeleto> masak: intetesting. going to play with that now. masak++ <masak> waitwait, I didn't say it *works*! :/ <PerlJam> it's mentioned in src/core/MAIN.pm <PerlJam> and src/glue/run.pir and src/gen/core.pm <masak> probably read-only, though... <masak> rakudo: $*PROGRAM_NAME = "foo"; say "alive" <p6eval> rakudo 632f81: OUTPUT«Cannot modify readonly value [...] * masak submits rakudobug
Download (untitled) / with headers
text/plain 1003b
On Mon May 02 12:11:48 2011, masak wrote: Show quoted text
> <dukeleto> how does one change the current process name in Perl 6? Is > that in the spec somewhere, or is it still implementation-dependent? > * masak goes a-lookin' > <PerlJam> I'd guess the latter though > <PerlJam> I wonder if you could search for "$0" or "the old $0" and > find something useful. > <masak> $*PROGRAM_NAME > <dukeleto> masak: intetesting. going to play with that now. masak++ > <masak> waitwait, I didn't say it *works*! :/ > <PerlJam> it's mentioned in src/core/MAIN.pm > <PerlJam> and src/glue/run.pir and src/gen/core.pm > <masak> probably read-only, though... > <masak> rakudo: $*PROGRAM_NAME = "foo"; say "alive" > <p6eval> rakudo 632f81: OUTPUT�Cannot modify readonly value [...] > * masak submits rakudobug
fixed. marking testneeded. 17:51 <diakopter> rakudo: say $*PROGRAM_NAME; $*PROGRAM_NAME = "foo"; say $*PROGRAM_NAME; say "alive" 17:51 <p6eval> rakudo 024843: OUTPUT«/tmp/wQdMLNwVmF␤foo␤alive␤»
Download (untitled) / with headers
text/plain 194b
Note that assigning to $*PROGRAM_NAME doesn't change the program name that you see from the outside (for example from `ps aux` on linux). This depends on https://github.com/perl6/specs/issues/14
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 307b
On Tue Aug 07 14:37:13 2012, moritz wrote: Show quoted text
> Note that assigning to $*PROGRAM_NAME doesn't change the program name > that you see from the outside (for example from `ps aux` on linux). This > depends on https://github.com/perl6/specs/issues/14
Tests added to S02-magicals/progname.t -- Will "Coke" Coleda


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org