Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
devel:languages:perl:CPAN-P
perl-Perl6-Placeholders
perl-Perl6-Placeholders.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File perl-Perl6-Placeholders.spec of Package perl-Perl6-Placeholders
# # spec file for package perl-Perl6-Placeholders # # Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # 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 http://bugs.opensuse.org/ # Name: perl-Perl6-Placeholders Version: 0.07 Release: 0 %define cpan_name Perl6-Placeholders Summary: Perl 6 implicitly declared parameters for Perl 5 License: software. It may be used, redistributed and/or modified under the terms of the Perl Artistic License (see http://www.perl.com/perl/misc/Artistic.html) Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/Perl6-Placeholders/ Source0: http://www.cpan.org/authors/id/L/LP/LPALMER/%{cpan_name}-%{version}.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros %{perl_requires} %description The Perl6::Placeholders module lets you try out the new Perl 6 implicit parameter specification syntax in Perl 5. Perl 6 reserves all variables of the form '$^name' or '@^name' or '%^name' as "placeholders" that can be used to turn regular blocks into subroutine references. Any block containing one or more such placeholders is treated as a reference to a subroutine in which the placeholders are replaced by the appropriate number and sequence of arguments. That is, the expression: # Perl 6 code $check = { $^a == $^b**2 * $^c or die $^err_msg }; is equivalent to: # Perl 6 code $check = sub ($a, $b, $c, $err_msg) { $a == $b**2 * $c or die $err_msg }; This could then be invoked: # Perl 6 code $check.($i,$j,$k,$msg); It is also be possible to interpolate an argument list into a static expression like so: # Perl 6 code { $^a == $^b**2 * $^c or die $^err_msg }.($i,$j,$k,$msg); The placeholders are sorted UTF8-abetically before they are used to create the subroutine's parameter list. Hence the following: # Perl 6 code @reverse_sorted = sort {$^b <=> $^a} @list; works as expected. That is, it's equivalent to: @reverse_sorted = sort sub($a,$b){$b <=> $a}, @list; %prep %setup -q -n %{cpan_name}-%{version} find . -type f -print0 | xargs -0 chmod 644 %build %{__perl} Makefile.PL INSTALLDIRS=vendor %{__make} %{?_smp_mflags} %check %{__make} test %install %perl_make_install %perl_process_packlist %perl_gen_filelist %files -f %{name}.files %defattr(-,root,root,755) %doc Changes 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