[22951] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5171 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 3 00:05:45 2003

Date: Wed, 2 Jul 2003 21: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           Wed, 2 Jul 2003     Volume: 10 Number: 5171

Today's topics:
    Re: "Word too long" ? And exactly WHAT word might that  (Sara)
        [Q] all installed modules <mattia.c@libero.it>
    Re: [Q] all installed modules <noreply@gunnar.cc>
    Re: [Q] all installed modules <mattia.c@libero.it>
    Re: [Q] all installed modules <theaney@cablespeed.com>
    Re: [Q] all installed modules <grazz@pobox.com>
    Re: BTree examples ?? <joerg@objectpark.org>
    Re: Calculate next available IP (Jay Tilton)
    Re: Calculate next available IP <ben.goldberg@hotpop.com>
    Re: doing 'ref' on blessed reference (Bryan Castillo)
    Re: doing 'ref' on blessed reference <mgjv@tradingpost.com.au>
    Re: doing 'ref' on blessed reference <no@spam.net>
        first.pl | second.pl  with ARGV filehandle ? (stu7)
    Re: first.pl | second.pl  with ARGV filehandle ? <uri@stemsystems.com>
        HTTP Headers (Jeff Mott)
    Re: HTTP Headers <mgjv@tradingpost.com.au>
    Re: installing perl modules via ftp <noreply@gunnar.cc>
    Re: k operator in REGEX?? <asu1@c-o-r-n-e-l-l.edu>
    Re: need assistance understanding multilevel hashes. (Jay Tilton)
    Re: Need help with Win32::GuiTest and Indigo perl <kalinabears@hdc.com.au>
    Re: Need help with Win32::GuiTest and Indigo perl <awingnut@hotmail.com>
    Re: script for unrestricted permutation <bdonlan@bd-home-comp.no-ip.org>
    Re: using 'DB_File' versus just plain tie() ? (dan baker)
    Re: UTF16 and Control M's <michael.p.broida@boeing.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 2 Jul 2003 18:58:59 -0700
From: genericax@hotmail.com (Sara)
Subject: Re: "Word too long" ? And exactly WHAT word might that be? Curious
Message-Id: <776e0325.0307021758.10e3e4d5@posting.google.com>

news@roaima.freeserve.co.uk wrote in message news:<ks5bt-s7q.ln1@moldev.cmagroup.co.uk>...
> Sara <genericax@hotmail.com> wrote:
> > I have a script that runs fine, but on invocation in csh or bash or
> > tcsh or ksh, the script reports:
> >    Word too long
> > before a single line is executed
> 
> How can it be that it "runs fine" if it reports an unexpected error? This
> sounds suspiciously like your shell is trying to run a perl script
> instead of passing it over to perl.
> 
> What are the first few lines of your program? (Copy and paste them. DON'T
> retype them by hand.)
> 
> Chris

hi Chris-

What I mean is aside from the odd message, when I enter "c" at the
DBG> prompt the script takes off and does just what it's supposed to
do. So the only oddity is this message. If not for this strange
message I would't have any indication of a problem.

The begining or the script is the usual fare:

#!/usr/bin/perl -wd

use strict;

use mod1;
  .
  .


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

Date: Thu, 03 Jul 2003 03:37:11 +0200
From: Mattia <mattia.c@libero.it>
Subject: [Q] all installed modules
Message-Id: <zMLMa.1063$7y2.23763@tornado.fastwebnet.it>

Does anyone know how to get a list of all intelled modules that are 
available to be USEd?
I work with a provider and would like to know this info.

thank you



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

Date: Thu, 03 Jul 2003 03:52:28 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: [Q] all installed modules
Message-Id: <be027r$113qme$1@ID-184292.news.dfncis.de>

Mattia wrote:
> Does anyone know how to get a list of all intelled modules that are 
> available to be USEd?

Hints:
     @INC
     File::Find

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



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

Date: Thu, 03 Jul 2003 04:46:34 +0200
From: Mattia <mattia.c@libero.it>
Subject: Re: [Q] all installed modules
Message-Id: <NNMMa.1080$7y2.24946@tornado.fastwebnet.it>

Gunnar Hjalmarsson wrote:
> Mattia wrote:
> 
>> Does anyone know how to get a list of all intelled modules that are 
>> available to be USEd?
> 
> 
> Hints:
>     @INC
>     File::Find
> 


oh, well...
if I have to write a prog on its own...
I wanted to know it the was some quick way to do it



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

Date: Wed, 02 Jul 2003 22:57:16 -0400
From: Tim Heaney <theaney@cablespeed.com>
Subject: Re: [Q] all installed modules
Message-Id: <871xx8jp0z.fsf@mrbun.watterson>

Mattia <mattia.c@libero.it> writes:
>
> Gunnar Hjalmarsson wrote:
>> Mattia wrote:
>>
>>> Does anyone know how to get a list of all intelled modules that are
>>> available to be USEd?
>> Hints:
>>     @INC
>>     File::Find
>
> oh, well...
> if I have to write a prog on its own...
> I wanted to know it the was some quick way to do it

Actually, that is the quick way. Something like

  perl -MFile::Find -le 'find sub{push @m, $File::Find::name if 
  /\.pm$/}, $_ for @INC; print for @m'

should be all you need.

I hope this helps,

Tim


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

Date: Thu, 03 Jul 2003 02:58:04 GMT
From: Steve Grazzini <grazz@pobox.com>
Subject: Re: [Q] all installed modules
Message-Id: <0ZMMa.7083$U23.4093@nwrdny01.gnilink.net>

Mattia <mattia.c@libero.it> wrote:
> Does anyone know how to get a list of all intelled modules that 
> are available to be USEd?
> I work with a provider and would like to know this info.

    $ perldoc perlmodlib   # standard
    $ perldoc perllocal    # CPAN

And possibly best of all:

    $ perldoc ExtUtils::Installed

> thank you

Sure thing.

-- 
Steve


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

Date: Wed, 02 Jul 2003 21:42:03 +0000
From: =?ISO-8859-1?Q?J=F6rg?= Westheide <joerg@objectpark.org>
Subject: Re: BTree examples ??
Message-Id: <0307KE7T+ienb+GcHIHRLKkXeg@objectpark.org>

Hi Paul!

> Can you elaborate on the performance issues on Win2k?

Well, we have a program that reads data, stores them in a DB_File BTree=20
and then reads and prints them (sorted).
With some test data we had times of 40 minutes for a whole run under=20
Linux. Under Win2K we killed it after 24 hours while it was still=20
reading and storing the data. Profiling showed that inserting the data=20
is the problem (and not in our code)

> I don't do any development on Windows myself, and haven't had any
> reports of bad performance (as far as I can remember).

Maybe others don't use it with that much data. We had more than a=20
million entries in the BTree and the db file grew to more than 1GB. It=20
seemed to me that the perfomance became more worse the more data was=20
stored. With only some 10,000 entries there was not a big difference

> If there is a performance issue
> with Windows, I'd like to fix it (if it is fixable), or document it
> if it is not.

I would like to see it fixed.
If you need additional information, let me know

J=F6rg



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

Date: Wed, 02 Jul 2003 22:14:14 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Calculate next available IP
Message-Id: <3f03581a.943182260@news.erols.com>

jimnl69@hotmail.com (Jim) wrote:

: Is there a module, or a readily available algorithm, for calculating
: the next available IP Address?
: 
: Let's say I have an array
: ('10.1.1.1','10.1.1.2','10.1.1.3','10.1.1.10'). I want to find that
: the next available address is 10.1.1.4.  Thanks.

    #!perl
    use warnings;
    use strict;
    use Socket qw(inet_aton inet_ntoa);
    use List::Util qw(min);

    my @used = ('10.1.1.1', '10.1.1.2', '10.1.1.3', '10.1.1.10');
    my %seen = map { unpack('N', inet_aton($_)), 1 } @used;
    my $check = min( keys %seen );
    $check++ while defined $seen{$check};
    print inet_ntoa( pack 'N', $check ), " is available\n";



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

Date: Wed, 02 Jul 2003 23:25:39 -0400
From: Benjamin Goldberg <ben.goldberg@hotpop.com>
Subject: Re: Calculate next available IP
Message-Id: <3F03A233.DA82A00B@hotpop.com>

Jim wrote:
> 
> Is there a module, or a readily available algorithm, for calculating
> the next available IP Address?
> 
> Let's say I have an array
> ('10.1.1.1','10.1.1.2','10.1.1.3','10.1.1.10'). I want to find that
> the next available address is 10.1.1.4.  Thanks.

use Socket qw(inet_aton inet_ntoa);

my @readable = qw(10.1.1.1 10.1.1.2 10.1.1.3 10.1.1.10);

my @addrs = sort map inet_aton($_), @readable;
my ($mask) = @addrs or die;
chop $mask;
for my $i ( 1 .. 255 ) {
   if( !@addrs or $addrs[0] ne $mask . chr($i) ) {
      print inet_ntoa( $mask . chr($i) ), "\n";
      exit;
   }
   shift @addrs;
}

-- 
$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}


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

Date: 2 Jul 2003 15:41:01 -0700
From: rook_5150@yahoo.com (Bryan Castillo)
Subject: Re: doing 'ref' on blessed reference
Message-Id: <1bff1830.0307021441.45089e79@posting.google.com>

Martien Verbruggen <mgjv@tradingpost.com.au> wrote in message news:<slrnbg224d.3er.mgjv@verbruggen.comdyn.com.au>...
> On Tue, 01 Jul 2003 02:01:48 GMT,
> 	JT <woland99@earthlink.net> wrote:
> > If we do 'ref' on blessed reference it return string that is the name of 
> > the class
> > but how can I know if this was a hash, array or sth else? Is there a way to
> > return ARRAY, HASH or SCALAR for blessed reference?
> 
> First of all: Why do you think you need to know? One of the main
> advantages of OO programming is the encapsulation of the
> implementationof the object, internally. Outside the class, or one of
> its subclasses, you should not care what the implementation is.
> Whenever you find yourself wondering whether you should know something
> about the internal implementation of a class, you should think really
> hard about whether you should be asking a different question.
> 
> 
> To answer your question: A blessed reference "inherits" the ARRAY or
> HASH or SCALAR "class"[1]. In other words, UNIVERSAL::isa will return
> true.
> 

Don't forget GLOB.  Blessed GLOB refs are the most fun!

<snip>


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

Date: 03 Jul 2003 00:55:34 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: doing 'ref' on blessed reference
Message-Id: <slrnbg6vo8.1ge.mgjv@verbruggen.comdyn.com.au>

On 02 Jul 2003 14:15:47 GMT,
	Abigail <abigail@abigail.nl> wrote:
> Martien Verbruggen (mgjv@tradingpost.com.au) wrote on MMMDXCI September
> MCMXCIII in <URL:news:slrnbg224d.3er.mgjv@verbruggen.comdyn.com.au>:
> ~~  On Tue, 01 Jul 2003 02:01:48 GMT,
> ~~  	JT <woland99@earthlink.net> wrote:
> ~~ > If we do 'ref' on blessed reference it return string that is the name of 
> ~~ > the class
> ~~ > but how can I know if this was a hash, array or sth else? Is there a way to
> ~~ > return ARRAY, HASH or SCALAR for blessed reference?
> ~~  
> ~~  First of all: Why do you think you need to know? One of the main
> ~~  advantages of OO programming is the encapsulation of the
> ~~  implementationof the object, internally. Outside the class, or one of
> ~~  its subclasses, you should not care what the implementation is.
> ~~  Whenever you find yourself wondering whether you should know something
> ~~  about the internal implementation of a class, you should think really
> ~~  hard about whether you should be asking a different question.
> 
> Oh, come on! The majority of the Perl classes that subclass something
> depends on the implementation of the superclass, and will break if it
> changes. About 99% of the inheriting classes assume the class they are
> inheriting uses a hashref to implement the object.

Yep. and if the OP needed to inherit from a superclass that didn't
provide an interface for that, then that could be a reasonable reason
for it.

However, if you inherit from a superclass, and you need knowledge of
the internals, you will also know whether the object is based on a
hash or array reference. You would need to know to be able to
aproperly access the attributes. So, why do you need to dynamically
find that out? The only thing you could do with that is bail out if it
doesn't match your assumptions.

> I agree with you that the main advantage of OO programming is
> encapsulation.  But Perl's support for encapsulation is almost
> non-existant. Any introduction text on OO program I've encountered,
> whether that's part of the Perl main distribution, a book about Perl, or
> an article on Perlmonks or so other forum will use hashrefs to implement
> objects, and throw away encapsulation from the start.

Indeed. But my original question still stands: Why would you want to
find out, at runtime, what sort of data structure an object uses
internally? If you need to access the internals of that object, you
need to know anyway, when you write code that accesses it, and you'd
do that well before compile time.

The only reason I can think of is that you're writing something like
Data::Dumper or FreezeThaw. If you just intend to use a class for what
it was intended, then, as far as I can tell, there is never a reason
to ask that question at runtime. Even if you want to make sure your
code will still work with a new version of the class, this check would
be completely insufficient, although it could be a good test in the
first bits of a t/*.t file.

> There's a gigantic difference between theory and practise.

Yep. I know that. But that does not answer the question why one would
need to know the internal data representation of an object at runtime.

Martien
-- 
                        | 
Martien Verbruggen      | For heaven's sake, don't TRY to be cynical.
Trading Post Australia  | It's perfectly easy to be cynical.
                        | 


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

Date: Wed, 2 Jul 2003 19:36:25 -0700
From: "Michael" <no@spam.net>
Subject: Re: doing 'ref' on blessed reference
Message-Id: <TCMMa.1215$yw3.86710@news.uswest.net>

People love to announce their plonking to feel important as if "plonking"
needs or warrants a sermon or announcement. Not very brainy. :)

Plonk! --- no wait, hold on a second...

-- 
- JMM

"Martien Verbruggen" <mgjv@tradingpost.com.au> wrote in message
news:slrnbg4ej5.3er.mgjv@verbruggen.comdyn.com.au...
> [Sorry for the missing context. Mr anonymous Michael insists on
> posting in a broken manner.]
>
> On Tue, 1 Jul 2003 18:45:54 -0700,
> Michael <no@spam.net> wrote:
> > Nope. Sorry, Marty.
>
> Well, you obviously will never learn, then.
>
> *plonk*
>
> Martien
> -- 
>                         |
> Martien Verbruggen      |
> Trading Post Australia  | values of Beta will give rise to dom!
>                         |




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

Date: 2 Jul 2003 17:22:38 -0700
From: stuseven@hotmail.com (stu7)
Subject: first.pl | second.pl  with ARGV filehandle ?
Message-Id: <d7dd90b0.0307021622.1ea3f6d2@posting.google.com>

+  perl first.pl | perl second.pl   something, something  ARGV fh ?

   This is what I've seen suggested... running the first
 perl script, piping it to the second perl script, and that
 the  ARGV  filehandle, or  <>  (?)  will now automatically
 contain the file, or arguments from the first file for use in
 the second ?
   Sounds exciting... passing arguments between files... but how 
 might it work ?  
    After trying for an hour or so, I didn't succeed at reading
 anything at all by printing  <>  from the second script... maybe, 
 some module needs to be used here for this to work ?


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

Date: Thu, 03 Jul 2003 02:51:15 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: first.pl | second.pl  with ARGV filehandle ?
Message-Id: <x74r242uho.fsf@mail.sysarch.com>

>>>>> "s" == stu7  <stuseven@hotmail.com> writes:

  s> + perl first.pl | perl second.pl something, something ARGV fh ?
  s> This is what I've seen suggested... running the first perl script,
  s> piping it to the second perl script, and that the ARGV filehandle,
  s> or <> (?)  will now automatically contain the file, or arguments
  s> from the first file for use in the second ?  Sounds
  s> exciting... passing arguments between files... but how might it
  s> work ?  After trying for an hour or so, I didn't succeed at reading
  s> anything at all by printing <> from the second script... maybe,
  s> some module needs to be used here for this to work ?

that makes no sense at all. who suggested this? what is the real
problem? you don't need to say perl foo.pl to run a perl script.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: 2 Jul 2003 17:51:17 -0700
From: mjeff1@twcny.rr.com (Jeff Mott)
Subject: HTTP Headers
Message-Id: <970676ed.0307021651.27a2e575@posting.google.com>

How would an HTTP request sent with Perl return the *full* set of HTTP
headers? In fact I'm not even interested in the content. I think the
best I've been able to pull out using the standard modules is the
status code.


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

Date: 03 Jul 2003 01:24:06 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: HTTP Headers
Message-Id: <slrnbg71do.1ge.mgjv@verbruggen.comdyn.com.au>

On 2 Jul 2003 17:51:17 -0700,
	Jeff Mott <mjeff1@twcny.rr.com> wrote:
> How would an HTTP request sent with Perl return the *full* set of HTTP
> headers? In fact I'm not even interested in the content. I think the
> best I've been able to pull out using the standard modules is the
> status code.

First of all, Perl does not send HTTP requests. I will assume that you
mean the LWP modules when you say "the standard modules" (They're not
standard modules, since they are not included with the standard Perl
distribution).

Create a LWP::UserAgent, create a HTTP::Request, send the request, and
what comes back is a HTTP::Response object. Check the status code of
the response to find out whether it was successful in performing the
request. Since HTTP::Response inherits from HTTP::Message, you can use
the headers() or headers_as_string() methods on the response object to
get them.

Read the lwpcook documentation, followed by the LWP::UserAgent and
HTTP::Response and HTTP::Message documentation. It's all in there.

Martien
-- 
                        | 
Martien Verbruggen      | Useful Statistic: 75% of the people make up
Trading Post Australia  | 3/4 of the population.
                        | 


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

Date: Thu, 03 Jul 2003 02:50:25 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: installing perl modules via ftp
Message-Id: <bdvujf$113d6o$1@ID-184292.news.dfncis.de>

A. Sinan Unur wrote:
> me@me.com (me) wrote in news:3f02ed5d_7@corp.newsgroups.com:
>> My Web host won't install the WebDB::Session module from Paul
>> DuBois's Book MySQL and Perl for the Web, but told me I could
>> install it to my account locally.
>> 
>> Does anyone have a clue how? As it is, I install Perl scripts to
>> a CGI-BIN folder via FTP. HELP!
> 
> You can put the modules you would like to use in a directory, for 
> example,

<answer snipped>

This is probably one of the most frequently asked questions that's not
covered in the FAQ. I believe this is the closest:
http://www.perldoc.com/perl5.8.0/pod/perlfaq8.html#How-do-I-keep-my-own-module-library-directory-

However, as usual the answer presupposes shell access on a *nix platform.

Wouldn't it be a good idea to include in the FAQ that many modules can
be 'installed' by simply uploading the *.pm file(s)? I believe it
would make Perl accessible to a broader audience.

As an example, in the POD of a trivial module I wrote, I included a
few lines with the 'FTP users' in mind:
http://search.cpan.org/author/GUNNAR/CGI-ContactForm-1.13/lib/CGI/ContactForm.pm#Manual_Installation

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



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

Date: 2 Jul 2003 22:19:38 GMT
From: "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
Subject: Re: k operator in REGEX??
Message-Id: <Xns93ACBA702E21asu1cornelledu@132.236.56.8>

Abigail <abigail@abigail.nl> wrote in
news:slrnbg6l6d.mu3.abigail@alexandra.abigail.nl: 

> http://perl.abigail.nl/Talks/Japhs/ and
> http://perl.abigail.nl/Talks/Japhs-II/
> 
> I think the one you are asking about is discussed in the former talk.

Thank you very much.

-- 
A. Sinan Unur
asu1@c-o-r-n-e-l-l.edu
Remove dashes for address
Spam bait: mailto:uce@ftc.gov


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

Date: Wed, 02 Jul 2003 22:20:41 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: need assistance understanding multilevel hashes.
Message-Id: <3f035a3a.943725880@news.erols.com>

Allen Wooden <allen.wooden@educate.invalid> wrote:

: $cust = ARGV[0];
         ^
Lost its '$'

: %hash1 = %{ $hash{$cust} };
: 
: Now this should copy the data in from $hash{<customer-id>} into a new
: hash but instead I don't get jack. But I can loop through %hash and 
: print out all the keys,values but if I try it with %hash1, I get 
: "Use of unitialized value in hash dereference at line blah blah.. "
: Which just so happens to be where the data should be assiged to the
: new hash.  ie: %hash1 = %{ $hash{$cust} }; 
: 
: if I enter foo on commanline, I should be able to access
: $hash1{foo}{"ports"} and get the value.  

Not quite.  You should be able to get the value of $hash1{'ports'}.

%hash1 is a copy of the hash referenced by $hash{foo}, so looking for
$hash1{foo} is an attempt to do something that's already been done.

: I think I'm  either misunderstanding something or doing it the wrong
: way.

Certainly something wrong is happening, but it's not clear whether the
cause is misunderstanding, poor assistance, or something else.

If $hash{$cust} exists and its value is a hash reference, 
"%hash1 = %{ $hash{$cust} }" should work as expected.

The "Use of uninitialized value in hash dereference" warning indicates
one or more of the assumptions is wrong:  either $hash{foo} does not
exist, its value is undefined, or $cust does not really have a value
of "foo".

I would add some kind of argument validation to the code, the more
helpful and verbose the better.

    my $cust = $ARGV[0];
    die "usage: $0 [customer name]\n" unless defined $cust;
    our %hash;
    my $ret = do 'config.cfg';
    unless( defined $ret ) {
        die "eval failed: $@" if $@;
        die "do failed: $!";
    }
    unless( defined $hash{$cust} ) {
        die "'$cust' is not a valid customer name.\n",
          "Known customer names: ",
          join(', ', map "'$_'", keys %hash), "\n";
    }
    my %hash1 = %{ $hash{$cust} };
    printf "'ports' value for customer '%s' is %d\n",
      $cust, $hash1{ports};

: I have a much smaller example prog if your interested.

I think posting that would be appropriate.



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

Date: Thu, 3 Jul 2003 11:20:55 +1000
From: "Sisyphus" <kalinabears@hdc.com.au>
Subject: Re: Need help with Win32::GuiTest and Indigo perl
Message-Id: <3f038633$0$22124@echo-01.iinet.net.au>


"gw1500se" <awingnut@hotmail.com> wrote in message
news:dgl5gv814rch7dr4ec80jdjajiksomv7gd@4ax.com...
> I need some help with a problem running Win32::GuiTest and Indigo
> perl. I installed the package using IPM and there were no errors.
> However, the statement "use Win32::GuiTest;"  get the following error:
>
> Can't load 'C:/OpenSA/perl/site/lib/auto/Win32/GuiTest/GuiTest.dll'
> for module Win32::GuiTest: load_file:One of the library files needed
> to run this application cannot be found at
> C:/OpenSA/perl/lib/DynaLoader.pm line 229.
>
> The path and file are correct and do exist. Can someone help me figure
> out why it will not load the library. TIA.

The dll is being found ok but there's apparently some problem with that dll
that prevents it from loading.

You could also get the same error if GUITest.dll tried to load some other
"problem" dll. But I don't think GUITest.dll looks for any other dll.

Could it be that you've installed a 5.6 version of Win32::GUITest on perl
5.8 (or vice-versa) ?
I'm not sure that would produce the error you get .... but it's all I can
think of :-)

Cheers,
Rob




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

Date: Wed, 02 Jul 2003 22:52:02 -0400
From: gw1500se <awingnut@hotmail.com>
Subject: Re: Need help with Win32::GuiTest and Indigo perl
Message-Id: <pe67gvccfu2h7k8c0k3g7nteed9m265i2q@4ax.com>

On Thu, 3 Jul 2003 11:20:55 +1000, "Sisyphus" <kalinabears@hdc.com.au>
wrote:
>
>The dll is being found ok but there's apparently some problem with that dll
>that prevents it from loading.
>
>You could also get the same error if GUITest.dll tried to load some other
>"problem" dll. But I don't think GUITest.dll looks for any other dll.
>
>Could it be that you've installed a 5.6 version of Win32::GUITest on perl
>5.8 (or vice-versa) ?
>I'm not sure that would produce the error you get .... but it's all I can
>think of :-)
>

Thats for the reply.  Now the question becomes how do I tell? I'm
running Indigo perl 5.8 and GuiTest 1.3. There is no mention, I can
find, about compatability issues with different version of perl.


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

Date: Wed, 02 Jul 2003 20:33:51 -0400
From: "bd" <bdonlan@bd-home-comp.no-ip.org>
Subject: Re: script for unrestricted permutation
Message-Id: <pan.2003.07.03.00.33.46.207093@bd-home-comp.no-ip.org>

On Wed, 02 Jul 2003 11:35:01 -0700, weberh wrote:

> Hi !
> 
> All scripts for permutation I found yet, were restricted by depth
> (loops have to be hardcoded) or memory (recursive approach).
> 
> Here I wrote a handy script that gives the user unrestricted 
> choice of number of elements and depth of permutation.
> 
> The script is a bit special, because it dynamically generates code.
> This code delivers the permutation and is evaluated within the script.
> 
> So, "perm 4 red green blue" gives
> 
> redredredred
> redredredgreen
> .
> .
> blueblueblueblue 
> 
> It's still an ad hoc script and has to be refined, of course.
> 
> Would you like to see it as part of a module ?
> Maybe together with other flavors of permutation and combination ?
> 
> Here we go ...
> 
> #!/usr/bin/perl
> #perm: permutation with user defined depth and number of elements
> #usage: perm depth element1 element2 ...
[snip]

eval is hardly necessary:

#!/usr/bin/perl
use strict;
use warnings;

my $count = shift @ARGV;
my @elements = @ARGV;

my @indices;
unshift @indices, 0 for (0..$count - 1);

while($indices[0] < @elements){
    foreach my $index (@indices) {
        print "$elements[$index] ";
    }
    print "\n";
    $indices[-1]++;
    for($_ = $#indices; $_ > 0; $_--){
        if($indices[$_] >= @elements){
            $indices[$_] = 0;
            $indices[$_ - 1]++;
        }
    }
}

Of course, there will always be memory limitations.

-- 
Freenet distribution not available
You're not my type.  For that matter, you're not even my species!!!



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

Date: 2 Jul 2003 19:47:48 -0700
From: botfood@yahoo.com (dan baker)
Subject: Re: using 'DB_File' versus just plain tie() ?
Message-Id: <13685ef8.0307021847.281453c7@posting.google.com>

Perusion Hostmaster <nanae@bill.perusion.com> wrote in message news:<slrnbg6dg5.j9u.nanae@bill.heins.net>...
> 
> AFAIK, DB_File is portable between machines and even big-endian
> and little-endian architectures (unlike GDBM or NDBM).
> 
> You may be running into version bifurcation -- many DB_File
> modules still use 1.x, and a lot have moved to 2.x/3.x.
> 
--------------------

huh, I wonder how I can tell if this is the issue? All I know is that
if I FTP the tied()ed file from the unix host to my pc, the app can't
read it when run on my localhost... I was hoping there would be a
simple (although maybe slower) alternative that would save the info in
a p-lain ASCII file rather than abinary b-tree or however they do it
internally.

d


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

Date: Wed, 2 Jul 2003 20:48:55 GMT
From: "Michael P. Broida" <michael.p.broida@boeing.com>
Subject: Re: UTF16 and Control M's
Message-Id: <3F034537.8FBE6269@boeing.com>

The Ctrl-M is a "carriage-return" which is \r in Perl.

	Mike

Eileen wrote:
> 
> Hi,
> 
> I have a text file with CTRL-M's. It is encoded as UTF16. When I try
> to search for a string in this file, nothing is found. If I remove the
> control-m's in vi, my search works. However, I cannot get the
> control-m's to be removed using Perl. I've tried:
> 
>  my $file= "myfile.xml";
>  while (<IN>) {
>         s/\cM//g;
>  }
> 
> and
> 
>   my $file= "myfile.xml";
>  while (<IN>) {
>         s/\x{0x0D00}//g;
>  }
> 
> and
> 
>  my $file= "myfile.xml";
>  while (<IN>) {
>         s/\^M//g;
>  }
> 
> and
> 
> while (<IN>) {
>         s/\cM//g;
>  }
> 
> all to no avail. I've tried it on Unix perl as well as Windows perl.
> Again, I can remove the characters with vi (using s/^V^M//g).
> 
> Does anyone have any ideas on what to do? If I convert the file to
> UTF8, the substitution and subsequent searches work. However, I have
> several hundred files to deal with, and they are all encoded as UTF16.
> 
> Thanks,
> 
> Eileen


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

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 5171
***************************************


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