Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:illuusio:perl
perl-Tie-STDOUT
perl-Tie-STDOUT.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File perl-Tie-STDOUT.spec of Package perl-Tie-STDOUT
# # spec file for package perl-Tie-STDOUT # # Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define cpan_name Tie-STDOUT Name: perl-Tie-STDOUT Version: 1.0500 Release: 0 Summary: Intercept writes to STDOUT and apply user-defined functions License: Artistic-1.0 OR GPL-1.0-or-later URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/D/DC/DCANTRELL/%{cpan_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(Devel::CheckOS) BuildRequires: perl(Test::More) >= 0.88 Requires: perl(Devel::CheckOS) Requires: perl(Test::More) >= 0.88 %{perl_requires} %description This module intercepts all writes to the STDOUT filehandle and applies whatever function you desire to what would have gone to STDOUT. In the example above, any use of the print() function on this filehandle will have its output transmogrified into upper case. You will have noticed that we blithely print to the default filehandle (which is almost always STDOUT) in the function we supplied. Relax, this doesn't cause an infinite loop, because your functions are always called with a *normal* STDOUT. You may provide up to three user-defined functions which are respectively called whenever you use print(), printf() or syswrite() on the filehandle: * print defaults to printing to the real STDOUT; * printf defaults to passing all parameters through sprintf() and then passing them to whatever the 'print' function is; * syswrite Defaults to going straight through to the real STDOUT. You will note that the default behaviour is exactly the same as it would be without this module. Because we have a sensible default for 'printf' and because syswrite is so rarely used, you will normally only have to provide your own code for 'print'. %prep %autosetup -n %{cpan_name}-%{version} find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -name "configure" -print0 | xargs -0 chmod 644 %build perl Makefile.PL INSTALLDIRS=vendor %make_build %check make test %install %perl_make_install %perl_process_packlist %perl_gen_filelist %files -f %{name}.files %doc CHANGELOG README %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor