[22881] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5102 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 10 11:06:16 2003

Date: Tue, 10 Jun 2003 08:05:07 -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, 10 Jun 2003     Volume: 10 Number: 5102

Today's topics:
    Re: Building Threaded List of Newsgroup Headers <cpryce@pryce.net>
        Do yu know abetter way to do it ? <beaudet@cyber.kodak.com>
    Re: How to I arrange for a socket connection to time ou <mothra@nowhereatall.com>
        need the ascii set for arrow down (gerrym)
        Pb with characters and blanks... <beaudet@cyber.kodak.com>
    Re: Pb with characters and blanks... <noreply@gunnar.cc>
    Re: Pb with characters and blanks... <beaudet@cyber.kodak.com>
    Re: Pb with characters and blanks... news@roaima.freeserve.co.uk
    Re: Perl CGI and Downloading Files - How? <flavell@mail.cern.ch>
    Re: Perl CGI and Downloading Files - How? 10ghz@radiate.com
    Re: Perl CGI and Downloading Files - How? <nobull@mail.com>
        Returning a database array from a class <makemineaschripple@houseofbooze.com>
    Re: Returning a database array from a class <nobull@mail.com>
    Re: Returning a database array from a class <makemineaschripple@houseofbooze.com>
        setting screen size with Net::Telnet and Term::VT102 (Golem)
    Re: SORT  sort hash with alpha-numeric keys (John D)
    Re: Unusual Can't load fail (web only) <Mike@Army.ca>
    Re: Unusual Can't load fail (web only) <Mike@Army.ca>
    Re: Unusual Can't load fail (web only) (Randy Kobes)
        virtual x server for Tk <chip@NO-Spam-afcoms.com>
    Re: Win32::ListView  sample please?? <mothra@nowhereatall.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 10 Jun 2003 09:05:17 -0500
From: cp <cpryce@pryce.net>
Subject: Re: Building Threaded List of Newsgroup Headers
Message-Id: <100620030905178608%cpryce@pryce.net>

In article <3EE54BB6.175A78CE@hotpop.com>, Benjamin Goldberg
<ben.goldberg@hotpop.com> wrote:

> Unless *all* your messages that are referred to are still in existance
> (they might not be, due to them expiring), there's a good chance that
> $child at some point will become undef, and your program will die.

A good point, and I was going to address it with error checking the
value that was being shifted off of @moms. Your way is better. Thanks.
> 
> I would suggest that the inside of that if() block become:
> 
[ snip ]
> 
> Or, possibly:
> 
>          my $child = \$msg_list;
>          $child = \$$child->{$_}{kids} for @moms;
>          $$child->{$id} = $message;

The alternative that I chose. Hopefully my test suite is complete
enough, as this seems to serve the purpose. Again, thanks for reviewing
the code.

-- 
cp


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

Date: Tue, 10 Jun 2003 15:33:55 +0200
From: Jean-Luc BEAUDET <beaudet@cyber.kodak.com>
Subject: Do yu know abetter way to do it ?
Message-Id: <3EE5DE43.603@cyber.kodak.com>

Hi all,

I've got smth like

$search_pattern = $d7tt[0]." ".$d7tt[2]." ".(sprintf '% 2s', $d7tt[1]);
if ($read_line =~ m/^$search_pattern \d{2}:\d{2}:\d{2} MEST 2003/) {
 ../..
}

Is there a better way to write
 \d{2}:\d{2}:\d{2} # for time format to be detected

Or better to affect $search_pattern the whole pattern to be match so 
that i can write:

if ($read_line =~ m/$search_patern/ {
 ../..
}

Than you for yur help.

Regards.

Jean-Luc B :O)



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

Date: Tue, 10 Jun 2003 06:23:58 -0700
From: "Mothra" <mothra@nowhereatall.com>
Subject: Re: How to I arrange for a socket connection to time out?
Message-Id: <3ee5da59@usenet.ugs.com>

Hi John,

"John Brock" <jbrock@panix.com> wrote in message
news:bc2klt$sb6$1@panix1.panix.com...
> In article <3EE4CCDA.8060103@dev.null>,
> Andras Malatinszky  <nobody@dev.null> wrote:
> >
> >
> >John Brock wrote:
> >
[snipped]

> I looked at alarm() initally, but I rejected it because it wasn't
> clear that it would work properly on NT (it "sends a SIGALRM signal
> to the current process after EXPR seconds" -- will that work on
> NT?), and because it would be nice to have finer granularity than

As of perl 5.8.0 alarm is supported and it does work on NT

Hope this helps

Mothra




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

Date: 10 Jun 2003 05:30:57 -0700
From: gerard.maloney@intel.com (gerrym)
Subject: need the ascii set for arrow down
Message-Id: <e43d74e5.0306100430.70c8b90f@posting.google.com>

Hello 
I have aq ascii menu on a linux box which uses the arrow up and down
to nagivate the menus.
I want to automate it using Perl Expect.pm, but I cannot find the
character set I need to send.

Anyone come across a table of these before.


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

Date: Tue, 10 Jun 2003 12:10:35 +0200
From: Jean-Luc BEAUDET <beaudet@cyber.kodak.com>
Subject: Pb with characters and blanks...
Message-Id: <3EE5AE9B.4060402@cyber.kodak.com>

Hi all,

I've got a little pb concerning date converted fields.

My log files are like this:
Fri May 23 22:53:41 MEST 2003 .....
 ../..
Tue Jun  3 22:53:43 MEST 2003 ......

I'm building a pattern by extracting fields from a date cmd and can 
obtain smth like
"Fri", "23", "May".
In my log files, everything is OK when i'm parsing BUT for all the date 
between 1 and 9 of each month,
i'm getting smth like "Tue", "3", "Jun".

As yu can see the "3" is not the same as " 3" like in my log file 
assuming i'm parsing with the entire string built like below:
$date_pattern = $d7tt[0]." ".$d7tt[2]." ".$d7tt[1]

Does someone knows about how to convert automatically string "3" in " 3" 
and keep "10" unchanged ?

I tried with smth like pack ("A2", $string) but it seems that added 
spaces are trailing ones and not leading ones...

This is my limit aknowledgement in Perl, for the moment.

Thxs for yur help.

Regards.

Jean-Luc B :O)
 






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

Date: Tue, 10 Jun 2003 12:32:39 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Pb with characters and blanks...
Message-Id: <bc4c4r$e0rud$1@ID-184292.news.dfncis.de>

Jean-Luc BEAUDET wrote:
> Does someone knows about how to convert automatically string "3" in
> " 3" and keep "10" unchanged ?

     $formated_string = sprintf '% 2s', $string;

/ Gunnar

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



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

Date: Tue, 10 Jun 2003 12:45:52 +0200
From: Jean-Luc BEAUDET <beaudet@cyber.kodak.com>
Subject: Re: Pb with characters and blanks...
Message-Id: <3EE5B6E0.6070605@cyber.kodak.com>

OK, gunnar.

Thx. It works like usual :O)


Gunnar Hjalmarsson wrote:

> Jean-Luc BEAUDET wrote:
>
>> Does someone knows about how to convert automatically string "3" in
>> " 3" and keep "10" unchanged ?
>
>
>     $formated_string = sprintf '% 2s', $string;
>
> / Gunnar
>



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

Date: Tue, 10 Jun 2003 13:27:11 +0100
From: news@roaima.freeserve.co.uk
Subject: Re: Pb with characters and blanks...
Message-Id: <vdvgr-hru.ln1@moldev.cmagroup.co.uk>

Jean-Luc BEAUDET <beaudet@cyber.kodak.com> wrote:
> Does someone knows about how to convert automatically string "3" in " 3" 
> and keep "10" unchanged ?

printf "%2s", "3" ## or $string = sprintf "%2s", "3"

Chris
-- 
@s=split(//,"Je,\nhn ersloak rcet thuarP");$k=$l=@s;for(;$k;$k--){$i=($i+1)%$l
until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}


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

Date: Tue, 10 Jun 2003 12:05:35 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Perl CGI and Downloading Files - How?
Message-Id: <Pine.LNX.4.53.0306101204400.27642@lxplus006.cern.ch>

On Tue, Jun 10, 10ghz@radiate.com inscribed on the eternal scroll:

> Funny, I have 99% of it coded in Perl already.

So you don't think you have a problem.  Fine, but it still looks to me
like a case of premature closure.

Bye



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

Date: Tue, 10 Jun 2003 10:24:16 GMT
From: 10ghz@radiate.com
Subject: Re: Perl CGI and Downloading Files - How?
Message-Id: <b9cbev8f50qh56uiug2hgf8gg21a141i76@4ax.com>

On Tue, 10 Jun 2003 12:05:35 +0200, "Alan J. Flavell" <flavell@mail.cern.ch>
wrote:

>On Tue, Jun 10, 10ghz@radiate.com inscribed on the eternal scroll:
>
>> Funny, I have 99% of it coded in Perl already.
>
>So you don't think you have a problem.  Fine, but it still looks to me
>like a case of premature closure.

How so?



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

Date: 10 Jun 2003 13:03:27 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Perl CGI and Downloading Files - How?
Message-Id: <u98ysaywa8.fsf@wcl-l.bham.ac.uk>

10ghz@radiate.com writes:

> On Mon, 9 Jun 2003 23:52:07 +0200, "Alan J. Flavell" <flavell@mail.cern.ch>
> wrote:
> 
> > You still haven't provided any reason for this profligate waste of
> > resources, however.
> 
> I just didn't want to confuse anyone with erroneous information.

So, just to be clear, you are saying your reason for not giving your
reasons for wanting to do this is because you knew those reasons were
erroneous?

> I want Users of my software to get file updates only through the Perl script and
> no other way. This way the script can automatically check their versions, give
> tips, tell them special information, and perform tracking. There are many
> reasons for them to have to go through the script to get file updates.
> 
> >There are far more efficient ways of applying access controls, if
> >that's what you wanted to do, than to have a CGI script laboriously
> >copying their contents.
> 
> Which brings us back to my original question:  "Using Perl, what is the best way
> to distribute a file while applying access controls so the User has to use the
> Perl script to get those files".

Use a print statement (in CGI) or alter the request object and them passing it
down the handler chain (in mod_perl).

Using CGI the best way is to make the CGI script's response be an
internal redirect to a web location that is accessible only via
internal redirects.  This is, of course, totally independant of the
language in which the CGI script is written.

The way for a CGI script written in Perl to send a response is to use
a print statement, hense my answer above.

The format of an internal redirect CGI response and how to configure
your web server so that some location can only be accessed this way
are not Perl specific.  The simplest way is simple obscurity - since
the end user never sees the "real" URL just make it a really obscure
one.  You also need to be sure your web server is not configured to
put "helpfull" Content-location headers on entities located via
interal redirect.

If you are in mod_perl then you can use a slightly different approach
which I won't go into because I'd have to RTFM.

This question is typically asked and answered here at least once a
month.  Every time the asker refueses to accept that they are asing
the wrong question and asking it in the wrong place. If you think we
are a bit sarcastic and jaded I suggest you go look back at the
history of this question in this newsgroup so that you can see it
through our eyes.

I think it's probably asked and answered quite often in newsgroups
where it is on-topic - although I know I've answered it less in CIWAC.
Of course when I do answer this question in CIWAC I'm less jaded and
sarcastic - because there I'm answering an on-topic question.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 10 Jun 2003 11:17:49 +0100
From: "Resident Drunk" <makemineaschripple@houseofbooze.com>
Subject: Returning a database array from a class
Message-Id: <bc4b2u$f2r2u$1@ID-83104.news.dfncis.de>

Hi all,

I have been using mod_perl to retrieve a single row of data from an array
using

sub handler {
    my $r = shift;
    .......
    my $foo= path::to::model->new(ID => "$bar");
    $view_data{'foobar'} = $foo->view;
    ....
    [process it using template toolkit]
}

and then in the model:

sub new {
    my $class = shift;
    [connect to dabase - load row into $self->{'a'} and $self->{'b'}]
    return $self;
}

sub view {
    return shift;
}


My question is - could someone please show me a sample method(s) to perform
a multi-row select in the method and return the array to the controller ?.

i.e. - something like :

    my $foo= path::to::model->getAllEmployees(DEPT => "$bar"); <- sets up a
multi-row select
    @view_data{'EmployeeList'} = $foo->view; <- How do I get to the data ?



Thanks in advance





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

Date: 10 Jun 2003 12:36:44 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Returning a database array from a class
Message-Id: <u9d6hmyxir.fsf@wcl-l.bham.ac.uk>

"Resident Drunk" <makemineaschripple@houseofbooze.com> writes:

> I have been using mod_perl to retrieve a single row of data from an array
> using
> 
> sub handler {
>     my $r = shift;
>     .......
>     my $foo= path::to::model->new(ID => "$bar");
>     $view_data{'foobar'} = $foo->view;
>     ....
>     [process it using template toolkit]
> }
> 
> and then in the model:
> 
> sub new {
>     my $class = shift;
>     [connect to dabase - load row into $self->{'a'} and $self->{'b'}]
>     return $self;
> }
> 
> sub view {
>     return shift;
> }
> 
> 
> My question is - could someone please show me a sample method(s) to perform
> a multi-row select in the method and return the array to the controller ?.

You appear not to have partitioned your problem.

What is your question?

Is it FAQ: "How can I pass/return a {Function, FileHandle, Array,
Hash, Method, Regex}?"?

Where do you think classes come into this?  Returning data from a
method is just like returning data from any other subroutine.

Is your question about the database interface you are using?  If so
what database interface are you using?

If you are asking about your database interface and the database
interface is DBI you are probably looking for the selectcol_arryref or
selectall_arrayref methods.

Where do you think mod_perl comes into this?  mod_perl is a means of
integrating Perl with the Apache HTTPD.  It doesn't have much to do
with database access (except that Apache::DBI will make DBI connections
persist).

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 10 Jun 2003 13:57:06 +0100
From: "Resident Drunk" <makemineaschripple@houseofbooze.com>
Subject: Re: Returning a database array from a class
Message-Id: <bc4kdm$f5mpi$1@ID-83104.news.dfncis.de>

"Brian McCauley" <nobull@mail.com> wrote in message
news:u9d6hmyxir.fsf@wcl-l.bham.ac.uk...
> "Resident Drunk" <makemineaschripple@houseofbooze.com> writes:
>

> Where do you think classes come into this?  Returning data from a
> method is just like returning data from any other subroutine.
>
> Is your question about the database interface you are using?  If so
> what database interface are you using?
>
> If you are asking about your database interface and the database
> interface is DBI you are probably looking for the selectcol_arryref or
> selectall_arrayref methods.
>
> Where do you think mod_perl comes into this?  mod_perl is a means of
> integrating Perl with the Apache HTTPD.  It doesn't have much to do
> with database access (except that Apache::DBI will make DBI connections
> persist).

Excuse my terminology - I come from a J2EE background & I am more used to
talking about MVC (which is actually what I am trying to mimic).

I will try to be more precise.

I have a package which contains the following

A model (which is what I meant by class)

-- If I have a table containing dept_key, dept_desc, dept_employee_count and
I want a single dept from dept key I would use :

#use strict;
sub new {
    my $class = shift;
    my %args = @_;
    my $self;
    $self = bless {}, $class;
    my $dept_key= $args{'DEPT_KEY'};
    $self->{'dept_desc'} = undef;
    $self->{'dept_employee_count'} = undef;

    #
    # Get row from database and assign it like this
       $self->{'dept_desc'} = $r_row->[0];
       $self->{'dept_employee_count'} = $r_row->[1];


    return $self;
}

sub view {
    # the object itself will work for the view
    return shift;
}
##################
A Handler (which I have refered to as the controller)

sub handler {
 ......
     my $deptClass = MyOrg::Model::Dept->new(DEPT_KEY => "$foo");
     my $dept = $deptClass->view();
 ......
}
###################

I have the above working, what I want to do now is have a subroutine (and I
would like advice on where to place this) that returns all the rows in the
dept table in a structured array so I could access them with something like
(and apologies if incorrect syntax)

my @biglistofdepts = $deptClass->returnAll(); # < This would be a subroutine
in my model
foreach $dept (@biglistofdepts)
{
    print "Name = ", $dept->{'dept_desc'}, " Employees = ",
$dept->{'dept_employee_count'},"\n";
}


So my question is - what would the returnAll() subroutine look like (ignoing
db stuff) and how do I reference $dept->{'dept_desc'},
$dept->{'dept_employee_count'} in the returned array ?.

Thanks




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

Date: 10 Jun 2003 05:38:06 -0700
From: golemlist@hotmail.com (Golem)
Subject: setting screen size with Net::Telnet and Term::VT102
Message-Id: <3c8073a1.0306100438.7fd1d098@posting.google.com>

Hello,
I'm trying to script a cicsterm call to a transaction through a telnet
session to an AIX box (yuk).
The problem is the cicsterm command if called from a Net::Telnet
script quits out saying "minimum screen size of 25 rows by 80 coloumns
is required".
(the command works in a sort of graphical, mode , emulating a 3210
host connection).
I tried Term::ANSIScreen to send through the telnet a setmode(2) ,
which means ANSII codes for my terminal is 80x25.
but it didn't work.
I tried setting the TERM env both to vt100 and ansii but that's not
enough.
I found this Term:VT102 but unluckly I can't manage to use it properly
with Net::Telnet....
does anyone has a sample script to provide? (All my attempts to adapt
the example script included in the module failed )
This is the script I'm trying
(I'm using cicsterm with -A option, which should handle most terms)
-----------------

#!/usr/local/bin/perl
use Net::Telnet qw(TELOPT_TTYPE);
use Term::VT102;




#####
$username="xxx";
$passwd="xxx";
$server="10.52.36.17";
$logfile="script.log";
######

   $t = new Net::Telnet (Timeout => 10);
   $t->open($server);
   $fh = $t->dump_log($logfile);
   $t->login($username, $passwd) or die "Cannot login";
   $t->option_callback (\&opt_callback);
   $t->option_accept ('Do' => TELOPT_TTYPE);
   $t->suboption_callback (\&subopt_callback);
$cmd="su -";
$cmd2="rootpassword";

# here I su to root user
$su=$t->cmd( String => $cmd,
Prompt  => '/root/');
print $su;

# send root password
$pw = $t->cmd($cmd2);
print $pw;

#set TERM
$cmd="export TERM=ansi";
esegui();

#flush buffer
$|=1;

my $vt = Term::VT102->new (
 'cols' => 80,
 'rows' => 25,
);

#
$vt->callback_set ('OUTPUT', \&vt_output, $t);
$command="cicsterm -Q -A -T=OPT1*9700702*0005984044*0000000*01\n";
$vt->resize(80,25);
$vt->process ($command);

    print "\eH";     # return to the top left of the (real) screen
    for (my $row = 1; $row <= $vt->rows (); $row++) {
         printf "%s\n", $vt->row_plaintext ($row);
    }
    printf "Cursor position: (%d, %d)",
      $vt->x (),
      $vt->y ();

$vt->process ($command);

    for (my $row = 1; $row <= $vt->rows (); $row++) {
         printf "%s\n", $vt->row_plaintext ($row);
    }


$t->close;


print "\n**************end script************\n";
close $fh;
exit;


sub esegui {
@lines = $t->cmd( String => $cmd,
Prompt  => '/\@svuni046\/>/');
print @lines;     
     }


#
sub opt_callback {
    my ($obj,$opt,$is_remote,$is_enabled,$was_enabled,$buf_position) =
@_;

    if ($opt == TELOPT_TTYPE and $is_enabled and !$is_remote) {
         #
         # Perhaps do something if we get TELOPT_TTYPE switched on?
         #
    }

    return 1;
}


# Callback for sub-option handling - for Net::Telnet.
#
sub subopt_callback {
    my ($obj, $opt, $parameters) = @_;
    my ($ors_old, $otm_old);

    # Respond to TELOPT_TTYPE with "I'm a VT102".
    #
    if ($opt == TELOPT_TTYPE) {
         $ors_old = $obj->output_record_separator ('');
         $otm_old = $obj->telnetmode (0);
         $obj->print (
           "\xff\xfa",
           pack ('CC', $opt, 0),
           'vt102',
           "\xff\xf0"
         );
         $obj->telnetmode ($otm_old);
         $obj->output_record_separator ($ors_old);
    }

    return 1;
}


# Callback for OUTPUT events - for Term::VT102.
#
sub vt_output {
    my ($vtobject, $type, $arg1, $arg2, $private) = @_;

    if ($type eq 'OUTPUT') {
         $private->print ($arg1);
    }
}
____________
Infinite thanks Golem


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

Date: 10 Jun 2003 06:46:51 -0700
From: johndageek@yahoo.com (John D)
Subject: Re: SORT  sort hash with alpha-numeric keys
Message-Id: <c608545f.0306100546.15b75321@posting.google.com>

"Joe Hasting" <hasting@agere.com> wrote in message news:<bblhjs$ebq$1@alageremail2.agere.com>...
> I've been through the FAQs and mauals, but cannot find info on sort using
> alphanumeric.
> 
> Let's use this has table:
> %hash = ( "L8" => "Left 8", "L9" => "Left 9", "L80" => "Left 80", "L90" =>
> "Left 90", "R8" => "Right 8", "R9" => "Right 9", "R80" => "Right 80", "R90"
> => "Right 90") ;
> 
> NOTE: these are coordinates,  I would like to be able to use L08 & L09 for
> example, but cannot.
> 
> I want the sort output to be  (sorting of hash keys or hash values would be
> fine):
> L8   Left 8
> L9   Left 9
> L80 Left 80
> L90 Left 90
> R8   Right 8
> R9   Right 9
> R80 Right 80
> R90 Right 90
> 
> I have tried all permutations of <=>, cmp, and lc,  with sort but I get
> either something completly messed up or this:
> L8   Left 8
> L80 Left 80
> L9   Left 9
> L90 Left 90
> R8   Right 8
> R80 Right 80
> R9   Right 9
> R90 Right 90
> 
> Can anyone give some guidance on how I can do this alphnumeric sort?  I have
> attached a piece of my test code below with the testing of the 3 sort
> operators.
> 
> Thanks for any help.
> Joe Hasting

Just for fun try this:
use strict;
my %hash = ( "L8" => "Left 8", "L9" => "Left 9", "L80" => "Left 80", "L90" =>
"Left 90", "R8" => "Right 8", "R9" => "Right 9", "R80" => "Right 80", "R90"
=> "Right 90") ;
my @keys=keys %hash;

my @sortkeys;
for (@keys)
{
     /([A-Z]+)(\d+)/;
## overcomes the alphanubetic sort problem you were having
     push @sortkeys, (substr($1 . "     ",0,5) . substr("000000" . $2, -5));
}
@keys = @keys[ sort {$sortkeys[$a] cmp $sortkeys[$b]} 0..$#sortkeys];
for (@keys)
{
   print "$_  $hash{$_}\n";
}

Enjoy
JD


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

Date: Tue, 10 Jun 2003 09:29:06 -0400
From: "Mike Bobbitt" <Mike@Army.ca>
Subject: Re: Unusual Can't load fail (web only)
Message-Id: <bc4mf9$dp1$1@news.storm.ca>

Thanks for the insight guys, it has given me plenty to chew on. Should have
mentioned that I'm on a RedHat 9 system, sounds like this would all be
easier if it was a problem on Win32. :(

I've kind of been down the "multiple install" road before. When I check for
multiple mysql.so's I get this:

>locate mysql.so
/usr/lib/perl5/site_perl/i386-linux/auto/DBD/mysql/mysql.so
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBD/mysql/mysq
l.so
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux/auto/DBD/mysql/mysql.so

Now, what I've done is make the first 2 symbolic links to the third (which
is where my CPAN install went), and I still get the same reaction. When I
remove the link referred to in the error log
(/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBD/mysql/mys
ql.so), I get this:

install_driver(mysql) failed: Can't locate loadable object for module
DBD::mysql in @INC (@INC contains:
/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at
(eval 2) line 3

Which makes sense. And to help solve the mystery slightly, when that link is
removed, I can still run the script via the command line. Soooo, the command
line is looking elsewhere, and by process of elimination, that "elsewhere"
is /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/auto/DBD/mysql/mysql.so.

I've done some tinkering with symbolic links and probably managed just to
break things even more. Anyone know how I can now force my apache web
environment to use the same (I.E. correct) perl lib paths as the command
line?

Thanks




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

Date: Tue, 10 Jun 2003 10:40:49 -0400
From: "Mike Bobbitt" <Mike@Army.ca>
Subject: Re: Unusual Can't load fail (web only)
Message-Id: <bc4qlj$emm$1@news.storm.ca>

"Ralph Snart" wrote
> you probably want to run (as root) ldconfig to add the directories where
> your perl libraries and mysql libraries live.

Thanks Ralph, this sounds like it might be the right way to go.
Unfortunately, none of the directories I add to /etc/ld.so.config seem to
actually add any libraries when ldconfig -v is run. Any advice on what to
add?

Thanks




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

Date: 10 Jun 2003 15:02:35 GMT
From: randy@theoryx5.uwinnipeg.ca (Randy Kobes)
Subject: Re: Unusual Can't load fail (web only)
Message-Id: <slrnbebrss.f28.randy@theoryx5.uwinnipeg.ca>

On Tue, 10 Jun 2003 09:29:06 -0400, Mike Bobbitt <Mike@Army.ca> wrote:
>Thanks for the insight guys, it has given me plenty to chew on. Should have
>mentioned that I'm on a RedHat 9 system, sounds like this would all be
>easier if it was a problem on Win32. :(
>
>I've kind of been down the "multiple install" road before. When I check for
>multiple mysql.so's I get this:
>
>>locate mysql.so
>/usr/lib/perl5/site_perl/i386-linux/auto/DBD/mysql/mysql.so
>/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBD/mysql/mysq
>l.so
>/usr/local/lib/perl5/site_perl/5.8.0/i686-linux/auto/DBD/mysql/mysql.so
>
>Now, what I've done is make the first 2 symbolic links to the third (which
>is where my CPAN install went), and I still get the same reaction. When I
>remove the link referred to in the error log
>(/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBD/mysql/mys
>ql.so), I get this:
>
>install_driver(mysql) failed: Can't locate loadable object for module
>DBD::mysql in @INC (@INC contains:
>/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0
>/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
>/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl
>/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
>/usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl
>/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at
>(eval 2) line 3
>
>Which makes sense. 

That does make sense - probably the DBD::mysql under
/usr/lib/perl5/vendor_perl/5.8.0/ is looking for the
mysql.so under the same directory, as that's what it
was compiled with.

>And to help solve the mystery slightly, when that link is
>removed, I can still run the script via the command line. Soooo, the command
>line is looking elsewhere, and by process of elimination, that "elsewhere"
>is /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/auto/DBD/mysql/mysql.so.
>
>I've done some tinkering with symbolic links and probably managed just to
>break things even more. Anyone know how I can now force my apache web
>environment to use the same (I.E. correct) perl lib paths as the command
>line?

It might be a better idea, in principle, not to have two
versions of the same module lying around, just so as to not
run into this problem again. What you might try is going
underneath /usr/lib/perl5/vendor_perl/5.8.0/ and removing
(or, to be safe, moving to some archive elsewhere) all the
DBD-mysql distribution files. To see what's involved, when you 
build DBD::mysql from the sources, the files to be installed are
placed under the blib/ directory, in a similar directory
structure to what will be installed.

-- 
best regards,
randy


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

Date: Tue, 10 Jun 2003 12:10:41 GMT
From: "Chip" <chip@NO-Spam-afcoms.com>
Subject: virtual x server for Tk
Message-Id: <5VjFa.3010$Jw6.2162795@news1.news.adelphia.net>

I am trying to use the Tk module with perl when I telnet
into my server from a remote location and keep getting
the following error:

<snip>
couldn't connect to display ":0"
at /usr/lib/perl5/site_perl/5.8.0/i386-linux/Tk/MainWindow.pm
</snip>

I have installed the Tk-800.0024.tar.gz and can run the scripts
from the server with the KDE 3.1 desktop so I know the scripts
and the Tk module are working correctly.

All the information I have found on google points to running a
virtual x server but I can't seem to find anything on how to set
it up.

I'm using Slackware 9.0 (full install) and perl 5.8.0

Any and all help is appriceated.

Chip





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

Date: Tue, 10 Jun 2003 06:50:17 -0700
From: "Mothra" <mothra@nowhereatall.com>
Subject: Re: Win32::ListView  sample please??
Message-Id: <3ee5e083$1@usenet.ugs.com>

Hi Kenjis,

"Kenjis Kaan" <tivolinewbie@canada.com> wrote in message
news:6a8ba9f8.0306092248.78b6263c@posting.google.com...
> Hi,  I am trying to create a listview program but no matter what I do
> its is not working.  I wonder if its because of the activestate perl
> (5.6.1) I am using.  I can open up a win32 window but the listview
> just isn't what I wanted.

[snipped]

What is ListView? I checked CPAN and found no ListView.

Mothra




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

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.  

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 V10 Issue 5102
***************************************


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