http://www.cpan.org/modules/04pause.html
:-)
A place for John to record his techy notes, both to refer back to when needed, and as a help for others...
Friday, December 04, 2009
Thursday, December 03, 2009
Lexical filehandles on old (pre 5.6) Perl...
I was looking into this because of wanting to use lexical filehandles in pre 5.6 Perl.
http://www.perl.com/doc/manual/html/pod/perldata.html#Typeglobs_and_Filehandles
http://perl.plover.com/local.html#2_Localized_Filehandles
http://stackoverflow.com/questions/613906/why-does-programming-perl-use-local-not-my-for-filehandles
http://www.perlmonks.org/?node_id=305217
http://www.perl.com/doc/manual/html/pod/perldata.html#Typeglobs_and_Filehandles
http://perl.plover.com/local.html#2_Localized_Filehandles
http://stackoverflow.com/questions/613906/why-does-programming-perl-use-local-not-my-for-filehandles
http://www.perlmonks.org/?node_id=305217
#!/usr/bin/perl -w
#
#
#
use strict;
my $file = 'file.txt';
local *FH;
# my $file_fh = do { *FH };
my $file_fh = \*FH;
open ($file_fh, "> $file") || die "Can't write to '$file': $!\n";
my $line = "This is some text";
print $file_fh "$line\n";
close $file_fh;
Wednesday, December 02, 2009
Compiling Perl modules on Solaris
cc: unrecognized option `-KPIC'
cc: language ildoff not recognized
cc: Expat.c: linker input file unused because linking not done
http://prefetch.net/blog/index.php/2006/07/29/building-perl-modules-for-solaris/
You will note here that this is trying to compile XML::Parser ...
You will find the most relevent instructions for that here http://aspn.activestate.com/ASPN/Mail/Message/perl-xml/1757618
gcc -c -I/opt/yum/libs/common/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TS_ERRNO -DVERSION=\"2.36\" -DXS_VERSION=\"2.36\" -fPIC "-I/usr/perl5
/5.8.4/lib/i86pc-solaris-64int/CORE" Expat.c
Expat.xs:132: error: conflicting types for 'Perl_newSVpvn'
/usr/perl5/5.8.4/lib/i86pc-solaris-64int/CORE/proto.h:521: error: previous declaration of 'Perl_newSVpvn' was here
Expat.xs:132: error: conflicting types for 'Perl_newSVpvn'
/usr/perl5/5.8.4/lib/i86pc-solaris-64int/CORE/proto.h:521: error: previous declaration of 'Perl_newSVpvn' was here
Expat.xs:140:1: warning: "ERRSV" redefined
In file included from Expat.xs:15:
/usr/perl5/5.8.4/lib/i86pc-solaris-64int/CORE/perl.h:799:1: warning: this is the location of the previous definition
Expat.xs: In function `newUTF8SVpv':
Expat.xs:149: warning: assignment makes pointer from integer without a cast
Expat.xs: In function `generate_model':
Expat.xs:257: warning: passing arg 4 of `Perl_hv_store' makes pointer from integer without a cast
Expat.xs: In function `nsStart':
Expat.xs:678: error: `sv_undef' undeclared (first use in this function)
Expat.xs:678: error: (Each undeclared identifier is reported only once
Expat.xs:678: error: for each function it appears in.)
Expat.xs: In function `nsEnd':
Expat.xs:698: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `attributeDecl':
Expat.xs:783: error: `sv_yes' undeclared (first use in this function)
Expat.xs: In function `entityDecl':
Expat.xs:811: error: `sv_undef' undeclared (first use in this function)
Expat.xs:816: error: `sv_yes' undeclared (first use in this function)
Expat.xs: In function `doctypeStart':
Expat.xs:840: error: `sv_undef' undeclared (first use in this function)
Expat.xs:842: error: `sv_yes' undeclared (first use in this function)
Expat.xs:842: error: `sv_no' undeclared (first use in this function)
Expat.xs: In function `xmlDecl':
Expat.xs:880: error: `sv_undef' undeclared (first use in this function)
Expat.xs:884: error: `sv_yes' undeclared (first use in this function)
Expat.xs:884: error: `sv_no' undeclared (first use in this function)
Expat.xs: In function `unparsedEntityDecl':
Expat.xs:910: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `notationDecl':
Expat.xs:940: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `externalEntityRef':
Expat.xs:985: error: `sv_undef' undeclared (first use in this function)
Expat.xs:986: warning: passing arg 1 of `Perl_sv_2mortal' makes pointer from integer without a cast
Expat.xs:1011: warning: cast from pointer to integer of different size
Expat.xs:1024: error: `errgv' undeclared (first use in this function)
Expat.xs:1043: warning: cast from pointer to integer of different size
Expat.xs:1055: error: `na' undeclared (first use in this function)
Expat.xs: In function `unknownEncoding':
Expat.xs:1166: warning: cast to pointer from integer of different size
Expat.xs: In function `XS_XML__Parser__Expat_ParserCreate':
Expat.xs:1281: error: `na' undeclared (first use in this function)
Expat.xs: In function `XS_XML__Parser__Expat_SetStartElementHandler':
Expat.xs:1519: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `XS_XML__Parser__Expat_SetEndElementHandler':
Expat.xs:1530: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `XS_XML__Parser__Expat_SetCharacterDataHandler':
Expat.xs:1543: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `XS_XML__Parser__Expat_SetProcessingInstructionHandler':
Expat.xs:1561: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `XS_XML__Parser__Expat_SetCommentHandler':
Expat.xs:1578: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `XS_XML__Parser__Expat_SetDefaultHandler':
Expat.xs:1595: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `XS_XML__Parser__Expat_SetUnparsedEntityDeclHandler':
Expat.xs:1617: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `XS_XML__Parser__Expat_SetNotationDeclHandler':
Expat.xs:1634: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `XS_XML__Parser__Expat_SetExternalEntityRefHandler':
Expat.xs:1652: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `XS_XML__Parser__Expat_SetExtEntFinishHandler':
Expat.xs:1672: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `XS_XML__Parser__Expat_SetEntityDeclHandler':
Expat.xs:1687: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `XS_XML__Parser__Expat_SetElementDeclHandler':
Expat.xs:1705: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `XS_XML__Parser__Expat_SetAttListDeclHandler':
Expat.xs:1723: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `XS_XML__Parser__Expat_SetDoctypeHandler':
Expat.xs:1742: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `XS_XML__Parser__Expat_SetEndDoctypeHandler':
Expat.xs:1760: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `XS_XML__Parser__Expat_SetXMLDeclHandler':
Expat.xs:1779: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `XS_XML__Parser__Expat_SetBase':
Expat.xs:1800: error: `na' undeclared (first use in this function)
Expat.xs: In function `XS_XML__Parser__Expat_GetBase':
Expat.xs:1818: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `XS_XML__Parser__Expat_LoadEncoding':
Expat.xs:1998: error: `sv_undef' undeclared (first use in this function)
Expat.c: In function `XS_XML__Parser__Expat_FreeEncoding':
Expat.c:2464: warning: cast to pointer from integer of different size
Expat.xs: In function `XS_XML__Parser__Expat_OriginalString':
Expat.xs:2097: warning: assignment makes pointer from integer without a cast
Expat.xs: In function `XS_XML__Parser__Expat_SetStartCdataHandler':
Expat.xs:2113: error: `sv_undef' undeclared (first use in this function)
Expat.xs: In function `XS_XML__Parser__Expat_SetEndCdataHandler':
Expat.xs:2131: error: `sv_undef' undeclared (first use in this function)
Expat.c: In function `boot_XML__Parser__Expat':
Expat.c:2729: error: `sv_yes' undeclared (first use in this function)
make[1]: *** [Expat.o] Error 1
make[1]: Leaving directory `/var/tmp/XML-Parser-2.36/Expat'
make: *** [subdirs] Error 2
http://www.xav.com/perl/lib/Pod/perldelta.html
Subscribe to:
Posts (Atom)