Name: perl-Context-Preserve Version: 0.01 Release: 1%{?dist} Summary: Run code after a subroutine call, preserving the context the subroutine would have seen if it were the last statement in the caller License: CHECK(Distributable) Group: Development/Libraries URL: http://search.cpan.org/dist/Context-Preserve/ Source0: http://www.cpan.org/authors/id/J/JR/JROCKWAY/Context-Preserve-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: perl(ExtUtils::MakeMaker) BuildRequires: perl(ok) BuildRequires: perl(Test::Exception) BuildRequires: perl(Test::More) Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) %description Sometimes you need to call a function, get the results, act on the results, then return the result of the function. This is painful because of contexts; the original function can behave different if it's called in void, scalar, or list context. You can ignore the various cases and just pick one, but that's fragile. To do things right, you need to see which case you're being called in, and then call the function in that context. This results in 3 code paths, which is a pain to type in (and maintain). %prep %setup -q -n Context-Preserve-%{version} %build %{__perl} Makefile.PL INSTALLDIRS=vendor make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \; find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \; %{_fixperms} $RPM_BUILD_ROOT/* %check make test %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc Changes README %{perl_vendorlib}/* %{_mandir}/man3/* %changelog * Tue Aug 11 2009 Dave Cross 0.01-1 - Specfile autogenerated by cpanspec 1.78.