[31401] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2653 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 27 06:09:40 2009

Date: Tue, 27 Oct 2009 03:09:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 27 Oct 2009     Volume: 11 Number: 2653

Today's topics:
    Re: 6 images in tile format(google maps) <dwayne.triffitt@gmail.com>
    Re: File locking using threads (Jens Thoms Toerring)
    Re: File locking using threads <ben@morrow.me.uk>
    Re: File locking using threads <xhoster@gmail.com>
    Re: File locking using threads <timothy.hill@gmail.com>
    Re: How to prevent hanging when writing lots of text to <someone@example.com>
    Re: Parse nodes in a XML file for comparison to CGI pos <richardk.cj@gmail.com>
    Re: Parse nodes in a XML file for comparison to CGI pos <rkb@i.frys.com>
    Re: Perl bioinformatics <kbradnam@gmail.com>
    Re: Perl bioinformatics <xhoster@gmail.com>
    Re: Perl bioinformatics <xhoster@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 27 Oct 2009 00:40:56 -0700 (PDT)
From: Dwayne Triffitt <dwayne.triffitt@gmail.com>
Subject: Re: 6 images in tile format(google maps)
Message-Id: <bb211f1c-8c6d-4973-85fa-4c32246794a7@b3g2000pre.googlegroups.com>

Tad McClellan -
Before 2 weeks ago - i did not know one line about perl.
I am starting off and learning line by line... i add something, check
it, read warning/error...
fix error .....
Move on .....
So on .....
Thanks for the insight's

Onto the code....

When adding multi images to the widget i have to assign them a -tag,
every 'marker' is called more, no hick-up
But i plan to make them as way-points, so each 'marker' needs its own
name/number. so here it is to add a name and to get the name.

my $name = 1;

##On button-2 - create 'marker'
    sub create_item {
        my ($c1, $x, $y, $name) = @_;

        my $ev = $c1->XEvent;
        ($dx, $dy) = (0 - $ev->x, 0 - $ev->y);
        \&pimg, Ev('x'), Ev('y');
    }

##On button-1 - Get name then move to 'Moving'
    sub get_name {
        my ($c1) = @_;
        my $item = $c1->find('withtag', 'current');
        my @taglist = $c1->gettags($item);
        my $name;
        foreach (@taglist) {
            next if ($_ eq 'current');
            $name = $_;
            last;
        }
        return $name;
    }

sub mobileStart {
      my $ev = $c1->XEvent;
      ($dx, $dy) = (0 - $ev->x, 0 - $ev->y);
      $c1->raise('move');
      $listbox->insert('end', "Start $dx $dy");
      $xworldst = $dx;
      $yworldst = $dy;

}

sub mobileMove {
      my $ev = $c1->XEvent;
      $c1->move('current', $ev->x + $dx, $ev-> y + $dy);
      ($dx, $dy) = (0 - $ev-> x, 0 - $ev-> y);
      $listbox->insert('end', "");
      $listbox->delete('end');

      $listbox->insert('end', "Moving $dx $dy");
      $listbox->delete('end');

}

sub pimg {

   my ($canv, $x, $y) = @_;
   my $x1 = $canv->canvasx($x);
   my $y1 = $canv->canvasx($y);
#   print "$x1  $y1\n";

        #$c1->pack(-side => 'left');
        $c1->createImage($x1, $y1, -image => $icon, -tags =>
['move']);

        $listbox->insert('end', " Input $x1 $y1");
        $pre->insert('end', "$x1 $y1");

        $current = $c1;
}

More to come.


------------------------------

Date: 26 Oct 2009 21:54:19 GMT
From: jt@toerring.de (Jens Thoms Toerring)
Subject: Re: File locking using threads
Message-Id: <7kmk4bF399s4tU1@mid.uni-berlin.de>

Prince Al <timothy.hill@gmail.com> wrote:
> On Oct 25, 9:21 pm, j...@toerring.de (Jens Thoms Toerring) wrote:
> > S**t happens;-) But what is actually the "same result"?

> When I run the script, I get:

> Thread 1: acquired lock!
> Thread 2: acquired lock!
> Thread 2: released lock!
> Thread 1: released lock!

> Which is obviously wrong as Thread 1 should complete before Thread 2
> can obtain the lock...

> > And
> > are you sure that your home directory isn't on a NFS mounted
> > partition or that flock() on the system you're testing this
> > on works with NFS partitons?

> No, I am not sure. However, there is no man page for flock. I have
> lockf however - is this the same/similar? From the man page, it seems
> to do a similar job, although I'm not sure it helps me any...

I think Ben's idea to start by figuring out what Perl really uses
when flock() is called is a very sensible proposal (and, of course,
he's correct when pointing out that flock() isn't a POSIX function
at all but a BSDism). Once you have figured that out (and it turns
to be flock() anyway) then you might ask your system administrator
NFS is use at all and what partitions it's used for. Perhaps that's
just a red hering, but I am not aware at the moment of any other
reasons for failure of locking the file (unless there are some
special issues with your system and locks and threads...).

Of course, ait could also be the case that Perl's flock() uses
lockf() internally, but I haven't seen anything concerning lockf()
that would easily explain the problems you're running into. But
perhaps the man page for lockf() on your system has some hints
but I can't check since I have no access to it.

                              Regards, Jens
-- 
  \   Jens Thoms Toerring  ___      jt@toerring.de
   \__________________________      http://toerring.de


------------------------------

Date: Mon, 26 Oct 2009 22:52:22 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: File locking using threads
Message-Id: <6qlhr6-ap22.ln1@osiris.mauzo.dyndns.org>


Quoth jt@toerring.de (Jens Thoms Toerring):
> Prince Al <timothy.hill@gmail.com> wrote:
> 
> > No, I am not sure. However, there is no man page for flock. I have

I didn't notice this before. This strongly suggests that this is a
system which doesn't have flock, and uses POSIX locking instead.

To the OP: what OS are you using? (I don't think you've answered that
yet.) Is there an entry for SYS_flock in your <sys/syscall.h>?

> > lockf however - is this the same/similar? From the man page, it seems
> > to do a similar job, although I'm not sure it helps me any...

lockf is just a POSIX-mandated wrapper for the locking functions of
fcntl. Technically speaking lockf locks don't have to be the same as
fcntl locks, but since they both follow the same (broken) semantics it
would be foolish to do anything else.

> I think Ben's idea to start by figuring out what Perl really uses
> when flock() is called is a very sensible proposal (and, of course,
> he's correct when pointing out that flock() isn't a POSIX function
> at all but a BSDism). Once you have figured that out (and it turns
> to be flock() anyway) then you might ask your system administrator
> NFS is use at all and what partitions it's used for. Perhaps that's
> just a red hering, but I am not aware at the moment of any other
> reasons for failure of locking the file (unless there are some
> special issues with your system and locks and threads...).

I don't know what the usual behaviour of flock is under NFS, but I would
expect to get EINVAL or some such rather than silently appearing to
succeed without actually locking anything. (I believe my system
(FreeBSD) returns EOPNOTSUPP.)

> Of course, ait could also be the case that Perl's flock() uses
> lockf() internally, but I haven't seen anything concerning lockf()
> that would easily explain the problems you're running into. But
> perhaps the man page for lockf() on your system has some hints
> but I can't check since I have no access to it.

POSIX locking via fcntl or lockf will produce exactly the behaviour
observed. POSIX locks are held by a particular process on a particular
file (not on a particular fd), so different threads in the same process
cannot use POSIX locking to protect against each other. Even if the
second thread re-opens the file, it will still be considered to be
holding the lock, so a lock attempt will succeed (and an unlock attempt
will also succeed, leaving the file unlocked).

Ben



------------------------------

Date: Mon, 26 Oct 2009 19:10:24 -0700
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: File locking using threads
Message-Id: <4ae65752$0$25977$ed362ca5@nr5-q3a.newsreader.com>

Ben Morrow wrote:
> 
> I don't know what the usual behaviour of flock is under NFS, but I would
> expect to get EINVAL or some such rather than silently appearing to
> succeed without actually locking anything. (I believe my system
> (FreeBSD) returns EOPNOTSUPP.)

The behavior that I usually see with flock over NFS is that it works as 
expected within one machine, just as if the file were a local one.  But 
processes running on different machines will silently be granted 
conflicting locks on the same file.  If the file were exposed to the 
same machine via different NFS mounts, then presumably you could get 
conflicting locks by using different NFS paths to open.

But obviously there are more permutations than just the ones I have 
witnessed.

Xho


------------------------------

Date: Tue, 27 Oct 2009 02:44:28 -0700 (PDT)
From: Prince Al <timothy.hill@gmail.com>
Subject: Re: File locking using threads
Message-Id: <f5851fc5-d428-47b1-b8bf-bf286ea90d2a@v36g2000yqv.googlegroups.com>

Hi all,

First, many thanks for the taking the time to help me out - very much
appreciated :-) Answers to the various queries posted above are...

OS is HP-UX B.11.11 U

There are NFS mounts in use on the server, but none where I have been
trying to lock a file

I have found 5 files relating to sys/syscall.h and none of them
contain any reference to 'SYS_flock':
/usr/conf/pa/sys/syscall.h
/usr/conf/sys/syscall.h
/usr/include/sys/syscall.h
/usr/include/pa/sys/syscall.h
/usr/include/syscall.h

lockf man page snippets:
 NAME
      lockf - provide semaphores and record locking on files

 SYNOPSIS
      #include <unistd.h>

      int lockf(int fildes, int function, off_t size);

 DESCRIPTION
      The lockf() function allows regions of a file to be used as
semaphores
      (advisory locks) or restricts access to only the locking process
      (enforcement-mode record locks).  Other processes that attempt
to
      access the locked resource either return an error or sleep until
the
      resource becomes unlocked.  All locks for a process are released
upon
      the first close of the file, even if the process still has the
file
      opened, and all locks held by a process are released when the
process
      terminates.

      fildes is an open file descriptor.  The file descriptor must
have been
      opened with write-only permission (O_WRONLY) or read-write
permission
      (O_RDWR) in order to establish a lock with this function call
(see
      open(2)).

      If the calling process is a member of a group that has the
      PRIV_LOCKRDONLY privilege (see getprivgrp(2)), it can also use
lockf()
      to lock files opened with read-only permission (O_RDONLY).

      function is a control value that specifies the action to be
taken.
      Permissible values for function are defined in <unistd.h> as
follows:

           #define F_ULOCK   0      /* unlock a region */
           #define F_LOCK    1      /* lock a region */
           #define F_TLOCK   2      /* test and lock a region */
           #define F_TEST    3      /* test region for lock */

      All other values of function are reserved for future extensions
and
      result in an error return if not implemented.

      F_TEST is used to detect whether a lock by another process is
present
      on the specified region.  lockf() returns zero if the region is
      accessible and -1 if it is not; in which case errno is set to
EACCES.
      F_LOCK and F_TLOCK both lock a region of a file if the region is
      available.  F_ULOCK removes locks from a region of the file.

      size is the number of contiguous bytes to be locked or
unlocked.  The
      resource to be locked starts at the current offset in the file,
and
      extends forward for a positive size, and backward for a negative
size
      (the preceding bytes up to but not including the current
offset).  If
      size is zero, the region from the current offset through the end
of
      the largest possible file is locked (that is, from the current
offset
      through the present or any future end-of-file).  An area need
not be

 Hewlett-Packard Company            - 1 -   HP-UX Release 11i:
November 2000

 lockf(2)
lockf(2)

      allocated to the file in order to be locked, because such locks
can
      exist past the end of the file.

      Regions locked with F_LOCK or F_TLOCK can, in whole or in part,
      contain or be contained by a previously locked region for the
same
      process.  When this occurs or if adjacent regions occur, the
regions
      are combined into a single region.  If the request requires that
a new
      element be added to the table of active locks but the table is
already
      full, an error is returned, and the new region is not locked.

      F_LOCK and F_TLOCK requests differ only by the action taken if
the
      resource is not available: F_LOCK causes the calling process to
sleep
      until the resource is available, whereas F_TLOCK returns an
EACCES
      error if the region is already locked by another process.

      F_ULOCK requests can, in whole or part, release one or more
locked
      regions controlled by the process.  When regions are not fully
      released, the remaining regions are still locked by the process.
      Releasing the center section of a locked region requires an
additional
      element in the table of active locks.  If this table is full, an
      EDEADLK error is returned, and the requested region is not
released.

      Regular files with the file mode of S_ENFMT, not having the
group
      execute bit set, will have an enforcement policy enabled.  With
      enforcement enabled, reads and writes that would access a locked
      region sleep until the entire region is available if O_NDELAY is
      clear, but return -1 with errno set if O_NDELAY is set.  File
access
      by other system functions, such as exec(), are not subject to
the
      enforcement policy.  Locks on directories, pipes, and special
files
      are advisory only; no enforcement policy is used.

      A potential for deadlock occurs if a process controlling a
locked
      resource is put to sleep by accessing the locked resource of
another
      process.  Thus, calls to fcntl(), lockf(), read(), or write()
(see
      fcntl(2), lockf(2), read(2), and write(2)) scan for a deadlock
prior
      to sleeping on a locked resource.  Deadlock is not checked for
the
      wait() and pause() system calls (see wait(2) and pause(2)), so
      potential for deadlock is not eliminated.  A creat() call or an
open()
      call with the O_CREATE and O_TRUNC flags set on a regular file
returns
      error EAGAIN if another process has locked part of the file and
the
      file is currently in enforcement mode.

 NETWORKING FEATURES
    NFS
      The advisory record-locking capabilities of lockf() are
implemented
      throughout the network by the ``network lock daemon'' (see lockd
(1M)).
      If the file server crashes and is rebooted, the lock daemon
attempts
      to recover all locks associated with the crashed server.  If a
lock
      cannot be reclaimed, the process that held the lock is issued a
      SIGLOST signal.

 Hewlett-Packard Company            - 2 -   HP-UX Release 11i:
November 2000

 lockf(2)
lockf(2)

      Only advisory record locking is implemented for NFS files.

 RETURN VALUE
      Upon successful completion, a value of 0 is returned.
Otherwise, a
      value of -1 is returned and errno is set to indicate the error.

 ERRORS
      lockf() fails if any of the following occur:

           [EACCES]       function is F_TLOCK or F_TEST and the region
is
                          already locked by another process.

           [EBADF]        fildes is not a valid, open file descriptor.

           [EDEADLK]      A deadlock would occur or the number of
entries in
                          the system lock table would exceed a system-
                          dependent maximum.  HP-UX guarantees this
value to
                          be at least 50.

           [EINTR]        A signal was caught during the lockf()
system
                          call.

           [EINVAL]       Either function is not one of the functions
                          specified above, or size plus current offset
                          produces a negative offset into the file.

           [EINVAL]       size plus current offset cannot be
represented
                          correctly by an object of size off_t.

           [ENOLCK]       Either function is F_TLOCK or F_LOCK and the
file
                          is an NFS file with access bits set for
                          enforcement mode, or the file is an NFS file
and a
                          system error occurred on the remote node.

 WARNINGS
      Deadlock conditions may arise when either the wait() or pause()
system
      calls are used in conjunction with enforced locking (see wait(2)
and
      pause(2) for details).

      When a file descriptor is closed, all locks on the file from the
      calling process are deleted, even if other file descriptors for
that
      file (obtained through dup() or open(), for example) still
exist.

      Unexpected results may occur in processes that use buffers in
the user
      address space.  The process may later read or write data which
is or
      was locked.  The standard I/O package, stdio(3S), is the most
common
      source of unexpected buffering.

      In a hostile environment, locking can be misused by holding key
public
      resources locked.  This is particularly true with public read
files
      that have enforcement enabled.

 Hewlett-Packard Company            - 3 -   HP-UX Release 11i:
November 2000

 lockf(2)
lockf(2)

      It is not recommended that the PRIV_LOCKRDONLY capability be
used
      because it is provided for backward compatibility only.  This
feature
      may be modified or dropped from future HP-UX releases.

      Locks default to advisory mode unless the setgid bit of the file
      permissions is set.

    Application Usage
      Because in the future the variable errno will be set to EAGAIN
rather
      than EACCES when a section of a file is already locked by
another
      process, portable application programs should expect and test
for
      either value.  For example:

           if (lockf(fd, F_TLOCK, siz) == -1)
               if ((errno == EAGAIN) || (errno == EACCES))
               /*
               * section locked by another process
               * check for either EAGAIN or EACCES
               * due to different implementations
               */
               else if ...
               /*
               * check for other errors
               */

 SEE ALSO
      lockd(1M), statd(1M), chmod(2), close(2), creat(2), fcntl(2),
      creat64(2), open(2), pause(2), read(2), stat(2), wait(2), write
(2),
      unistd(5).

 STANDARDS CONFORMANCE
      lockf(): SVID2, SVID3, XPG2




------------------------------

Date: Mon, 26 Oct 2009 21:29:55 -0700
From: "John W. Krahn" <someone@example.com>
Subject: Re: How to prevent hanging when writing lots of text to a pipe?
Message-Id: <7HuFm.44117$eF1.12284@newsfe24.iad>

jl_post@hotmail.com wrote:
>> Quoth "jl_p...@hotmail.com" <jl_p...@hotmail.com>:
>>
>>>    # Populate @lines with the lines in $output:
>>>    my $readHandle = new IO::Scalar(\$output);
>>>    <$readHandle>
> 
> On Oct 26, 10:39 am, Ben Morrow <b...@morrow.me.uk> wrote:
>> Um, there's no need for this. Just use
>>
>>     split /\n/, $output;
> 
>    That doesn't do the same thing.  Splitting on /\n/ removes the
> newlines from the entries, and creates an extra final element that's
> an empty string.
> 
>    I could have used this instead:
> 
>       split m/(?<=\n)(?!\z)/, $output;

Or this:

         $output =~ /.*\n/g;



John
-- 
The programmer is fighting against the two most
destructive forces in the universe: entropy and
human stupidity.               -- Damian Conway


------------------------------

Date: Mon, 26 Oct 2009 14:08:08 -0700 (PDT)
From: ricky <richardk.cj@gmail.com>
Subject: Re: Parse nodes in a XML file for comparison to CGI posted variable.
Message-Id: <cec33353-1804-4714-9d03-694b96043c85@o36g2000vbl.googlegroups.com>

On Oct 26, 2:56=A0pm, Ron Bergin <r...@i.frys.com> wrote:
> On Oct 26, 11:43=A0am, Ron Bergin <r...@i.frys.com> wrote:
>
>
>
>
>
> > #!/usr/bin/perl
>
> > use strict;
> > use warnings;
> > use Mail::Sendmail;
> > use XML::Simple;
>
> > my $xml =A0 =A0 =A0=3D 'group.xml';
> > my $simple =A0 =3D XMLin($xml);
> > my $cgi =A0 =A0 =A0=3D CGI->new;
> > my $to_group =3D $cgi->param('to_group');
> > my $body =A0 =A0 =3D $cgi->param('YourMessage');
> > my $namnum =A0 =3D $cgi->param('YourName') =A0. '@' . $cgi->param
> > ('YourNumber');
> > my $groups =A0 =3D $simple->{Group};
>
> > foreach my $group ( @$groups ) {
> > =A0 =A0 if ( $group->{'Pager'} =3D~ /^$to_group/ ) {
> > =A0 =A0 =A0 =A0 my %mail;
> > =A0 =A0 =A0 =A0 my @to =3D split /\s+/, $group->{'Pager'};
> > =A0 =A0 =A0 =A0 foreach my $reciepient (@to) =A0{
> > =A0 =A0 =A0 =A0 =A0 =A0 $mail{To} =A0 =3D $reciepient;
> > =A0 =A0 =A0 =A0 =A0 =A0 $mail{Subject} =3D $namnum;
> > =A0 =A0 =A0 =A0 =A0 =A0 $mail{Message} =3D $body;
> > =A0 =A0 =A0 =A0 =A0 =A0 sendmail %mail;
> > =A0 =A0 =A0 =A0 }
> > =A0 =A0 =A0 =A0 writeLog($group->{'Name'}, $namnum, $body);
> > =A0 =A0 =A0 =A0 last;
> > =A0 =A0 }
>
> I should point out that this has the minimum level of error handling
> and lacks file locking. =A0I'll leave those issues to the OP to figure
> out.
>
> ricky, this is just a minor adjustment to what I provided in your EE
> question.http://www.experts-exchange.com/Programming/Languages/Scripting/=
Perl/...
>
>
>
> > }
>
> > sub writeLog {
> > =A0 =A0 my ($name, $name_num, $body) =3D @_;
> > =A0 =A0 my $date =3D localtime(time);
>
> > =A0 =A0 open my $LOG, '>>', 'AlphaPageLog.txt'
> > =A0 =A0 =A0 or die "Cannot open AlphaPageLog.txt: $!";
>
> > =A0 =A0 print $LOG "$name|$date|$name_num|$body\n";
>
> > =A0 =A0 close $LOG;
>
> > }- Hide quoted text -
>
> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

It's sending out the cpage correctly, but not writing to the log.


------------------------------

Date: Mon, 26 Oct 2009 15:04:24 -0700 (PDT)
From: Ron Bergin <rkb@i.frys.com>
Subject: Re: Parse nodes in a XML file for comparison to CGI posted variable.
Message-Id: <10d78d3d-92ee-4035-8705-9854fe55469e@r24g2000prf.googlegroups.com>

On Oct 26, 1:08=A0pm, ricky <richardk...@gmail.com> wrote:
> On Oct 26, 2:56=A0pm, Ron Bergin <r...@i.frys.com> wrote:
>
>
>
> > On Oct 26, 11:43=A0am, Ron Bergin <r...@i.frys.com> wrote:
>
> > > #!/usr/bin/perl
>
> > > use strict;
> > > use warnings;
> > > use Mail::Sendmail;
> > > use XML::Simple;
>
> > > my $xml =A0 =A0 =A0=3D 'group.xml';
> > > my $simple =A0 =3D XMLin($xml);
> > > my $cgi =A0 =A0 =A0=3D CGI->new;
> > > my $to_group =3D $cgi->param('to_group');
> > > my $body =A0 =A0 =3D $cgi->param('YourMessage');
> > > my $namnum =A0 =3D $cgi->param('YourName') =A0. '@' . $cgi->param
> > > ('YourNumber');
> > > my $groups =A0 =3D $simple->{Group};
>
> > > foreach my $group ( @$groups ) {
> > > =A0 =A0 if ( $group->{'Pager'} =3D~ /^$to_group/ ) {
> > > =A0 =A0 =A0 =A0 my %mail;
> > > =A0 =A0 =A0 =A0 my @to =3D split /\s+/, $group->{'Pager'};
> > > =A0 =A0 =A0 =A0 foreach my $reciepient (@to) =A0{
> > > =A0 =A0 =A0 =A0 =A0 =A0 $mail{To} =A0 =3D $reciepient;
> > > =A0 =A0 =A0 =A0 =A0 =A0 $mail{Subject} =3D $namnum;
> > > =A0 =A0 =A0 =A0 =A0 =A0 $mail{Message} =3D $body;
> > > =A0 =A0 =A0 =A0 =A0 =A0 sendmail %mail;
> > > =A0 =A0 =A0 =A0 }
> > > =A0 =A0 =A0 =A0 writeLog($group->{'Name'}, $namnum, $body);
> > > =A0 =A0 =A0 =A0 last;
> > > =A0 =A0 }
>
> > I should point out that this has the minimum level of error handling
> > and lacks file locking. =A0I'll leave those issues to the OP to figure
> > out.
>
> > ricky, this is just a minor adjustment to what I provided in your EE
> > question.http://www.experts-exchange.com/Programming/Languages/Scriptin=
g/Perl/...
>
> > > }
>
> > > sub writeLog {
> > > =A0 =A0 my ($name, $name_num, $body) =3D @_;
> > > =A0 =A0 my $date =3D localtime(time);
>
> > > =A0 =A0 open my $LOG, '>>', 'AlphaPageLog.txt'
> > > =A0 =A0 =A0 or die "Cannot open AlphaPageLog.txt: $!";
>
> > > =A0 =A0 print $LOG "$name|$date|$name_num|$body\n";
>
> > > =A0 =A0 close $LOG;
>
> > > }- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -
>
> It's sending out the cpage correctly, but not writing to the log.

Did you check the web server error log?

Most likely it failed to open the log file due to permission settings.

Add this with the loading of the other modules.

use CGI::Carp qw(fatalsToBrowser);


------------------------------

Date: Mon, 26 Oct 2009 13:32:16 -0700 (PDT)
From: Keith Bradnam <kbradnam@gmail.com>
Subject: Re: Perl bioinformatics
Message-Id: <b4b69ea2-5248-4a8e-a2dd-697a70a6d263@v37g2000prg.googlegroups.com>

On Oct 26, 7:17=A0am, ccc31807 <carte...@gmail.com> wrote:
> I'm not changing jobs, but I've been contacted about some contract
> opportunities that (reportedly) are difficult but seem easy enough to
> me, manipulating genome files to produce various kinds of reports,
> graphs, etc. I have zero experience in this, so I'm just wondering ...
>
> 1. What are the career opportunities in bioinformatics using Perl?
>
> 2. Looking for books, I found the following:
> =A0a. Beginning Perl for Bioinformatics by James Tisdall
> =A0b. Mastering Perl for Bioinformatics by James D. Tisdall
> =A0c. Building Bioinformatics Solutions: with Perl, R and MySQL by
> Conrad Bessant**
> =A0d. Perl Programming for Biologists by D. Curtis Jamison
> =A0e. Genomic Perl: From Bioinformatics Basics to Working Code by Rex A.
> Dwyer
>
> Looking at the tables of contents, reviews, and reader comments, I
> believe that c. is probably the best value, but it's real hard to tell
> without buying and reading the book. Anybody have any experiences
> using any of these books? I'd like to conserve both time and money by
> starting with the 'best' book.
>
> Thanks, CC.

I co-teach a Unix & Perl course at UC Davis that is aimed at teaching
graduate students how to learn the basics of Perl in a biological
context. We have specifically tried to assume no prior knowledge of
programming as many people who take our course are new to this.

We have made our course materials (data & documentation) freely
available to anyone else who is interested:

http://korflab.ucdavis.edu/Unix_and_Perl/index.html

There is a corresponding Google Group for discussion of issues arising
from the course. We also make regular updates to the documentation.
Hope this might be of use to you.

Keith


------------------------------

Date: Mon, 26 Oct 2009 18:57:48 -0700
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: Perl bioinformatics
Message-Id: <4ae6549b$0$25957$ed362ca5@nr5-q3a.newsreader.com>

Jürgen Exner wrote:
> ccc31807 <cartercc@gmail.com> wrote:
>> I'm not changing jobs, but I've been contacted about some contract
>> opportunities that (reportedly) are difficult but seem easy enough to
>> me, manipulating genome files to produce various kinds of reports,
>> graphs, etc. I have zero experience in this, so I'm just wondering ...
> 
> The usual problem is the huge volume of data that needs processing.
> Therefore typically the standard algorithms don't work any more and you
> need a really strong background in data processing.

Isn't that exactly Perl's strength?

> Perl is not necessariy the best choice here. Perl's powerful features
> make it easy to write code that seems to do the job, but it won't scale
> from the small test samples to the huge actual data set where you really
> need special methods and optimizations.

If you think about scalability as you write the code, Perl will not 
present any special scalability issues versus other languages.  If you 
do not think about scalability, no language choice will protect you.

I certainly would not implement a heavy duty multiple alignment 
algorithm directly in Perl, but I certainly might (and have) implement 
things like that in Inline::C or just link pre-existing C code in via 
XS, using Perl to handle the book-keeping, memory management, IPC, 
pre-processing and parsing, post-processing, packing, unpacking, etc.

Based on the description of "produce various kinds of reports", I 
wouldn't think they expect this to cover Smith-Waterman type of things 
anyway, but only the kind of reports that are very similar to what you 
would find in non-bioinformatics type work.

Xho


------------------------------

Date: Mon, 26 Oct 2009 19:13:17 -0700
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: Perl bioinformatics
Message-Id: <4ae65753$0$25977$ed362ca5@nr5-q3a.newsreader.com>

ccc31807 wrote:
> 
> You seem to have a handle on what's going on. Is using Perl for
> bioinformatics totally off the wall, or a reasonable option for data
> mangling?

Not off the wall at all.

http://bio.perl.org/wiki/How_Perl_saved_human_genome


Xho


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 2653
***************************************


home help back first fref pref prev next nref lref last post