Skip Menu |

This queue is for tickets about the File-XDG CPAN distribution.

Report information
The Basics
Id: 100798
Status: open
Priority: 0/
Queue: File-XDG

People
Owner: Nobody in particular
Requestors: theo [...] willows.se
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Silence "experimental" warnings
Date: Tue, 09 Dec 2014 10:31:02 +0000
To: bug-File-XDG [...] rt.cpan.org
From: Theo Willows <theo [...] willows.se>
Using File::XDG produces a number of "experimental" warnings. Adding the following to the top of File/XDG.pm should silence them: no if $] >= 5.018000, warnings => qw( experimental::smartmatch ); I would have supplied a patch or even made a pull request but I couldn't find any repository info. (But that's an other issue.)
Alas, it looks like this may never be fixed, so here's a workaround for this issue that one can use in one's code in place of `use File::XDG`. BEGIN { package File::XDG; local $SIG{'__WARN__'} = sub { my $warning = shift; warn $warning unless $warning =~ m/^(?:given|when) is experimental at /; }; require File::XDG; }
Subject: Silence "experimental" warnings [rt.cpan.org #100798]
Date: Sun, 7 Oct 2018 16:52:22 +0200
To: bug-File-XDG [...] rt.cpan.org
From: Serpent7776 <serpent7776 [...] gmail.com>
"Alas, it looks like this may never be fixed" What? The fix is plain and simple - don't use experimental features in a library. All those warnings come from given/when and this library doesn't need them. Just remove it and use plain if statements. Putting some code in BEGIN block just to silence warnings from a library is insane.
On Tue Dec 09 05:31:13 2014, theo@willows.se wrote: Show quoted text
> Using File::XDG produces a number of "experimental" warnings. Adding the > following to the top of File/XDG.pm should silence them: > > no if $] >= 5.018000, warnings => qw( experimental::smartmatch ); > > I would have supplied a patch or even made a pull request but I couldn't > find any repository info. (But that's an other issue.)
I did a fix, it got accepted and merged, but now I think the repository is gone. All I can find is this: https://github.com/pjf/perl-file-xdg/commit/fbee55750c655bf7daee367da6cbf9e711e00f6b I can't find the original pull requests, nor do I remember which github repository I made the pull requests against.
From: rwp
On Tue Dec 09 05:31:13 2014, theo@willows.se wrote: Show quoted text
> Using File::XDG produces a number of "experimental" warnings. Adding the > following to the top of File/XDG.pm should silence them: > > no if $] >= 5.018000, warnings => qw( experimental::smartmatch ); > > I would have supplied a patch or even made a pull request but I couldn't > find any repository info. (But that's an other issue.)
also: use experimental 'switch'; within XDG.pm silences warnings (from module's side)
Subject: XDG.pm.patch
--- XDG.pm 2019-12-17 12:07:24.087876000 +0400 +++ XDG.pm.m 2019-12-17 12:08:39.574111000 +0400 @@ -3,6 +3,7 @@ use strict; use warnings; use feature qw(:5.10); +use experimental 'switch'; our $VERSION = 0.04;