Search Results

Search found 5 results on 1 pages for 'andrewr'.

Page 1/1 | 1 

  • What is the 'best practice' for installing perl modules on Solaris/OpenSolaris?

    - by AndrewR
    I'm currently in the process of writing setup instructions for some software I've written that is implemented as a set of Perl modules. Having done this for various flavours of Linux, I'm now doing the same for Solaris/OpenSolaris (v10 only). Part of the setup process is to make sure that dependent Perl modules are installed. This has been pretty easy on Linux as the Perl modules I require tend to be within the distro's packaging system (eg yum install perl-Cache-Cache). This is not the case on Solaris so I'm working on setup instructions that use the CPAN module to fetch dependent modules (eg perl -MCPAN -e 'install Cache::Cache'). This works ok but there are known problems with modules that require things to be built with a C compiler. The problem is that the C Makefile generated assumes you're using Sun's compiler and uses command-line options not understood by gcc, which you may be using instead. Consulting teh Internetz has thrown up a number of solutions to this: Install and use Sun's compiler Use the perlgcc wrapper script Edit the makefiles by hand (yuk) All of these work. My question to those more familiar with Solaris than me is: Is one of these the 'best' or 'most commonly used' method?

    Read the article

  • What's the best way to check that environment variables are set in Unix shellscript

    - by AndrewR
    I've got a few Unix shell scripts where I need to check that certain environment variables are set before I start doing stuff, so I do this sort of thing: if [ -z "$STATE" ]; then echo "Need to set STATE" exit 1 fi if [ -z "$DEST" ]; then echo "Need to set DEST" exit 1 fi which is a lot of typing. Is there a more elegant idiom for checking that a set of environment variables is set? EDIT: I should mention that these variables have no meaningful default value - the script should error out if any are unset.

    Read the article

  • log4j rootLogger seems to inherit log level of other logger. Why?

    - by AndrewR
    I've got a log4J setup in which the root logger is supposed to log ERROR level messages and above to the console and another logger logs everything to syslog. log4j.properties is: # Root logger option log4j.rootLogger=ERROR,R log4j.appender.R=org.apache.log4j.ConsoleAppender log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%d %p %t %c - %m%n log4j.logger.SGSearch=DEBUG,SGSearch log4j.appender.SGSearch=org.apache.log4j.net.SyslogAppender log4j.appender.SGSearch.SyslogHost=localhost log4j.appender.SGSearch.Facility=LOCAL6 log4j.appender.SGSearch.layout=org.apache.log4j.PatternLayout log4j.appender.SGSearch.layout.ConversionPattern=[%-5p] %m%n In code I do private static final Logger logger = Logger.getLogger("SGSearch"); . . . logger.info("Commencing snapshot index [" + args[1] + " -> " + args[2] + "]"); What is happening is that I get the console logging for all logging levels. What seems to be happening is that the level for SGSearch overrides the level set for the root logger somehow. I can't figure it out. I have confirmed that Log4J is reading then properties file I think it is, and no other (via the -Dlog4j.debug option)

    Read the article

  • How can I strip invalid XML characters from strings in Perl?

    - by AndrewR
    I'm looking for what the standard, approved, and robust way of stripping invalid characters from strings before writing them to an XML file. I'm talking here about blocks of text containing backspace (^H) and formfeed characters etc. There has to be a standard library/module function for doing this but I can't find it. I'm using XML::LibXML to build a DOM tree that I then serialize to disk.

    Read the article

1