The Perl language in general

perl script, how to perl, tutorial perl

Archive for October, 2010

EPrints "Call for Plugins" (perl)

Date: Mon, 29 Oct 2007 07:06:50 +0000
From: Leslie Carr lac–ecs.soton.ac.uk
To: JISC-REPOSITORIES–JISCMAIL.AC.UK
Subject: Prizes Offered for EPrints "Call for Plugins"

[This call is available at the EPrints website:
http://www.eprints.org/software/cfp.php
Please excuse multiple postings. On the other hand, please feel
free to distribute this call through your normal channels.]

Call for Plugins for EPrints Repositories

Developers are warmly invited to create import and export plugins for
the EPrints repository platform.

EPrints is a mature repository platform that has a particular emphasis
on interoperability. EPrints repositories operate in complex
information environments consisting of mobile devices, user desktop
applications, library environments, institutional databases and
Internet services. EPrints is looking to increase its range of
interoperability capabilities with more community-developed plugins.

EPrints Services is offering prizes for new plugins submitted to the
EPrints developers repository by January 31st 2008. EPrints Services
is the repository hosting company that funds EPrints development.

First Prize: Apple iPhone plus contract (or equivalent value item)
Second Prize: iPod Touch
Third Prize: iPod Nano

You are invited to develop an import or export plugin. You don’t need
to be an established EPrints developer to participate, anyone with
some basic Perl programming skills can join in. To get started
download an EPrints LiveCD, which boots up a running EPrints
repository with training materials. Support can be obtained through
the EP-Tech mailing list, the EPrints wiki and the EPrints website.

EPrints has a growing list of plugins that can handle requirements as
diverse as importing publications from PubMed or creating mashups
using Google Maps. EPrints supports insitutional repositories, but it
is also suitable for individual student projects and research
environments, as its import and export features allow existing digital
collections to be used and reused in innovative ways.

For further information about this Call for Plugins, please see the
Further Information Wiki page or email lac–ecs.soton.ac.uk.

Important Links

EPrints Services
http://www.eprints.org/services/
Call for Plugins
http://www.eprints.org/software/cfp.php
Further Information
http://wiki.eprints.org/w/CallForPlugins
EPrints Package Repository (Plugins)
http://files.eprints.org/view/type/plugin.html
EPrints Live CD
http://wiki.eprints.org/w/Ubuntu_Live_CD_Help
Lists of Standard EPrints Plugins
Import plugins http://wiki.eprints.org/w/Perl_lib/EPrints/Plugin/
Import/ and export plugins
http://wiki.eprints.org/w/Perl_lib/EPrints/Plugin/Export/
Plugin Development Tutorial
http://wiki.eprints.org/w/Contribute:_Plugins
How To Create Export Plugins
http://wiki.eprints.org/w/Create_Export_Plugins
General Training Materials
http://www.eprints.org/software/training/ (see the "Customisation
Training" panel for developer training)
General Documentation
http://wiki.eprints.org/w/Documentation
EPrints Orientation for New Users
Demo Repository http://demoprints.eprints.org/ and Feature Overview
http://www.eprints.org/software/training/users/overview.php

posted by admin in Uncategorized and have Comment (1)

FAQ 8.7 How do I clear the screen?

This is an excerpt from the latest version perlfaq8.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

——————————————————————–

8.7: How do I clear the screen?

    If you only have do so infrequently, use "system":

            system("clear");

    If you have to do this a lot, save the clear string so you can print it
    100 times without calling a program 100 times:

            $clear_string = `clear`;
            print $clear_string;

    If you’re planning on doing other screen manipulations, like cursor
    positions, etc, you might wish to use Term::Cap module:

            use Term::Cap;
            $terminal = Term::Cap->Tgetent( {OSPEED => 9600} );
            $clear_string = $terminal->Tputs(‘cl’);

——————————————————————–

The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
are not necessarily experts in every domain where Perl might show up,
so please include as much information as possible and relevant in any
corrections. The perlfaq-workers also don’t have access to every
operating system or platform, so please include relevant details for
corrections to examples that do not work on particular platforms.
Working code is greatly appreciated.

If you’d like to help maintain the perlfaq, see the details in
perlfaq.pod.

posted by admin in Uncategorized and have No Comments

###FREE SEX #STILL FREE##WORLD SEX FREE###

###SEX LIVE  SHOW  FREE INDIAN SEX ####

LISPINA  SEX GARLS SEX  FREEE

##TO NIGHT  SEX  IN LIVE FREE##

   http://gopitty.googlepages.com/

posted by admin in Uncategorized and have No Comments

FAQ 8.33 Is there a way to hide perl's command line from programs such as "ps"?

This is an excerpt from the latest version perlfaq8.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

——————————————————————–

8.33: Is there a way to hide perl’s command line from programs such as "ps"?

    First of all note that if you’re doing this for security reasons (to
    avoid people seeing passwords, for example) then you should rewrite your
    program so that critical information is never given as an argument.
    Hiding the arguments won’t make your program completely secure.

    To actually alter the visible command line, you can assign to the
    variable $0 as documented in perlvar. This won’t work on all operating
    systems, though. Daemon programs like sendmail place their state there,
    as in:

            $0 = "orcus [accepting connections]";

——————————————————————–

The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
are not necessarily experts in every domain where Perl might show up,
so please include as much information as possible and relevant in any
corrections. The perlfaq-workers also don’t have access to every
operating system or platform, so please include relevant details for
corrections to examples that do not work on particular platforms.
Working code is greatly appreciated.

If you’d like to help maintain the perlfaq, see the details in
perlfaq.pod.

posted by admin in Uncategorized and have No Comments

WHY are args for sprintf in scalar context?

Just ran into this nasty trap:

> perl -we’@a=("%s %s\n", qw/foo bar/); printf @a’
foo bar
> perl -we’@a=("%s %s\n", qw/foo bar/); print sprintf @a’

3

And indeed, ‘perldoc -f sprintf’ says:
"Unlike printf, sprintf does not do what you probably mean when you
pass it an array as your first argument. The array is given scalar
context, and instead of using the 0th element of the array as the
format, Perl will use the count of elements in the array as the
format, which is almost never useful."

But *why* are args for printf in array context and for sprintf in
scalar context? Especially if it’s "not what I probably mean" and
"almost never useful". It’s not like Perl to make easy things
harder…

Wolfram

posted by admin in Uncategorized and have Comment (1)

Printing to a Windows printer.

I am trying to improve a label printing program that I wrote in perl.
I want to use a Laser Printer instead of the current dot matrix and I
would like to include some Fonts and graphics in the output.
Portability isn’t an issue right now and I really don’t want to have
to install Ghostscript.
I have looked on the Activestate Website but couldn’t find anything
that pointed to how to use a windows printer as anything but a char
device.
I have also gone to CPAN and found a modual that looks like it would
do EXACTLY what I would like to do.
http://search.cpan.org/~wasx/Win32-Printer-0.9.0/Printer.pm
But when I go to the home page that is supposed to have that module I
get a page of ads. It looks like it has been abandoned.
So any help would be great.
Thanks

posted by admin in Uncategorized and have Comments (3)

!Help: can't get into perl -MCPAN -e shell

I try to login in at command line.  It gives me the output below.  It
then kicks me out of the perl shell.  What do I need to do to be able
to use it?

Mike

Here is the error message:

Can’t load ‘/opt/perl/lib/5.8.3/IA64.ARCHREV_0-thread-multi/auto/IO/
IO.so’ for module IO: Exec format error at /opt/perl/lib/5.8.3/
IA64.ARCHREV_0-thread-multi/XSLoader.pm line 68.
 at /opt/perl/lib/5.8.3/IA64.ARCHREV_0-thread-multi/IO.pm line 11
Compilation failed in require at /opt/perl/lib/5.8.3/IA64.ARCHREV_0-
thread-multi/IO/Handle.pm line 260.
BEGIN failed–compilation aborted at /opt/perl/lib/5.8.3/
IA64.ARCHREV_0-thread-multi/IO/Handle.pm line 260.
Compilation failed in require at /opt/perl/lib/5.8.3/IA64.ARCHREV_0-
thread-multi/IO/Seekable.pm line 101.
BEGIN failed–compilation aborted at /opt/perl/lib/5.8.3/
IA64.ARCHREV_0-thread-multi/IO/Seekable.pm line 101.
Compilation failed in require at /opt/perl/lib/5.8.3/IA64.ARCHREV_0-
thread-multi/IO/File.pm line 117.
BEGIN failed–compilation aborted at /opt/perl/lib/5.8.3/
IA64.ARCHREV_0-thread-multi/IO/File.pm line 117.
Compilation failed in require at /opt/perl/lib/5.8.3/FileHandle.pm
line 9.
Compilation failed in require at /opt/perl/lib/5.8.3/CPAN.pm line 26.
BEGIN failed–compilation aborted at /opt/perl/lib/5.8.3/CPAN.pm line
26.
Compilation failed in require.
BEGIN failed–compilation aborted.

posted by admin in Uncategorized and have Comments (14)

FAQ 8.10 How do I read and write the serial port?

This is an excerpt from the latest version perlfaq8.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

——————————————————————–

8.10: How do I read and write the serial port?

    This depends on which operating system your program is running on. In
    the case of Unix, the serial ports will be accessible through files in
    /dev; on other systems, device names will doubtless differ. Several
    problem areas common to all device interaction are the following:

    lockfiles
        Your system may use lockfiles to control multiple access. Make sure
        you follow the correct protocol. Unpredictable behavior can result
        from multiple processes reading from one device.

    open mode
        If you expect to use both read and write operations on the device,
        you’ll have to open it for update (see "open" in perlfunc for
        details). You may wish to open it without running the risk of
        blocking by using sysopen() and "O_RDWR|O_NDELAY|O_NOCTTY" from the
        Fcntl module (part of the standard perl distribution). See "sysopen"
        in perlfunc for more on this approach.

    end of line
        Some devices will be expecting a "\r" at the end of each line rather
        than a "\n". In some ports of perl, "\r" and "\n" are different from
        their usual (Unix) ASCII values of "\012" and "\015". You may have
        to give the numeric values you want directly, using octal ("\015"),
        hex ("0x0D"), or as a control-character specification ("\cM").

                print DEV "atv1\012";   # wrong, for some devices
                print DEV "atv1\015";   # right, for some devices

        Even though with normal text files a "\n" will do the trick, there
        is still no unified scheme for terminating a line that is portable
        between Unix, DOS/Win, and Macintosh, except to terminate *ALL* line
        ends with "\015\012", and strip what you don’t need from the output.
        This applies especially to socket I/O and autoflushing, discussed
        next.

    flushing output
        If you expect characters to get to your device when you print()
        them, you’ll want to autoflush that filehandle. You can use select()
        and the $| variable to control autoflushing (see "$|" in perlvar and
        "select" in perlfunc, or perlfaq5, "How do I flush/unbuffer an
        output filehandle? Why must I do this?"):

                $oldh = select(DEV);
                $| = 1;
                select($oldh);

        You’ll also see code that does this without a temporary variable, as
        in

                select((select(DEV), $| = 1)[0]);

        Or if you don’t mind pulling in a few thousand lines of code just
        because you’re afraid of a little $| variable:

                use IO::Handle;
                DEV->autoflush(1);

        As mentioned in the previous item, this still doesn’t work when
        using socket I/O between Unix and Macintosh. You’ll need to hard
        code your line terminators, in that case.

    non-blocking input
        If you are doing a blocking read() or sysread(), you’ll have to
        arrange for an alarm handler to provide a timeout (see "alarm" in
        perlfunc). If you have a non-blocking open, you’ll likely have a
        non-blocking read, which means you may have to use a 4-arg select()
        to determine whether I/O is ready on that device (see "select" in
        perlfunc.

    While trying to read from his caller-id box, the notorious Jamie
    Zawinski "<j…@netscape.com>", after much gnashing of teeth and fighting
    with sysread, sysopen, POSIX’s tcgetattr business, and various other
    functions that go bump in the night, finally came up with this:

            sub open_modem {
                    use IPC::Open2;
                    my $stty = `/bin/stty -g`;
                    open2( \*MODEM_IN, \*MODEM_OUT, "cu -l$modem_device -s2400 2>&1");
                    # starting cu hoses /dev/tty’s stty settings, even when it has
                    # been opened on a pipe…
                    system("/bin/stty $stty");
                    $_ = <MODEM_IN>;
                    chomp;
                    if ( !m/^Connected/ ) {
                            print STDERR "$0: cu printed `$_’ instead of `Connected’\n";
                    }
            }

——————————————————————–

The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
are not necessarily experts in every domain where Perl might show up,
so please include as much information as possible and relevant in any
corrections. The perlfaq-workers also don’t have access to every
operating system or platform, so please include relevant details for
corrections to examples that do not work on particular platforms.
Working code is greatly appreciated.

If you’d like to help maintain the perlfaq, see the details in
perlfaq.pod.

posted by admin in Uncategorized and have No Comments

using cpu and ram of a group of boxes to do work with perl, mix os and hardwarer

I saw pvm, does it work?
anyone using it?

posted by admin in Uncategorized and have No Comments

FAQ 7.26 How can I find out my current package?

This is an excerpt from the latest version perlfaq7.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

——————————————————————–

7.26: How can I find out my current package?

    If you’re just a random program, you can do this to find out what the
    currently compiled package is:

            my $packname = __PACKAGE__;

    But, if you’re a method and you want to print an error message that
    includes the kind of object you were called on (which is not necessarily
    the same as the one in which you were compiled):

            sub amethod {
                    my $self  = shift;
                    my $class = ref($self) || $self;
                    warn "called me from a $class object";
                    }

——————————————————————–

The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
are not necessarily experts in every domain where Perl might show up,
so please include as much information as possible and relevant in any
corrections. The perlfaq-workers also don’t have access to every
operating system or platform, so please include relevant details for
corrections to examples that do not work on particular platforms.
Working code is greatly appreciated.

If you’d like to help maintain the perlfaq, see the details in
perlfaq.pod.

posted by admin in Uncategorized and have No Comments