[9477] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3071 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 6 21:17:16 1998

Date: Mon, 6 Jul 98 18:06:04 -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, 6 Jul 1998     Volume: 8 Number: 3071

Today's topics:
    Re: perl with Mysql (brian d foy)
        pgperl and CGI <ibarg@as.arizona.edu>
    Re: PLEASE TRY THIS OUT !!! <quednauf@nortel.co.uk>
    Re: PLEASE TRY THIS OUT !!! (Tad McClellan)
        POSIX/Perl question ? <dmencin@unavco.ucar.edu>
    Re: Problems if print <<END_of_PRINT (Allan M. Due)
        ptkdb Vers 1.031 perl Debugger with ptk GUI Interface (Andrew E Page)
    Re: Q: Can I run Perl program regularly? (David Adler)
        Q: DBI & Table/Column Names zdpurvis@my-dejanews.com
        Quaintness involving the /x modifier, a comment and sla (Tina Marie Holmboe)
    Re: Quaintness involving the /x modifier, a comment and <tkil@scrye.com>
    Re: question about objects <quednauf@nortel.co.uk>
    Re: question about objects <jdporter@min.net>
    Re: question about objects <jdporter@min.net>
    Re: question about objects <quednauf@nortel.co.uk>
        Re: (Irene Barg)
    Re: Reading a file from the bottom up (Jacqui Caren) (Jacqui Caren)
    Re: Reading in GIFs (Martien Verbruggen)
        Redirection using location <pwhite@nospam_surfsouth.com>
    Re: regexp ... thanks <jerry@fitzweb.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 06 Jul 1998 00:51:41 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: perl with Mysql
Message-Id: <comdog-0607980051410001@news.panix.com>
Keywords: just another new york perl hacker

In article <359DD3A0.57A3D3E2@ehb.iac.net>, ehb@iac.net posted:

> I am fairly new to Perl and CGI... However, I have begun to see what a
> pain it is to use flat text files as databases. Could someone please
> point me to a website or other source that will show me how to use Mysql
> server with Perl 5??? I would appreciate this SO SO Much... I have been
> going crazy trying to get this thing to work....

see the documentation and examples that come with the DBI module
and its drivers for m(y)sql.

if your questions aren't answered by the docs, just ask :)

-- 
brian d foy                                 <http://computerdog.com>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


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

Date: Mon, 06 Jul 1998 13:55:15 -0700
From: Irene Barg <ibarg@as.arizona.edu>
Subject: pgperl and CGI
Message-Id: <35A139B3.6668@as.arizona.edu>

Hello All,

I went back an looked at some of my old notes and noted that Michael
Peppler responded to a similar query concerning sybperl, he said:

"The issue here is that you can't set LD_LIBRARY_PATH for the process
itself, only for children of this process."

I had forgotten that.  Further testing indicates I may be having 
Apache configuration problems.

I apologize for wasting anyone's time!
--irene 

Irene Barg wrote:
> 
> In article ,  writes:
> |> Try looking at the server error log.  The description in it is usually
> |> much more helpful than the one you get in the browser.
> |>
> |> Are you sending a valid HTTP header before you start sending data to the
> |> browser????
> |>
> |> HTH,
> |>
> |> Brent
> 
> Thank you, the error log does tell me quite a bit, but I still don't know
> why it fails.  Here is what the error log says:
> 
> Can't load '/home/sybase/lib/perl5/site_perl/sun4-solaris/auto/PGPLOT/PGPLOT.so'
> for module PGPLOT: ld.so.1: /home/sybase/bin/perl: fatal: libucb.so.1: can't open
>  file: errno=2 at /home/sybase/lib/perl5/sun4-solaris/5.00404/DynaLoader.pm
> line 166.
> 
>  at /home/sybase/public_html/cgi-bin/plotdemo.cgi line 21
> BEGIN failed--compilation aborted at /home/sybase/public_html/cgi-bin/plotdemo.cgi
>  line 21.
> [Mon Jul  6 11:37:08 1998] [error] Premature end of script headers:
>  /home/sybase/public_html/cgi-bin/plotdemo.cgi
> 
> If I read this correctly, it can't read both ld.so.1 or libucb.so.1.  So I
> explicitly set the LD_LIBRARY_PATH in my Perl CGI script, and print it out
> on the form:
> 
> LD_LIBRARY_PATH=/home/sybase/pgplot/:/l/u/openwin/lib:/usr/dt/lib:/
> l/SUNWspro/lib:/usr/lib:/usr/ucblib
> 
> But, it still fails when it tries to do:
> 
> use PGPLOT;              # line 21 as ref in error log above
> 
> As I said in my first posting on this, this script runs from debug mode,
> i.e. if I run it from the command line.  It produces a perfectly good
> HTML output.  It just bombs when it is ran from the URL.
> 
> I can run PGPERL scripts outside of the browser, but not inside.  It appears
> that I'm doing the right thing in setting the ENV but still NOT!
> 
> Thanks anyway.
> 
> --irene
> 
> -------------------------------------------------------------------
> Irene Barg                      Email:  ibarg@as.arizona.edu
> Steward Observatory             Phone:  520-621-2602
> University of Arizona           FAX:    520-621-1891
> Tucson, AZ  85721               http://nickel.as.arizona.edu/~barg
> -------------------------------------------------------------------

-- 

-------------------------------------------------------------------
Irene Barg			Email:	ibarg@as.arizona.edu
Steward Observatory		Phone:  520-621-2602
University of Arizona		FAX:    520-621-1891
Tucson, AZ  85721		http://nickel.as.arizona.edu/~barg
-------------------------------------------------------------------


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

Date: Mon, 06 Jul 1998 14:57:03 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: PLEASE TRY THIS OUT !!!
Message-Id: <35A0D7AF.A48BC2DF@nortel.co.uk>

Moises Salmeron C. wrote:
 
> % test.pl
> Please enter no. of clients desired: 2
> --------------------Commision number 1
> Nombre: Mick Stephens
> Qtty: 1500
> Comission at 0.25 rate equals 375
> --------------------Commision number 2
> Nombre: Larry Wall
> Qtty: 7117.3
> Comission at 0.25 rate equals 1779.325
> 

> Last Name               First Name      Comission
> ======================= =============== ==========
> Stephens                Mick                375.00
> Wall                    Larry              1779.33
>                         =============== ==========
>                         TOTAL COMMS.:      2154.32
> %
> 

Your format line rounds the numbers, all right. 1779.325 becomes 1779.33.
But internally it is still 1779.325; Or so you would like to believe.
The time you add those numbers up, you're still adding 1779.325 + blabla.
That wouldn't account for what you're experiencing, but you should also know
that computers are notoriously inaccurate.
My guess is, that after the addition the total is something like 2154.324999999
, which is then rounded to
2154.32. What can you do? 

 $tot += ($com *= 0.25);

I am not that much of a computer scientist, but apart from increasing the
bytesize of your variables,
you could change that expression to add up the $coms, and divide it by 4 at the
end. That probably decreases the introduction of errors by reducing the amount
of multiplications you do. 

HTH!
-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


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

Date: Mon, 6 Jul 1998 09:40:52 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: PLEASE TRY THIS OUT !!!
Message-Id: <llnqn6.37p.ln@localhost>

Moises Salmeron C. (moises@ugr.es) wrote:

: Subject: Re: PLEASE TRY THIS OUT !!!

You should refrain from shouting at us.

Most folks do not like to be yelled at...



:   This message is in MIME format.  The first part should be readable text,
                    ^^^^^^^^^^^^^^

Please don't do that anymore.

Post plain text like everyone else does.




: I was beginning to learn Perl 5, so please don't flame
: me about this <maybe> stupid newbie question!


We don't generally flame for stupid newbie questions 
(or we shouldn't, anyway).

We do, however, flame for re-asking of Frequently Asked Questions
that have been asked, answered, and validated hundreds (thousands?)
of times before.

Being a newbie does not exempt you from the socially acceptable 
requirement of check the FAQ for a newsgroup before posting to
that newsgroup.


I hope that was a gentle flame  ;-)

I really hope that you will try to be a better Usenet citizen in the future.


: I encourage you to try this script "test.pl" out -if you're on an

Don't need to. 

(and most folks will skip the rest of your article when
they see that they have to unpack it just to skim your code,
which should be plain text, and therefore does not need any sort
of "packing"...)


Have seen this question so many times before that I know what your
problem is already.

It is the very first Question in the FAQ titled "Data Manipulation"
(perlfaq4).

Shame on you for asking it yet again.

If, after seeing your FAQ above, you still don't understand why you
are getting results that you weren't expecting, please post a
question here pointing out what part you need more help with.



: I can't figure out WHY THIS TOTAL COMMS.: doesn't seem to do arithmetic
: the right way!!!! I have examined the code carefully and don't know
: what's the problem.

The problem is not in the code.

It is not even a Perl problem.

It is usual consequence of how numbers are stored in computers.



: Could you Perl gurus please help me?

I don't think it requires a guru to simply read the FAQs...


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Mon, 06 Jul 1998 14:41:04 -0600
From: Dave Mencin <dmencin@unavco.ucar.edu>
Subject: POSIX/Perl question ?
Message-Id: <35A13660.462A378B@unavco.ucar.edu>

I am trying to write a perl script that captures data from a series of
serial devices. In order for these serial devices to "switch" from one
to the other the expect DTR to drop as a hangup notification.
	I am using the POSIX module within Perl which clearly states that
setting the baud rate of your open and selcted port(special file) to 0
(or POSIX::B0 in this case) is meant to drop DTR. It does not do this in
a consistent fashion - i.e it works under Solaris and not Linux. Does
anybody know how I would begin to track down such a bug ? Straight C
calls seem to work - which would indicate that underlying libs are
working properly.


I am using perl 5.000x with Redhat Linux 5.1

Thanks in advance,

Dave Mencin


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

Date: 6 Jul 1998 17:01:09 GMT
From: due@murray.fordham.edu (Allan M. Due)
Subject: Re: Problems if print <<END_of_PRINT
Message-Id: <6nqvsl$911$0@206.165.146.18>

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

In article <359BFFC3.6FAB15EE@ncsa.uiuc.edu>, david lee altenburg 
(altenbur@ncsa.uiuc.edu) posted...

|
|# lots o' code here
|
|      print <<END_of_HTML;
|
|        Some stuff I printed here
|         Yes, it's  a web page.
|
|END_of_HTML
|
|# lots more code
|
|
|Anyway, I keep getting the following error:
|
|"Can't find string terminator "END_of_HTML" anywhere before EOF at
|./editstudent.cgi line 285."


Also make sure that END_of_HTML it is not the very last line of the 
file.  That one drove me crazy for a solid day once.  You don't need 
content on the next line just another line at the end of the file.

AmD

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

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


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

Date: Mon, 6 Jul 1998 14:16:51 GMT
From: aep@world.std.com (Andrew E Page)
Subject: ptkdb Vers 1.031 perl Debugger with ptk GUI Interface
Message-Id: <EvoFo3.3Br@world.std.com>


ptkdb  A  Perl debugger with Graphical User Interface

You can find this utility with at:

<a href="http://world.std.com/~aep/ptkdb">http://world.std.com/~aep/ptkdb</a>

http://world.std.com/~aep/ptkdb


New Version 1.031

Bug Fix...   Calls to certain flavors of subroutines causing a 'usage' error

Tune up: Removing 'checkbutton' objects from breakpoints lists before
saving them.   There have been no reported problems with this, but I
was concerned about restoring these objects through evalling 'Dumped'
structures and then having DESTROY called on this bogus control.


Release Notes. 1.03

New Feature...   Expression Evaluation window
New Feature...   Configuration save/restore
New Feature...   Control-C stops scripts and enters debugger
Bug Fix:  Variables not scoped with 'my' in breakpoint
expressions were not being evalled properly.  
Bug Fix:  Evaluation of certain 'CODE' ref variables
caused the debugger to fail and exit.  
Bug Fix:  Debugger did not properly handle scripts entered through STDIN.  
Added a Tk::Adjuster to the main window to adjust the size
of the code and expression windows.
Environmental variables to control appearence and configuration
Line numbers have been added
Making old versions avaliable for download

-- 
Andrew E. Page   (Warrior Poet) |   Decision and Effort The Archer and Arrow
Software Engineering Consultant |     The difference between what we are
Unix, Mac, C/C++/Java, Perl, NT |           and what we want to be.


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

Date: 6 Jul 1998 23:00:46 GMT
From: dha@panix.com (David Adler)
Subject: Re: Q: Can I run Perl program regularly?
Message-Id: <6nrkuu$4ja@news1.panix.com>

On Sun, 28 Jun 1998 21:55:03 GMT, Gary M. Greenberg <garyg@gator.net> wrote:
>In article <358ecba4.0@rapeme.kirov.ru>, dmgl@dmgl.kirov.ru says...
>> Dear Sir/Madam
>> 
>> How can I make a program that can run my Perl program regularly (daily)?
>
>Give it more vitamins.

I would have thought fibre, but what do I know...

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"It's all eggs, bacon, beans and a fried slice." - Madness


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

Date: Mon, 06 Jul 1998 16:28:24 GMT
From: zdpurvis@my-dejanews.com
Subject: Q: DBI & Table/Column Names
Message-Id: <6nqtv8$vge$1@nnrp1.dejanews.com>

I have a question....  I am using DBI w/ Perl to create a "generic" table
viewer that will allow us to view tables and sort them in any order and
display the columns in any order in a web browser.  The thing is, we use both
mSQL and mySQL where I work.  So, I would like to be able to use DBI.  I need
to know how to use DBI to show the names of databases, tables, and column
names.

Thanks for any help!

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 6 Jul 1998 17:30:17 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
Subject: Quaintness involving the /x modifier, a comment and slash...
Message-Id: <6nr1j9$so7$1@news1.sol.no>

  (Or was that a backslash; I never could tell... )

  Before I go ahead and make a fool of myself on p5p, I thought I'd do
  so here - with the hope of being told that I am wrong. Quaint notion...

  Anyway. When I write (for me) complex regexp's, I tend to use the /x
  modifier, in order to be able to get some comments in there.

  Consider, then, the following (numbered) example:

01   $Text =~ s/
02              <                           # One '<'
03              xref                        # The word 'xref'
04              >                           # One '>'
05              .+?                         # One, or more, of anything
06              <                           # One '<'
07              \/                          # One '/'
08              xref                        # The word 'xref'
09              >                           # One '>'
10             //igx ;


  What this does is, in the context of this letter, not interesting at
  all. Do look closely at line 07. Inside the comment is a slash - '/'

  Sending this through Perl 5.003 or 5.004 produces the rather surprising
  message:

   'Illegal division by zero at convert_sql.pl5 line 121.'


  This interested me. I'll try to escape the '/':


01   $Text =~ s/
02              <                           # One '<'
03              xref                        # The word 'xref'
04              >                           # One '>'
05              .+?                         # One, or more, of anything
06              <                           # One '<'
07              \/                          # One '\/'
08              xref                        # The word 'xref'
09              >                           # One '>'
10             //igx ;


  This worked. Being the curious sort, I tried to write a '/' inside a
  regular comment. That gave no errors. Refering back to the perlre
  manpage enlightened me not the least. Refering (forward >:) to the
  FAQ gave me:

    "The /x modifier causes whitespace to be ignored in a regexp pattern 
     (except in a character class), and also allows you to use normal
     comments there, too. As you can imagine, whitespace and comments
     help a lot"


  That says *normal* comments - can someone tell me how much egg I have
  on my face, and why ?? It *does* seem that a / can be *un* escaped in
  regular comments, but *not* in /x-comments - yet the FAQ clearly states
  that 'normal' comments can be used.

  So, is the bug in Tina or in Perl ?


  (Ohyes, and if its in Tina, I think I'll reconsider going to PerlC 2.0 >:)

-- 
 (t-chan || ka`ira)@DALnet

                                                                    - TiM
  Tina Holmboe <tina@tech.scandinaviaonline.se>


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

Date: 06 Jul 1998 13:56:28 -0600
From: Tkil <tkil@scrye.com>
Subject: Re: Quaintness involving the /x modifier, a comment and slash...
Message-Id: <g4swu3g9f.fsf@scrye.com>

[posted and cc'd]

>>>>> "Tina" == Tina Marie Holmboe <tina@scandinaviaonline.se> writes:

Tina> What this does is, in the context of this letter, not
Tina> interesting at all. Do look closely at line 07. Inside the
Tina> comment is a slash - '/'

Abigail already ran across this one, and reported it about a month
ago:

   http://www.rosat.mpe-garching.mpg.de/mailing-lists/perl-porters/1998-06/msg01068.html

the final outcome was basically a doc patch:

   http://www.rosat.mpe-garching.mpg.de/mailing-lists/perl-porters/1998-06/msg01218.html

which can be distilled to: "be careful about putting pattern
delimiters into comments when you do /x-style regexps."

for your current situation, try using matched delimiters, or some
other symbol (like maybe a colon or an exclamation mark.)

t.
-- 
Tkil * <URL: http://www.scrye.com/~tkil> * hopelessly hopeless romantic.
  "So amplify this little one 	|   She hears as much as she can see
   She's a volume freak       	|   And what she sees, she can't believe."
        -- Catherine Wheel, _Happy Days_, "Judy Staring At The Sun"


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

Date: Mon, 06 Jul 1998 09:46:11 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: question about objects
Message-Id: <35A08ED3.70A2B048@nortel.co.uk>

Russ Allbery wrote:
> 

> Ew.  I'd never write either.  It saves so much typing to just write:
> 
>         print while <blah>;
> 
And is it dangerous to have 

print <blah>;
     for that matter ?

-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


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

Date: Mon, 06 Jul 1998 13:35:31 GMT
From: John Porter <jdporter@min.net>
Subject: Re: question about objects
Message-Id: <35A0D47C.94C@min.net>

Jeremy D. Zawodny wrote:
> 
>   while(<blah>) {
>         print;
>   }
> 
>   while(<blah>) {
>         print $_;
>   }
> 
> I tend to write the second case.
> 
> But, strangely, I'm a big fan of "$blah = shift;" instead of
> "$blah = shift(@_);"

Then you're a hypocrite.

-- 
John Porter


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

Date: Mon, 06 Jul 1998 13:51:44 GMT
From: John Porter <jdporter@min.net>
Subject: Re: question about objects
Message-Id: <35A0D849.254C@min.net>

Charlie Stross wrote:
> >> >require "./point.pm";
> >>
> >> You used require() instead of use() to load your module. Consequently
> >> stuff you put in it shows up in the namespace point, as opposed to MAIN.
> 
> As far as I'm aware, require() doesn't
> import anything.

You're right, it doesn't cause the invocation of import.
But whether you call use (and get import) or require (and not),
the require'd file should have all of its stuff in its own package(s),
so that in no case should one be able to say that it goes into main.
(Obviously, if you're calling from main, and you use use, then maybe
some stuff will be imported into main -- but even that's not
guaranteed; it depends on the implementation of the module.)


> >Should the caller never be allowed to set x to zero?
> 
> it was implied by my reading of the original problem; that the
> issue of which quadrant a point is in is undecidable if either
> coordinate is zero. Of course, how you deal with this is now a religious
> issue; do you rely on the programmer to check their input, or build
> it into the module?

O.k.


> >Rob also had
> >       my $self = shift;
> >which is standard, correct perl idiom.
> 
> It's standard, correct, and idiomatic.
> [re: my( $self ) = shift;]

There's a problem with 
	my( $self ) = shift;
even though it works as a specific case.
The problem essentially stems from the fact that you're assigning a
scalar value to a list, which in this case happens to contain one
variable.  As soon as you need to add more variables -- arguments --
to that list, you have to replace shift with @_, or it's an error.
There are two proper ways to get the arg list (assuming you don't
want to just use @_ directly):

	my( $self, $a, $b ) = @_;

and

	my $self = shift;
	my $a = shift;
	my $b = shift;

Of course, you can mix the two forms, like this:

	my $self = shift;
	my( $a, $b ) = @_;


> I dislike reliance on idiom; the implicit use of $_ and @_ in
> particular. 

You're out on your own limb on that one, Charlie.


> Can I plead guilty to wanting clarity here?  Anything
> functionally equivalent to a case statement will do the job: the
> choice of what to use depends on where your priorities lie.

O.k.  But it sounds like you're saying that you think 

   if      (($self->x() > 0) && ($self->y() > 0)) {
       return 1;
   } elsif (($self->x() < 0) && ($self->y() < 0)) {
       return 3;
   } elsif (($self->x() < 0) && ($self->y() > 0)) {
       return 2;
   } elsif (($self->x() > 0) && ($self->y() < 0)) {
       return 4;
   } else {
       return 0; # eeek!
   }

is clearer and more readable than

   return 1  if ($self->x() > 0) && ($self->y() > 0);
   return 2  if ($self->x() < 0) && ($self->y() > 0);
   return 3  if ($self->x() < 0) && ($self->y() < 0);
   return 4  if ($self->x() > 0) && ($self->y() < 0);
   return 0;

Maybe you're right. Who am I to say?

-- 
John Porter


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

Date: Mon, 06 Jul 1998 14:58:46 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: question about objects
Message-Id: <35A0D816.56772A6@nortel.co.uk>

John Porter wrote:
> 
> Jeremy D. Zawodny wrote:

[stuff]

> Then you're a hypocrite.

Who isn't ?

-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


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

Date: 6 Jul 1998 18:54:48 GMT
From: barg@nickel.as.arizona.edu (Irene Barg)
Subject: Re:
Message-Id: <6nr6ho$hk8$2@news.ccit.arizona.edu>

In article ,  writes:
|> Try looking at the server error log.  The description in it is usually
|> much more helpful than the one you get in the browser.
|> 
|> Are you sending a valid HTTP header before you start sending data to the
|> browser????
|> 
|> HTH,
|> 
|> Brent

Thank you, the error log does tell me quite a bit, but I still don't know
why it fails.  Here is what the error log says:

Can't load '/home/sybase/lib/perl5/site_perl/sun4-solaris/auto/PGPLOT/PGPLOT.so' 
for module PGPLOT: ld.so.1: /home/sybase/bin/perl: fatal: libucb.so.1: can't open
 file: errno=2 at /home/sybase/lib/perl5/sun4-solaris/5.00404/DynaLoader.pm 
line 166.
 
 at /home/sybase/public_html/cgi-bin/plotdemo.cgi line 21
BEGIN failed--compilation aborted at /home/sybase/public_html/cgi-bin/plotdemo.cgi
 line 21.
[Mon Jul  6 11:37:08 1998] [error] Premature end of script headers:
 /home/sybase/public_html/cgi-bin/plotdemo.cgi

If I read this correctly, it can't read both ld.so.1 or libucb.so.1.  So I
explicitly set the LD_LIBRARY_PATH in my Perl CGI script, and print it out
on the form:

LD_LIBRARY_PATH=/home/sybase/pgplot/:/l/u/openwin/lib:/usr/dt/lib:/
l/SUNWspro/lib:/usr/lib:/usr/ucblib

But, it still fails when it tries to do:

use PGPLOT;              # line 21 as ref in error log above

As I said in my first posting on this, this script runs from debug mode,
i.e. if I run it from the command line.  It produces a perfectly good
HTML output.  It just bombs when it is ran from the URL.  

I can run PGPERL scripts outside of the browser, but not inside.  It appears
that I'm doing the right thing in setting the ENV but still NOT!

Thanks anyway.

--irene

-------------------------------------------------------------------
Irene Barg			Email:	ibarg@as.arizona.edu
Steward Observatory		Phone:  520-621-2602
University of Arizona		FAX:    520-621-1891
Tucson, AZ  85721		http://nickel.as.arizona.edu/~barg
-------------------------------------------------------------------





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

Date: Mon, 6 Jul 1998 16:04:53 GMT
From: Jacqui.Caren@ig.co.uk (Jacqui Caren) (Jacqui Caren)
Subject: Re: Reading a file from the bottom up
Message-Id: <EvoKo5.IJ8@ig.co.uk>

In article <3578ffac.0@newsread1.dircon.co.uk>,
Tan <tan@jettech.dircon.co.uk> wrote:
>Hi,
>
>Is there a way to read files starting from the end?
>
>Data coming in from a switch appends to a file so that the most recent
>records are at the end of the file. To reduce processing time I would like

Well there is that very nice tail module under CPAN? :-)

>to start searching for the most recent data and so would like to start
>reading from the end of the file to the beginning in order to cut processing
>time down.

I had to do something similar for polled telecoms data/stats.

I kept seek points for each of the files and seek()ed to the last
effective EOF.

WRT to log rotation, new files are named uniquely and never replace old
files, so no problems there.

You still need to handle the problem of arriving data during consumption.

However, with periodic polled data sources this tends not to be a problem.

>Any help would be gratefully appreciated.
>
>Regards
>Tan

<PLUG class="shameless">
If by switch, you mean system X or similar see http://www.ig.co.uk/adam.html
</PLUG>

-- 
Email: Jacqui.Caren@ig.co.uk  http://www.ig.co.uk/
Fax  : +44 1483 419 419       http://www.perlclinic.com/
Phone: +44 1483 424 424       http://www.perl.co.uk/
Paul Ingram Group Ltd,140A High Street,Godalming GU7 1AB United Kingdom



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

Date: 6 Jul 1998 03:41:58 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Reading in GIFs
Message-Id: <6nph26$bra$2@comdyn.comdyn.com.au>

In article <6nnol6$16j@news.netcologne.de>,
	"Stephan Magnus" <nc-magnusst@netcologne.de> writes:
> Hi,
> 
> I just programmed some code to read in parts of a GIF and then all append
> the parts to one file. I did it as follows:
> 
> open(ANFANG, "anfang.gif") || die;
> binmode(ANFANG);
> $anfang=<ANFANG>;
> close (ANFANG);

This will read just the first 'line' or record from ANFANG. The record
separator by default is a newline, and you probably want it set to
undef.

# perldoc perlvar
look for $/

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | 
Commercial Dynamics Pty. Ltd.       | Curiouser and curiouser, said Alice.
NSW, Australia                      | 


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

Date: Sun, 5 Jul 1998 23:27:18 -0400
From: "Penn White" <pwhite@nospam_surfsouth.com>
Subject: Redirection using location
Message-Id: <35a044ba.0@news2.surfsouth.com>

Does anyone know if Sambar 4.1 supports redirection.  I can't get this to
run after trying many, many things and I thought that maybe that might be
the problem.  There may be a problem with my script but I can't find it.

TIA,

Penn White

### test11.pl ###
#!c:\sambar41\perl\Perl.exe

&parse_form;

if ($FORM{'email'} ne "") {
    &openfile;
    exit;
} else {
    &login;
}

sub login {
    print "Content-type: text/html\n\n";
    print qq~
        <html>
        <head><title>Test 1</title></head>
        <body>
        <form method=post action=\"/cgi-bin/test11.pl\">
        Please enter your email address:
        <input type=text NAME=email size=40 value="">
        <input type=submit value="Move on">
        </form>
        </body></html>
    ~;
}

sub parse_form {
    if ($ENV{'REQUEST_METHOD'} eq 'POST') {
        read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
        @pairs = split(/&/, $buffer);
        foreach $pair (@pairs) {
            ($name, $value) = split(/=/, $pair);
            $value =~ tr/+/ /;
            $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
            $value =~ s/<([^>]|\n)*>//g;
            $value =~ s/<//g;
            $value =~ s/>//g;
            $FORM{$name} = $value;
        }
    }
}

sub open_file {
    if ($page =~ /http/gi || $page =~ /.pl/gi || $page =~ /.cgi/gi) {
      print "Location: /cgi-bin/test22.pl\n\n";
      exit;
    }
 exit;
}

### test22.pl ###
#!c:\sambar41\perl\Perl.exe

&printpage;

sub printpage {
 print "Content-type: text/html\n\n";
 print qq~
        <html>
        <head><title>Test 2</title></head>
        <body  bgcolor=\"#008000\">
        <center>
        <h1>You've made it this far!</h1>
        </center>
        </body></html>
    ~;
}




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

Date: Mon, 6 Jul 1998 16:50:34 -0500
From: "Fitz" <jerry@fitzweb.com>
Subject: Re: regexp ... thanks
Message-Id: <6nrgrb$pt0$1@news.iquest.net>

Thanks for all the quick replies.  I learned a lot from them.  I
misunderstood the meaning of both '?' and '$'.  I'm somewhat clearer now.
I used the regexp approach, and it works like I wanted it to.  I could have
gone with the File:: module, but hated to use a module for something even I
knew was simple.
I have _Mastering Regular Expressions_, by Jeffrey Friedl, but haven't
committed it all to memory yet.  And yes, I did check this newsgroup and
dejanews, but saw nothing that would answer my question.

Thanks again,
Fitz





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

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

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