ÿØÿà JFIF    ÿÛ „ !.%+&8&+/1555$;@;4?.451 4,$,44444444444414444444444444444444444444444444444444ÿÀ  á á" ÿÄ     ÿÄ ?    !1AQaq"2‘¡±ÁðBRbrÑá#‚’¢²3S CñÿÄ   ÿÄ !    !1QAa‘2ÿÚ   ? 5˜Z¯V¦cø)›t/? z¨±>Õ5€¶‹Á¤·¼z¼Ü¬+ñ®v¤¨_ˆR­BFn©—˜ý®ç̝P8gýt·ÉSTŦˆìät?þé¼íìN/Þa)ì–í6ô… Ï¿øÃj´¿KÇü]ÿ ªô¹-eKànëÕHTx}ýSÜ›ÿ ”7Ø×&µ<¦  ¥ÑO¶[Ù¯ä¨ÞÃÿ PZ-¬;#õ|•oaÿ ©CìÞz3˜öː/¤­ñTûIØ}š^ mÓ%ªxˆ¥ÉŸu=Z+ISe¿45™¼u;ú&WØ÷€æßQ™®{|íx*TC“#ZŠìZ§²‹ 6pv…³¿¡äª*áZÐ%ÒOáˆo"x«OHk w±æ+¬V(kMúŸ5Vö«$ ÁrÏbàb57/luR ¸ÑÛj Òµì`Мq­û žICÀÊ•©4€Âcà¨Ï€O´<èÐ:›ù(Ë^L8þ‘ÍÌ#¸Ð_Ì©ÙK(Öz 4¬û+¸;ü’V’84‘¬ÃŽ:[â‡ÔÌáõp¢~§ªlæ£ö{®G>J¼"°‡7¯ÆÉèßû ‹É‹§ÁòÃýâßî ^ƾÙõ‹×óH#«LP½ïX=xÑÍ$|W?•~• îëÔ©ª‹ {ÝT…Kÿ ”hûâá)J*ö˜–ÔU;iÇ€/ ÆþjóZ\ýwØ=Ìm ºèËL9 ýèÆð/¨’¥öo=nË.%Îì ŽÕ¯È|{Oj²ƒE6e/ßdÄõ²Ìâ1O®ò×TsəԸhOMýíMˆ¿¼H˜l²,7Â¥#MF/Úf°Ö½± ¸–dr‹NýÊ íjqx{œÉ ä-È ¦ øÄër¨q°ð †nцýÑÄÆ’mä…n<0È™;ÁÝá¯ÁZƒ7FÀmì­ É&9ˆîéi¶ùN§Y• ÃZãAâ?•‡©‰ , ó¾IŸŠc1 4â&y­&pŠ­6;M À 0¹qç»p.á …ŸÅáK@%6·y6ƒ‰3?”úºŽ‰éX5ªPT §µ!=Mž«Ú½‹ÅgÂSâÉaþÓoö–¯ÁÔìR>5éÿ üs¶ÆUcÌ kÇR ]ÿ ù¬¼«VŽ;Â|‡~¢¦”ÏŰæ {L™Õ°Óv¹ò¸írޡעCÃ!íVÕ {¶»sŒNPg/ "uÕbkm²“$ďå¿é¹§°½æz¯6 †s¿!s–wÚÝ“™Œ °.ûj>·+™Òa…©Œ&rÝÎtÛë긪Ît’LAVp%c Úý[ÄzJ¾ÇàXXç@˜ó<êL]·T˜¾¥1Ó©V‡g´æ½¦Ý@¹óø!_@´ÞâSÁ —S3™•& ]@JHÚý©ZŽ €×æÔr»Áf!‡yÞ4Mv*èÓã_{‘åóUuљØ«Oïé*®EvÑ Œ÷‡U \"㪒ÍK+À 4“M¡ï:0¥5í!'<@î´”>Ç»&Z–ïCCV˜Ì5Šo&îhè.žû |ÓK©h$s6KìŒëã)¹hI¦GïOåóI;ììü#É$Š0…Ææ¥TØ.5­¾gn´ “ÂÖ\:hœ89G)J@„}œ:’Ò{/Š"¦_Æ×7Æ3VÇŠÊa]ÚŒÙ€Ä–=®uÁßâACZƒ§§£ Qnâ:«,×{tyø¬iÛcœÜÄ€H½ÄÍCk´÷šß .W'b¤Íåh]÷€=,Žv×cÚEÚHXJX¶îo¨FÒtèöŸ>ªª6[J®Fµ£sGÁeqõfe\íjÒÐïÄÐGˆe1Ø‹.Ø”‘Ëuø Y­ˆÜ ŽG|zùªüMpDnQWÄ”%JŠ™)â*p@Örš«ÕT2Ð%ˆG#ª„ ·¤!°ŸOTÂT¸aÚ%4&h™LµšØüÐ.F¿²ÐÞ_Ç‚¾ÅÃaÜ÷09Æ q€öy˜v‡85õN÷]¬äѼóS{°_MެúÔ#°Ç¸0åÞè2ëôPcvÆw9®ií1Ä8F™˜à‰´+‰Ik1òÝ7“Ñ×ÒsÝ\x‚h`ÞÑ`ó"|µEcý£n˜h`}GÞ !±ù²Ápü²ß6 0ïi󜵩SÈÇ7˜-ÕURO˜¦´f$ªž-Í6(œ}<„ éc øs]ŽŽ„*—¾ ìdŽ„)méª\¿êÎIg¾ØÞ~I#C/¼¼´EÁÈŽi8“©õådô·>euä ƒ'Ê×लR1ÉJE1ÐAát`t;ÇР%Ý<‡¥„ÍÆ`×Oyó)õiI€ñQaŸ4Ûù\áàaÃÔ¹HÃu¹*k€¦<„e S‡&õÏ B!ŽhüÞ`yj}mªf×\¿ Ç~æ­9‡û\՞Ǖg²1Žû5V7 !àöšm° c`ܬøÇìµÒ'P"?…´Ö,"§^•õލsÔ)6˜sæéÍR¼ ò|Sl”‹7 nPW Gòú÷½§O¯‡„l¡kSÞŒr½PÊ@æ¢pŽ-mÿ #Ÿ˜Àº¶Áä¦;ïÔæ$1££`“Õ>„—·ž)ßð³ñ#Ï Ô$¶œ‰ÊE‹À;÷º ¯«P:Ñ”8–IÊtpÞ3ª“>ê“þës4ò2OÏÕ­±zô†Õ§‰.÷ä¸;¿˜“'œ›žª}«Œ{ª±Ì 9ÔóÞÕ‡0 $íWV3Üì¬ —@kÝ4@¿r¼±½¬™›?øØæ´'Áé®CË3-g$˜ö‡×auÚi´Žp/êÛ æF›Ú2v‹ã¿¿,nB1̨ƃqÞa5͝@&Æû“él÷ \C²½UÍc ¯k×¢U ÖéQå™—-r wô ÞÏ<Ò=&=ÿ Ôê Òêˈt,i—;LîÜ á¸*ÚÃ1$êL•LÍ <É)ýÐà’ ;F™{ƒ™˜€&'}‚ãÄK`¡ÞT@I;®žZóè‚s’7®°›+§O­Åq©é»²9<Ô J ¼9O’HL»Ùïì¸rk¼Ž_ý‘TŸu[²ßÚŒ·ü÷B%¯E ŸÔX5êO´ Ç•€’I0 ÉJX` ñ¹õ%;µŸD‘«´€àwÒ™U ûئžÖö\×®×´8 ½‡ºÐÆÓ§?Àkmœ=;d5*@-ì0F Rªýš[Ü6âö̃ڸr*KA9· u*µæ£?U¸Âêí†8@¦X4 e-ò„0s{ HâUpU?¼mñRa°®a%Ð'tÉ×’\¾ÊÉ]t›h>·(Ë@R¼¡Ãt h}’O÷au<+nT…Ö…MӐ??Óe95 q>í/;&JSû °¯ÊéÞ øƒ*Ã2½Ài&:nôUl=¾¿5eˆ3”ñc|Ú2V”>„»&eE;«ÚäC p¢Û úy 9š[ŒÌx¼擼A&DåÒ¯ˆ¤ÀÌ;"˜ ÏQä¸åhÊ}Ûq«Û0WžÒ|»€ø®öCm5•\ÇÀ§Pe3£]0ÃàLDÉ‰1øªxjgwT‚÷¿LΨK‹›ùs—xˆÜ±µ kæ¸f‰‰ÜGk/LÛØ6d9ò¶ùA{ƒA3š/¬D¬khÓk‰`˜"㯒r¿±Óã jx‡°e}<Ñø\3y:'À•/h½Í€Ç4~g ?Û(¼]v‘ªlKÎâ~?O‚W%{Ì:“'©úNq¾›úo(X’¥¯ˆ nFê{Ç€ü?º'ë ø‹ì Þ09ŒÌç9Æ —ËC`j@ÓÄ(+a‹un¸#ÂꟋ{K`‘ÑÍÍ'à´»/Û,KW;Þ4²þð ï Nm|~fGÏ(…³Ã)«1ö­Õ ¥‡¨©ƒÃ™ü-s=à=U66Ï«Ýc蓦W¹íž®›nÔ%êÇìŒ<#Ü×84ån®Ð ÒåOC` ñânÑs‡¢ç 1õ%Îhì½Ã½® e:ݼUZo™`  ÅZŸŒÊ«ê1ÏÄo$q¹Þ€©ˆhÐÉä¯ñ[!…Ú˜àJ:x2$Íß&PåT£6ç— ‡Í*4Ýšçjÿ ‰É nófÐ ó(L5C•åÆ\rMÒ@ò }y-W}™üýVù—ú¢=Ù”c®‘< M ž ´Phr ¦©TD ‘ù.$´÷O‡‘V2Æò.=IUŒ=ž‡â¬i™aþÓåÙ?òUø'ØÖ•.~* šTŒ!•-×áºTâ®ä#õü'´ eýlYÅÓeÕKÂrT"CÚ@u!Óxƒ{š3€}1¿(r}%«nËamjÑ%ÑNEò v ˜à  σöK³,*º.àzù¨™Ó ÚçâU¦*¿ 9{%Ö¹ njûdaXöb) kÛÆ±ûÓ\°M7ˆÂ=û›ç¿Ã‚­V»Cg–8ÙêE- j)k$º`Ã-ùEýeBÆÇ]c¡°ñty&Òd0nõ'¡W+ƒ*|–øµFa\GQªEAÔp5\Ǽ·¼Ç8·õ -â§Ú[ ‡ uZeÖ 3}×d'+¹:ð+K†Û®s!Ï$úe€<Û”x)1»a­¡LC]¸µík…ÚàA»AYº{†ªS[¦5HÒ7ù --,ísòDØ€èk ÞÀîÜ ò@â( ËNˆë›4ô½•/¦o‡€Û7 ê•ÆêòðÜy'Án½µ á˜ݦ ndeo…[ì¶Ê,¥R³Ä=À±—–ß;£™´ñSâ*g§”ïaið‘Jå~™ÓÞ ß³Õ¢»8x埒²52>AÊb&-÷\7´éÄù€T˜,w;3{ï˜k…à¹ÄqÀ«œ{€\ ˆ¾[´¨јr &Úé„Ívˆ±8†¿]|¬ņ4I×pÞS1ÈÖz‰#Ìv‡G!YNògñ:màTz¢Ý1ô©^O=~ë|5Bã™ç•¼µõ•bÆ@úÕS¬ÈŒ#¬zünrŸ û” Z²•èðV"ÁHÚý©wÝ €7¼Ìu1hÑa3Éä û f$o¿É ™Ú›ÝçnpÒ3äÌ3†Í§,Äï]$‰/pê †«À¼¸e9­Æê_C]žƒ·ý·frÁN«, E=›Çq -‰öŒ:aÏ¿±í&£Í:-} 84‘ÿ eƒQÑeëSsuiA ³g㟥ú£?ÿ ʼn*”“÷aühe:ÊWa@ÒÞk±eØ] F Ô—r.åä˜ @ö¥ªZoÐýYL·¥S²G/‡ñ <~*ZÆ´è>JlòàÛÆ½ÿ 窘ìGN¢:I®KšJp/`íIÁÀõ#Ä-€ö­šµŒoF4|ÆQØÆ@Ì|£Ô…¢À{9˜è½Üó›€ôYÒÎYsið;ís¤€à²ˆ‚4qÉVŒI$ ‰"° æµ8cXGjœˏ¡Aâý•ËÜ¢ûï e·çLx']á"oÅÎê3¯Ç—¹”ó0nå‚âg{Œñ> S´˜îè°g238‚ãköÝfÚd´6Ò€;ò÷±¢™¼›º ¢Æ'¥Ðx'e¬ç ]bÈÆV¢ó‹kýBO ðÊâ$Ÿ!×T 3Mýמ žìٍàÌü‘8÷€àæØ8æ©6‰©L´«…oãpð„~Çk‰!ñ;‹”ÛžÍ àž±z Ÿôû øŸÝužÏ;ÿ #|u6™Þ¬ÚˆÐõA4¶â|ôl|Ê2ŽÇ¤ÝÅÇY.<#Aí.k§hóF‚”Y; M½Ö4hŸ4&›­¿tès´%FìL¥£Ãk‰ÇT¤haÁ¤ÚxfÉ`ÑìË›>i 3t‚:,–+^÷´–{Û–Nxi"x‘Ûg î¨>¥Õ܁ùZH,2Û“:8xÊ¢Çí9.É-Ìâã-=çjwµS˜dütžçwýGòú®®ûº_ˆýx$–¡ãøO EÚÛÏ÷R„×w+3£Á£öUMyR²¹âŒ°š›¸Ñãò9§Ó_Dl+Ùßc›úšGÅÌc†Ž!Ko=¶.‘Îÿ c²(2®V mª.ÿ ¹B›¹å ù„öŸSV>™ü¯$y:G¢Z×àøúdî¹û­·ýÇ´:•c LÍõi_‹ö+ÎæGÊè>OŠ•äž´§Þ{X}¨1ÚTc›»Qþ•êô°t¿OP?eæ~É{5]•ÙR£r5†nZ\ã@ &îJõ ¾àC°þV>fé¥/ü5ñÊIº_é5 ;e­h<@ Ä&æÃëE%;X,ÒãÆÞ`Oò¦kŸm#˜!ÀyÄ¢| óLšò¥Ä` ¶R=|ÈCâh5ò3DˆïF†ðÒ#ÅìÛœ?¸yhBãœí ZxßÎÄhºRK„`Þödvײ™ÀÈÑÒgŒuY w³%†ƒÓzõ ÖÏp‚dH®¦A´ù§»ÓÇMæ~)ˆð‡û:ù&Ä •vGD´À n ݇¼Ö8Fö óáà£~Ë¥x`oK|Ä?fxiØü%pìR>éò+Û±éÎ>núlFŤ'tq8LZÏvÃ?„¡ß±È⽆¯³íü@x|PöUäèØã¡ð‚ŒAìÏ"vÍwóŸÍ{ ý0.z È•Ö{,N¡£¡ŸKÕÙž>Ýœþ ÍÀ°<×EA!Å‚D™IúOÍ¡>ôG}Â` ÍßkÜL™Ž Þð™ {IøF²¹òQ3&!ÃÂÞz.d&Ï-sH¸,Ôõ˜ŽP€ 77ˆÝ¼ÊëÜw =cÕ Ú,ØÐ5ÎYÐ)ì´öœgŒ[¤ßv㙑8心>h]§µháYš£²ºÑ.{Ï7Sð•?´~×SÃKýJÛ˜ ™Íäiúu<µX¶1õ^kâçIÑ£sZ4h>j*ÔšD:4­¿_ ÷¸ Õxæÿ ¸?Mù _•­ÊÐ ä ÷ý ÑwL œ­ïnTkÛUÍN©ë:¦fV ¶ÜÔÜMªÅâA½–¿R×TXš-%iTÊT•‡Ù‚JôϐZxWÑè‰f‰òG º ×Õû2aZ7OU3[“×AT–ÞŒ…-‘¤”Ì ì&(ˆ¿­•ƒkï’:ðY¦W‘ Å)“†‘˜³Åtcø˜ñTÂwÚÇ4|üLÇªí–v- qˆèU qPE.†â‘˜µ Æ,ÐÅs]8¾„oúÑ i>ÜxxÈó)ƒ ´æÁâØ$À‰vžŸf$Ž |ãw;ÀÁIJ»b` {¦Ó¤Ú$©YÀ‘n@Óïž«9J¼êG m¤ ܯ¹ÌW4€ÐÒÅÛ‡#褕Ÿn-?í|с¥÷Ú¹¬'´ÞÜ9ÓK `hê£SÄSà?7—Wí_´…óB›»:=Ãïq`<8ñÓŒÑlú2d¬ê³£hÖ[l|$vÝro~'R®‰§°ñmY ͧäP |PUª¹·:3Œ[Û{Xÿ ºâ@‚W–Äé u‚ ¯´*=íή.pûÒdt @G‰¬ s¸ ëÉücr ÞæÑ¨Ê@>¤¢Ö±. Þ'¯°ÌME[YéïĵÂCå½ Ué©Áû'Ê9%eÔðNU”ë‘ÌsD3/®+UI˜9h.WC”빓$#:pz:YÓ ¿xž* ³$Í +$kñAŠ‹†¢ Uê>¸)_š¬÷©ßAÂÔb9ÇU ¯¾á•9¯ÏÏ÷O÷¼¼Fähal1‰3Ì[Ïr•´UCksNÐ] R‘¸¥H+§Šé†c©vÖÞ0iÓ76s†î!§=ß ¼~Ô'°Ãmäoäš³ªøi1úÉ)³yV8 CLÄØÁ‘WYïi€H6ÖÑiámø^ÈY´°Ñ7¥Û*—Ñ©L«Qƒï—Ùrÿ ›£Ð*š¸ˆL©ˆ$ˆ ÷¾D§9È®«qbqC)–ˆïv´çñsÑVT­Ø, <àïºÀO«Jý·õ àfPìð .wFšir´þ’2_Y *Æ€x\« ì€9š@ Ž|F⇥ˆkZ@hÖÄ0t¿-<“‹qµ¾*ZL¤Ú)&BJpÓF5=$„at*Zš$’ÑtdûÝRI1 2މ$€$I$#‰SÞ’Hë¬ï;Á$¡t$’`<(ñÇt)$‡Ð.Êf¢X’Kt=Éé$‚ˆªè¢oÝëòI%Rgcª÷ŠyI%¡‰ÿ !ñ)´õ $¤ Ô’IIGÿÙrequire 5.006; package Pod::Perldoc::ToMan; use strict; use warnings; use parent qw(Pod::Perldoc::BaseTo); use vars qw($VERSION); $VERSION = '3.28'; use File::Spec::Functions qw(catfile); use Pod::Man 2.18; # This class is unlike ToText.pm et al, because we're NOT paging thru # the output in our particular format -- we make the output and # then we run nroff (or whatever) on it, and then page thru the # (plaintext) output of THAT! sub SUCCESS () { 1 } sub FAILED () { 0 } sub is_pageable { 1 } sub write_with_binmode { 0 } sub output_extension { 'txt' } sub __filter_nroff { shift->_perldoc_elem('__filter_nroff' , @_) } sub __nroffer { shift->_perldoc_elem('__nroffer' , @_) } sub __bindir { shift->_perldoc_elem('__bindir' , @_) } sub __pod2man { shift->_perldoc_elem('__pod2man' , @_) } sub __output_file { shift->_perldoc_elem('__output_file' , @_) } sub center { shift->_perldoc_elem('center' , @_) } sub date { shift->_perldoc_elem('date' , @_) } sub fixed { shift->_perldoc_elem('fixed' , @_) } sub fixedbold { shift->_perldoc_elem('fixedbold' , @_) } sub fixeditalic { shift->_perldoc_elem('fixeditalic' , @_) } sub fixedbolditalic { shift->_perldoc_elem('fixedbolditalic', @_) } sub name { shift->_perldoc_elem('name' , @_) } sub quotes { shift->_perldoc_elem('quotes' , @_) } sub release { shift->_perldoc_elem('release' , @_) } sub section { shift->_perldoc_elem('section' , @_) } sub new { my( $either ) = shift; my $self = bless {}, ref($either) || $either; $self->init( @_ ); return $self; } sub init { my( $self, @args ) = @_; unless( $self->__nroffer ) { my $roffer = $self->_find_roffer( $self->_roffer_candidates ); $self->debug( "Using $roffer\n" ); $self->__nroffer( $roffer ); } else { $self->debug( "__nroffer is " . $self->__nroffer() . "\n" ); } $self->_check_nroffer; } sub _roffer_candidates { my( $self ) = @_; if( $self->is_openbsd || $self->is_freebsd || $self->is_bitrig ) { qw( mandoc groff nroff ) } else { qw( groff nroff mandoc ) } } sub _find_roffer { my( $self, @candidates ) = @_; my @found = (); foreach my $candidate ( @candidates ) { push @found, $self->_find_executable_in_path( $candidate ); } return wantarray ? @found : $found[0]; } sub _check_nroffer { return 1; # where is it in the PATH? # is it executable? # what is its real name? # what is its version? # does it support the flags we need? # is it good enough for us? } sub _get_stty { `stty -a` } sub _get_columns_from_stty { my $output = $_[0]->_get_stty; if( $output =~ /\bcolumns\s+(\d+)/ ) { return $1 } elsif( $output =~ /;\s*(\d+)\s+columns;/ ) { return $1 } else { return 0 } } sub _get_columns_from_manwidth { my( $self ) = @_; return 0 unless defined $ENV{MANWIDTH}; unless( $ENV{MANWIDTH} =~ m/\A\d+\z/ ) { $self->warn( "Ignoring non-numeric MANWIDTH ($ENV{MANWIDTH})\n" ); return 0; } if( $ENV{MANWIDTH} == 0 ) { $self->warn( "Ignoring MANWIDTH of 0. Really? Why even run the program? :)\n" ); return 0; } if( $ENV{MANWIDTH} =~ m/\A(\d+)\z/ ) { return $1 } return 0; } sub _get_default_width { 73 } sub _get_columns { $_[0]->_get_columns_from_manwidth || $_[0]->_get_columns_from_stty || $_[0]->_get_default_width; } sub _get_podman_switches { my( $self ) = @_; my @switches = map { $_, $self->{$_} } grep !m/^_/s, keys %$self; # There needs to be a cleaner way to handle setting # the UTF-8 flag, but for now, comment out this # line because it often does the wrong thing. # # See RT #77465 # #push @switches, 'utf8' => 1; $self->debug( "Pod::Man switches are [@switches]\n" ); return @switches; } sub _parse_with_pod_man { my( $self, $file ) = @_; #->output_fh and ->output_string from Pod::Simple aren't # working, apparently, so there's this ugly hack: local *STDOUT; open STDOUT, '>', $self->{_text_ref}; my $parser = Pod::Man->new( $self->_get_podman_switches ); $self->debug( "Parsing $file\n" ); $parser->parse_from_file( $file ); $self->debug( "Done parsing $file\n" ); close STDOUT; $self->die( "No output from Pod::Man!\n" ) unless length $self->{_text_ref}; $self->_save_pod_man_output if $self->debugging; return SUCCESS; } sub _save_pod_man_output { my( $self, $fh ) = @_; $fh = do { my $file = "podman.out.$$.txt"; $self->debug( "Writing $file with Pod::Man output\n" ); open my $fh2, '>', $file; $fh2; } unless $fh; print { $fh } ${ $self->{_text_ref} }; } sub _have_groff_with_utf8 { my( $self ) = @_; return 0 unless $self->_is_groff; my $roffer = $self->__nroffer; my $minimum_groff_version = '1.20.1'; my $version_string = `$roffer -v`; my( $version ) = $version_string =~ /\(?groff\)? version (\d+\.\d+(?:\.\d+)?)/; $self->debug( "Found groff $version\n" ); # is a string comparison good enough? if( $version lt $minimum_groff_version ) { $self->warn( "You have an old groff." . " Update to version $minimum_groff_version for good Unicode support.\n" . "If you don't upgrade, wide characters may come out oddly.\n" ); } $version ge $minimum_groff_version; } sub _have_mandoc_with_utf8 { my( $self ) = @_; $self->_is_mandoc and not system 'mandoc -Tlocale -V > /dev/null 2>&1'; } sub _collect_nroff_switches { my( $self ) = shift; my @render_switches = ('-man', $self->_get_device_switches); # Thanks to Brendan O'Dea for contributing the following block if( $self->_is_roff and -t STDOUT and my ($cols) = $self->_get_columns ) { my $c = $cols * 39 / 40; $cols = $c > $cols - 2 ? $c : $cols -2; push @render_switches, '-rLL=' . (int $c) . 'n' if $cols > 80; } # I hear persistent reports that adding a -c switch to $render # solves many people's problems. But I also hear that some mans # don't have a -c switch, so that unconditionally adding it here # would presumably be a Bad Thing -- sburke@cpan.org push @render_switches, '-c' if( $self->_is_roff and $self->is_cygwin ); return @render_switches; } sub _get_device_switches { my( $self ) = @_; if( $self->_is_nroff ) { qw() } elsif( $self->_have_groff_with_utf8 ) { qw(-Kutf8 -Tutf8) } elsif( $self->_is_ebcdic ) { qw(-Tcp1047) } elsif( $self->_have_mandoc_with_utf8 ) { qw(-Tlocale) } elsif( $self->_is_mandoc ) { qw() } else { qw(-Tlatin1) } } sub _is_roff { my( $self ) = @_; $self->_is_nroff or $self->_is_groff; } sub _is_nroff { my( $self ) = @_; $self->__nroffer =~ /\bnroff\b/; } sub _is_groff { my( $self ) = @_; $self->__nroffer =~ /\bgroff\b/; } sub _is_mandoc { my ( $self ) = @_; $self->__nroffer =~ /\bmandoc\b/; } sub _is_ebcdic { my( $self ) = @_; return 0; } sub _filter_through_nroff { my( $self ) = shift; $self->debug( "Filtering through " . $self->__nroffer() . "\n" ); # Maybe someone set rendering switches as part of the opt_n value # Deal with that here. my ($render, $switches) = $self->__nroffer() =~ /\A([\/a-zA-Z0-9_\.-]+)\b(.+)?\z/; $self->die("no nroffer!?") unless $render; my @render_switches = $self->_collect_nroff_switches; if ( $switches ) { # Eliminate whitespace $switches =~ s/\s//g; # Then separate the switches with a zero-width positive # lookahead on the dash. # # See: # http://www.effectiveperlprogramming.com/blog/1411 # for a good discussion of this technique push @render_switches, split(/(?=-)/, $switches); } $self->debug( "render is $render\n" ); $self->debug( "render options are @render_switches\n" ); require Symbol; require IPC::Open3; require IO::Handle; my $pid = IPC::Open3::open3( my $writer, my $reader, my $err = Symbol::gensym(), $render, @render_switches ); $reader->autoflush(1); use IO::Select; my $selector = IO::Select->new( $reader ); $self->debug( "Writing to pipe to $render\n" ); my $offset = 0; my $chunk_size = 4096; my $length = length( ${ $self->{_text_ref} } ); my $chunks = $length / $chunk_size; my $done; my $buffer; while( $offset <= $length ) { $self->debug( "Writing chunk $chunks\n" ); $chunks++; syswrite $writer, ${ $self->{_text_ref} }, $chunk_size, $offset or $self->die( $! ); $offset += $chunk_size; $self->debug( "Checking read\n" ); READ: { last READ unless $selector->can_read( 0.01 ); $self->debug( "Reading\n" ); my $bytes = sysread $reader, $buffer, 4096; $self->debug( "Read $bytes bytes\n" ); $done .= $buffer; $self->debug( sprintf "Output is %d bytes\n", length $done ); next READ; } } close $writer; $self->debug( "Done writing\n" ); # read any leftovers $done .= do { local $/; <$reader> }; $self->debug( sprintf "Done reading. Output is %d bytes\n", length $done ); if( $? ) { $self->warn( "Error from pipe to $render!\n" ); $self->debug( 'Error: ' . do { local $/; <$err> } ); } close $reader; if( my $err = $? ) { $self->debug( "Nonzero exit ($?) while running `$render @render_switches`.\n" . "Falling back to Pod::Perldoc::ToPod\n" ); return $self->_fallback_to_pod( @_ ); } $self->debug( "Output:\n----\n$done\n----\n" ); ${ $self->{_text_ref} } = $done; return length ${ $self->{_text_ref} } ? SUCCESS : FAILED; } sub parse_from_file { my( $self, $file, $outfh) = @_; # We have a pipeline of filters each affecting the reference # in $self->{_text_ref} $self->{_text_ref} = \my $output; $self->_parse_with_pod_man( $file ); # so far, nroff is an external command so we ensure it worked my $result = $self->_filter_through_nroff; return $self->_fallback_to_pod( @_ ) unless $result == SUCCESS; $self->_post_nroff_processing; print { $outfh } $output or $self->die( "Can't print to $$self{__output_file}: $!" ); return; } sub _fallback_to_pod { my( $self, @args ) = @_; $self->warn( "Falling back to Pod because there was a problem!\n" ); require Pod::Perldoc::ToPod; return Pod::Perldoc::ToPod->new->parse_from_file(@_); } # maybe there's a user setting we should check? sub _get_tab_width { 4 } sub _expand_tabs { my( $self ) = @_; my $tab_width = ' ' x $self->_get_tab_width; ${ $self->{_text_ref} } =~ s/\t/$tab_width/g; } sub _post_nroff_processing { my( $self ) = @_; if( $self->is_hpux ) { $self->debug( "On HP-UX, I'm going to expand tabs for you\n" ); # this used to be a pipe to `col -x` for HP-UX $self->_expand_tabs; } if( $self->{'__filter_nroff'} ) { $self->debug( "filter_nroff is set, so filtering\n" ); $self->_remove_nroff_header; $self->_remove_nroff_footer; } else { $self->debug( "filter_nroff is not set, so not filtering\n" ); } $self->_handle_unicode; return 1; } # I don't think this does anything since there aren't two consecutive # newlines in the Pod::Man output sub _remove_nroff_header { my( $self ) = @_; $self->debug( "_remove_nroff_header is still a stub!\n" ); return 1; # my @data = split /\n{2,}/, shift; # shift @data while @data and $data[0] !~ /\S/; # Go to header # shift @data if @data and $data[0] =~ /Contributed\s+Perl/; # Skip header } # I don't think this does anything since there aren't two consecutive # newlines in the Pod::Man output sub _remove_nroff_footer { my( $self ) = @_; $self->debug( "_remove_nroff_footer is still a stub!\n" ); return 1; ${ $self->{_text_ref} } =~ s/\n\n+.*\w.*\Z//m; # my @data = split /\n{2,}/, shift; # pop @data if @data and $data[-1] =~ /^\w/; # Skip footer, like # 28/Jan/99 perl 5.005, patch 53 1 } sub _unicode_already_handled { my( $self ) = @_; $self->_have_groff_with_utf8 || 1 # so, we don't have a case that needs _handle_unicode ; } sub _handle_unicode { # this is the job of preconv # we don't need this with groff 1.20 and later. my( $self ) = @_; return 1 if $self->_unicode_already_handled; require Encode; # it's UTF-8 here, but we need character data my $text = Encode::decode( 'UTF-8', ${ $self->{_text_ref} } ) ; # http://www.mail-archive.com/groff@gnu.org/msg01378.html # http://linux.die.net/man/7/groff_char # http://www.gnu.org/software/groff/manual/html_node/Using-Symbols.html # http://lists.gnu.org/archive/html/groff/2011-05/msg00007.html # http://www.simplicidade.org/notes/archives/2009/05/fixing_the_pod.html # http://lists.freebsd.org/pipermail/freebsd-questions/2011-July/232239.html $text =~ s/(\P{ASCII})/ sprintf '\\[u%04X]', ord $1 /eg; # should we encode? ${ $self->{_text_ref} } = $text; } 1; __END__ =head1 NAME Pod::Perldoc::ToMan - let Perldoc render Pod as man pages =head1 SYNOPSIS perldoc -o man Some::Modulename =head1 DESCRIPTION This is a "plug-in" class that allows Perldoc to use Pod::Man and C for reading Pod pages. The following options are supported: center, date, fixed, fixedbold, fixeditalic, fixedbolditalic, quotes, release, section (Those options are explained in L.) For example: perldoc -o man -w center:Pod Some::Modulename =head1 CAVEAT This module may change to use a different pod-to-nroff formatter class in the future, and this may change what options are supported. =head1 SEE ALSO L, L, L =head1 COPYRIGHT AND DISCLAIMERS Copyright (c) 2011 brian d foy. All rights reserved. Copyright (c) 2002,3,4 Sean M. Burke. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. =head1 AUTHOR Current maintainer: Mark Allen C<< >> Past contributions from: brian d foy C<< >> Adriano R. Ferreira C<< >>, Sean M. Burke C<< >> =cut