Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Seekers of Perl Wisdom

( #479=superdoc: print w/ replies, xml ) Need Help??

If you have a question on how to do something in Perl, or you need a Perl solution to an actual real-life problem, or you're unsure why something you've tried just isn't working... then this section is the place to ask. Post a new question!

However, you might consider asking in the chatterbox first (if you're a registered user). The response time tends to be quicker, and if it turns out that the problem/solutions are too much for the cb to handle, the kind monks will be sure to direct you here.

User Questions
mqseries_1.34 Makefile loop
1 direct reply — Read more / Contribute
by itc
on Aug 28, 2014 at 06:40

    I am looking for help with a problem installing the MQseries-1.34 Perl API.

    I had successfully installed it in our sandpit server, then moved onto our development server and had an issue with the Makefile resulting in a looping zombie process requiring the server to be rebooted.

    I then had the sandpit server rebuilt to mirror development and have reproduced the issue on the sandpit server.

    After installing required pre-requisites, here is what I see for the Makefile….

    $ sudo perl Makefile.PL verbose Password: Checking if your kit is complete... Looks good ABSTRACT => q[Interface to IBM's MQSeries Product] AUTHOR => q[MQ Engineering Group <mqseries@cpan.org>] NAME => q[MQSeries] PREREQ_PM => { Params::Validate=>q[1.00], Test::Simple=>q[0.62], Con +vert::EBCDIC=>q[0.06], Test::Pod=>q[1.20] } VERSION_FROM => q[MQSeries.pm] Using PERL=/usr/bin/perl

    ….it does not respond beyond this point and continues looping indefinitely. Additional info below

    AIX version

    $ oslevel -s 6100-08-03-1339

    MQ version

    (0)mqm@rs6stech02:/home/mqm: dspmqver Name: WebSphere MQ Version: 7.0.1.7 CMVC level: p701-107-111117 BuildType: IKAP - (Production)

    Perl installation

    $ perl -V Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=aix, osvers=5.3.0.0, archname=aix-thread-multi uname='aix akash79 3 5 00011a85d600 ' config_args='-desr -Dinstallprefix=/usr/opt/perl5 -Dprefix=/usr/op +t/perl5 -Dcc=xlc_r -Duseshrplib -Dusethreads' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemulti +plicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc_r', ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURC +E -qmaxmem=-1 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT - +q32 -D_LARGE_FILES -qlonglong', optimize='-O', cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem= +-1 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT' ccversion='9.0.0.2', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='ld', ldflags =' -brtl -bdynamic -b32' libpth=/lib /usr/lib /usr/ccs/lib libs=-lbind -lnsl -lgdbm -ldbm -ldb -ldl -lld -lm -lcrypt -lpthrea +ds -lc -lbsd perllibs=-lbind -lnsl -ldl -lld -lm -lcrypt -lpthreads -lc -lbsd libc=, so=a, useshrplib=true, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -bE:/usr/ +opt/perl5/lib/5.8.8/aix-thread-multi/CORE/perl.exp' cccdlflags=' ', lddlflags='-bhalt:4 -bexpall -G -bnoentry -lpthrea +ds -lc' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Built under aix Compiled at Jun 2 2009 16:11:40 @INC: /usr/opt/perl5/lib/5.8.8/aix-thread-multi /usr/opt/perl5/lib/5.8.8 /usr/opt/perl5/lib/site_perl/5.8.8/aix-thread-multi /usr/opt/perl5/lib/site_perl/5.8.8 /usr/opt/perl5/lib/site_perl

    Can you please help me identify where I have gone wrong or offer me a workaround ?

DES ECB mode encryption
4 direct replies — Read more / Contribute
by v4169sgr
on Aug 28, 2014 at 03:46

    I use Perl 5.10 ActivePerl 5.14 on win7. I am a humble user, and don't really understand what I am doing.

    I have a requirement to connect to a remote host and send locally encrypted messages, using DES ECB mode encryption. This is not my choice, but a part of the requirement. I am trying to find out how to implement DES ECB mode encryption simply in Perl

    I do not have access to a C compiler, and cannot be the local administrator on my machine. I don't have download rights either, but can copy / paste source from CPAN into .pm files in my C:. I have copied the source for DES.pm and ECB.pm to C:\Perl 5.10\lib\Crypt\ from CPAN.

    In my script I use

    use Crypt::ECB qw(encrypt decrypt encrypt_hex decrypt_hex);

    and try using it as a proof of concept - the text is from FIPS PUB 81:

    print encrypt_hex("0123456789abcdef", "DES", "Now is the time for all ", "1") . "\n";

    However, when trying to run this, I see the following error:

    Couldn't load Crypt::DES: Attempt to reload Crypt/DES.pm aborted. Compilation failed in require at (eval 27) line 3. Are you sure 'DES' is correct? If so, install Crypt::DES in the proper + path or choose some other cipher.

    I think this is because I don't have a binary for DES (not sure what this means).

    I did notice that there is a DES module written in Perl called Crypt::DES_PP. Would using this solve the problem and help me satisfy the requirement? If so, how can I use this module? (Basic, please, I don't understand much!)

    Thanks in advance for any assistance!!!

Nested HTML::Template usage
2 direct replies — Read more / Contribute
by skx
on Aug 28, 2014 at 03:45

    I've got a fairly complex web application which I've almost completely ported from a series of static cgi scripts to using CGI::Application.

    The one outstanding task I've yet to cover is how to handle nested HTML::Template files.

    In my application I have a global "layout" template, as well as run-mode-specific templates. We could pretend that the layout would look like this, although in truth there is more divitus:

    <html>
      <head> <title> <!-- tmpl_var name='title' --></title>
      <body>
        ..
         <div id="content">
           <!-- tmpl_include name='###' -->
         </div>
      </body>
    </html>
    

    The magic here is obviously the insertion of a second template, the run-mode-specific page template, which is carried out dynamically.

    HTML::Template doesn't allow loading dynamic include-files so I've had to be sneaky - which is often a sign I'm going down a bad route:

    
    sub mk_include_filter
    {
        my $page = shift;
        return sub {
            my $text_ref = shift;
            $$text_ref =~ s/###/$page/g;
        };
    }
    
    sub load_page_layout
    {
        my( $self, $page, %options ) = ( @_ );
    
        my $layout = "../templates/layouts/default.template";
        my $l = HTML::Template->new( filename => $layout,
                                     %options,
                                     filter => mk_include_filter($page) );
    
    
       # ...
       return ($l);
    }
    

    This allows me to run code such as:

    my $template = $self->load_page_layout( "about.tmpl" );
    

    The return value is essentially the union of the layout-template and the page-template, and allows values to be set which are defined in either:

    $template->param( title => "The title, as defined in the layout",
                      page_specific => "A page-specific value" );
    

    All this works, and works well, but I wonder if there is a better approach to handling dynamic sub-templates, or similar?

    Specifically my problem is that I cannot use this approach and migrate to HTML::Template::Compiled because the filter doesn't work as expected. Pages return completely wrong values..

    (Edit: The obvious solution is to duplicate the global-layout into each page, if possible I'd like to avoid that as it makes updating the layout a challenge. Although perhaps I could use the C-preprocessor to build complete pages from the layout + sub-pages. I might explore this if there is no "obvious" answer to my query.)

    Steve
    --
Parsing a complex csv, cleaning it up, and exporting it
3 direct replies — Read more / Contribute
by scotttromley
on Aug 27, 2014 at 20:38

    Hello,

    I've got a CSV file of contacts from a customer of mine. Whoever migrated his contacts into Gmail ended up putting the First Name, Last Name, Email, and a few other fields into the notes field of the CSV, and leaving the actual fields undef, and I've taken it upon myself to clean this up.

    I decided the best way to handle this would be by learning perl and using it, and I've made decent progress thus far. I've cleaned up the csv as best as I can using Sublime Text 2, as I have lots of experience in it and a fair grasp of regex. Here is the situation I'm in:</p

    I have written a Perl program that can (using Text::CSV) import each line of the CSV. It then saves the Notes field for the current line to a scalar $notesField. Here is an example of a few lines of the input data:

    ,,,,,,,,,,,,,,,,,,,,,,,,,"First Name: Dobbin Last Name: David L. Addre +ss: david@adamsonanddobbin.com City: PO Box 1326407 Pido Road State: +Peterborough ZIP Code: ON Country: K9J 7H5 First Name: Dobbin Last Name: David L. E-mail: david@adamsonanddobbin. +com Address: PO Box 1326407 Pido Road City: Peterborough State: ON ZI +P Code: K9J 7H5",,,,,,Home,743 7790,Other,742 4524,Work,745 5751,,,,, +,,,,,,Adamson And Dobbin Ltd. Mechanical Contractors,,General Manager +,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,,,,,,,"First Name: Chapleau Last Name: Kathy, Ken A +ddress: 666 FrankFirst Name: Chapleau Last Name: Kathy, Ken City: 666 + Frank ",,,,,,Home,876-9863,,,,,,,,,,,,,,,Admiralty Hall,,Accountant,,,,,,,,, +,,

    The data between the double quotes is field[ 25 ] of the line, and is the notes field. You may notice the Last Name: string in the notes field is followed by the first name of the contact, as whoever migrated this data seems to have transposed those two fields

    My next step, given that I can read each line in and extract the notes field, is to use regex to match the string following First Name: so I can save it to the appropriate field in that row, the Given Name field of the CSV. The pattern I've come up with is:

    if ($notesField =~ /First Name:.*?(?=Last)/) { print "MATCHED!"; }

    Which approximately works in Sublime Text 2's Regex search to select what I need it to. However, it doesn't match anything in my Perl program.

    My intention is to match each field in the row, concatenate together a new row, and write it out to a new CSV file, preserving the existing Notes field to account for any data that may be lost in the process.

    Please help me figure out what I am doing wrong with my regex, as well as any other protips you could offer. I realize this is a pretty messy dataset, but I am really enjoying the challenge and am not easily discouraged. Thank you for your help, if you need any more information please let me know. Here is the full text of my program thus far:

    use strict; use warnings; use Text::CSV; my $csv = Text::CSV->new ({ sep_char => ',', binary => 1, auto_diag => 1, allow_loose_quotes => 1 }); my $file = $ARGV[0] or die "Need to load a file from stdin"; open (my $data, '<', $file) or die "Couldn't load file '$file'\n"; while(my $row = $csv->getline($data)) { my @fields = @{$row}; my $notesField = $fields[25]; if (defined $notesField) { if ($notesField =~ /First Name:.*?(?=Last)/) { print "MATCHED!"; } } else { print"No Notes Field \n\n"; } } if (not $csv->eof) { $csv->error_diag(); } close $data;
Return spreadsheet names from google
3 direct replies — Read more / Contribute
by AllPaoTeam
on Aug 27, 2014 at 13:13

    Good morning Perl Monks, Could someone tell me how to retrieve the name of the spreadsheets, it looks like its stored as a hash array. Below is the code and what I tried to do it but it is not returning what I was hoping for:

    use Net::Google::Spreadsheets; my $service = Net::Google::Spreadsheets->new( username => 'pass@gmail.com', password => 'pass' ); my @spreadsheets = $service->spreadsheets(); print "@spreadsheets\n"; my $array_ref = \@spreadsheets; print "$$array_ref[0]\n"; Here is output: Net::Google::Spreadsheets::Spreadsheet=HASH(0x4c1a068) + Net::Google::Spreadsheets::Spreadsheet=HASH(034cxh064)
EXE missing module at runtime
2 direct replies — Read more / Contribute
by Anonymous Monk
on Aug 27, 2014 at 12:48

    Dear Monks,

    I really don't know where to begin with in solving my problem. I generate EXE for distributing my GUI software. I use ActiveState. Everything is fine, the software is installed on many machines. BUT Some users have problems in running the EXE. I've done a test and I've discovered that the DOS prompt shows an error massage sayng a module (JSON) is missing! How can it be? On every other machine the SAME EXE is working fine, all machines are using the same operating system (Windows 8.1 64 bit). For know, I just compiled a version of the software without the JSON module...

    Where should I look in? I'm really without a clou.

    I would appreciate if you have some suggestions

last_insert_id issue
3 direct replies — Read more / Contribute
by sowais
on Aug 27, 2014 at 12:33

    Needd help figuring out why last_insert_id() is giving an error. I am using an INSERT statement via interpolating values (an issue asked in another post), but get "Inappropiate I/O control operation" on the last_insert_id line. I ran trace as well but didnt get much out of it.

    Trace:
    <- execute= ( 1 ) 1 items at C:\IMS_db.pl line 59 via at C:\IMS_db.pl line 43
    -> last_insert_id for DBD::ODBC::db (DBI::db=HASH(0x2985304)~0x2985274 undef undef 'table' undef) thr#b52bac
    <- last_insert_id= ( ) 0 items (not implemented) at C:\IMS_db.pl line 68 via at C:\IMS_db.pl line 43
    <> DESTROY(DBI::st=HASH(0x2985534)) ignored for outer handle (inner DBI::st=HASH(0x29854f4) has ref cnt 1)
    -> DESTROY for DBD::ODBC::st (DBI::st=HASH(0x29854f4)~INNER) thr#b52bac
    <- DESTROY= ( undef ) 1 items at C:\IMS_db.pl line 43 via at C:\IMS_db.pl line 43 dbih_clearcom 0x29854f4 (com 0x27ffbe4, type 3) done.

    use strict; use warnings; use DBI; use Time::HiRes qw/gettimeofday/; use Win32::ODBC; my @timedata = localtime(); my $sec = $timedata[0]; $sec = '0'.$sec if $sec < 10; my $min = $timedata[1]; $min = '0'.$min if $min < 10; #check I put in place for the single di +gits my $hour = $timedata[2]; $hour = '0'.$hour if $hour < 10; my $day = $timedata[3]; $day = '0'.$day if $day < 10; my $month = $timedata[4]+1; $month = '0'.$month if $month < 10; my $year = $timedata[5]+1900; (my $seconds, my $ms) = gettimeofday(); $ms = ($ms-($ms%1000))/1000; my $time = $hour.":".$min.":".$sec.".".$ms; my $date = $year."-".$month."-".$day; my $temp_date = $date.' '.$time; my $server_name = 'SMOKE-SERVER'; my $database_name = 'TESTDB'; my $database_user = ''; my $database_pass = ''; my $filename = 'test_file'; my $file_date = '2011-01-01 00:00:00.000'; my $record_count = 20; my $sheet_count = 400; my $doc_ID = 12; my $client_ID = 2; my $dbh; my $DSN = "driver={SQL Server};server=$server_name;database=$database_ +name;uid=$database_user;pwd=$database_pass;"; eval { $dbh = DBI->connect("dbi:ODBC:$DSN"); DBI->trace(4,'C:\db_test_log88.txt'); my $sql = "INSERT INTO table VALUES ('$filename','$file_date','$re +cord_count','$sheet_count','$doc_ID','$client_ID','$temp_date')"; my $sth = $dbh->prepare($sql); $sth->execute() or die "Execute Failed: $!"; my $last_ID = $dbh->last_insert_id(undef,undef,'table',undef) or d +ie "No Last ID: $!"; print "Last ID inserted: $last_ID"; $dbh->disconnect(); }; if($@) { print "DB Failure: $@"; } exit 0;
Binding values to table with autoincrement ID
1 direct reply — Read more / Contribute
by sowais
on Aug 27, 2014 at 12:22

    Hello Monks! Lately I've been expanding my DB related Perl skills, so please excuse all the DB related posts.

    I am getting errors while inserting into a table with autoincrement ID using bind-param. I get 'Invalid character value for cast specification (SQL-22018)' with binding. I tried interpolating values for shits and giggles and that worked fine. After implementing the trace, I believe the issue is that the DB is taking 'param 1' as the ID value but since its an autoincrement value the DB would have given an error related to "...trying to populate an identity column while IDENTITY_INSERT is ON", so I am not sure where the issue resides. Can someone please help in figuring out how to insert into this table with autoincrement ID?

    Different options I have tried unsuccessfully:
    a. started with param value 2 while having 8 placeholders
    b. used undef, '', "" while binding the ID
    c. while setting the placeholders skipped the ID value (,?,?,?,?,?,?,?)

    From Trace:
    * This is why i think its trying to bind filename to ID as ID is integer and filename is VARCHAR: +rebind_param 1 'test_file' (size SvCUR=9/SvLEN=12/max=0) svtype:4, value type:1, sql type:0 +get_param_type(26b8254,1) bind 1 'test...' value_len=9 maxlen=10 null=0) bind 1 value_type:1 INTEGER cs=9 dd=0 bl=9
    *Errors recorded in Trace:
    !!dbd_error2(err_rc=-1, what=st_execute/SQLExecute, handles=(2627568,22a4a8,2190d0) !SQLError(2627568,22a4a8,2190d0) = (22018, 0, MicrosoftODBC SQL Server DriverInvalid character value for cast specification) -dbd_st_execute(26b8254)=-2 !! ERROR: 1 'MicrosoftODBC SQL Server DriverInvalid character value for cast specification (SQL-22018)' (err#1) <- execute= ( undef ) 1 items at C:\IMS_db.pl line 61 via at C:\IMS_db.pl line 43 <> DESTROY(DBI::st=HASH(0x27c3534)) ignored for outer handle (inner DBI::st=HASH(0x27c34f4) has ref cnt 1) -> DESTROY for DBD::ODBC::st (DBI::st=HASH(0x27c34f4)~INNER) thr#1e2bac ERROR: 1 'MicrosoftODBC SQL Server DriverInvalid character value for cast specification (SQL-22018)' (err#1) <- DESTROY= ( undef ) 1 items at C:\IMS_db.pl line 43 via at C:\IMS_db.pl line 43 dbih_clearcom 0x27c34f4 (com 0x27afbe4, type 3) done. <> DESTROY(DBI::db=HASH(0x27c3304)) ignored for outer handle (inner DBI::db=HASH(0x27c3274) has ref cnt 1) -> DESTROY for DBD::ODBC::db (DBI::db=HASH(0x27c3274)~INNER) thr#1e2bac ERROR: 1 'MicrosoftODBC SQL Server DriverInvalid character value for cast specification (SQL-22018)' (err#0) <- DESTROY= ( undef ) 1 items at C:\IMS_db.pl line 72 via at C:\IMS_db.pl line 72 dbih_clearcom 0x27c3274 (com 0x27af39c, type 2) done.

    use strict; use warnings; use DBI; use Time::HiRes qw/gettimeofday/; use Win32::ODBC; my @timedata = localtime(); my $sec = $timedata[0]; $sec = '0'.$sec if $sec < 10; my $min = $timedata[1]; $min = '0'.$min if $min < 10; my $hour = $timedata[2]; $hour = '0'.$hour if $hour < 10; my $day = $timedata[3]; $day = '0'.$day if $day < 10; my $month = $timedata[4]+1; $month = '0'.$month if $month < 10; my $year = $timedata[5]+1900; (my $seconds, my $ms) = gettimeofday(); $ms = ($ms-($ms%1000))/1000; my $time = $hour.":".$min.":".$sec.".".$ms; my $date = $year."-".$month."-".$day; my $temp_date = $date.' '.$time; my $server_name = 'SMOKE-SERVER'; my $database_name = 'TESTDB'; my $database_user = ''; my $database_pass = ''; my $filename = 'test_file'; my $file_date = '2011-01-01 00:00:00.000'; my $record_count = 20; my $sheet_count = 400; my $doc_ID = 12; my $client_ID = 2; my $dbh; my $DSN = "driver={SQL Server};server=$server_name;database=$database_ +name;uid=$database_user;pwd=$database_pass;"; eval { $dbh = DBI->connect("dbi:ODBC:$DSN"); DBI->trace(4,'C:\db_test_log3.txt'); #below line INSERTS fine #my $sql = "INSERT INTO table VALUES ('$filename','$file_date','$r +ecord_count','$sheet_count','$doc_ID','$client_ID','$temp_date')"; my $sql = "INSERT INTO table VALUES (?,?,?,?,?,?,?)"; my $sth = $dbh->prepare($sql); $sth->bind_param(1, $filename); $sth->bind_param(2, $temp_date); #using temp_date instead of $file +_date to exclude date format issues $sth->bind_param(3, $record_count); $sth->bind_param(4, $sheet_count); $sth->bind_param(5, $doc_ID); $sth->bind_param(6, $client_ID); $sth->bind_param(7, $temp_date); $sth->execute() or die "Execute Failed: $!"; my $last_ID = $dbh->last_insert_id(undef,undef,'table',undef) or d +ie "No Last ID: $!"; print "Last ID inserted: $last_ID"; $dbh->disconnect(); }; if($@) { print "DB Failure: $@"; } exit 0;
Can you offer me some tips on this module?
1 direct reply — Read more / Contribute
by Anonymous Monk
on Aug 27, 2014 at 11:25
    Dear friends,
    I am trying to use the following module in a project of mine...
    https://metacpan.org/pod/Bio::Graphics::DrawTransmembrane

    It works fine, but I was wondering, is there a way that I can tilt the bars to have an angle, instead of being vertical?
    My code, based on the module, which uses GD-graph, is the following:
    use DrawTransmembrane; $topology_final = 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII +IIIIIIIII0IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII +IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIMMMMMMMMMOOOOO +OOOOOOOOOOMMMMMMMIIIMMMMMMMMMOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOMMM +MMMMMMIIIMMMMMMMMMOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOMMMMMMMMMIIIIIIIMMMM +MMMMMMMOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOMMMMMMMMMMMIIIMMMMMMMMMMMOOOO +OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOMMMMMMMMMMMIIIIIMMMMMMMMMOOOOOOOM +MMMMMMMMMMIIIMMMMMMMMMMMOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOMMMMMM +MMMMMIIIIMMMMMMMOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOMMMMMMMMMIIIMMM +MMMMMMMMOOOOOOOOOOOOOOMMMMMMMMMMMIIIIIMMMMMMMMMOOOOOOOOOOOOOOOOOOOOOO +OOOOOMMMMMMMMMMMIIIMMMMMMMOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOMMM +MMMMMM'; @total_top = (); if($topology_final=~/M/) { while ($topology_final =~/(.)\1*/g) { if ($1 eq "M") { my $start_TM = $-[0] + 1; my $end_TM = $+[0]; push @total_top, $start_TM; push @total_top, $end_TM; } } my $image = DrawTransmembrane->new ( -title=>"topology prediction image", -n_terminal=>'in', -topology=>\@total_top, -bold_helices=> 1, -bold_labels=>1, -text_offset=>-25, -helix_label=>'b', -outside_label=>'Extracellular', -inside_label=>'Periplasm', -membrane_label=>'Membrane', -helix_width=>30, -vertical_padding=>150, -horizontal_padding=>120, -n_terminal_offset=>50, -n_terminal_height=>220, -c_terminal_offset=>30, -c_terminal_height=>220, -helix_label=>'Sheet', -colour_scheme=>'yellow' ); open (OUTPUT, '>', 'test.png'); binmode OUTPUT; print OUTPUT $image->png; close (OUTPUT); }

    Any tips would be greatly appreciated... The goal should be to tilt the bars a bit, like, e.g. in:
    http://bioinformatics.biol.uoa.gr/TMRPres2D/screens/big4.png
Setting syslog layout with log4perl
1 direct reply — Read more / Contribute
by neilwatson
on Aug 27, 2014 at 10:52

    Greetings

    This is my first dive in log4perl. I'm trying to configure for syslog, but I get the error ERROR: trying to set layout for SYSLOG to '%-5p %C - %m%n'. What is the correct way to configure the layout?

    log4perl.rootLogger=DEBUG, SYSLOG log4perl.appender.SYSLOG = Log::Dispatch::Syslog log4perl.appender.SYSLOG.min_level = debug log4perl.appender.SYSLOG.ident = logging.pl log4perl.appender.SYSLOG.facility = daemon log4perl.appender.SYSLOG.layout = %-5p %C - %m%n

    Neil Watson
    watson-wilson.ca


Add your question
Title:
Your question:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":


  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others studying the Monastery: (4)
    As of 2014-08-30 14:15 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (293 votes), past polls