From: Nick Ing-Simmons Date: Sat, 28 Nov 1998 15:21:59 +0000 (+0000) Subject: Implement $^C to allow perl access to -c flag - I think this X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=49460fe6d299521eb33c31ef95793c8ca16e93d2;p=p5sagit%2Fp5-mst-13.2.git Implement $^C to allow perl access to -c flag - I think this was agreed once... p4raw-id: //depot/perl@2352 --- diff --git a/gv.c b/gv.c index 4cef56d..beffabf 100644 --- a/gv.c +++ b/gv.c @@ -761,6 +761,7 @@ gv_fetchpv(char *nambeg, I32 add, I32 sv_type) case '|': case '\001': case '\002': + case '\003': case '\004': case '\005': case '\006': diff --git a/mg.c b/mg.c index 7859c47..360e304 100644 --- a/mg.c +++ b/mg.c @@ -477,6 +477,10 @@ magic_get(SV *sv, MAGIC *mg) /* printf("some %s\n", printW(PL_curcop->cop_warnings)), */ sv_setsv(sv, PL_curcop->cop_warnings); break; + case '\003': /* ^C */ + sv_setiv(sv, (IV)PL_minus_c); + break; + case '\004': /* ^D */ sv_setiv(sv, (IV)(PL_debug & 32767)); break; @@ -1655,6 +1659,11 @@ magic_set(SV *sv, MAGIC *mg) } } break; + + case '\003': /* ^C */ + PL_minus_c = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv); + break; + case '\004': /* ^D */ PL_debug = (SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv)) | 0x80000000; DEBUG_x(dump_all());