develooper Front page | perl.perl5.porters | Postings from October 2021

Re: Pre-RFC: no feature 'filetests';

Thread Previous | Thread Next
Paul "LeoNerd" Evans
October 2, 2021 21:30
Re: Pre-RFC: no feature 'filetests';
Message ID:
On Sat, 2 Oct 2021 14:26:05 -0700
Darren Duncan <> wrote:

> My real point with my second paragraph before was that if a feature
> like this file operator syntax removal can't sufficiently easily be
> implemented as a CPAN module, either with or without XS, then it
> could be a core discussion about removing roadblocks such that the
> change is sufficiently easy.  Although I suspect but don't know that
> the required core foundation already exists, considering the
> existence of other syntax-modifying CPAN modules.

Definitely can't.

The only way I can think to do it involves lots of hackery at the core
of toke.c and/or perly.y, to make those parts of the tokenizer (yes,
really) be conditional on some flag. Maybe expose those bit-constants
to perl-land via some new global; call it ${^QUIRKS} or somesuch.

Then we'd just have

  package quirk::filetests;
  sub unimport { ${^QUIRKS} |=  0x0001; }
  sub import   { ${^QUIRKS} &= ~0x0001; }

so now we can

  no quirk::filetests;

But really, 99% of the work is in core .c file source, not pureperl .pm

Paul "LeoNerd" Evans      |  |

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About