[6990] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 615 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 16 13:18:02 1997

Date: Mon, 16 Jun 97 10:00:24 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 16 Jun 1997     Volume: 8 Number: 615

Today's topics:
     *HELP* installing perl <e.j.craft@bham.ac.uk>
     Accessing Win 95 Registry w/Perl dagcs@knuth.mtsu.edu
     Big-Endian <--> little Endian conversion? <hartje@etech.hs-bremen.de>
     Re: Case Conversion <rootbeer@teleport.com>
     Closures and objects. (Brian Mcandrews)
     DBD and Oracle 7.3.2.3 build problem! davramenko@dlj.com
     Re: Does perl version matter? <rootbeer@teleport.com>
     Re: Editor for Perl on Unix box (Kent Perrier)
     Re: help!!!! <rootbeer@teleport.com>
     help: TEST-EXP ? TRUE-EXP :FALSE-EXP <patrick@arch.ethz.ch>
     Re: Is this decent? <rootbeer@teleport.com>
     Re: Is this decent? (Nathan V. Patwardhan)
     Re: limit to record size? <bryan@eai.com>
     mSQL and the Perl compiler <dan@clockwork.net>
     Re: not printing <eike.grote@theo.phy.uni-bayreuth.de>
     perl and refs <Patrick.Husi@de.epfl.ch>
     Re: Perl Compiler Trubles (Malcolm Beattie)
     Re: Perl Compiler Trubles <dan@clockwork.net>
     Re: perl joke of the day ? <nav@patriot.net>
     Perl language question - a regular expressions. (Henrik Schmiediche)
     ptk with perl 5.003_93 and Tk400.202 (William E. Hatch)
     retreive and parse an html page <tj@irg.net>
     Sockets <anil@inta.net.au>
     Re: Sorting Associative Array? (Urgent) <rootbeer@teleport.com>
     Re: What does "UNIX" stand for.. <eddie@cs.odu.edu>
     Re: What does "UNIX" stand for.. <eddie@cs.odu.edu>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 16 Jun 1997 17:25:23 +0100
From: "Edward Craft" <e.j.craft@bham.ac.uk>
Subject: *HELP* installing perl
Message-Id: <5o3pa1$ioa$1@usenet.bham.ac.uk>


****HHHHHHHHHEEEEEEEEELLLLLLLLLLLLP****

I need to have perl installed by Thursday (when someone's coming to install
some other software which requires perl.

I've downloaded the latest version and run 'sh Configure' which has run and
told me to do a make. After about 60 seconds the make bombs out with :

make: Warning: Both `makefile' and `Makefile' exist
`sh  cflags libperl.a util.o`  util.c
          CCCMD =  /opt/gnu/bin/gcc -DPERL_CORE -c  -O
util.c: In function `Perl_form':
util.c:1107: number of arguments doesn't match prototype
proto.h:124: prototype declaration
util.c: In function `Perl_die':
util.c:1164: number of arguments doesn't match prototype
proto.h:69: prototype declaration
util.c: In function `Perl_croak':
util.c:1231: argument `pat' doesn't match prototype
proto.h:46: prototype declaration
util.c:1231: number of arguments doesn't match prototype
proto.h:46: prototype declaration
util.c: In function `Perl_warn':
util.c:1288: number of arguments doesn't match prototype
proto.h:524: prototype declaration
util.c: In function `Perl_my_popen':
util.c:1773: warning: return makes pointer from integer without a cast
*** Error code 1
make: Fatal error: Command failed for target `util.o'
#


I'm running Solaris 2.5.1 on a Sun Ultra 2170. Perl is ver 5.003.

Can anyone offer suggestions ? *OR* can anyone offer a compiled version I
can download ? (Or is it too tricky to reconfigure ?)

TIA

Edward.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
" 88.2% of statistics are made up on the spot. " 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Edward Craft, EIS Systems Manager, LISS, ICSD, IS,
                              University of Birmingham, UK.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 




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

Date: Mon, 16 Jun 1997 04:09:59 GMT
From: dagcs@knuth.mtsu.edu
Subject: Accessing Win 95 Registry w/Perl
Message-Id: <33a4bae1.6932945@news-s01.ny.us.ibm.net>


I am trying set up a script to modify generic install during a PC 95
platform build.  When I try using the command ' use registry',
refering to the file registry.pm in the perl5\bin directory.  The
directory is in the path.  The error I get says, ' can't  locate
registry.pm in @INC . . .'.  

Can someone help me!

David Gatewood
dagcs@knuth.mtsu.edu


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

Date: Mon, 16 Jun 1997 16:23:55 +0200
From: "Dr. Michael Hartje" <hartje@etech.hs-bremen.de>
Subject: Big-Endian <--> little Endian conversion?
Message-Id: <33A54C7B.29F0@etech.hs-bremen.de>

If I read a binary data file with sysread and use unpack to get the
contents to varibles like:

sysread(INFILE, 16, $buf);
($a, $i, $j) = unpack ("d i i", $buf);

You get different results doing it on Macintosh an on PC because of
"endianess". The lowest bytes are on lower adresses on one machine and
on the highest position on the other machines. 

Is there any switch / function / statement sequence solving this problem
for unpack?

Thanks for thinking about my problem.

Preferred answer to : mailto:hartje@etech.hs-bremen.de

Michael Hartje
-- 
Hochschule Bremen                 Labor fuer Hochspannungstechnik
Prof. Dr. Michael Hartje        Neustadtswall 30;    28199 Bremen
Telefon: +49 421 5905-444                   FAX: +49 421 5905-476
mailto:hartje@etech.hs-bremen.de          http://www.hs-bremen.de


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

Date: Mon, 16 Jun 1997 07:36:13 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Dean Inada <dmi@deltanet.com>
Subject: Re: Case Conversion
Message-Id: <Pine.GSO.3.96.970616072721.23046F-100000@kelly.teleport.com>

On 15 Jun 1997, Dean Inada wrote:

> In article <Pine.GSO.3.96.970614083429.4940V-100000@kelly.teleport.com>,
> Tom Phoenix  <rootbeer@teleport.com> wrote:
> >> 
> >> 	$_ ^= lc($_) ^ uc($_);
> >
> >That's _still_ not going to work on accented characters, tyrannosaurus or
> >not. 
> So I tried to find a character on which that method wouldn't work by
> comparing it against the method you suggested in
> <Pine.GSO.3.96.970606192316.6604D-100000@kelly.teleport.com>:

> Under HP-UX the results were identical in every supported locale.

Maybe your locales weren't installed properly. :-)  Are you able to use
non-English characters, such as n-with-tilde and u-with-umlaut in any of
them?

> But under IRIX 6.3 there was one discrepancy with chr(0xd1) in
> POSIX::setlocale(&POSIX::LC_CTYPE, "cs") and
> POSIX::setlocale(&POSIX::LC_CTYPE, "sk")
> (both iso8859/2)
> Your method translated it to "\xf1", while mine left it unchanged. 

Well, that means that (according to the locale) \xd1 and \xf1 are the
"same" letter but opposite case. Whether that's true or not is left as an
exercise. :-)

> Strangely, both POSIX::isupper("\xd1") and POSIX::istolower("\xd1")
> were true in those locales, and both lc("\xd1") and uc("\xd1") were "\xf1"

Well, _that_ means that either the locale or those POSIX functions are
mucked up. What character is that supposed to be?

> Comparing the charmap files, it looks like this could possibly be due
> to a typo of 0xd1 for 0xb1 in the islower table.

That could be. You could file a bug report and see whether the vendor
fixes it.

> But even if we accept that chr(0xd1) is correctly classified as both upper
> and lower case, couldn't we argue that the lc^uc method is correctly
> reversing the case by transforming that character to itself?

I'm not sure what you're saying. Is your argument analogous to saying, "if
we agree that dimes and centimes are worth seven cents each, then isn't it
true that dollars and francs are equivalent?" :-)  

I'm claiming that the lc^uc method, while very clever, relies upon an
idiosyncracy of the way that English letters are represented in ASCII. If
you've got non-English letters or a non-ASCII coding, that algorithm can
easily fail.

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: 16 Jun 1997 09:42:55 -0500
From: bmcandre@shrike.depaul.edu (Brian Mcandrews)
Subject: Closures and objects.
Message-Id: <5o3jdf$bna@shrike.depaul.edu>

I apologize if this topic is somewhat out of scope for this group, but since
it came from the Camel book, I think that it's relevant.

What's the difference between closures and objects/classes?  As I understand
it, closures allow you to assign a state at declaration, much like objects, and
then the closure "remembers" its assigned state at invocation.  How is this
different than calling an object method?

Brian


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

Date: Mon, 16 Jun 1997 09:12:24 -0600
From: davramenko@dlj.com
Subject: DBD and Oracle 7.3.2.3 build problem!
Message-Id: <866470180.10098@dejanews.com>

 >
  > I use DBD/DBI with Oracle RDBMS 7.2.2.3, it seems to work
  > superbly.
  >                     Regards Tam

  Hello Tim,

  We were using 7.2.2.3 and it also worked great.

  Now for a number of reasons we have to migrate to 7.3.2.3 (latest
version
  of Oracle) and all of a sudden I can no longer build DBD .

  I'm using DBI version 0.74 , DBD version 0.44 on Solaris 2.5.1.
  Perl 5 version 5.003.

  This is the output of make test:


  # make test
  PERL_DL_NONLAZY=1 /usr/bin/perl -I./blib/arch -I./blib/lib
  -I/opt/lib/perl5/sun4-solaris/5.003 -I/opt/lib/perl5 -e 'use
   Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;'
t/*.t
  t/base..............install_driver(Oracle) failed: Can't load
  './blib/arch/auto/DBD/Oracle/Oracle.so' for module DBD::O
  racle: ld.so.1: /usr/bin/perl: fatal: relocation error: symbol not
found:
  osnptt: referenced in ./blib/arch/auto/DBD/Or
  acle/Oracle.so at /opt/lib/perl5/DynaLoader.pm line 140.

   at blib/lib/DBD/Oracle.pm line 24
          DBI::install_driver called at t/base.t line 16
  FAILED tests 4-5
          Failed 2/5 tests, 60.00% okay
          Test returned status 2 (wstat 512)
  Failed 1 test script, 0.00% okay. 2/5 subtests failed, 60.00% okay.
  *** Error code 29
  make: Fatal error: Command failed for target `test_dynamic'


  I did build perl with an option to support dynamic loading, so I do not
  understand why I get that message. I'm building 4 machines one of which
  still had old version of Oracle 7.2.2.3 and DBD was built on it just
fine.

  Any ideas everyone. Am I missing some other info you guys need to track
  what the problem is? Please let me know. Does anybody have a sucessfull
  build of DBD against Oracle 7.3.2.3 ?



  Please help.

  Thanks in advance.

  Dmitry.
  ~


-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Mon, 16 Jun 1997 07:26:45 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Rick Freeman <Rick@MarinWeb.com>
Subject: Re: Does perl version matter?
Message-Id: <Pine.GSO.3.96.970616071924.23046E-100000@kelly.teleport.com>

On Sun, 15 Jun 1997, Rick Freeman wrote:

> I'm trying to get Matt's wwwboard script running, but am having some
> trouble.  

Have you tried writing to the author? That's often a good source of help,
especially if there's a newer version of the script (or its documentation)
available. :-) 

> If I fill in all the fields I get a Server Error

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to
solving such problems. It's available on the perl.com web pages. 

   http://www.perl.com/perl/
   http://www.perl.com/perl/faq/
   http://www.perl.com/perl/faq/idiots-guide.html

> -w switch mentions possible typos, trying to use unopened fliehandles,
> and uninitialized variables.  I am assuming all these are ok to ignore

Probably not a good assumption. You should check out anything that -w
complains about. It may be that the original author left in constructs
which would cause warnings, but it may also be that you've uncovered a
new problem.

> "perl -v" says
> 
>      This is perl, version 4.0
> 
>      $RCSfile: perl.c,v $$Revision: 1.2 $$Date: 1993/12/22 17:08:26 $
>      Patch level: 36
> 
> Is that OK for this script?  Is that old? Should I ask about getting
> perl5 on my machine?

I would have to say that software from 1993 is old; software ages in dog
years, so that's about 25. :-) Yes, you should install 5.004. It's not
hard to do, and you'll gain a lot of new features and documentation.

> In the readme for wwwboard it shows a config setting $date_command =
> "/bin/date",  but in the script I downloaded (from
> http://www.worldwidemart.com/scripts/) wwwboard.pl DOESN'T have that
> line in it.  Is that a problem?  ( I went ahead and inserted it as the
> readme seemed to indicate, but it made no difference.)

Probably the author (wisely) used localtime instead of /bin/date when
upgrading the script to use Perl 5 features. And possibly the author
(unwisely) failed to say "require 5;" to force the script to only work on
Perl 5. :-) 

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: 14 Jun 1997 09:58:45 -0500
From: kperrier@Starbase.NeoSoft.COM (Kent Perrier)
Subject: Re: Editor for Perl on Unix box
Message-Id: <csrae51ba2.fsf@Starbase.NeoSoft.COM>

In article <33A248F1.51B3@sj.bigger.net> ray <raymond@sj.bigger.net> writes:

>
>Does anyone know of a good programmer's editor for Perl on a Unix box? I
>am trying to find one with a graphical user interface or has at some
>color-syntaxing, such as for comments and keywords. Since Perl has some
>keywords that are similar to other languages, an editor in an ide for a
>different computer language might work also.
>

vi and emacs seem to work well for most of the people using perl.

Kent
-- 
Kent Perrier         
kperrier@neosoft.com 
Corporations don't have opinions, people do.  These are mine.



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

Date: Mon, 16 Jun 1997 07:45:41 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: rroberts@gowebway.com
Subject: Re: help!!!!
Message-Id: <Pine.GSO.3.96.970616073826.23046G-100000@kelly.teleport.com>

On Mon, 16 Jun 1997 rroberts@gowebway.com wrote:

> Subject: help!!!!

First help: Check out the frequent posting about choosing good subject
lines. 

> What it is doing is asking for the list of words, then I press ^z and
> nothing happens, till I hit it again or press enter.  Then either
> nothing, it ends the program, or I get a bunch of errors about $c

It sounds like you're using a DOS/Windows-type machine, and that it
doesn't like reading input after getting ^Z to indicate end of file. 

> print "Give me a list of words and press^z when done.\n";
> @a=<stdin>;

(You should really use STDIN instead of stdin.) How about recoding this to
work without ^Z? Does this do what you want?

    @words = ();
    print "Enter a list of words, one per line; blank line to quit:\n";
    push @words, $_ while defined($_ = <STDIN>) and /\S/;

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 16 Jun 1997 16:00:10 +0200
From: Sibenaler <patrick@arch.ethz.ch>
Subject: help: TEST-EXP ? TRUE-EXP :FALSE-EXP
Message-Id: <33A546EA.41C6@arch.ethz.ch>

I have this strange behaviour that I cannot explain, so I hope
one of you can. I'm doing this:

---------------------------------------------------
#Parameter readin:
use Getopt::Std;
&getopts("s:t:");
(defined($opt_s)) ? $slice=$opt_s   : &usage;
(defined($opt_t)) ? $type=$opt_t    : $type= "type_a";
---------------------------------------------------

What I would like it to do is the folowing:
IF ($opt_s) is defined, THEN ($slice=$opt_s) ELSE (&usage)

Ok. Fine by now. This works. So I assumed that the second 
line will act the same:
IF ($opt_t) is defined, THEN ($type=$opt_t) ELSE ($type="type_a")

Strangely, this will now work, and the ELSE statement is ALWAYS
evaluated. How come? Did I fall for a variable scope problem? I
know that the second statement can be written as:

$type = (defined($opt_t)) ? $opt_t : "type_a"

 ..but this will now work with the &usage routine. Is there a 
difference between sub calls and assignments in this construct?
As soon as there is an assignment in the ELSE expression, it 
will always be carried out...


Any hints? (Or did I simply fall for a common bug?)
   greets, 
    patrick



---------------------------------------------------------------------------
The trick is to communicate bi-directional in real time and high
resolution
---------------------------------------------------------------------------


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

Date: Mon, 16 Jun 1997 07:51:05 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Dan Smith <daniel@fit.qut.edu.au>
Subject: Re: Is this decent?
Message-Id: <Pine.GSO.3.96.970616074619.23046H-100000@kelly.teleport.com>

On Mon, 16 Jun 1997, Dan Smith wrote:

> I'm trying to assign a multi-field record to a hash, where the data for
> the hash is contained in a nicely-formatted scalar.  I was wondering if
> this is a good way to do it:
> 
> my $blah = '{ "foo" => {"man" => "choo"}, "bar" => "none"}';
> my %blah2 = %{ eval $blah};
> print $blah2{'foo'}{'man'};

Eek! It's eval string! :-)

Well, it may be the only reasonable way to do what you want, but the real
question is whether you have any control over the form in which that data
comes to you. If you are given no choice but to get a scalar in that
format, that's probably the best way to do it, but you should be wary that
that string might contain something dangerous (such as a Trojan horse, for
example). 

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: 16 Jun 1997 14:54:12 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Is this decent?
Message-Id: <5o3k2k$7e5@fridge-nf0.shore.net>

Tom Phoenix (rootbeer@teleport.com) wrote:

: Eek! It's eval string! :-)

Oh.  I was thinking more along the lines of daredevil Eval Keneval.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Mon, 16 Jun 1997 11:35:13 -0500
From: Bryan Hart <bryan@eai.com>
Subject: Re: limit to record size?
Message-Id: <33A56B41.41C6@eai.com>

Tad McClellan wrote:
> 
> Darwin O.V. Alonso (dalonso@u.washington.edu) wrote:
> : It there a limit to the length of a record that perl can handle?
> 
> No, perl handles any length just fine.
> 
> There *is* a limit to the length of a record that any particular
> computer can handle though.
> 
> The size of the virtual memory.
> 
> : Is there a way to reset that limit?
> 
> Yes.
> 
> Buy more RAM or increase the swap size ;-)
> 

Depending on the system, you might also have to change the kernal
settings to allow a single process to access all the available memory
and swap (HP-UX and AIX come to mind...)

Bryan
-- 
-------------------------------
|  Bryan Hart                 
|  Network Products Engineer  
|  Engineering Animation Inc. 
|  Phone: (515) 296-5979
|  Fax: (515) 296-7025
|  Email: bryan@eai.com              
|  Web: http://www.eai.com/                          
-------------------------------
"A conclusion is simply the place where you got tired of thinking"


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

Date: Mon, 16 Jun 1997 09:25:29 -0500
From: Dan Brian <dan@clockwork.net>
Subject: mSQL and the Perl compiler
Message-Id: <33A54CD9.21E0@clockwork.net>

Has anyone successfully compiled a Perl program that uses the mSQL XSUBs
(msql-perl) with the compiler alpha-3? I am aware of the difficulties in
compiling extensions with the current release. I am not a C native, and
not extremely familiar with the workings of the compiler. Here is what I
have tried:

Compiled the msql-perl package (Msql.c) outputting an archive file (with
no "-shared") and then compiled using the Perl compiler, linking to the
 .a file. This doesn't compile at all, giving "undefined reference
errors."

Compiled the Msql.o object file, outputting an archive file, and then
compiled using the Perl compiler, linking to the .a file, as well as the
libmsql.a library. This results in a failed call to the package, "Can't
call method 'connect' in empty package 'Msql'" when the executable runs. 

The Perl compiler has been otherwise fantastic, and I know I'm trying to
do something it doesn't claim to be able to. I would be quite thankful
to anyone who can help me actually get a functional compiled executable
out of this. Thanks in advance.

Regards,

Dan Brian
dan@clockwork.net


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

Date: Mon, 16 Jun 1997 13:33:30 +0200
From: Eike Grote <eike.grote@theo.phy.uni-bayreuth.de>
Subject: Re: not printing
Message-Id: <33A5248A.15FB@theo.phy.uni-bayreuth.de>

Hi,

rroberts@gowebway.com wrote:
> 
> I meant line 5.  I changed it before I sent it.
> Could someone tell me if this is my fault or perl's and why?
> 
> >This program is not printing at line 6. In all other ways it is
> >working just fine.
> >
> >########################----  begin code
> >#!/usr/bin/perl -w
> >print "Give me a list of words and press^z when done.\n";
                                      ^^^^^^^
Do you really mean "press Ctrl-Z" ? On my machine/system this
means "stop the process" (message: "Suspended"). If I enter
Ctrl-D on an empty line everything works fine.

> >@a=<stdin>;
> >$b = @a;
> >print "Now give me a number between 1 and $b.";
> >$c = <stdin>;
> >chop($c);
> >print $a[$c-1];
> >########################-------   end code

Bye, Eike
-- 
======================================================================
 Eike Grote, Theoretical Physics IV, University of Bayreuth, Germany
----------------------------------------------------------------------
 e-mail -> eike.grote@theo.phy.uni-bayreuth.de
 WWW    -> http://www.phy.uni-bayreuth.de/theo/tp4/members/grote.html 
           http://www.phy.uni-bayreuth.de/~btpa25/
======================================================================


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

Date: Mon, 16 Jun 1997 17:07:26 +0200
From: Patrick Husi <Patrick.Husi@de.epfl.ch>
Subject: perl and refs
Message-Id: <33A556AE.39EF@de.epfl.ch>

in a perl script I call a sub with a ref:

my %myhash;
 .
 .
displayHash (\%myhash); #line 61

sub displayHash {
    my $input = @_;
    print $input->{'keyXY'}; #line 135
}


On my computer there's no trouble, but at an another computer there are
2 errors:

"displayHash" may clash with future reserved word at test.pl line 61.
parse error in file test.pl at line 61, next 2 tikens "displayHash("
Spurious backslash ignored at test.pl line 61. 

parse error in file test.pl at line 135, next 2 tokens "->"


Both perl versions are 5.003. Does anyone know why it works only at one
machine?

thanks
Patrick Husi


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

Date: 16 Jun 1997 12:00:41 GMT
From: mbeattie@sable.ox.ac.uk (Malcolm Beattie)
Subject: Re: Perl Compiler Trubles
Message-Id: <5o39t9$4ko@news.ox.ac.uk>

In article <33A50BA1.6E2@chim1.unifi.it>,
Massimo Fontanelli  <maxi@chim1.unifi.it> wrote:
>I have a Perl Compiler Toolkit problem, so I posted a message, but many
>informations
>about were missing, let's try again?
>
>My environment is: Dec Aplha running DEC Unix V3.2, Perl Version 5.004 +
                                                                  ^^^^^

There's the problem: 5.004 introduced a new keyword which means the
compiler kit's arrays of optypes and names are incorrect from a
certain point onwards.

>Perl Compiler Toolkit,
>both was compiled without problems using DEC OSF/1 C compiler
>
>The origin of the truble was that I wish to compile the following code:
>
>    #!/usr/bin/perl
>    $the_dir="/tmp";
>    opendir(CDIR, $the_dir);
>    @files = grep(/./,readdir(CDIR));
>    closedir(CDIR);
>    print "\n@files\n";
>
>The message of the toolkit is:
>>test syntax OK
>>Can't locate object method "first" via package "B::OP" at /usr/local/lib/perl5/s
>>ite_perl/B.pm line 95.

Here's a patch for that problem. Now that 5.004 is out and the current
compiler snapshot is being tested, I should be able to release alpha4
very soon. For now, try this:

------------------------------ cut here ------------------------------
Index: perlext/Compiler/ccop.c
==== //depot/perlext/Compiler/ccop.c#1 - //depot/perlext/Compiler/ccop.c#2 ====
*** perlext/Compiler/ccop.c.old	Mon Jun 16 11:57:04 1997
--- perlext/Compiler/ccop.c	Mon Jun 16 11:57:04 1997
***************
*** 404,409 ****
--- 404,412 ----
  	cc_listop,		/* prtf */
  	cc_listop,		/* print */
  	cc_listop,		/* sysopen */
+ #if PATCHLEVEL > 3
+ 	cc_listop,		/* sysseek */
+ #endif
  	cc_listop,		/* sysread */
  	cc_listop,		/* syswrite */
  	cc_listop,		/* send */
Index: perlext/Compiler/ccop.h
==== //depot/perlext/Compiler/ccop.h#1 - //depot/perlext/Compiler/ccop.h#2 ====
*** perlext/Compiler/ccop.h.old	Mon Jun 16 11:57:12 1997
--- perlext/Compiler/ccop.h	Mon Jun 16 11:57:12 1997
***************
*** 1,3 ****
--- 1,7 ----
+ #ifndef PATCHLEVEL
+ #include "patchlevel.h"
+ #endif
+ 
  typedef enum {
      OPc_NULL,	/* 0 */
      OPc_BASEOP,	/* 1 */
***************
*** 230,235 ****
--- 234,242 ----
  	"pp_prtf",
  	"pp_print",
  	"pp_sysopen",
+ #if PATCHLEVEL > 3
+ 	"pp_sysseek",
+ #endif
  	"pp_sysread",
  	"pp_syswrite",
  	"pp_send",
------------------------------ cut here ------------------------------

--Malcolm

-- 
Malcolm Beattie <mbeattie@sable.ox.ac.uk>
Oxford University Computing Services
"Widget. It's got a widget. A lovely widget. A widget it has got." --Jack Dee


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

Date: Mon, 16 Jun 1997 10:32:02 -0500
From: Dan Brian <dan@clockwork.net>
Subject: Re: Perl Compiler Trubles
Message-Id: <33A55C72.61D5@clockwork.net>

Has anyone successfully compiled a Perl program that uses the mSQL XSUBs
(msql-perl) with the compiler alpha-3? I am aware of the difficulties in
compiling extensions with the current release. I am not a C native, and
not extremely familiar with the workings of the compiler. Here is what I
have tried:

Compiled the msql-perl package (Msql.c) outputting an archive file (with
no "-shared") and then compiled using the Perl compiler, linking to the
 .a file. This doesn't compile at all, giving "undefined reference
errors."

Compiled the Msql.o object file, outputting an archive file, and then
compiled using the Perl compiler, linking to the .a file, as well as the
libmsql.a library. This results in a failed call to the package, "Can't
call method 'connect' in empty package 'Msql'" when the executable runs. 

The Perl compiler has been otherwise fantastic, and I know I'm trying to
do something it doesn't claim to be able to. I would be quite thankful
to anyone who can help me actually get a functional compiled executable
out of this. Thanks in advance.

Regards,

Dan Brian
dan@clockwork.net


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

Date: Mon, 16 Jun 1997 11:39:14 -0400
From: Nick Vargish <nav@patriot.net>
Subject: Re: perl joke of the day ?
Message-Id: <Pine.LNX.3.95.970616112952.28669F-100000@adams.patriot.net>


On 11 Jun 1997, Rick Klement wrote:

> I saw this line in a perl script today...
>        if ( length($aString) gt 0 )
 
Not quite as sad, because it works as expected:

if (length(@opyrf[$idx]) > 0) ...

I spent a whole day last week fixing lines like this in a 90K "filter"
that was handed to me by my current contract. I also spent some time 
with:

for ($idx = 0; $idx < @opyrf; ++$idx) {
    $line .= @opyrf[$idx] . "~";
}

Never mind the slice where a scalar was intended ("perl -wc" reported
373 such warnings the first time I checked the filter), I  just did:

$line = join ("~", @opyrf) . "~";

I shouldn't complain, since this is paying the bills _very_ nicely, but it
must be expensive for the contractee... :^)

Nick
--
nav@patriot.net      Unix Systems Engineer; Programmer; Internet Security 



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

Date: 16 Jun 1997 16:12:55 GMT
From: henrik@stat.tamu.edu (Henrik Schmiediche)
Subject: Perl language question - a regular expressions.
Message-Id: <5o3om7$emo@news.tamu.edu>

    Hello,
I am trying to configure a database server written in perl. I need
to restrict access to the server from IP addresses:

    165.91.*.*
    128.194.*.*

I do this by specifying a variable called AddressMask:

  AddressMask = 165\.91\.*

which would restrict access o the first of the two IP address
ranges. Problem is I am not sure how to write the AddressMask
so that both address ranges above are valid and no others.

The code in the perl program that checks for the correct address 
is:

        if ($Config{'AddressMask'}) { # Check address
            unless ($inetaddr =~ /$Config{'AddressMask'}/) {        
                print NS
                    "010 Connections from address $inetaddr" .
                        " not allowed on this server\n";
                close NS;
                exit;
            }
        }

Is there a Regular Expression I can create to allow access
from both IP address ranges?

Thanks. 
     - Henrik
--
Henrik Schmiediche, Dept. of Statistics, Texas A&M, College Station, TX 77843
E-mail: henrik@stat.tamu.edu  |  Tel: (409) 862-1764   |  Fax: (409) 845-3144


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

Date: 16 Jun 1997 09:15:32 -0400
From: hatch@cais2.cais.com (William E. Hatch)
Subject: ptk with perl 5.003_93 and Tk400.202
Message-Id: <5o3e9k$fro@cais2.cais.com>

I have been trying to build tkperl with static loading using perl 5.003_93
and Tk400.202 . I have tried perl 5.003_93 with and without perl 5.003
binary compatibility. In each case i get a slightly different set of
unresolved external references when trying to build tkperl. Is there
a simple workaround or do I have to chase down each reference in the
perl 5.003_93 libraries ?

My system is BSDI 3386 3.0 on a 90 MHz pentium. The C compiler is gcc
which seems to be required for Tk400.202 .

bill hatch



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

Date: Mon, 16 Jun 1997 09:28:26 -0400
From: TJ Grewal <tj@irg.net>
Subject: retreive and parse an html page
Message-Id: <33A53F79.F861A915@irg.net>

I need pointers on how i can retreive a remote html page which consists
of comma delimited text. The parsing shouldnt be a problem, but how do i
grab the page?

Any help appreciated

TJ


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

Date: Mon, 16 Jun 1997 23:50:29 +1000
From: Anil Gupta <anil@inta.net.au>
Subject: Sockets
Message-Id: <33A544A5.5D7D@inta.net.au>

Hello there..

Does anyone know where I can find a good socket tutorial?
I tried perlipc but it was a bit advanced


Thanks.

Anil Gupta


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

Date: Mon, 16 Jun 1997 07:54:52 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Ng Chin Kiong <ckng@global.com.my>
Subject: Re: Sorting Associative Array? (Urgent)
Message-Id: <Pine.GSO.3.96.970616075224.23046I-100000@kelly.teleport.com>

On Mon, 16 Jun 1997, Ng Chin Kiong wrote:

> Subject: Sorting Associative Array? (Urgent)

If it's urgent, you should check the docs and FAQs first.

> Does anyone know how to sort an associative array by the key value?

Yes, you simply sort the keys. There's an example in perlfunc(1) under
keys(). 

> I've look into http://www.perl.com/perl/everything_to_know/sort.html,
> but couldn't find anything.

Keep trying. Good luck!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 16 Jun 1997 10:58:49 -0500
From: Eddie Brown <eddie@cs.odu.edu>
Subject: Re: What does "UNIX" stand for..
Message-Id: <33A562B9.5A3E@cs.odu.edu>

av wrote:
> 
> Bill (Gates) Erwin wrote:
> 
> > UNIX started out as "Castrated MULTICS" and was shortened from there.
> > Check out the "UNIX Haters Handbook" for further details.
> >
> > Bill
> 
> I have 4 Intranet servers running. 3 are Linux and one is NT. I keep the
> NT alive just for demo, it runs on the better machine and still has the
> worse performance, and crashes at least twice a week... Really Microsoft
> style.. :-b
> 
> I don't know what the "UNIX Haters Handbook" is, but sounds like
> bullshit...

 Yeah.. I think all of us who have used both Microsoft operating systems
and any UNIX operating system know what's better. I'm currently being
forced to use Win95.. (barf!). UNIX is a real operating system made
for real computers.. the only thing that comes to mind when I look
at Win95/NT/etc or PC's for that matter is: toy.


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

Date: Mon, 16 Jun 1997 10:59:56 -0500
From: Eddie Brown <eddie@cs.odu.edu>
Subject: Re: What does "UNIX" stand for..
Message-Id: <33A562FC.3126@cs.odu.edu>

av wrote:
> 
> Bill (Gates) Erwin wrote:
> 
> > UNIX started out as "Castrated MULTICS" and was shortened from there.
> > Check out the "UNIX Haters Handbook" for further details.
> >
> > Bill
> 
> I have 4 Intranet servers running. 3 are Linux and one is NT. I keep the
> NT alive just for demo, it runs on the better machine and still has the
> worse performance, and crashes at least twice a week... Really Microsoft
> style.. :-b
> 
> I don't know what the "UNIX Haters Handbook" is, but sounds like
> bullshit...

If operating systems were programming languages UNIX would be C 
and Win95 would be BASIC with line numbers. :)


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 615
*************************************

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