Text-Header-1.03/0040755000175000017500000000000007772027610013067 5ustar tfheentfheenText-Header-1.03/debian/0040755000175000017500000000000007772027610014311 5ustar tfheentfheenText-Header-1.03/debian/control0100644000175000017500000000142507534363442015715 0ustar tfheentfheenSource: libtext-header-perl Section: interpreters Priority: optional Build-Depends-Indep: debhelper (>= 3.0.5), perl (>= 5.6.0-17) Maintainer: Tollef Fog Heen Standards-Version: 3.5.1 Package: libtext-header-perl Architecture: all Depends: ${perl:Depends} Description: RFC 822/2068 header and unheader functions This module provides two new functions, header and unheader, which provide general-purpose RFC 822 header construction and parsing. They do not provide any intelligent defaults of HTTP-specific methods. They are simply aimed at providing an easy means to address the mechanics of header parsing. . The output style is designed to mimic CGI.pm and HTTP::Headers, so that users familiar with these interfaces will feel at home with these functions.Text-Header-1.03/debian/rules0100755000175000017500000000342507534363550015374 0ustar tfheentfheen#!/usr/bin/make -f #-*- makefile -*- # Made with the aid of dh_make, by Craig Small # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. # Some lines taken from debmake, by Christoph Lameter. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 export DH_COMPAT=3 PACKAGE=$(shell dh_listpackages) ifndef PERL PERL = /usr/bin/perl endif ifndef DESTDIR DESTDIR=.. endif TMP =`pwd`/debian/$(PACKAGE) build: build-stamp build-stamp: dh_testdir # Add here commands to compile the package. $(PERL) Makefile.PL INSTALLDIRS=vendor $(MAKE) OPTIMIZE="-O2 -g -Wall" touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp # Add here commands to clean up after the build process. -$(MAKE) realclean dh_clean install: dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into debian/tmp. #$(MAKE) install DESTDIR=`pwd`/debian/tmp $(MAKE) install PREFIX=$(TMP)/usr # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install # dh_testversion dh_testdir dh_testroot dh_installdocs README dh_installexamples dh_installmenu # dh_installemacsen # dh_installinit dh_installcron dh_installman # dh_undocumented dh_installchangelogs Changes dh_link dh_strip dh_compress dh_fixperms chmod -x $(TMP)/usr/share/perl5/Text/Header.pm # dh_makeshlibs dh_installdeb dh_perl dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb --destdir=$(DESTDIR) source diff: @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary Text-Header-1.03/debian/changelog0100644000175000017500000000047507772027600016165 0ustar tfheentfheenlibtext-header-perl (1.03-2) unstable; urgency=low * Trivial fix for -w. (closes: #217791) -- Tollef Fog Heen Tue, 23 Dec 2003 13:05:20 +0100 libtext-header-perl (1.03-1) unstable; urgency=low * Initial Release. -- Tollef Fog Heen Sun, 1 Sep 2002 11:59:53 +0200 Text-Header-1.03/debian/copyright0100644000175000017500000000077607534363144016254 0ustar tfheentfheenThis package was debianized by Tollef Fog Heen on 2002-09-01. The upstream author is: Copyright (c) 2000 Nathan Wiger . All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. In Debian, the complete text of the GPL can be found under /usr/share/common-licenses/GPL Text-Header-1.03/Makefile0100644000175000017500000004407307534363556014544 0ustar tfheentfheen# This Makefile is for the Text::Header extension to perl. # # It was generated automatically by MakeMaker version # 5.45 (Revision: 1.222) from the contents of # Makefile.PL. Don't edit this file, edit Makefile.PL instead. # # ANY CHANGES MADE HERE WILL BE LOST! # # MakeMaker ARGV: (q[INSTALLDIRS=vendor]) # # MakeMaker Parameters: # NAME => q[Text::Header] # VERSION_FROM => q[Header.pm] # --- MakeMaker post_initialize section: # --- MakeMaker const_config section: # These definitions are from config.sh (via /usr/lib/perl/5.6.1/Config.pm) # They may have been overridden via Makefile.PL or on the command line AR = ar CC = cc CCCDLFLAGS = -fPIC CCDLFLAGS = -rdynamic DLEXT = so DLSRC = dl_dlopen.xs LD = cc LDDLFLAGS = -shared -L/usr/local/lib LDFLAGS = -L/usr/local/lib LIBC = /lib/libc-2.2.4.so LIB_EXT = .a OBJ_EXT = .o OSNAME = linux OSVERS = 2.4.13 RANLIB = : SO = so EXE_EXT = FULL_AR = /usr/bin/ar # --- MakeMaker constants section: AR_STATIC_ARGS = cr NAME = Text::Header DISTNAME = Text-Header NAME_SYM = Text_Header VERSION = 1.03 VERSION_SYM = 1_03 XS_VERSION = 1.03 INST_BIN = blib/bin INST_EXE = blib/script INST_LIB = blib/lib INST_ARCHLIB = blib/arch INST_SCRIPT = blib/script PREFIX = /usr SITEPREFIX = $(PREFIX)/local INSTALLDIRS = vendor INSTALLPRIVLIB = $(PREFIX)/share/perl/5.6.1 INSTALLARCHLIB = $(PREFIX)/lib/perl/5.6.1 INSTALLSITELIB = $(SITEPREFIX)/share/perl/5.6.1 INSTALLSITEARCH = $(SITEPREFIX)/lib/perl/5.6.1 INSTALLVENDORLIB = $(PREFIX)/share/perl5 INSTALLVENDORARCH = $(PREFIX)/lib/perl5 INSTALLBIN = $(PREFIX)/bin INSTALLSCRIPT = $(PREFIX)/bin INSTALLSITEBIN = $(SITEPREFIX)/bin PERL_LIB = /usr/share/perl/5.6.1 PERL_ARCHLIB = /usr/lib/perl/5.6.1 SITELIBEXP = /usr/local/share/perl/5.6.1 SITEARCHEXP = /usr/local/lib/perl/5.6.1 LIBPERL_A = libperl.a FIRST_MAKEFILE = Makefile MAKE_APERL_FILE = Makefile.aperl PERLMAINCC = $(CC) PERL_INC = /usr/lib/perl/5.6.1/CORE PERL = /usr/bin/perl FULLPERL = /usr/bin/perl FULL_AR = /usr/bin/ar VERSION_MACRO = VERSION DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\" XS_VERSION_MACRO = XS_VERSION XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\" PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc MAKEMAKER = /usr/share/perl/5.6.1/ExtUtils/MakeMaker.pm MM_VERSION = 5.45 # FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle). # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle) # ROOTEXT = Directory part of FULLEXT with leading slash (eg /DBD) !!! Deprecated from MM 5.32 !!! # PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar) # DLBASE = Basename part of dynamic library. May be just equal BASEEXT. FULLEXT = Text/Header BASEEXT = Header PARENT_NAME = Text DLBASE = $(BASEEXT) VERSION_FROM = Header.pm OBJECT = LDFROM = $(OBJECT) LINKTYPE = dynamic # Handy lists of source code files: XS_FILES= C_FILES = O_FILES = H_FILES = HTMLLIBPODS = HTMLSCRIPTPODS = MAN1PODS = MAN3PODS = Header.pm HTMLEXT = html INST_MAN1DIR = blib/man1 INSTALLMAN1DIR = $(PREFIX)/share/man/man1 INSTALLSITEMAN1DIR = $(SITEPREFIX)/man/man1 MAN1EXT = 1p INST_MAN3DIR = blib/man3 INSTALLMAN3DIR = $(PREFIX)/share/man/man3 INSTALLSITEMAN3DIR = $(SITEPREFIX)/man/man3 MAN3EXT = 3pm PERM_RW = 644 PERM_RWX = 755 # work around a famous dec-osf make(1) feature(?): makemakerdflt: all .SUFFIXES: .xs .c .C .cpp .cxx .cc $(OBJ_EXT) # Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to recall, that # some make implementations will delete the Makefile when we rebuild it. Because # we call false(1) when we rebuild it. So make(1) is not completely wrong when it # does so. Our milage may vary. # .PRECIOUS: Makefile # seems to be not necessary anymore .PHONY: all config static dynamic test linkext manifest # Where is the Config information that we are using/depend on CONFIGDEP = $(PERL_ARCHLIB)/Config.pm $(PERL_INC)/config.h # Where to put things: INST_LIBDIR = $(INST_LIB)/Text INST_ARCHLIBDIR = $(INST_ARCHLIB)/Text INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT) INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT) INST_STATIC = INST_DYNAMIC = INST_BOOT = EXPORT_LIST = PERL_ARCHIVE = PERL_ARCHIVE_AFTER = TO_INST_PM = Header.pm PM_TO_BLIB = Header.pm \ $(INST_LIBDIR)/Header.pm # --- MakeMaker tool_autosplit section: # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto AUTOSPLITFILE = $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e 'use AutoSplit;autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1) ;' # --- MakeMaker tool_xsubpp section: # --- MakeMaker tools_other section: SHELL = /bin/sh CHMOD = chmod CP = cp LD = cc MV = mv NOOP = $(SHELL) -c true RM_F = rm -f RM_RF = rm -rf TEST_F = test -f TOUCH = touch UMASK_NULL = umask 0 DEV_NULL = > /dev/null 2>&1 # The following is a portable way to say mkdir -p # To see which directories are created, change the if 0 to if 1 MKPATH = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e mkpath # This helps us to minimize the effect of the .exists files A yet # better solution would be to have a stable file in the perl # distribution with a timestamp of zero. But this solution doesn't # need any changes to the core distribution and works with older perls EQUALIZE_TIMESTAMP = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e eqtime # Here we warn users that an old packlist file was found somewhere, # and that they should call some uninstall routine WARN_IF_OLD_PACKLIST = $(PERL) -we 'exit unless -f $$ARGV[0];' \ -e 'print "WARNING: I have found an old package in\n";' \ -e 'print "\t$$ARGV[0].\n";' \ -e 'print "Please make sure the two installations are not conflicting\n";' UNINST=0 VERBINST=0 MOD_INSTALL = $(PERL) -I$(INST_LIB) -I$(PERL_LIB) -MExtUtils::Install \ -e "install({@ARGV},'$(VERBINST)',0,'$(UNINST)');" DOC_INSTALL = $(PERL) -e '$$\="\n\n";' \ -e 'print "=head2 ", scalar(localtime), ": C<", shift, ">", " L<", $$arg=shift, "|", $$arg, ">";' \ -e 'print "=over 4";' \ -e 'while (defined($$key = shift) and defined($$val = shift)){print "=item *";print "C<$$key: $$val>";}' \ -e 'print "=back";' UNINSTALL = $(PERL) -MExtUtils::Install \ -e 'uninstall($$ARGV[0],1,1); print "\nUninstall is deprecated. Please check the";' \ -e 'print " packlist above carefully.\n There may be errors. Remove the";' \ -e 'print " appropriate files manually.\n Sorry for the inconveniences.\n"' # --- MakeMaker dist section: DISTVNAME = $(DISTNAME)-$(VERSION) TAR = tar TARFLAGS = cvf ZIP = zip ZIPFLAGS = -r COMPRESS = gzip --best SUFFIX = .gz SHAR = shar PREOP = @$(NOOP) POSTOP = @$(NOOP) TO_UNIX = @$(NOOP) CI = ci -u RCS_LABEL = rcs -Nv$(VERSION_SYM): -q DIST_CP = best DIST_DEFAULT = tardist # --- MakeMaker macro section: # --- MakeMaker depend section: # --- MakeMaker cflags section: # --- MakeMaker const_loadlibs section: # --- MakeMaker const_cccmd section: # --- MakeMaker post_constants section: # --- MakeMaker pasthru section: PASTHRU = LIB="$(LIB)"\ LIBPERL_A="$(LIBPERL_A)"\ LINKTYPE="$(LINKTYPE)"\ PREFIX="$(PREFIX)"\ OPTIMIZE="$(OPTIMIZE)" # --- MakeMaker c_o section: # --- MakeMaker xs_c section: # --- MakeMaker xs_o section: # --- MakeMaker top_targets section: #all :: config $(INST_PM) subdirs linkext manifypods all :: pure_all htmlifypods manifypods @$(NOOP) pure_all :: config pm_to_blib subdirs linkext @$(NOOP) subdirs :: $(MYEXTLIB) @$(NOOP) config :: Makefile $(INST_LIBDIR)/.exists @$(NOOP) config :: $(INST_ARCHAUTODIR)/.exists @$(NOOP) config :: $(INST_AUTODIR)/.exists @$(NOOP) $(INST_AUTODIR)/.exists :: /usr/lib/perl/5.6.1/CORE/perl.h @$(MKPATH) $(INST_AUTODIR) @$(EQUALIZE_TIMESTAMP) /usr/lib/perl/5.6.1/CORE/perl.h $(INST_AUTODIR)/.exists -@$(CHMOD) $(PERM_RWX) $(INST_AUTODIR) $(INST_LIBDIR)/.exists :: /usr/lib/perl/5.6.1/CORE/perl.h @$(MKPATH) $(INST_LIBDIR) @$(EQUALIZE_TIMESTAMP) /usr/lib/perl/5.6.1/CORE/perl.h $(INST_LIBDIR)/.exists -@$(CHMOD) $(PERM_RWX) $(INST_LIBDIR) $(INST_ARCHAUTODIR)/.exists :: /usr/lib/perl/5.6.1/CORE/perl.h @$(MKPATH) $(INST_ARCHAUTODIR) @$(EQUALIZE_TIMESTAMP) /usr/lib/perl/5.6.1/CORE/perl.h $(INST_ARCHAUTODIR)/.exists -@$(CHMOD) $(PERM_RWX) $(INST_ARCHAUTODIR) config :: $(INST_MAN3DIR)/.exists @$(NOOP) $(INST_MAN3DIR)/.exists :: /usr/lib/perl/5.6.1/CORE/perl.h @$(MKPATH) $(INST_MAN3DIR) @$(EQUALIZE_TIMESTAMP) /usr/lib/perl/5.6.1/CORE/perl.h $(INST_MAN3DIR)/.exists -@$(CHMOD) $(PERM_RWX) $(INST_MAN3DIR) help: perldoc ExtUtils::MakeMaker Version_check: @$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \ -MExtUtils::MakeMaker=Version_check \ -e "Version_check('$(MM_VERSION)')" # --- MakeMaker linkext section: linkext :: $(LINKTYPE) @$(NOOP) # --- MakeMaker dlsyms section: # --- MakeMaker dynamic section: ## $(INST_PM) has been moved to the all: target. ## It remains here for awhile to allow for old usage: "make dynamic" #dynamic :: Makefile $(INST_DYNAMIC) $(INST_BOOT) $(INST_PM) dynamic :: Makefile $(INST_DYNAMIC) $(INST_BOOT) @$(NOOP) # --- MakeMaker dynamic_bs section: BOOTSTRAP = # --- MakeMaker dynamic_lib section: # --- MakeMaker static section: ## $(INST_PM) has been moved to the all: target. ## It remains here for awhile to allow for old usage: "make static" #static :: Makefile $(INST_STATIC) $(INST_PM) static :: Makefile $(INST_STATIC) @$(NOOP) # --- MakeMaker static_lib section: # --- MakeMaker htmlifypods section: htmlifypods : pure_all @$(NOOP) # --- MakeMaker manifypods section: POD2MAN_EXE = /usr/bin/pod2man POD2MAN = $(PERL) -we '%m=@ARGV;for (keys %m){' \ -e 'next if -e $$m{$$_} && -M $$m{$$_} < -M $$_ && -M $$m{$$_} < -M "Makefile";' \ -e 'print "Manifying $$m{$$_}\n";' \ -e 'system(qq[$$^X ].q["-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" $(POD2MAN_EXE) ].qq[$$_>$$m{$$_}])==0 or warn "Couldn\047t install $$m{$$_}\n";' \ -e 'chmod(oct($(PERM_RW))), $$m{$$_} or warn "chmod $(PERM_RW) $$m{$$_}: $$!\n";}' manifypods : pure_all Header.pm @$(POD2MAN) \ Header.pm \ $(INST_MAN3DIR)/Text::Header.$(MAN3EXT) # --- MakeMaker processPL section: # --- MakeMaker installbin section: # --- MakeMaker subdirs section: # none # --- MakeMaker clean section: # Delete temporary files but do not touch installed files. We don't delete # the Makefile here so a later make realclean still has a makefile to use. clean :: -rm -rf ./blib $(MAKE_APERL_FILE) $(INST_ARCHAUTODIR)/extralibs.all perlmain.c mon.out core core.*perl.*.? *perl.core so_locations pm_to_blib *$(OBJ_EXT) *$(LIB_EXT) perl.exe $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).def $(BASEEXT).exp -mv Makefile Makefile.old $(DEV_NULL) # --- MakeMaker realclean section: # Delete temporary files (via clean) and also delete installed files realclean purge :: clean rm -rf $(INST_AUTODIR) $(INST_ARCHAUTODIR) rm -f $(INST_LIBDIR)/Header.pm rm -rf Makefile Makefile.old # --- MakeMaker dist_basics section: distclean :: realclean distcheck distcheck : $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=fullcheck \ -e fullcheck skipcheck : $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=skipcheck \ -e skipcheck manifest : $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=mkmanifest \ -e mkmanifest veryclean : realclean $(RM_F) *~ *.orig */*~ */*.orig # --- MakeMaker dist_core section: dist : $(DIST_DEFAULT) @$(PERL) -le 'print "Warning: Makefile possibly out of date with $$vf" if ' \ -e '-e ($$vf="$(VERSION_FROM)") and -M $$vf < -M "Makefile";' tardist : $(DISTVNAME).tar$(SUFFIX) zipdist : $(DISTVNAME).zip $(DISTVNAME).tar$(SUFFIX) : distdir $(PREOP) $(TO_UNIX) $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME) $(RM_RF) $(DISTVNAME) $(COMPRESS) $(DISTVNAME).tar $(POSTOP) $(DISTVNAME).zip : distdir $(PREOP) $(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME) $(RM_RF) $(DISTVNAME) $(POSTOP) uutardist : $(DISTVNAME).tar$(SUFFIX) uuencode $(DISTVNAME).tar$(SUFFIX) \ $(DISTVNAME).tar$(SUFFIX) > \ $(DISTVNAME).tar$(SUFFIX)_uu shdist : distdir $(PREOP) $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar $(RM_RF) $(DISTVNAME) $(POSTOP) # --- MakeMaker dist_dir section: distdir : $(RM_RF) $(DISTVNAME) $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=manicopy,maniread \ -e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');" # --- MakeMaker dist_test section: disttest : distdir cd $(DISTVNAME) && $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) Makefile.PL cd $(DISTVNAME) && $(MAKE) cd $(DISTVNAME) && $(MAKE) test # --- MakeMaker dist_ci section: ci : $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=maniread \ -e "@all = keys %{ maniread() };" \ -e 'print("Executing $(CI) @all\n"); system("$(CI) @all");' \ -e 'print("Executing $(RCS_LABEL) ...\n"); system("$(RCS_LABEL) @all");' # --- MakeMaker install section: install :: all pure_install doc_install install_perl :: all pure_perl_install doc_perl_install install_site :: all pure_site_install doc_site_install install_vendor :: all pure_vendor_install doc_vendor_install install_ :: install_site @echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site pure_install :: pure_$(INSTALLDIRS)_install doc_install :: doc_$(INSTALLDIRS)_install pure__install : pure_site_install @echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site doc__install : doc_site_install @echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site pure_perl_install :: @umask 022; $(MOD_INSTALL) \ read $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist \ write $(INSTALLARCHLIB)/auto/$(FULLEXT)/.packlist \ $(INST_LIB) $(INSTALLPRIVLIB) \ $(INST_ARCHLIB) $(INSTALLARCHLIB) \ $(INST_BIN) $(INSTALLBIN) \ $(INST_SCRIPT) $(INSTALLSCRIPT) \ $(INST_HTMLLIBDIR) $(INSTALLHTMLPRIVLIBDIR) \ $(INST_HTMLSCRIPTDIR) $(INSTALLHTMLSCRIPTDIR) \ $(INST_MAN1DIR) $(INSTALLMAN1DIR) \ $(INST_MAN3DIR) $(INSTALLMAN3DIR) @$(WARN_IF_OLD_PACKLIST) \ $(SITEARCHEXP)/auto/$(FULLEXT) pure_site_install :: @umask 02; $(MOD_INSTALL) \ read $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist \ write $(INSTALLSITEARCH)/auto/$(FULLEXT)/.packlist \ $(INST_LIB) $(INSTALLSITELIB) \ $(INST_ARCHLIB) $(INSTALLSITEARCH) \ $(INST_BIN) $(INSTALLSITEBIN) \ $(INST_SCRIPT) $(INSTALLSITEBIN) \ $(INST_MAN1DIR) $(INSTALLSITEMAN1DIR) \ $(INST_MAN3DIR) $(INSTALLSITEMAN3DIR) @$(WARN_IF_OLD_PACKLIST) \ $(PERL_ARCHLIB)/auto/$(FULLEXT) pure_vendor_install :: @umask 022; $(MOD_INSTALL) \ $(INST_LIB) $(INSTALLVENDORLIB) \ $(INST_ARCHLIB) $(INSTALLVENDORARCH) \ $(INST_BIN) $(INSTALLBIN) \ $(INST_SCRIPT) $(INSTALLSCRIPT) \ $(INST_MAN1DIR) $(INSTALLMAN1DIR) \ $(INST_MAN3DIR) $(INSTALLMAN3DIR) doc_perl_install :: @echo Appending installation info to $(INSTALLARCHLIB)/perllocal.pod -@umask 022; $(MKPATH) $(INSTALLARCHLIB) -@umask 022; $(DOC_INSTALL) \ "Module" "$(NAME)" \ "installed into" "$(INSTALLPRIVLIB)" \ LINKTYPE "$(LINKTYPE)" \ VERSION "$(VERSION)" \ EXE_FILES "$(EXE_FILES)" \ >> $(INSTALLARCHLIB)/perllocal.pod doc_site_install :: @echo Appending installation info to $(INSTALLSITEARCH)/perllocal.pod -@umask 02; $(MKPATH) $(INSTALLSITEARCH) -@umask 02; $(DOC_INSTALL) \ "Module" "$(NAME)" \ "installed into" "$(INSTALLSITELIB)" \ LINKTYPE "$(LINKTYPE)" \ VERSION "$(VERSION)" \ EXE_FILES "$(EXE_FILES)" \ >> $(INSTALLSITEARCH)/perllocal.pod doc_vendor_install :: uninstall :: uninstall_from_$(INSTALLDIRS)dirs uninstall_from_perldirs :: @$(UNINSTALL) $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist uninstall_from_sitedirs :: @$(UNINSTALL) $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist # --- MakeMaker force section: # Phony target to force checking subdirectories. FORCE: @$(NOOP) # --- MakeMaker perldepend section: # --- MakeMaker makefile section: # We take a very conservative approach here, but it\'s worth it. # We move Makefile to Makefile.old here to avoid gnu make looping. Makefile : Makefile.PL $(CONFIGDEP) @echo "Makefile out-of-date with respect to $?" @echo "Cleaning current config before rebuilding Makefile..." -@$(RM_F) Makefile.old -@$(MV) Makefile Makefile.old -$(MAKE) -f Makefile.old clean $(DEV_NULL) || $(NOOP) $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" Makefile.PL "INSTALLDIRS=vendor" @echo "==> Your Makefile has been rebuilt. <==" @echo "==> Please rerun the make command. <==" false # To change behavior to :: would be nice, but would break Tk b9.02 # so you find such a warning below the dist target. #Makefile :: $(VERSION_FROM) # @echo "Warning: Makefile possibly out of date with $(VERSION_FROM)" # --- MakeMaker staticmake section: # --- MakeMaker makeaperl section --- MAP_TARGET = perl FULLPERL = /usr/bin/perl $(MAP_TARGET) :: static $(MAKE_APERL_FILE) $(MAKE) -f $(MAKE_APERL_FILE) $@ $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) @echo Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET) @$(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \ Makefile.PL DIR= \ MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \ MAKEAPERL=1 NORECURS=1 CCCDLFLAGS= \ INSTALLDIRS=vendor # --- MakeMaker test section: TEST_VERBOSE=0 TEST_TYPE=test_$(LINKTYPE) TEST_FILE = test.pl TEST_FILES = TESTDB_SW = -d testdb :: testdb_$(LINKTYPE) test :: $(TEST_TYPE) test_dynamic :: pure_all PERL_DL_NONLAZY=1 $(FULLPERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(TEST_FILE) testdb_dynamic :: pure_all PERL_DL_NONLAZY=1 $(FULLPERL) $(TESTDB_SW) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(TEST_FILE) test_ : test_dynamic test_static :: test_dynamic testdb_static :: testdb_dynamic # --- MakeMaker ppd section: # Creates a PPD (Perl Package Description) for a binary distribution. ppd: @$(PERL) -e "print qq{\n}. qq{\tText-Header\n}. qq{\t\n}. qq{\t\n}. qq{\t\n}. qq{\t\t\n}. qq{\t\t\n}. qq{\t\t\n}. qq{\t\n}. qq{\n}" > Text-Header.ppd # --- MakeMaker pm_to_blib section: pm_to_blib: $(TO_INST_PM) @$(PERL) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" \ "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Install \ -e "pm_to_blib({qw{$(PM_TO_BLIB)}},'$(INST_LIB)/auto','$(PM_FILTER)')" @$(TOUCH) $@ # --- MakeMaker selfdocument section: # --- MakeMaker postamble section: # End. Text-Header-1.03/Makefile.PL0100644000175000017500000000035507166144650015042 0ustar tfheentfheenuse ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'Text::Header', 'VERSION_FROM' => 'Header.pm', # finds $VERSION ); Text-Header-1.03/pm_to_blib0100644000175000017500000000000007534363556015113 0ustar tfheentfheenText-Header-1.03/Header.pm0100555000175000017500000001626507772027550014630 0ustar tfheentfheen # $Id: Header.pm,v 1.3 2000/10/02 17:43:20 nwiger Exp $ #################################################################### # # Copyright (c) 2000 Nathan Wiger # # This simple module provides two functions, header and unheader, # which do lightweight, general-purpose RFC 822 header parsing. # # This module is intended mainly as a proof-of-concept for the Perl # 6 proposal located at: http://dev.perl.org/rfc/3__.html # #################################################################### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # 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. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # #################################################################### package Text::Header; require 5.004; use strict; use vars qw(@EXPORT @ISA $VERSION); $VERSION = do { my @r=(q$Revision: 1.3 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r }; use Exporter; @ISA = qw(Exporter); @EXPORT = qw(header unheader); sub header { my @ret; my @args = @_; # go through each tag pair, reformatting the tag # and pushing it onto an array while (my $tag = shift @args and my $val = shift @args) { chomp($tag = ucfirst lc $tag); $tag =~ s/[-_](\w)/-\u$1/g; if ( ref $val ) { $val = join ', ', @$val; } chomp $val; push @ret, "$tag: $val\n"; } return @ret; } sub unheader { my @ret; chomp(my @lines = @_); my $i = 0; while (my $line = $lines[$i]) { # join multiple indented lines per RFC 822 $line .= $lines[$i] while (defined($lines[++$i]) && ($lines[$i] =~ /^\s+/)); # split the two and change the tag to lowercase my($tag, $val) = $line =~ m/([-\w]+)\s*:\s*(.*)/s; $tag = lc $tag; $tag =~ s/-/_/g; # some cleanup $val =~ s/\n\s*/ /g; $val =~ s/\s*,\s+/, /g; push @ret, $tag, $val; } return @ret; } 1; __END__ =head1 NAME Text::Header - RFC 822/2068 C
and C functions =head1 SYNOPSIS use Text::Header; # header and unheader exported # Construct headers similar to CGI.pm and HTTP::Headers @HEADERS = header(content_type => 'text/html', author => 'Nathan Wiger', last_modified => $date, accept => [qw(text/html text/plain)]); # The above produces the array: @HEADERS = ("Content-Type: text/html\n", "Author: Nathan Wiger\n", "Last-Modified: Wed Sep 27 13:31:06 PDT 2000\n", "Accept: text/html, text/plain\n"); # Can also construct SMTP headers to format mail @mail_headers = header(from => 'Nathan Wiger ', to => 'perl5-porters@perl.org'); print $MAIL @mail_headers, "\nKeep up the great work!\n"; # The above would print this to the $MAIL handle: From: Nathan Wiger To: perl5-porters@perl.org Keep up the great work! =head1 DESCRIPTION This module provides two new functions, C
and C, which provide general-purpose RFC 822 header construction and parsing. They do not provide any intelligent defaults of HTTP-specific methods. They are simply aimed at providing an easy means to address the mechanics of header parsing. The output style is designed to mimic C and C, so that users familiar with these interfaces will feel at home with these functions. As shown above, the C function automatically does the following: 1. uc's the first letter of each tag token and lc's the rest, also converting _'s to -'s automatically 2. Adds a colon separating each tag and its value, and exactly one newline after each one 3. Combines list elements into a comma-delimited string Note that a list is always joined into a comma-delimited string. To insert multiple separate headers, simply call C
with multiple args: push @out, header(accept => 'text/html', accept => 'text/plain'); This would create multiple "Accept:" lines. Note that unlike C, the C
function provided here does not provide any intelligent defaults. If called as: @out_headers = header; It will return an empty list. This allows C
to be more general pupose, so it can provide SMTP and other headers as well. You can also use it as a generic text formatting tool, hence the reason it's under the C hierarchy. The C function works in exactly the opposite direction from C
, pulling apart headers and returning a list. C: 1. lc's the entire tag name, converting -'s to _'s 2. Separates each tag based on the colon delimiter, chomping newlines. 3. Returns a list of tag/value pairs for easy assignment to a hash So, assuming the C<@HEADERS> array shown up top: %myheaders = unheader(@HEADERS); The hash C<%myheaders> would have the following values: %myheaders = ( content_type => 'text/html', author => 'Nathan Wiger', last_modified => 'Wed Sep 27 13:31:06 PDT 2000', accept => 'text/html, text/plain' ); Note that all keys are converted to lowercase, and their values have their newlines stripped. However, note that comma-separated fields are B split up on input. This cannot be done reliably because some fields, such as the HTTP C header, can contain commas even though they are not lists. Inferring this type of structure would require knowledge of content, and these functions are specifically designed to be content-independent. The C function will respect line wrapping, as seen in SMTP headers. It will simply join the lines and return the value, so that: %mail = unheader("To: Nathan Wiger , perl5-porters@perl.org"); Would return: $mail{to} = "Nathan Wiger , perl5-porters@perl.org" Notice that multiple spaces between the comma separator have been condensed to a single space. Since the C
and C functions are direct inverses, this call: @out = header unheader @in; Will result in C<@out> being exactly equivalent to C<@in>. =head1 REFERENCES This is designed as both a Perl 5 module and also a Perl 6 prototype. Please see the Perl 6 proposal at http://dev.perl.org/rfc/333.html This module is designed to be fully compliant with the internet standards RFC 822 (SMTP Headers) and RFC 2068 (HTTP Headers). =head1 AUTHOR Copyright (c) 2000 Nathan Wiger . All Rights Reserved. This module is free software; you may copy this under the terms of the GNU General Public License, or the Artistic License, copies of which should have accompanied your Perl kit. =cut Text-Header-1.03/blib/0040755000175000017500000000000007534363556014007 5ustar tfheentfheenText-Header-1.03/blib/lib/0040755000175000017500000000000007534363556014555 5ustar tfheentfheenText-Header-1.03/blib/lib/Text/0040755000175000017500000000000007534363556015501 5ustar tfheentfheenText-Header-1.03/blib/lib/Text/Header.pm0100555000175000017500000001623507166144502017221 0ustar tfheentfheen # $Id: Header.pm,v 1.3 2000/10/02 17:43:20 nwiger Exp $ #################################################################### # # Copyright (c) 2000 Nathan Wiger # # This simple module provides two functions, header and unheader, # which do lightweight, general-purpose RFC 822 header parsing. # # This module is intended mainly as a proof-of-concept for the Perl # 6 proposal located at: http://dev.perl.org/rfc/3__.html # #################################################################### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # 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. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # #################################################################### package Text::Header; require 5.004; use strict; use vars qw(@EXPORT @ISA $VERSION); $VERSION = do { my @r=(q$Revision: 1.3 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r }; use Exporter; @ISA = qw(Exporter); @EXPORT = qw(header unheader); sub header { my @ret; my @args = @_; # go through each tag pair, reformatting the tag # and pushing it onto an array while (my $tag = shift @args and my $val = shift @args) { chomp($tag = ucfirst lc $tag); $tag =~ s/[-_](\w)/-\u$1/g; if ( ref $val ) { $val = join ', ', @$val; } chomp $val; push @ret, "$tag: $val\n"; } return @ret; } sub unheader { my @ret; chomp(my @lines = @_); my $i = 0; while (my $line = $lines[$i]) { # join multiple indented lines per RFC 822 $line .= $lines[$i] while ($lines[++$i] =~ /^\s+/); # split the two and change the tag to lowercase my($tag, $val) = $line =~ m/([-\w]+)\s*:\s*(.*)/s; $tag = lc $tag; $tag =~ s/-/_/g; # some cleanup $val =~ s/\n\s*/ /g; $val =~ s/\s*,\s+/, /g; push @ret, $tag, $val; } return @ret; } 1; __END__ =head1 NAME Text::Header - RFC 822/2068 C
and C functions =head1 SYNOPSIS use Text::Header; # header and unheader exported # Construct headers similar to CGI.pm and HTTP::Headers @HEADERS = header(content_type => 'text/html', author => 'Nathan Wiger', last_modified => $date, accept => [qw(text/html text/plain)]); # The above produces the array: @HEADERS = ("Content-Type: text/html\n", "Author: Nathan Wiger\n", "Last-Modified: Wed Sep 27 13:31:06 PDT 2000\n", "Accept: text/html, text/plain\n"); # Can also construct SMTP headers to format mail @mail_headers = header(from => 'Nathan Wiger ', to => 'perl5-porters@perl.org'); print $MAIL @mail_headers, "\nKeep up the great work!\n"; # The above would print this to the $MAIL handle: From: Nathan Wiger To: perl5-porters@perl.org Keep up the great work! =head1 DESCRIPTION This module provides two new functions, C
and C, which provide general-purpose RFC 822 header construction and parsing. They do not provide any intelligent defaults of HTTP-specific methods. They are simply aimed at providing an easy means to address the mechanics of header parsing. The output style is designed to mimic C and C, so that users familiar with these interfaces will feel at home with these functions. As shown above, the C function automatically does the following: 1. uc's the first letter of each tag token and lc's the rest, also converting _'s to -'s automatically 2. Adds a colon separating each tag and its value, and exactly one newline after each one 3. Combines list elements into a comma-delimited string Note that a list is always joined into a comma-delimited string. To insert multiple separate headers, simply call C
with multiple args: push @out, header(accept => 'text/html', accept => 'text/plain'); This would create multiple "Accept:" lines. Note that unlike C, the C
function provided here does not provide any intelligent defaults. If called as: @out_headers = header; It will return an empty list. This allows C
to be more general pupose, so it can provide SMTP and other headers as well. You can also use it as a generic text formatting tool, hence the reason it's under the C hierarchy. The C function works in exactly the opposite direction from C
, pulling apart headers and returning a list. C: 1. lc's the entire tag name, converting -'s to _'s 2. Separates each tag based on the colon delimiter, chomping newlines. 3. Returns a list of tag/value pairs for easy assignment to a hash So, assuming the C<@HEADERS> array shown up top: %myheaders = unheader(@HEADERS); The hash C<%myheaders> would have the following values: %myheaders = ( content_type => 'text/html', author => 'Nathan Wiger', last_modified => 'Wed Sep 27 13:31:06 PDT 2000', accept => 'text/html, text/plain' ); Note that all keys are converted to lowercase, and their values have their newlines stripped. However, note that comma-separated fields are B split up on input. This cannot be done reliably because some fields, such as the HTTP C header, can contain commas even though they are not lists. Inferring this type of structure would require knowledge of content, and these functions are specifically designed to be content-independent. The C function will respect line wrapping, as seen in SMTP headers. It will simply join the lines and return the value, so that: %mail = unheader("To: Nathan Wiger , perl5-porters@perl.org"); Would return: $mail{to} = "Nathan Wiger , perl5-porters@perl.org" Notice that multiple spaces between the comma separator have been condensed to a single space. Since the C
and C functions are direct inverses, this call: @out = header unheader @in; Will result in C<@out> being exactly equivalent to C<@in>. =head1 REFERENCES This is designed as both a Perl 5 module and also a Perl 6 prototype. Please see the Perl 6 proposal at http://dev.perl.org/rfc/333.html This module is designed to be fully compliant with the internet standards RFC 822 (SMTP Headers) and RFC 2068 (HTTP Headers). =head1 AUTHOR Copyright (c) 2000 Nathan Wiger . All Rights Reserved. This module is free software; you may copy this under the terms of the GNU General Public License, or the Artistic License, copies of which should have accompanied your Perl kit. =cut Text-Header-1.03/blib/lib/Text/.exists0100644000175000017500000000000007417346411016773 0ustar tfheentfheenText-Header-1.03/blib/lib/auto/0040755000175000017500000000000007534363556015525 5ustar tfheentfheenText-Header-1.03/blib/lib/auto/Text/0040755000175000017500000000000007534363556016451 5ustar tfheentfheenText-Header-1.03/blib/lib/auto/Text/Header/0040755000175000017500000000000007534363556017641 5ustar tfheentfheenText-Header-1.03/blib/lib/auto/Text/Header/.exists0100644000175000017500000000000007417346411021133 0ustar tfheentfheenText-Header-1.03/blib/man3/0040755000175000017500000000000007534363556014645 5ustar tfheentfheenText-Header-1.03/blib/man3/.exists0100644000175000017500000000000007417346411016137 0ustar tfheentfheenText-Header-1.03/blib/man3/Text::Header.3pm0100644000175000017500000002230707534363557017511 0ustar tfheentfheen.\" Automatically generated by Pod::Man v1.3, Pod::Parser v1.13 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Header 3" .TH Header 3 "2000-10-02" "perl v5.6.1" "User Contributed Perl Documentation" .UC .SH "NAME" Text::Header \- \s-1RFC\s0 822/2068 \f(CW\*(C`header\*(C'\fR and \f(CW\*(C`unheader\*(C'\fR functions .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Text::Header; # header and unheader exported .Ve .Vb 1 \& # Construct headers similar to CGI.pm and HTTP::Headers .Ve .Vb 4 \& @HEADERS = header(content_type => 'text/html', \& author => 'Nathan Wiger', \& last_modified => $date, \& accept => [qw(text/html text/plain)]); .Ve .Vb 1 \& # The above produces the array: .Ve .Vb 4 \& @HEADERS = ("Content-Type: text/html\en", \& "Author: Nathan Wiger\en", \& "Last-Modified: Wed Sep 27 13:31:06 PDT 2000\en", \& "Accept: text/html, text/plain\en"); .Ve .Vb 1 \& # Can also construct SMTP headers to format mail .Ve .Vb 2 \& @mail_headers = header(from => 'Nathan Wiger ', \& to => 'perl5-porters@perl.org'); .Ve .Vb 1 \& print $MAIL @mail_headers, "\enKeep up the great work!\en"; .Ve .Vb 1 \& # The above would print this to the $MAIL handle: .Ve .Vb 2 \& From: Nathan Wiger \& To: perl5-porters@perl.org .Ve .Vb 1 \& Keep up the great work! .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides two new functions, \f(CW\*(C`header\*(C'\fR and \f(CW\*(C`unheader\*(C'\fR, which provide general-purpose \s-1RFC\s0 822 header construction and parsing. They do not provide any intelligent defaults of HTTP-specific methods. They are simply aimed at providing an easy means to address the mechanics of header parsing. .PP The output style is designed to mimic \f(CW\*(C`CGI.pm\*(C'\fR and \f(CW\*(C`HTTP::Headers\*(C'\fR, so that users familiar with these interfaces will feel at home with these functions. As shown above, the \f(CW\*(C`headers\*(C'\fR function automatically does the following: .PP .Vb 2 \& 1. uc's the first letter of each tag token and lc's the \& rest, also converting _'s to -'s automatically .Ve .Vb 2 \& 2. Adds a colon separating each tag and its value, and \& exactly one newline after each one .Ve .Vb 2 \& 3. Combines list elements into a comma-delimited \& string .Ve Note that a list is always joined into a comma-delimited string. To insert multiple separate headers, simply call \f(CW\*(C`header\*(C'\fR with multiple args: .PP .Vb 2 \& push @out, header(accept => 'text/html', \& accept => 'text/plain'); .Ve This would create multiple \*(L"Accept:\*(R" lines. .PP Note that unlike \f(CW\*(C`CGI.pm\*(C'\fR, the \f(CW\*(C`header\*(C'\fR function provided here does not provide any intelligent defaults. If called as: .PP .Vb 1 \& @out_headers = header; .Ve It will return an empty list. This allows \f(CW\*(C`header\*(C'\fR to be more general pupose, so it can provide \s-1SMTP\s0 and other headers as well. You can also use it as a generic text formatting tool, hence the reason it's under the \f(CW\*(C`Text::\*(C'\fR hierarchy. .PP The \f(CW\*(C`unheader\*(C'\fR function works in exactly the opposite direction from \&\f(CW\*(C`header\*(C'\fR, pulling apart headers and returning a list. \f(CW\*(C`unheader\*(C'\fR: .PP .Vb 1 \& 1. lc's the entire tag name, converting -'s to _'s .Ve .Vb 2 \& 2. Separates each tag based on the colon delimiter, \& chomping newlines. .Ve .Vb 2 \& 3. Returns a list of tag/value pairs for easy assignment \& to a hash .Ve So, assuming the \f(CW@HEADERS\fR array shown up top: .PP .Vb 1 \& %myheaders = unheader(@HEADERS); .Ve The hash \f(CW%myheaders\fR would have the following values: .PP .Vb 6 \& %myheaders = ( \& content_type => 'text/html', \& author => 'Nathan Wiger', \& last_modified => 'Wed Sep 27 13:31:06 PDT 2000', \& accept => 'text/html, text/plain' \& ); .Ve Note that all keys are converted to lowercase, and their values have their newlines stripped. However, note that comma-separated fields are \fBnot\fR split up on input. This cannot be done reliably because some fields, such as the \s-1HTTP\s0 \f(CW\*(C`Date:\*(C'\fR header, can contain commas even though they are not lists. Inferring this type of structure would require knowledge of content, and these functions are specifically designed to be content\-independent. .PP The \f(CW\*(C`unheader\*(C'\fR function will respect line wrapping, as seen in \&\s-1SMTP\s0 headers. It will simply join the lines and return the value, so that: .PP .Vb 2 \& %mail = unheader("To: Nathan Wiger , \& perl5-porters@perl.org"); .Ve Would return: .PP .Vb 1 \& $mail{to} = "Nathan Wiger , perl5-porters@perl.org" .Ve Notice that multiple spaces between the comma separator have been condensed to a single space. Since the \f(CW\*(C`header\*(C'\fR and \f(CW\*(C`unheader\*(C'\fR functions are direct inverses, this call: .PP .Vb 1 \& @out = header unheader @in; .Ve Will result in \f(CW@out\fR being exactly equivalent to \f(CW@in\fR. .SH "REFERENCES" .IX Header "REFERENCES" This is designed as both a Perl 5 module and also a Perl 6 prototype. Please see the Perl 6 proposal at http://dev.perl.org/rfc/333.html .PP This module is designed to be fully compliant with the internet standards \s-1RFC\s0 822 (\s-1SMTP\s0 Headers) and \s-1RFC\s0 2068 (\s-1HTTP\s0 Headers). .SH "AUTHOR" .IX Header "AUTHOR" Copyright (c) 2000 Nathan Wiger . All Rights Reserved. .PP This module is free software; you may copy this under the terms of the \s-1GNU\s0 General Public License, or the Artistic License, copies of which should have accompanied your Perl kit. Text-Header-1.03/blib/arch/0040755000175000017500000000000007534363556014724 5ustar tfheentfheenText-Header-1.03/blib/arch/auto/0040755000175000017500000000000007534363556015674 5ustar tfheentfheenText-Header-1.03/blib/arch/auto/Text/0040755000175000017500000000000007534363556016620 5ustar tfheentfheenText-Header-1.03/blib/arch/auto/Text/Header/0040755000175000017500000000000007534363556020010 5ustar tfheentfheenText-Header-1.03/blib/arch/auto/Text/Header/.exists0100644000175000017500000000000007417346411021302 0ustar tfheentfheenText-Header-1.03/Changes0100644000175000017500000000045307166142031014351 0ustar tfheentfheenRevision history for Perl extension Text::Header. 1.02 Wed Sep 27 18:22:59 2000 - original version; created by h2xs 1.16 1.03 Mon Oct 2 10:20:29 PDT 2000 - Egads! Original one was so broken I can't believe I posted it on CPAN. This includes numerous bug fixes and feature enhancements. Text-Header-1.03/test.pl0100644000175000017500000000122107166144650014375 0ustar tfheentfheen# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..1\n"; } END {print "not ok 1\n" unless $loaded;} use Text::Header; $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): Text-Header-1.03/README0100644000175000017500000001200307166144543013742 0ustar tfheentfheenNAME Text::Header - RFC 822/2068 `header' and `unheader' functions SYNOPSIS use Text::Header; # header and unheader exported # Construct headers similar to CGI.pm and HTTP::Headers @HEADERS = header(content_type => 'text/html', author => 'Nathan Wiger', last_modified => $date, accept => [qw(text/html text/plain)]); # The above produces the array: @HEADERS = ("Content-Type: text/html\n", "Author: Nathan Wiger\n", "Last-Modified: Wed Sep 27 13:31:06 PDT 2000\n", "Accept: text/html, text/plain\n"); # Can also construct SMTP headers to format mail @mail_headers = header(from => 'Nathan Wiger ', to => 'perl5-porters@perl.org'); print $MAIL @mail_headers, "\nKeep up the great work!\n"; # The above would print this to the $MAIL handle: From: Nathan Wiger To: perl5-porters@perl.org Keep up the great work! DESCRIPTION This module provides two new functions, `header' and `unheader', which provide general-purpose RFC 822 header construction and parsing. They do not provide any intelligent defaults of HTTP-specific methods. They are simply aimed at providing an easy means to address the mechanics of header parsing. The output style is designed to mimic `CGI.pm' and `HTTP::Headers', so that users familiar with these interfaces will feel at home with these functions. As shown above, the `headers' function automatically does the following: 1. uc's the first letter of each tag token and lc's the rest, also converting _'s to -'s automatically 2. Adds a colon separating each tag and its value, and exactly one newline after each one 3. Combines list elements into a comma-delimited string Note that a list is always joined into a comma-delimited string. To insert multiple separate headers, simply call `header' with multiple args: push @out, header(accept => 'text/html', accept => 'text/plain'); This would create multiple "Accept:" lines. Note that unlike `CGI.pm', the `header' function provided here does not provide any intelligent defaults. If called as: @out_headers = header; It will return an empty list. This allows `header' to be more general pupose, so it can provide SMTP and other headers as well. You can also use it as a generic text formatting tool, hence the reason it's under the `Text::' hierarchy. The `unheader' function works in exactly the opposite direction from `header', pulling apart headers and returning a list. `unheader': 1. lc's the entire tag name, converting -'s to _'s 2. Separates each tag based on the colon delimiter, chomping newlines. 3. Returns a list of tag/value pairs for easy assignment to a hash So, assuming the `@HEADERS' array shown up top: %myheaders = unheader(@HEADERS); The hash `%myheaders' would have the following values: %myheaders = ( content_type => 'text/html', author => 'Nathan Wiger', last_modified => 'Wed Sep 27 13:31:06 PDT 2000', accept => 'text/html, text/plain' ); Note that all keys are converted to lowercase, and their values have their newlines stripped. However, note that comma-separated fields are not split up on input. This cannot be done reliably because some fields, such as the HTTP `Date:' header, can contain commas even though they are not lists. Inferring this type of structure would require knowledge of content, and these functions are specifically designed to be content-independent. The `unheader' function will respect line wrapping, as seen in SMTP headers. It will simply join the lines and return the value, so that: %mail = unheader("To: Nathan Wiger , perl5-porters@perl.org"); Would return: $mail{to} = "Nathan Wiger , perl5-porters@perl.org" Notice that multiple spaces between the comma separator have been condensed to a single space. Since the `header' and `unheader' functions are direct inverses, this call: @out = header unheader @in; Will result in `@out' being exactly equivalent to `@in'. REFERENCES This is designed as both a Perl 5 module and also a Perl 6 prototype. Please see the Perl 6 proposal at http://dev.perl.org/rfc/333.html This module is designed to be fully compliant with the internet standards RFC 822 (SMTP Headers) and RFC 2068 (HTTP Headers). AUTHOR Copyright (c) 2000 Nathan Wiger . All Rights Reserved. This module is free software; you may copy this under the terms of the GNU General Public License, or the Artistic License, copies of which should have accompanied your Perl kit. Text-Header-1.03/MANIFEST0100644000175000017500000000005607166144651014220 0ustar tfheentfheenChanges Header.pm MANIFEST Makefile.PL test.pl