[29230] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 474 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 31 16:09:50 2007

Date: Thu, 31 May 2007 13:09:08 -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           Thu, 31 May 2007     Volume: 11 Number: 474

Today's topics:
    Re: A simple way to make a code folder available as a m xhoster@gmail.com
    Re: fork() and script execution afterwards xhoster@gmail.com
    Re: How to find and replace something that is nested in <noreply@gunnar.cc>
    Re: Multiple Line Pattern Match problem <skye.shaw@gmail.com>
    Re: on my desk, as far as I can see <a24061@ducksburg.com>
    Re: on my desk, as far as I can see <ei@eio.com>
    Re: on my desk, as far as I can see barbara@bookpro.com
    Re: on my desk, as far as I can see <ei@eio.com>
        Prototypes and anonymous subroutines <baxter.brad@gmail.com>
    Re: Prototypes and anonymous subroutines (Greg Bacon)
    Re: Prototypes and anonymous subroutines <skye.shaw@gmail.com>
    Re: Prototypes and anonymous subroutines <skye.shaw@gmail.com>
    Re: Prototypes and anonymous subroutines <baxter.brad@gmail.com>
    Re: Prototypes and anonymous subroutines <baxter.brad@gmail.com>
    Re: Prototypes and anonymous subroutines <baxter.brad@gmail.com>
        reinstall perl <bohat14@yahoo.com>
    Re: stumped by graphics display problem... (Greg Bacon)
    Re: stumped by graphics display problem... <paduille.4061.mumia.w+nospam@earthlink.net>
    Re: stumped by graphics display problem... <socyl@987jk.com.invalid>
    Re: stumped by graphics display problem... <paduille.4061.mumia.w+nospam@earthlink.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 31 May 2007 16:13:06 GMT
From: xhoster@gmail.com
Subject: Re: A simple way to make a code folder available as a module
Message-Id: <20070531121307.795$Tg@newsreader.com>

Ilias Lazaridis <ilias@lazaridis.com> wrote:
> On May 24, 6:29 pm, xhos...@gmail.com wrote:
> > Ilias Lazaridis <i...@lazaridis.com> wrote:
> >
> > > a) How can I make a svn checked out folder available as a
> > > system-wide importable module (e.g. a command which adds the folder
> > > to the "perl module search path").
> >
> > run:
> > perl -le 'print "@INC"'
> >
> > And see if any of those directories look like good places to install
> > it.
>
> ok, but theres is a tiny problem.
>
> if I place my folder "mycode" into
>
> C:/Perl/site/lib
>
> C:/Perl/site/lib/mycode
>
> the "use" statements have to be corrected to start with "mycode::"
>
> How can I avoid this?

By moving the the code up a level, so it no longer sits in mycode
directory, but rather directly in site/lib.  Or, by changing mycode to
something better reflecting the nature of the code, for example your
company or department name, then just using it that way with the "::"

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: 31 May 2007 15:15:43 GMT
From: xhoster@gmail.com
Subject: Re: fork() and script execution afterwards
Message-Id: <20070531111545.141$FX@newsreader.com>

Andrew Fedyashov <andrew.fedyashov@gmail.com> wrote:
> On May 31, 5:38 pm, "Tom Storey" <t...@snnap.net> wrote:
> > [...]
> > If this is true, where I print BEGIN I could place my database code,
> > and replace the for loop with a while loop that runs through each
> > database record and forks a new child if neccessary.
> >
> > Thanks,
> > Tom
>
> what you want is just the way fork() works.

Yep.

But one thing to look out for, is that the forked children may screw up the
parent's database connection.  If the connection isn't needed after the
fork, the parent should disconnect before it forks.  It if it is needed, it
might still be best for the parent to disconnect and then reconnect after
the forks, or if that is not convenient, than setting InactiveDestroy in
the children may be necessary.  If the children themselves need
connections, they should initiate them after the fork, and *not* try to use
the one they inherited from the parent.

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: Thu, 31 May 2007 18:13:34 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: How to find and replace something that is nested inside something else?
Message-Id: <5c8amdF2vsuf5U1@mid.individual.net>

alainfri@gmail.com wrote:
> I am not sure if this group is the right place for this question but
> what I need is as follows. There is a piece of html. Throughout the
> html there are a lot of <br> tags. The task is to replace all these
> <br> tags with \n\r. The replacement must be performed only within
> <pre> blocks.

Why? I thought that <br> tags (and other html) was properly rendered 
also within <pre> tags.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: 31 May 2007 09:36:54 -0700
From: "Skye Shaw!@#$" <skye.shaw@gmail.com>
Subject: Re: Multiple Line Pattern Match problem
Message-Id: <1180629414.061436.315630@j4g2000prf.googlegroups.com>

On May 31, 7:26 am, Aukjan van Belkum <auk...@vanbelkum.no.spam.nl>
wrote:
> samuel wrote:
> > On May 31, 5:40 pm, Aukjan van Belkum <auk...@vanbelkum.no.spam.nl>
> > wrote:
> >> samuel wrote:
> >>> Hi All,
> >>> Now I need to analyze a file which is composed of several blocks ,
> >>> which is defined as below :
> >>> Start
> >>> <content>
> >>> <content>
> >>> ......
> >>> <content>
> >>> End

Maybe try:

[sshaw@localhost ~]$ cat > wakawakawaka.txt
Start
weeeee
dma
ahhhhh
irq
oooohhh its dma
End
Start
grrr
dma
End
[sshaw@localhost ~]$ perl -lne'print if !/(End|Start)/'
wakawakawaka.txt
weeeee
dma
ahhhhh
irq
oooohhh its dma
grrr
dma

> > And I need to print out both all the contents (both lines w and w/o
> > keyword dma) for the block where there are <content_with_keyword_dma>
> > there ?

For blocks with/without dma,  in either case you will  just print, so
why make the distinction?



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

Date: Thu, 31 May 2007 17:42:23 +0100
From: Adam Funk <a24061@ducksburg.com>
Subject: Re: on my desk, as far as I can see
Message-Id: <fga3j4-rme.ln1@news.ducksburg.com>

On 2003-12-02, Beable van Polasm wrote: 

> OOOPS! SORRY!
> 
> -----begin deacronymiser.pl---------------------

I hope Beable doesn't mind, but I've modified the program so it will
load the dictionary and split it up once, then process more than one
acronym in the same command, with an option to generate multiple
expansions per acronym, without reloading or resegmenting the
dictionary.

--- begin example ---
$ deacronymiser.pl -n 3 ark perl
ARK = Ablution's Recipe Kiloton's 
ARK = Aplenty Radiogram Kooking 
ARK = Announcer's Rejoinder Kazoo 
PERL = Pygmies Eve's Romano's Loped 
PERL = Philanderer Enhance Rusting Loader 
PERL = Pudgy Enthusiasm Reps Lifeworks 
--- end example ---

--- begin code ---
#!/usr/bin/perl

use strict;
use warnings;
use Getopt::Std ;

my (%option, $i, $acronym);
getopts("n:", \%option) ;

my $count = $option{n} || 1;
my %keyed_words = ();

load();

while (@ARGV > 0) {
    $acronym = shift(@ARGV);
    for ($i=0 ; $i < $count ; $i++) {
	run($acronym);
    }
}

sub load {
    my $words_file = "/usr/dict/words";
    my @words = ();
    open WORDS, "<$words_file" or die "can't open $words_file: $!";
    while(my $line = <WORDS>)
    {
        chomp $line;
        $line = lc $line;
        push @words, $line;
    }
    close WORDS or die "can't close $words_file: $!";

    my ($word, $letter);
    while(@words) {
	$word = shift(@words);
	$letter = lc(substr($word, 0, 1));
	push( @{$keyed_words{$letter}}, $word );
    }
}


sub run
{
    my $acronym = shift;

    $acronym = lc $acronym;
    my @letters = split //, $acronym;

    print uc $acronym, " = ";
    while (my $letter = shift @letters)
    {
        next if $letter !~ m/[a-z]/;
	
	my @match_words = @{$keyed_words{$letter}};
        my $word = @match_words[rand(@match_words)];
        print ucfirst $word, " ";
    }
    print "\n";
}
--- end code ---


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

Date: Thu, 31 May 2007 13:08:39 -0400
From: "Otto Bahn" <ei@eio.com>
Subject: Re: on my desk, as far as I can see
Message-Id: <f3mveo$96l$1@gargoyle.oit.duke.edu>

"Adam Funk" <a24061@ducksburg.com> wrote 

> > OOOPS! SORRY!
> > 
> > -----begin deacronymiser.pl---------------------
> 
> I hope Beable doesn't mind, but I've modified the program so it will
> load the dictionary and split it up once, then process more than one
> acronym in the same command, with an option to generate multiple
> expansions per acronym, without reloading or resegmenting the
> dictionary.
> 
> --- begin example ---
> $ deacronymiser.pl -n 3 ark perl
> ARK = Ablution's Recipe Kiloton's 
> ARK = Aplenty Radiogram Kooking 
> ARK = Announcer's Rejoinder Kazoo 
> PERL = Pygmies Eve's Romano's Loped 
> PERL = Philanderer Enhance Rusting Loader 
> PERL = Pudgy Enthusiasm Reps Lifeworks 
> --- end example ---
> 
> --- begin code ---
> #!/usr/bin/perl
> 
> use strict;
> use warnings;
> use Getopt::Std ;
> 
> my (%option, $i, $acronym);
> getopts("n:", \%option) ;
> 
> my $count = $option{n} || 1;
> my %keyed_words = ();
> 
> load();
> 
> while (@ARGV > 0) {
>     $acronym = shift(@ARGV);
>     for ($i=0 ; $i < $count ; $i++) {
> run($acronym);
>     }
> }
> 
> sub load {
>     my $words_file = "/usr/dict/words";
>     my @words = ();
>     open WORDS, "<$words_file" or die "can't open $words_file: $!";
>     while(my $line = <WORDS>)
>     {
>         chomp $line;
>         $line = lc $line;
>         push @words, $line;
>     }
>     close WORDS or die "can't close $words_file: $!";
> 
>     my ($word, $letter);
>     while(@words) {
> $word = shift(@words);
> $letter = lc(substr($word, 0, 1));
> push( @{$keyed_words{$letter}}, $word );
>     }
> }
> 
> 
> sub run
> {
>     my $acronym = shift;
> 
>     $acronym = lc $acronym;
>     my @letters = split //, $acronym;
> 
>     print uc $acronym, " = ";
>     while (my $letter = shift @letters)
>     {
>         next if $letter !~ m/[a-z]/;
> 
> my @match_words = @{$keyed_words{$letter}};
>         my $word = @match_words[rand(@match_words)];
>         print ucfirst $word, " ";
>     }
>     print "\n";
> }
> --- end code ---

Nope, no geeks on ARK.  No siree Bob.

--oTTo--


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

Date: Thu, 31 May 2007 14:22:35 -0400
From: barbara@bookpro.com
Subject: Re: on my desk, as far as I can see
Message-Id: <0e4u53pevm1tgu6nl1rhrq3nc2fmfg9gua@4ax.com>

On Thu, 31 May 2007 13:08:39 -0400, "Otto Bahn" <ei@eio.com> wrote:

>"Adam Funk" <a24061@ducksburg.com> wrote 
>
>> > OOOPS! SORRY!
>> > 
>> > -----begin deacronymiser.pl---------------------
>> 
>> I hope Beable doesn't mind, but I've modified the program so it will
>> load the dictionary and split it up once, then process more than one
>> acronym in the same command, with an option to generate multiple
>> expansions per acronym, without reloading or resegmenting the
>> dictionary.
>> 
>> --- begin example ---
>> $ deacronymiser.pl -n 3 ark perl
>> ARK = Ablution's Recipe Kiloton's 
>> ARK = Aplenty Radiogram Kooking 
>> ARK = Announcer's Rejoinder Kazoo 
>> PERL = Pygmies Eve's Romano's Loped 
>> PERL = Philanderer Enhance Rusting Loader 
>> PERL = Pudgy Enthusiasm Reps Lifeworks 
>> --- end example ---
>> 
>> --- begin code ---
>> #!/usr/bin/perl
>> 
>> use strict;
>> use warnings;
>> use Getopt::Std ;
>> 
>> my (%option, $i, $acronym);
>> getopts("n:", \%option) ;
>> 
>> my $count = $option{n} || 1;
>> my %keyed_words = ();
>> 
>> load();
>> 
>> while (@ARGV > 0) {
>>     $acronym = shift(@ARGV);
>>     for ($i=0 ; $i < $count ; $i++) {
>> run($acronym);
>>     }
>> }
>> 
>> sub load {
>>     my $words_file = "/usr/dict/words";
>>     my @words = ();
>>     open WORDS, "<$words_file" or die "can't open $words_file: $!";
>>     while(my $line = <WORDS>)
>>     {
>>         chomp $line;
>>         $line = lc $line;
>>         push @words, $line;
>>     }
>>     close WORDS or die "can't close $words_file: $!";
>> 
>>     my ($word, $letter);
>>     while(@words) {
>> $word = shift(@words);
>> $letter = lc(substr($word, 0, 1));
>> push( @{$keyed_words{$letter}}, $word );
>>     }
>> }
>> 
>> 
>> sub run
>> {
>>     my $acronym = shift;
>> 
>>     $acronym = lc $acronym;
>>     my @letters = split //, $acronym;
>> 
>>     print uc $acronym, " = ";
>>     while (my $letter = shift @letters)
>>     {
>>         next if $letter !~ m/[a-z]/;
>> 
>> my @match_words = @{$keyed_words{$letter}};
>>         my $word = @match_words[rand(@match_words)];
>>         print ucfirst $word, " ";
>>     }
>>     print "\n";
>> }
>> --- end code ---
>
>Nope, no geeks on ARK.  No siree Bob.

Yay, you proved that the person who said there are no geeks on ARK was
wrong wrong wrongety wrong!

Nobody said that, of course.  

But just in case anyone ever does, Goggle will have archived your
valuable proof to the contrary.

BW


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

Date: Thu, 31 May 2007 14:58:54 -0400
From: "Otto Bahn" <ei@eio.com>
Subject: Re: on my desk, as far as I can see
Message-Id: <f3n5tf$cgt$1@gargoyle.oit.duke.edu>

<barbara@bookpro.com> wrote 

> >Nope, no geeks on ARK.  No siree Bob.
> 
> Yay, you proved that the person who said there are no geeks on ARK was
> wrong wrong wrongety wrong!

And, of course, Adam totally misjudged his audience just
like I did.  Either that or you are unobservant.

--oTTo--


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

Date: 31 May 2007 08:51:39 -0700
From: Brad Baxter <baxter.brad@gmail.com>
Subject: Prototypes and anonymous subroutines
Message-Id: <1180626699.280974.311520@w5g2000hsg.googlegroups.com>

In the synopsis of perlsub, it says the following:

       To define an anonymous subroutine at runtime:

           $subref = sub BLOCK;                 # no proto
           $subref = sub (PROTO) BLOCK;         # with proto
           $subref = sub : ATTRS BLOCK;         # with attributes
           $subref = sub (PROTO) : ATTRS BLOCK; # with proto and
attributes

Then later is this:

       Prototypes

       Perl supports a very limited kind of compile-time argument
       checking using function prototyping.  If you declare

           sub mypush (\@@)

       then "mypush()" takes arguments exactly like "push()"
       does.  The function declaration must be visible at compile
       time.  The prototype affects only interpretation of new-
       style calls to the function, where new-style is defined as
       not using the "&" character.  In other words, if you call
       it like a built-in function, then it behaves like a built-
       in function.  If you call it like an old-fashioned subrou-
       tine, then it behaves like an old-fashioned subroutine.
       It naturally falls out from this rule that prototypes have
       no influence on subroutine references like "\&foo" or on
       indirect subroutine calls like "&{$subref}" or "$sub-
       ref->()".

That last sentence seems somewhat contradictory to the
synopsis, because if prototypes have no influence on indirect
subroutine calls, then why be able to define them for anonymous
subroutines?  For example:

> perl -le'sub n($$){print@_};n(1,2)'
12
 ... as expected

> perl -le'sub n($){print@_};n(1,2)'
Too many arguments for main::n at -e line 1, at end of line
 ... as expected

> perl -le'$an=sub ($$){print@_};$an->(1,2)'
12
 ... as expected

> perl -le'$an=sub ($){print@_};$an->(1,2)'
12
 ... expected an error, but prototype ignored?

> perl -le'sub n(\@){print$_[0][0]};n([1,2])'
Type of arg 1 to main::n must be array (not single ref constructor) at
-e line 1, at end of line
 ... as expected

> perl -le'$an=sub (\@){print$_[0][0]};$an->([1,2])'
1
 ... prototype ignored


So a couple of questions:

1. If prototypes are ignored for anonymous subroutines,
why be able to define them?

2. Am I missing a calling convention that does not ignore
them?

--
Brad



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

Date: Thu, 31 May 2007 16:27:43 -0000
From: gbacon@hiwaay.net (Greg Bacon)
Subject: Re: Prototypes and anonymous subroutines
Message-Id: <135ttrva77fe72a@corp.supernews.com>

In article <1180626699.280974.311520@w5g2000hsg.googlegroups.com>,
    Brad Baxter  <baxter.brad@gmail.com> wrote:

: So a couple of questions:
:
: 1. If prototypes are ignored for anonymous subroutines,
: why be able to define them?

You can make them work (see below), but maybe it was a speculative
development path that deadended.
 
: 2. Am I missing a calling convention that does not ignore
: them?

It's ugly, but consider

    $ perl -le 'BEGIN { *n = sub ($) { print @_ } } n(1,2)'
    Too many arguments for main::n at -e line 1, at end of line
    Execution of -e aborted due to compilation errors.

Greg
-- 
I couldn't believe it.  My book was used to define the ultimate geek, and
suddenly my son thinks I'm really cool.
    -- W. Richard Stevens on Garth carrying UNP in Wayne's World


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

Date: 31 May 2007 10:02:32 -0700
From: "Skye Shaw!@#$" <skye.shaw@gmail.com>
Subject: Re: Prototypes and anonymous subroutines
Message-Id: <1180630952.686548.27750@d30g2000prg.googlegroups.com>

On May 31, 9:27 am, gba...@hiwaay.net (Greg Bacon) wrote:
> In article <1180626699.280974.311...@w5g2000hsg.googlegroups.com>,
>     Brad Baxter  <baxter.b...@gmail.com> wrote:
>
> : So a couple of questions:
> :
> : 1. If prototypes are ignored for anonymous subroutines,
> : why be able to define them?

Why bother defining them?

> : 2. Am I missing a calling convention that does not ignore
> : them?

I believe it it because prototyping is a compile time feature. The
anonymous subroutines examples you provided are assignment statements,
and therefore get evaluated at runtime.




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

Date: 31 May 2007 10:05:50 -0700
From: "Skye Shaw!@#$" <skye.shaw@gmail.com>
Subject: Re: Prototypes and anonymous subroutines
Message-Id: <1180631150.173023.115010@o11g2000prd.googlegroups.com>

On May 31, 9:27 am, gba...@hiwaay.net (Greg Bacon) wrote:
> In article <1180626699.280974.311...@w5g2000hsg.googlegroups.com>,
>     Brad Baxter  <baxter.b...@gmail.com> wrote:
>
> : So a couple of questions:
> :
> : 1. If prototypes are ignored for anonymous subroutines,
> : why be able to define them?
>
> You can make them work (see below), but maybe it was a speculative
> development path that deadended.
>
> : 2. Am I missing a calling convention that does not ignore
> : them?
>
> It's ugly, but consider
>
>     $ perl -le 'BEGIN { *n = sub ($) { print @_ } } n(1,2)'
>     Too many arguments for main::n at -e line 1, at end of line
>     Execution of -e aborted due to compilation errors.
>

Hummm... BEGIN{} forces compile time evaluation, so the prototype is
evaluated in this case.



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

Date: 31 May 2007 11:21:02 -0700
From: Brad Baxter <baxter.brad@gmail.com>
Subject: Re: Prototypes and anonymous subroutines
Message-Id: <1180635662.922595.317040@h2g2000hsg.googlegroups.com>

On May 31, 12:27 pm, gba...@hiwaay.net (Greg Bacon) wrote:
> In article <1180626699.280974.311...@w5g2000hsg.googlegroups.com>,
>     Brad Baxter  <baxter.b...@gmail.com> wrote:
>
> : So a couple of questions:
> :
> : 1. If prototypes are ignored for anonymous subroutines,
> : why be able to define them?
>
> You can make them work (see below), but maybe it was a speculative
> development path that deadended.
>
> : 2. Am I missing a calling convention that does not ignore
> : them?
>
> It's ugly, but consider
>
>     $ perl -le 'BEGIN { *n = sub ($) { print @_ } } n(1,2)'
>     Too many arguments for main::n at -e line 1, at end of line
>     Execution of -e aborted due to compilation errors.

Ah, very interesting.  Carried further (for no reason other than
curiosity), I see

> perl -le 'BEGIN { $an = sub ($) { print @_ }; *n=\&$an } n(1,2)'
Too many arguments for main::n at -e line 1, at end of line
Execution of -e aborted due to compilation errors.

> perl -le 'BEGIN { $an = sub ($) { print @_ } } *n=\&$an; n(1,2)'
12

--
Brad



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

Date: 31 May 2007 11:26:33 -0700
From: Brad Baxter <baxter.brad@gmail.com>
Subject: Re: Prototypes and anonymous subroutines
Message-Id: <1180635993.166312.154610@p47g2000hsd.googlegroups.com>

On May 31, 1:02 pm, "Skye Shaw!@#$" <skye.s...@gmail.com> wrote:
> On May 31, 9:27 am, gba...@hiwaay.net (Greg Bacon) wrote:
>
> > In article <1180626699.280974.311...@w5g2000hsg.googlegroups.com>,
> >     Brad Baxter  <baxter.b...@gmail.com> wrote:
>
> > : So a couple of questions:
> > :
> > : 1. If prototypes are ignored for anonymous subroutines,
> > : why be able to define them?
>
> Why bother defining them?

Why bother documenting them?  :-)

Which was the point I was working around to: if it's not
a feature that can be reasonably used, perhaps it shouldn't
be quite so prominently featured in the docs.  As Greg
mentioned, it may have been intended to work more simply
for anonymous subs, but then dropped.

Cheers,

--
Brad



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

Date: 31 May 2007 12:02:53 -0700
From: Brad Baxter <baxter.brad@gmail.com>
Subject: Re: Prototypes and anonymous subroutines
Message-Id: <1180638172.976989.74830@p77g2000hsh.googlegroups.com>

On May 31, 2:21 pm, Brad Baxter <baxter.b...@gmail.com> wrote:
> > perl -le 'BEGIN { $an = sub ($) { print @_ }; *n=\&$an } n(1,2)'
>
> Too many arguments for main::n at -e line 1, at end of line
> Execution of -e aborted due to compilation errors.
>
> > perl -le 'BEGIN { $an = sub ($) { print @_ } } *n=\&$an; n(1,2)'
>
> 12

Of course, I meant:

> perl -le 'my $an; BEGIN { $an = sub ($) { print @_ }; *n=$an } n(1,2)'
Too many arguments for main::n at -e line 1, at end of line
> perl -le 'my $an;BEGIN { $an = sub ($) { print @_ } } *n=$an; n(1,2)'
12

--
Brad



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

Date: 31 May 2007 10:21:08 -0700
From: JonL <bohat14@yahoo.com>
Subject: reinstall perl
Message-Id: <1180632068.250832.149930@p77g2000hsh.googlegroups.com>

We have decided to reinstall perl 5.8.8 on our solaris 5.10 boxes.
This task has fallen in my lap and I have rebuilt core perl and all
the necessary modules in a local test directory using sh Configure -de
-Dprefix = /home/aardxx/perl.
Having tested the whole load I am now ready to "move" it to /usr/
perl588.  My understanding is that core perl has compiled into it the
@INC table and I notice that /home/aardxx prefix is scattered all
through the various files in the installation directory.
I realize that I will need to rebuild the cor perl using the prefix /
usr/perl588 but is there are way of moving the modules over uithout
recompiling them?  Might I be able to mod the config.sh then do a make
install?  Guess I'm looking for a few shortcuts. Any ideas would be
appreciated



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

Date: Thu, 31 May 2007 16:36:11 -0000
From: gbacon@hiwaay.net (Greg Bacon)
Subject: Re: stumped by graphics display problem...
Message-Id: <135tubrqoinq80b@corp.supernews.com>

In article <f3mk0m$e36$1@reader2.panix.com>,
    kj  <socyl@987jk.com.invalid> wrote:

: [...]
:     # display won't happen without this line!
:     close $IMG;
: 
:     ### script stalls before executing the next line

The perlfunc(1) manpage's section on the close operator makes the
following note: "Closing a pipe also waits for the process executing
on the pipe to complete . . ."

Hope this helps,
Greg
-- 
War is no longer merely a crime; it is an absurdity.  It is no longer
merely immoral and cruel; it is stupid.  It is no longer merely murder
on a large scale; it is suicide and voluntary ruin.
    -- Frederic Passy


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

Date: Thu, 31 May 2007 17:42:44 GMT
From: "Mumia W." <paduille.4061.mumia.w+nospam@earthlink.net>
Subject: Re: stumped by graphics display problem...
Message-Id: <oOD7i.11968$296.7986@newsread4.news.pas.earthlink.net>

On 05/31/2007 08:53 AM, kj wrote:
> [...]
>     open my $IMG, '|-', 'display';
>     print $IMG $gd->png;
> 
>     # display won't happen without this line!
>     close $IMG;
> 
>     ### script stalls before executing the next line
> 
>     print "Press any key to continue... ";
>     ReadMode 'cbreak';
>     ReadKey( 0 );
>     ReadMode 'normal';
>     print "\n";
>   }
> [...]

The method used to remotely display X programs is different from the 
method used to remotely display console programs, and Term::ReadKey 
doesn't have internal support for remote displays.

Trying to mix console type user-interaction with graphical 
user-interaction will confound you. It's best just to make your program 
fully graphical with one of the toolkits available: Gtk, Perl-Tk, etc.



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

Date: Thu, 31 May 2007 18:09:38 +0000 (UTC)
From: kj <socyl@987jk.com.invalid>
Subject: Re: stumped by graphics display problem...
Message-Id: <f3n312$evg$1@reader2.panix.com>

In <oOD7i.11968$296.7986@newsread4.news.pas.earthlink.net> "Mumia W." <paduille.4061.mumia.w+nospam@earthlink.net> writes:

>On 05/31/2007 08:53 AM, kj wrote:
>> [...]
>>     open my $IMG, '|-', 'display';
>>     print $IMG $gd->png;
>> 
>>     # display won't happen without this line!
>>     close $IMG;
>> 
>>     ### script stalls before executing the next line
>> 
>>     print "Press any key to continue... ";
>>     ReadMode 'cbreak';
>>     ReadKey( 0 );
>>     ReadMode 'normal';
>>     print "\n";
>>   }
>> [...]

>The method used to remotely display X programs is different from the 
>method used to remotely display console programs, and Term::ReadKey 
>doesn't have internal support for remote displays.

>Trying to mix console type user-interaction with graphical 
>user-interaction will confound you. It's best just to make your program 
>fully graphical with one of the toolkits available: Gtk, Perl-Tk, etc.

There's no shortage of fully graphical programs for viewing PNG
files, but what I need is a viewer that I can control *entirely*
from the keyboard.  Are you saying that this would be too difficult
to program?

kj
-- 
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.


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

Date: Thu, 31 May 2007 18:33:19 GMT
From: "Mumia W." <paduille.4061.mumia.w+nospam@earthlink.net>
Subject: Re: stumped by graphics display problem...
Message-Id: <PxE7i.21027$3P3.12865@newsread3.news.pas.earthlink.net>

On 05/31/2007 12:42 PM, Mumia W. wrote:
> [...]
> Trying to mix console type user-interaction with graphical 
> user-interaction will confound you [....]

And me too. Mr. Bacon's comment is correct. The user must close 
'display' before your program continues.

However, I would still avoid using both Term::ReadKey and X11 to 
interact with the same user.



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

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:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#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 474
**************************************


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