[9299] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2894 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 17 18:09:30 1998

Date: Wed, 17 Jun 98 15:00:31 -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           Wed, 17 Jun 1998     Volume: 8 Number: 2894

Today's topics:
    Re: A funny problem with "use integer" (Ilya Zakharevich)
    Re: A funny problem with "use integer" (Allan M. Due)
    Re: A funny problem with "use integer" (Mike Stok)
    Re: A funny problem with "use integer" <aqumsieh@matrox.com>
    Re: A funny problem with "use integer" (Ilya Zakharevich)
    Re: A funny problem with "use integer" (Allan M. Due)
    Re: Curly braces in if elsif contructs (Tom Rokicki)
        Event viewer <dshrader@students.uiuc.edu>
        Forks and reaping children question <aaron.becher@sdrc.com>
        formline and predefined formats <markjones@mindless.com>
    Re: getting first letter of a string (Larry Rosler)
        Help With files, please <dasha@shpl.ru>
        I need help with my ^M problem. (Bobby Chan)
    Re: I need help with my ^M problem. <burright@umbc.edu>
    Re: I need help with my ^M problem. (Larry Rosler)
        Lists vs. Arrays (Chip Salzenberg)
        Oracle,DBI <arkady@globes.co.il>
        perl command line options <norman.bunn@mci.com>
        Perlscript Problem <skrub@bigfoot.com>
    Re: print <<END (with variables) (Alex Barilo)
        Problem building GD.pm on Solaris 2.6 <michael_mongeau@stratus.com>
        Q: how to set regex options on the fly Matthew.Wickline@usa.net
    Re: Q: how to set regex options on the fly (Larry Rosler)
        regex terminator not allowed in comment in extended reg <mgregory@asc.sps.mot.com>
    Re: regex terminator not allowed in comment in extended (Ilya Zakharevich)
    Re: regex terminator not allowed in comment in extended <*@qz.to>
    Re: regex terminator not allowed in comment in extended <*@qz.to>
    Re: REVIEW: Perl CGI Programming - No Experience Requir (Chip Salzenberg)
    Re: strange error message .. "value of <handle> ..." (Larry Rosler)
    Re: turning off caching with cgi.pm (Patrick Timmins)
    Re: turning off caching with cgi.pm (Andy Lester)
        What do I use with perl to get database funcitons? <troy.bull@uni.edu>
    Re: Win NT- CGI script help please <ablaze@sonic.net>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 17 Jun 1998 19:33:25 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: A funny problem with "use integer"
Message-Id: <6m95m5$juj$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Bernard Cosell
<bernie@fantasyfarm.com>],
who wrote in article <3588ecbd.65423351@ganymede.rev.net>:
> Anyone know what's going on here?

Yes.  Upgrade.

Ilya


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

Date: 17 Jun 1998 20:17:44 GMT
From: due@murray.fordham.edu (Allan M. Due)
Subject: Re: A funny problem with "use integer"
Message-Id: <6m9898$coh$0@206.165.146.32>

[This followup was posted to comp.lang.perl.misc and a copy was sent to 
the cited author.]

In article <6m95m5$juj$1@mathserv.mps.ohio-state.edu>, Ilya Zakharevich 
(ilya@math.ohio-state.edu) posted...
|[A complimentary Cc of this posting was sent to Bernard Cosell
|<bernie@fantasyfarm.com>],
|who wrote in article <3588ecbd.65423351@ganymede.rev.net>:
|> Anyone know what's going on here?
|
|Yes.  Upgrade.
|
|Ilya
|
Under which version of Perl does this behavior disappear?  Stuck in my 
Windoze world I can only attain 5.004_02, a version where integer 
"oddities" still remain.  Interestingly, on my System the $a - $b does 
not produce 0 under use integer.  None the less, there are some strange 
things going on.  $a + 0 produces a large negative value for example.  
This would suggest to me that that the behavior has to do with how 
integers are stored in memory.  In fact, I would guess the maximum value 
that an integer can take under use integer is the absolute value of 
2,147,483,647.  I would appreciate it if someone could confirm this for 
me.  

The fact that there is a module called BigInt (to handle integers 
big in magnitude) would seem to confirm my belief that this is a memory 
issue.  But it might just be me.

-- 
Allan M. Due
Due@Murray.Fordham.edu

The beginning of wisdom is the definitions of terms.
- Socrates


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

Date: 17 Jun 1998 20:38:32 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: A funny problem with "use integer"
Message-Id: <6m99g8$ku3@news-central.tiac.net>

In article <6m95m5$juj$1@mathserv.mps.ohio-state.edu>,
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
>[A complimentary Cc of this posting was sent to Bernard Cosell
><bernie@fantasyfarm.com>],
>who wrote in article <3588ecbd.65423351@ganymede.rev.net>:
>> Anyone know what's going on here?
>
>Yes.  Upgrade.

What should he upgrade?  On my x86 linux box 5.004_04 and 5.004_66
versions both produce

3308782
3308782
0

but my alpha based machine with perl 5.004_04 says

3308782
3308782
3308782

I'm not saying that getting onto 5.004_04, the current stable release, is
a bad thing - just wondering if it'll cure this particular problem.

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Wed, 17 Jun 1998 15:54:24 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: A funny problem with "use integer"
Message-Id: <35881EEF.5FC912B8@matrox.com>

Bernard Cosell wrote:

> Consider:
> $a = "2709789211" ;
> $b =  "2706480429" ;
> print $a -  $b, "\n";
>
> use integer ;
> print $a -  $b, "\n";
>
> $a = "2709789211" ;
> $b =  "2706480429" ;
> print $a -  $b, "\n";
>
> =========================
> The output I get with "This is perl, version 5.003 with EMBED" is:
>
> 3308782
> 3308782
> 0

Hmmm.. I am using the same version of Perl at the moment (5.003) ... but
my output is:

3308782
3308782
3308782

Maybe something is wrong with your integer module? I suggest you
re-install, and upgrade to the latest version of Perl.

> Anyone know what's going on here?
>
>   /Bernie\
> --
> Bernie Cosell                     Fantasy Farm Fibers
> mailto:bernie@fantasyfarm.com     Pearisburg, VA
>     -->  Too many people, too few sheep  <--



--
Ala Qumsieh             |  No .. not just another
ASIC Design Engineer    |  Perl Hacker!!!!!
Matrox Graphics Inc.    |
Montreal, Quebec        |  (Not yet!)





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

Date: 17 Jun 1998 20:52:44 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: A funny problem with "use integer"
Message-Id: <6m9aas$72$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Allan M. Due
<due@murray.fordham.edu>],
who wrote in article <6m9898$coh$0@206.165.146.32>:
> |Yes.  Upgrade.

> Under which version of Perl does this behavior disappear?  Stuck in my 
> Windoze world I can only attain 5.004_02,

Wrong.  EMX version is at 5.004_55.  And I think that anyone can
compile 5.004_04, which cures the fault.

Ilya


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

Date: 17 Jun 1998 20:56:22 GMT
From: due@murray.fordham.edu (Allan M. Due)
Subject: Re: A funny problem with "use integer"
Message-Id: <6m9ahm$ko3$0@206.165.146.32>

In article <3588ecbd.65423351@ganymede.rev.net>, Bernard Cosell 
(bernie@fantasyfarm.com) posted...
|I don't know if this should be counted as a bug or just a subtle
|misfeature, but there's a cute trap in the use of 'use integer'.
|
|It seems to mess up how variables are stored.  Very odd stuff.
|
|Consider:
|$a = "2709789211" ;
|$b =  "2706480429" ;
|print $a -  $b, "\n";
|
|use integer ;
|print $a -  $b, "\n";
|
|$a = "2709789211" ;
|$b =  "2706480429" ;
|print $a -  $b, "\n";
|
|=========================
|The output I get with "This is perl, version 5.003 with EMBED" is:
|
|3308782
|3308782
|0
|
|There are a bunch of other anomalies surrounding this whole mess, but
|you get the idea... [e.g., you can try doing "$a + 0" and "$a * 1" and
|see the odd results]
|
|Anyone know what's going on here?
|
|  /Bernie\
|-- 
|Bernie Cosell                     Fantasy Farm Fibers
|mailto:bernie@fantasyfarm.com     Pearisburg, VA
|    -->  Too many people, too few sheep  <--
|
I believe what you are seeing here is perl storing integers in 4 bytes 
when use integer is evoked.  This is a conclusion, not something I know 
to be a fact.  Further edification would be appreciated. 

If my conclusion is correct then the following would explain the 
behavior you are observing.  If my memory serves me correctly 4 bytes 
can represent the integers from -2,147,483,648 to 2,147,483,647.  In the 
beginning of your code snippet you assign the vars $a and $b and they 
are stored in memory, with adequate memory to represent them.  When you 
evoke use integer any subsequent integer memory allocation will only use 
4 bytes.  So your first and second print statements are fine.  Next you 
reassign the vars using numbers outside the permissible range.  As the 
numbers are too large they are not represented accurately and errors 
occur.  The solution is to use smaller numbers or the BigInt module.  I 
would suggest the second alternative.

HTH

-- 
Allan M. Due
Due@Murray.Fordham.edu

The beginning of wisdom is the definitions of terms.
- Socrates


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

Date: 17 Jun 1998 12:38:21 -0700
From: rokicki@cello.hpl.hp.com (Tom Rokicki)
Subject: Re: Curly braces in if elsif contructs
Message-Id: <6m95vd$dj4@cello.hpl.hp.com>


>         Let the flames begin!

I was taught on my Momma's knee that proper object-oriented
programming requires that each method/subroutine fit on an 80x24
screen in its entirety, else it is too complex and should be split.
In order to satisfy this sage advice, I generally recommend that
the if,(), {, }, else, {, and } all be on the *same* line.

-tom




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

Date: Wed, 17 Jun 1998 16:37:51 -0500
From: David Shrader <dshrader@students.uiuc.edu>
Subject: Event viewer
Message-Id: <3588372F.4B3AE74E@students.uiuc.edu>

How can I get the backup function in the Win32::EventViewer module to
save the file as a text document rather than a .evt file. I need to find
a way to parse through the print server logs here at work and wanted to
have my Perl script first get the print log automatically and then parse
through it picking out the information I need.

Any answers or ideas would be appreciated!!!!

Thanks!!






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

Date: Wed, 17 Jun 1998 17:32:10 -0400
From: Aaron Becher <aaron.becher@sdrc.com>
Subject: Forks and reaping children question
Message-Id: <358835DA.984BFBE6@sdrc.com>

If I keep track of every pid that gets forked off, and then waitpid on
each and every one, is there any reason to still use "$SIG{'CHLD'}=<some
kind of child reaper>" in my script?

The reason I'd like to not use the SIG is because it causes my child
processes trouble when ever they try to do an operation that does its
own behind-the-scenes fork (system,backticks,etc.).

Or maybe the best answer is to use the SIG in the parent and turn the
SIG off in the children. I'm making a server that is going to be called
from a cgi script _a_lot_, so I want to be able to handle multiple
requests at a time while making sure I don't cause zombie processes to
fill up the web server.

Thanks for any help!
Aaron Becher
aaron.becher@sdrc.com


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

Date: Wed, 17 Jun 1998 14:22:13 -0500
From: Mark Evan Jones <markjones@mindless.com>
Subject: formline and predefined formats
Message-Id: <35881765.C89C4E75@mindless.com>

Is it possible to use formline and specify only a predefined format
instead of duplicating the picture every time?  ie, instead of


  formline ('@<<< @||| @>>>', 1, 2, 3);
  print "$^A\n";

or

  formline <<'END',1,2,3;
  @<<< @||| @>>>
  END
  print "$^A\n";


can I do something like:

  formline (SIMPLE, 1, 2, 3)
  $temp = $^A;


  format SIMPLE = 
  @<<< @||| @>>>
  $one, $two, $three
  .

I'm asking because I have several formats that I occasionally want to
use without writing to a file, and which very well could change.  If
they do change, I don't want to have to hunt down all the places the
picture appears (though that shouldn't be all that many places, it would
still be daunting for someone else to find).  Is there another way I can
accomplish this without writing to a temp file (eew)?


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

Date: Wed, 17 Jun 1998 13:57:57 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: getting first letter of a string
Message-Id: <MPG.ff1cdac8d7a9687989693@nntp.hpl.hp.com>

In article <6m8s5k$hb3$3@mainsrv.main.nc.us>, scott@softbase.com says...
> Ritche Macalaguim (ritche@san.rr.com) wrote:
> > How can I get the first letter of a string in Perl?
> 
> substr? Or is there more to the question than that?
 ...

Yes -- the possible semantic distinction between "letter" and "character" 
(which is what substr will return).  This has opened the door to a little 
ingenuity and fun.

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 18 Jun 1998 00:48:16 +0400
From: Daria Krouteleva <dasha@shpl.ru>
Subject: Help With files, please
Message-Id: <35882B90.7633@shpl.ru>

Hi all.

My problem is:

I have a diferent files (www.myhost.com/file.htm, file1.htm , file2,htm)
and i want choose one of them 
in simple form and then print this file into browser.


And this must be done by perl script...

 
Help please


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

Date: 17 Jun 1998 19:57:32 GMT
From: kwb_cha@alcor.concordia.ca (Bobby Chan)
Subject: I need help with my ^M problem.
Message-Id: <6m973c$cqe$1@newsflash.concordia.ca>


Hi...

	I'm taking a class on CGI/Perl programming and I can't figure out
how to get rid of the ^M appended to the data sent by Windows based
machines. I can get rid of the \n using regular expressions, but I can't
seem to be able to get rid of the ^M. The data is sent from a form on a
page and then I use that input and write it out to a file. If the user
presses enter inside that form, then it will have that dreaded ^M inside
my file. There is no problem with UNIX based input, only Windows based.
Is there any way to remove that ^M?

	I tried searching for the ASCII code for ^M (013) but that doesn't
work. Is there a special command in CGI.pm that will solve this problem?
Please let me know. Thanks!


-- 
* Bobby Chan                                         ICQ# 6847801           *
* kwb_cha@alcor.concordia.ca         ___ __o        "Put some excitement    *
* bobby_chan1@hotmail.com           --- -\<.         between your legs...   *
* Montreal, Quebec, CANADA        ((( (_)/(_)        Ride a Mountain Bike!" *


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

Date: Wed, 17 Jun 1998 17:04:35 -0400
From: Scott Burright <burright@umbc.edu>
To: Bobby Chan <kwb_cha@alcor.concordia.ca>
Subject: Re: I need help with my ^M problem.
Message-Id: <Pine.SGI.3.96.980617165915.3901E-100000@umbc7.umbc.edu>

Just backslash the ^.

	$blah =~ s/\^M//gs;

On 17 Jun 1998, Bobby Chan wrote:

> 
> Hi...
> 
> 	I'm taking a class on CGI/Perl programming and I can't figure out
> how to get rid of the ^M appended to the data sent by Windows based
> machines. I can get rid of the \n using regular expressions, but I can't
> seem to be able to get rid of the ^M.



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

Date: Wed, 17 Jun 1998 14:24:29 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: I need help with my ^M problem.
Message-Id: <MPG.ff1d3eb94ec4884989694@nntp.hpl.hp.com>

[This followup was posted to comp.lang.perl.misc and a copy was sent to 
the cited author.]

In article <Pine.SGI.3.96.980617165915.3901E-100000@umbc7.umbc.edu>, 
burright@umbc.edu says...
> Just backslash the ^.
> 
> 	$blah =~ s/\^M//gs;
> 
> On 17 Jun 1998, Bobby Chan wrote:
> 
> > 
> > Hi...
> > 
> > 	I'm taking a class on CGI/Perl programming and I can't figure out
> > how to get rid of the ^M appended to the data sent by Windows based
> > machines. I can get rid of the \n using regular expressions, but I can't
> > seem to be able to get rid of the ^M.

NO!!!  Even the most rudimentary test would show that this substitution 
does nothing.  What your editor may display as '^M' is a single 
character, not the two characters '^' and 'M'.  Perl's way of 
representing Control-M is '\cM' and

$blah =~ s/\cM//gs;

works just fine.  Please don't spew crap into the archives of this 
newsgroup without testing it first.

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Wed, 17 Jun 1998 21:42:04 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Lists vs. Arrays
Message-Id: <6m9da8$ma1$1@cyprus.atlantic.net>

According to Jaime Metcher <metcher@spider.herston.uq.edu.au>:
>[proposed language for early on in a Perl book]
>WARNING: There is a 98% chance you will ask a FAQ on comp.lang.perl.misc
>if you don't read the following bit of arcana.  [blurb about AV's]. 

When I teach the beginning Perl course based on the Llama book, I take
30 seconds to explain that lists are not arrays -- that lists are
bunches of scalars, and arrays are variables that hold list values.
Then I use the terms _correctly_ for the rest of the course.

I haven't had one student confuse the two when doing exercises.

Coicidence or conspiracy?!  You be the judge!
-- 
Chip Salzenberg                - a.k.a. -               <chip@pobox.com>
"I brought the atom bomb.  I think it's a good time to use it."  //MST3K
           ->  Ask me about Perl training and consulting  <-
     Like Perl?  Want to help out?  The Perl Institute: www.perl.org


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

Date: Wed, 17 Jun 1998 22:07:30 +0300
From: Arkady Karpman <arkady@globes.co.il>
Subject: Oracle,DBI
Message-Id: <358813F2.EE76F5FC@globes.co.il>

I have problem with connect to Oracle DB
ERROR: ORA-0.
Pls.help.



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

Date: Wed, 17 Jun 1998 21:24:55 GMT
From: "Norman Bunn" <norman.bunn@mci.com>
Subject: perl command line options
Message-Id: <HuWh1.5216$uC.2041238@pm01nn>

Is there anyway to tell perl from the command line not to look for input?  I
have a program that I want to run unattended from the command line (using
cron) and on demand from an HTML form.

Norman
norman.bunn@nospam.mci.com
remove "no spam" to reply.




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

Date: Wed, 17 Jun 1998 17:01:30 -0400
From: "Skrub" <skrub@bigfoot.com>
Subject: Perlscript Problem
Message-Id: <6m9asb$ct9$1@homer.bucknell.edu>

I know this is the Perl forum, but I couldn't find a perlscript newsgroup,
so I hope osmeone here can help me.

I need to use perlscript in an active server page to access files on the
server. I know it can be done with vbscript, so I hope it can be done in
perlscript. I really don't want to have to go and learn vbscript.

If anyone knows how to do this, please e-mail me.

Thank You,

--
Brian McCallister
skrub@bigfoot.com




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

Date: Wed, 17 Jun 1998 20:34:03 GMT
From: hash@email.infotrade.co.uk (Alex Barilo)
Subject: Re: print <<END (with variables)
Message-Id: <358a0a8b.3675712@news.force9.net>

On Wed, 17 Jun 1998 07:02:57 GMT, Eric Bohlman <ebohlman@netcom.com>
wrote:

> Michael Sazonov <msazonov@usa.net> wrote:
> : And another follow up question: is there a way to do like
> : this:
> : print <<"EOT"
> :   &perl_func
> : EOT
> 
> : For example, "${&localtime}[5]" call (I want get current
> : year) gets error "Undefined subroutine &main::localtime"
> 
> print <<"EOT";
>   The year is ${[localtime()]}[5].
> EOT
> 
> The square brackets force list context on localtime() and create an 
> anonymous array.

THANX, Eric! It is exactly what I need. But I have a question again:
it works perfectly fine if I use:
@{[my_func]}	or
@{[my_func()]}	or
${[my_func]}[0]

but it doesn't work here:

#!/usr/local/bin/perl -w
sub big_test { return 555 }
print <<"EOT";
  ${big_test}			# Use of uninitialized value
  ${&big_test}			# Use of uninitialized value
  ${big_test()}			# Use of uninitialized value
  ${&big_test()}		# Use of uninitialized value
  ${main::big_test()}		# Use of uninitialized value
  ${&main::big_test()}		# Use of uninitialized value
  &{main::big_test()}		# just prints '&{main::big_test()}'
  ${&{main::big_test()}}	# (!) Undefined subroutine &main::555
EOT

why do I need it to get it as anonymous array? Please note the last
line -- something interesting is going on. Can someone explain this
please.

Cheers,
Alex
---------
All you need is Perl


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

Date: Wed, 17 Jun 1998 17:04:52 -0400
From: "Michael Mongeau" <michael_mongeau@stratus.com>
Subject: Problem building GD.pm on Solaris 2.6
Message-Id: <6m9ati$b8c@transfer.stratus.com>

I'm trying to build GD.pm v1.18 in this environment:

  Solaris 2.6   Perl 5.004_04   gcc 2.7.2.3

It fails during the build of libgd:


gcc -c  -I/usr/local/include -O    -DVERSION=\"0.10\" -DXS_VERSION=\"0.10\" 
-fpic
 -I/usr/local/lib/perl5/sun4-solaris/5.00404/CORE  libgd.c
 libgd.c: In function `gdImageCreateFromGif':
 libgd.c:1651: `ssize_t' undeclared (first use this function)
 libgd.c:1651: (Each undeclared identifier is reported only once
 libgd.c:1651: for each function it appears in.)
 libgd.c:1651: parse error before `fread'
 libgd.c:1651: parse error before `)'
 libgd.c: At top level:
 libgd.c:1657: parse error before `('
 libgd.c:1658: invalid initializer
 libgd.c:1658: warning: data definition has no type or storage class
 libgd.c:1660: parse error before `if'
 libgd.c:1666: `buf' undeclared here (not in a function)
 libgd.c:1666: initializer element is not constant
 libgd.c:1666: warning: data definition has no type or storage class
 libgd.c:1667: `buf' undeclared here (not in a function)
 libgd.c:1667: warning: data definition has no type or storage class
 libgd.c:1668: `buf' undeclared here (not in a function)
 libgd.c:1668: warning: data definition has no type or storage class
 libgd.c:1669: `buf' undeclared here (not in a function)
 libgd.c:1669: warning: data definition has no type or storage class
 libgd.c:1671: parse error before `if'
 libgd.c:1692: parse error before `>='
 libgd.c:1706: parse error before `&'
 libgd.c:1706: warning: data definition has no type or storage class
 libgd.c:1720: `buf' undeclared here (not in a function)
 libgd.c:1720: warning: data definition has no type or storage class
 libgd.c:1722: `buf' undeclared here (not in a function)
 libgd.c:1722: initializer element is not constant
 libgd.c:1722: warning: data definition has no type or storage class
 libgd.c:1724: `buf' undeclared here (not in a function)
 libgd.c:1724: `buf' undeclared here (not in a function)
 libgd.c:1724: initializer element is not constant
 libgd.c:1724: warning: data definition has no type or storage class
 libgd.c:1725: `buf' undeclared here (not in a function)
 libgd.c:1725: `buf' undeclared here (not in a function)
 libgd.c:1725: initializer element is not constant
 libgd.c:1725: warning: data definition has no type or storage class
 libgd.c:1726: parse error before `if'
 libgd.c:1735: parse error before `('
 libgd.c: In function `ReadColorMap':
 libgd.c:1757: `ssize_t' undeclared (first use this function)
 libgd.c:1757: parse error before `fread'
 libgd.c:1757: parse error before `!='
 libgd.c: At top level:
 libgd.c:1766: parse error before `return'
 libgd.c: In function `GetDataBlock':
 libgd.c:1800: `ssize_t' undeclared (first use this function)
 libgd.c:1800: parse error before `fread'
 libgd.c:1800: parse error before `)'
 libgd.c: At top level:
 libgd.c:1804: `count' undeclared here (not in a function)
 libgd.c:1804: initializer element is not constant
 libgd.c:1804: warning: data definition has no type or storage class
 libgd.c:1806: parse error before `if'
 libgd.c: In function `ReadImage':
 libgd.c:1986: `ssize_t' undeclared (first use this function)
 libgd.c:1986: parse error before `fread'
 libgd.c:1986: parse error before `)'
 libgd.c: At top level:
 libgd.c:2007: warning: parameter names (without types) in function
declaration
 libgd.c:2007: conflicting types for `gdImageSetPixel'
 libgd.c:136: previous declaration of `gdImageSetPixel'
 libgd.c:2007: warning: data definition has no type or storage class
 libgd.c:2008: parse error before `++'
 make: *** [libgd.o] Error 1

I downloaded Thomas Boutell's GD library v1.3 (the current GD.pm  uses
v1.2).
I was able to compile that fine and then build GD.pm but I get an error when
running the tests:

 # make test
 make[1]: Entering directory `/home/local/src/perlmod/GD-1.18/libgd'
 make[1]: Nothing to be done for `all'.
 make[1]: Leaving directory `/home/local/src/perlmod/GD-1.18/libgd'
 PERL_DL_NONLAZY=1 /bin/perl -I./blib/arch -I./blib/lib
 -I/usr/local/lib/perl5/sun4-solaris/5.00404 -I/usr/local/lib/perl5 -e 'use
 Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
 t/GD................Can't load './blib/arch/auto/GD/GD.so' for module GD:
ld.so.1:
 /bin/perl: fatal: relocation error: file ./blib/arch/auto/GD/GD.so: symbol
 gdImageGifPtr: referenced symbol not found at
 /usr/local/lib/perl5/sun4-solaris/5.00404/DynaLoader.pm line 166.
 at t/GD.t line 4
 BEGIN failed--compilation aborted at t/GD.t line 4.
 dubious
        Test returned status 2 (wstat 512, 0x200)
 FAILED--1 test script could be run, alas--no output ever seen
 make: *** [test_dynamic] Error 2


All the demo programs fail also.  Has anyone else had any success on Solaris
2.6 ?

 Michael Mongeau
 Stratus Computer







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

Date: Wed, 17 Jun 1998 20:53:47 GMT
From: Matthew.Wickline@usa.net
Subject: Q: how to set regex options on the fly
Message-Id: <6m9acq$jan$1@nnrp1.dejanews.com>



hello there clpm'ers :)

I've been trying to figure out an easy way to do this, and I'm
begining to think that maybe there just isn't an easy way.

I'm writting a subroutine which will take some args, build an
annonymous subroutine based on those args, and then return a
reference to that anonymous sub. No problem there.

For the purposes of this message, we'll assume that the *only*
difference in these subroutines is the options used on a m//
operator burried within the anonymous subroutines. Depending on
the args given, there may be any/some/all of the imsx options.

Is there an easier way to do this than to code out some 2^4
anonymous subroutines and do an equivilant of a case?

Is there a way to have those options be set on the fly, and
then just have one anonymous sub coded with a variable placed
where those options would be?

TIA for any suggestions, or for confirmation from someone that
there is no easy way out...

-matt

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Wed, 17 Jun 1998 14:32:40 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Q: how to set regex options on the fly
Message-Id: <MPG.ff1d5d4cb218843989695@nntp.hpl.hp.com>

In article <6m9acq$jan$1@nnrp1.dejanews.com>, Matthew.Wickline@usa.net 
says...
 ... 
> For the purposes of this message, we'll assume that the *only*
> difference in these subroutines is the options used on a m//
> operator burried within the anonymous subroutines. Depending on
> the args given, there may be any/some/all of the imsx options.
> 
> Is there an easier way to do this than to code out some 2^4
> anonymous subroutines and do an equivilant of a case?
> 
> Is there a way to have those options be set on the fly, and
> then just have one anonymous sub coded with a variable placed
> where those options would be?

perldoc -f eval

The subroutine should construct a string comprising the regex and options 
that you want, then 'eval' it.

For example,

$result_of_match = eval "\$variable =~ /regex/$options";

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 17 Jun 1998 16:53:47 +0930
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: regex terminator not allowed in comment in extended regex?
Message-Id: <r8g1h48pa4.fsf@asc.sps.mot.com>


Hi,

Is it a bug that 


  ($Register, $Mask) = ($Register =~ 
			m/
			^[+-]?              # Optionally a +/- specifier
			(.*)                # the register
			(?:                 # optionally followed by
			 \s+([a-f0-9]{8})   # space and an 8 digit hex mask
			 )?
			$/x);
  

causes perl to barf?

The / embedded in the comment is the reason.

I would have thought that DWIM would have certainly meant that a
comment-to-end-of-line overrules any other interpretation!

Thanks,

Martin.


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

Date: 17 Jun 1998 20:50:10 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: regex terminator not allowed in comment in extended regex?
Message-Id: <6m9a62$t68$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Martin Gregory 
<mgregory@asc.sps.mot.com>],
who wrote in article <r8g1h48pa4.fsf@asc.sps.mot.com>:
> 
> Hi,
> 
> Is it a bug that 
> 
> 
>   ($Register, $Mask) = ($Register =~ 
> 			m/
> 			^[+-]?              # Optionally a +/- specifier
> 			(.*)                # the register
> 			(?:                 # optionally followed by
> 			 \s+([a-f0-9]{8})   # space and an 8 digit hex mask
> 			 )?
> 			$/x);

RE started by / is terminated by the first unbackwacked /.  Same as
with qq// etc.

Ilya


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

Date: 17 Jun 1998 21:11:35 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: regex terminator not allowed in comment in extended regex?
Message-Id: <eli$9806171655@qz.little-neck.ny.us>

In comp.lang.perl.misc, Martin Gregory  <mgregory@asc.sps.mot.com> wrote:
> Is it a bug that 
[the below]
> causes perl to barf?

Nope.

>   ($Register, $Mask) = ($Register =~ 
> 			m/
> 			^[+-]?              # Optionally a +/- specifier
> 			(.*)                # the register
> 			(?:                 # optionally followed by
> 			 \s+([a-f0-9]{8})   # space and an 8 digit hex mask
> 			 )?
> 			$/x);
> 
> The / embedded in the comment is the reason.

This is why God (Larry) gave you the ability to change the delimiter.
Hint: () {} [] and <> work as balanced delimiters. So this is quite
fine:

  ($Register, $Mask) = ($Register =~ m
 			(
 			^[+-]?              # Optionally a +/- specifier
 			(.*)                # the register
 			(?:                 # optionally followed by
 			 \s+([a-f0-9]{8})   # space and an 8 digit hex mask
 			 )?
 			$)x);

One very important rule is the the /options *cannot* have any
whitespace between them and the final delimiter.

> I would have thought that DWIM would have certainly meant that a
> comment-to-end-of-line overrules any other interpretation!

Feel free to patch perl if you insist, but I think that this sort of
thing should be allowed:

	$var =~ s< \b ( in )? valuable \b # shorten both ><$1v>x;

Though I would probably be more inclined to use (?# ... ) in practice.

Elijah
------
sometimes wishes for /x on qx//, qq//, and q//


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

Date: 17 Jun 1998 21:19:26 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: regex terminator not allowed in comment in extended regex?
Message-Id: <eli$9806171713@qz.little-neck.ny.us>

I followed up to Martin Gregory  <mgregory@asc.sps.mot.com>, writing:
> >   ($Register, $Mask) = ($Register =~ 
> > 			m/
> > 			^[+-]?              # Optionally a +/- specifier
> > 			(.*)                # the register
> > 			(?:                 # optionally followed by
> > 			 \s+([a-f0-9]{8})   # space and an 8 digit hex mask
> > 			 )?
> > 			$/x);

Say, did you intend for $Mask to always be empty? I think you might
want to tighten that (.*) part a bit. Maybe (\S*) ?

Elijah
------
and maybe ([A-Za-z][0-9A-Za-z]*)


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

Date: Wed, 17 Jun 1998 21:44:06 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: REVIEW: Perl CGI Programming - No Experience Required
Message-Id: <6m9de2$man$1@cyprus.atlantic.net>

According to c.c.eiftj@54.usenet.us.com (Rahul Dhesi):
>In <pudge-1406982115300001@192.168.0.3> pudge@pobox.com (Chris Nandor) writes:
>>Here we put a subscript on the contents of `perl -v`, split that line into
>>a list, and subscript that list, and neither is an array.
>
>By my definition it is.

"... but if you define 'religious' as 'liking peanut butter and jelly
sandwiches', then -- Yes, I'm a religious person." -- Emo Phillips
-- 
Chip Salzenberg                - a.k.a. -               <chip@pobox.com>
"I brought the atom bomb.  I think it's a good time to use it."  //MST3K
           ->  Ask me about Perl training and consulting  <-
     Like Perl?  Want to help out?  The Perl Institute: www.perl.org


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

Date: Wed, 17 Jun 1998 13:55:07 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: strange error message .. "value of <handle> ..."
Message-Id: <MPG.ff1cd0596faac42989692@nntp.hpl.hp.com>

In article <6m8v8s$ts2$1@nnrp1.dejanews.com>, jabrah15@my-dejanews.com 
says...
> 1.  the error message "Value of <HANDLE> construct can be 0" means that
> a filehandle could return the value "O" if that was a line in the file
> you were reading, which would not constitute the EOF.

Actually, it has to be the *last* "line" in the file, where "line" is in 
quotes because the 0 must not be followed by a new-line character.

This warning may be generously described as "persnickety".  I believe it 
will be removed in a future release (i.e., the same grandfathered 
graciousness applied to the implicit variable $_ will be applied also to 
an explicit variable).

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Wed, 17 Jun 1998 19:56:58 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: turning off caching with cgi.pm
Message-Id: <6m972a$d3d$1@nnrp1.dejanews.com>

In article <3587EC8E.33DD@nortel.ca>,
  Margaret Peacock <peacockm@nortel.ca> wrote:
>
> Can I turn off the caching of a cgi script that is written in cgi.pm? I
> realize that the script should not be caching, but on PCs it seems to be
> loading up the form side of the script in cache... which is a problem
> because it is supposed to read a cookie to generate parts of itself. Can
> anyone help? Please send me email.. thanks.
>
> peacockm@nortel.com
>
> -Margaret
>

Don't know that this is a Perl or cgi.pm problem ... If you don't want your
user's browser to cache a document you are sending them, just make sure the
document contains:

<HEAD>
<META HTTP-EQUIV=Expires CONTENT=Tue, 01 Jan 1980 1:00:00 GMT>
</HEAD>

between the <HTML> </HTML> tags of the document, where the date specified is
earlier that the current date. At least this works for Netscape 3.x
browsers ... never bothered to go see if this is actually a standard HTML
specification, though.

Hope that helps

Patrick Timmins
U. Nebraska Medical Center

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 17 Jun 1998 21:48:13 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Re: turning off caching with cgi.pm
Message-Id: <6m9dit$mat$1@supernews.com>

: > Can I turn off the caching of a cgi script that is written in cgi.pm? I

Keep in mind you cannot force the user to do anything.

: <HEAD>
: <META HTTP-EQUIV=Expires CONTENT=Tue, 01 Jan 1980 1:00:00 GMT>
: </HEAD>

Better than this, use the actual HTTP directive, in this case:
Expires: Tue, 01 Jan 1980 1:00:00 GMT

CGI.pm will certainly allow you to do this.  That META tag is there to
accomodate people who can't specify their own HTTP headers.

I strongly suggest getting Wong's "Web Client Programming With Perl" or
Stein's guide to his own CGI.pm.

xoxo,
Andy

--
-- 
Andy Lester:        <andy@petdance.com>       http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com>  http://ChicagoMusic.com/



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

Date: Wed, 17 Jun 1998 15:53:44 -0500
From: "Troy Bull" <troy.bull@uni.edu>
Subject: What do I use with perl to get database funcitons?
Message-Id: <6m9acu$b6a@news.uni.edu>

I have an application that will read in and parse report files from our
mainframe, then store them with some arbitrary name.  The part I don't know
how to do with perl:  I need an RDBMS (or something else that will work) to
store an index.  I invision one table with ssn, report type, print date,
report locaiton.

I then need to be able to invoke a program (from the www) and tell it via
assosciated cookies and parameters which report I want to see then it needs
to return the report.  One other thing I need to do is search the db and get
a list of all of one type of report.  For examples  Bob signs in and looks
at his benefits statement, or Bobs supervisor signs in and says show me all
the benefit statements.

I have a c library and db that can do all this, I would like to do it in
PERL though (it would save me a couple of steps in the load process).

I have poked around and have not figured out how to get something like this
working.  Also, I tried to use AnyDBM_file, GDBM_file SDBM_file and it in
each case said ????????.pm not found

Thanks
Troy




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

Date: Wed, 17 Jun 1998 13:12:27 -0700
From: Skip Lawson <ablaze@sonic.net>
Subject: Re: Win NT- CGI script help please
Message-Id: <3588232B.A29692FE@sonic.net>

Your browser may be placing it in a cache and saving the generated page to
disk. See if there is a setting to force the browser to not use the cache.

If you are using Navigator 4.x you can do this by going to
Edit+=>Preferences...=>Advanced=>Cache and chosing the Every Time button.

Edgar wrote:

> Hi,
>
> I need some advice if you are so kind:
>
> I installed perl 5.004. The last download from the perl site.
> After playing around quite a while, modifying the registry for IIS I got
> it to work.
> However something odd happens.
>
> I have a form which calls a script, the script runs, and produces some
> output.
> If I change the form input field, the output changes, i.e. the cgi -perl
> program works fine.
> BUT when I want to modify the perl program to let's say, print a new
> title, there is a problem.
> I modify the program, save it and when I call it using the mentioned
> form, It still gives me the old output copy, as if the old script was
> resident in memory. It is as if the program was compiled only once and
> then that copy used from memory.
> I tried everything, from restarting the browser, to stopping and
> restarting the IIS www server.
> Apparently the only thing that works is to delete the entire
> subdirectory where the program and form reside. Then stopping IIS www
> sever, and then coping back the programs and restarting the IIS www
> server.
> Even then I think on some occasions it gave me trouble.
>
> Any suggestions on how to fix this annoying problem will be greatly
> appreciated.
>
> Best regards.
> Edgar.





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

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

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