[8553] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2170 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 24 07:07:31 1998

Date: Tue, 24 Mar 98 04:00:31 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 24 Mar 1998     Volume: 8 Number: 2170

Today's topics:
        Anybody experienced in File-Locking with Perl5? <TobiasBugala@swol.de>
        bug? <ndufort@cadre.sjsu.edu>
    Re: bug? <Tony.Curtis+usenet@vcpc.univie.ac.at>
        CGI HELP!! jherrera@softmasters.com.ar
        Cgi script for visitor referrals? (Barbara Ling)
    Re: Creating a unique id number? <jhi@alpha.hut.fi>
    Re: debugging Perl <rjk@coos.dartmouth.edu>
    Re: debugging Perl <uri@sysarch.com>
    Re: eval, do FILE (Mike Heins)
        Fell at the last hurdle :( <jay.blaise@clear.net.nz>
        Form Input <danjezek@pixi.com>
    Re: Form Input (Tom Mornini)
    Re: How to instrument Perl a subroutine <zenin@archive.rhps.org>
    Re: How to log input to different files in perl audttjk@dbs.com.sg
    Re: How to log input to different files in perl audttjk@dbs.com.sg
        Multi-function Perl scripts (NIALL JAMES SELETZKY)
        Not the usual ``won't run on my browser'' problem. Modu <jerryp.usenet@connected.demon.co.uk>
        Novice RegExpr problem -- how to slurp down big chunks  (stephen benson)
    Re: Perl Databases... (Tom Mornini)
    Re: Perl to read  spreadsheet files darrell@annapolis.net
    Re: Question about DBM Array <kiml@zplace.com>
    Re: reset a array? <rick@slicks.demon.co.uk>
    Re: reset a array? (Tom Grydeland)
        Trouble getting gethostbyaddr() to work (Bruce Robertson)
    Re: Trouble getting gethostbyaddr() to work (Bruce Robertson)
        trouble with \r <pamdirac@mindspring.com>
    Re: trouble with \r <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: Using perl code as a config file syntax? (Or, can r (Tom Grydeland)
    Re: What's up with the debugger? (Mark Schmick)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 24 Mar 1998 11:46:47 +0100
From: Tobias Bugala <TobiasBugala@swol.de>
Subject: Anybody experienced in File-Locking with Perl5?
Message-Id: <35178F17.3C6D@swol.de>

Hi folks,

well I should lock a file so that only one process can access that file.
I'm using HP-UX and I've written a testing code like this:
Do you know where my fault is? I tested it by running the script two
times in different windows and it prints the file in both of them...

#!/usr/local/bin/perl5  -Tw

#use strict;
use lib '/opt/httpd/htdocs/cgi-lib';

require 5;
require 'cgi-lib.pl';

$F_LOCK = 1;
$F_ULOCK = 0;

open (FILE,"something") or $errormessage = "Hello";
flock FILE, $F_LOCK;
while ($inline = <FILE>) {
  $counter = 0;
  sleep 1;
  print $inline;
}
flock FILE, $F_ULOCK;
close (FILE);

Thanx for having a look on it

TOBI


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

Date: Tue, 24 Mar 1998 02:34:44 -0800
From: Nico Dufort <ndufort@cadre.sjsu.edu>
Subject: bug?
Message-Id: <35178C44.167E@cadre.sjsu.edu>

hello everyone,

i am trying to using a script that would modify an HTML file for an
assignment for my art class, and when i run my script thru the shell to
see if it works correctly, i can get it to work, but it behaves
strange.  here the script (quite simple):

#!/usr/bin/perl -w

open (IN,"test2.html")  || die "cannot open test2.html: $!"; 

   while (<IN>) {          
       $var = "var = X;";
       substr($var, 6, 1) = "9";
       print "$var\n";
   }

close (IN) || die "can't close number.dat: $!";

exit(0);


so, when i run it from the shell, it prints the output 19 times.  
anybody who could tell me what's wrong?  or maybe the computer doesn't
like me (that could be a possibility, it might be tired of me working
until 500am every night. hehehe)

thank you for your help
nico
-- 
The young (who always want more and have no game to protect),
the artists (who always hunger for the ecstatic moment),
and the alienated (the wise slaves and noble minority groups watching
from the periphery of the society).  "High Priest," -- Timothy Leary


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

Date: 24 Mar 1998 11:48:22 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: bug?
Message-Id: <7xbtuw9xft.fsf@beavis.vcpc.univie.ac.at>

Re: bug?, Nico <ndufort@cadre.sjsu.edu> said:

Nico> hello everyone, i am trying to using a script that
Nico> would modify an HTML file for an assignment for my art

You're only opening the file for read.

Nico> open (IN,"test2.html") || die "cannot open test2.html: $!";

Nico>    while (<IN>) {          
Nico>        $var = "var = X;";
Nico>        substr($var, 6, 1) = "9";

I'd use a simple assignment, or maybe a sprintf() if this is
a subset of something more complicated:

    my $var = sprintf("var = %d", $value_to_assign);

Nico>        print "$var\n";
Nico>    }

Nico> so, when i run it from the shell, it prints the output
Nico> 19 times.  anybody who could tell me what's wrong?  or

Your while loop iterates over all lines of the input file
test2.html - it will print "var = 9\n" for each line of the
input file.

If test2.html has 19 lines, you'll get 19 lines of output.

What do you _really_ want it to do?

hth,
tony

-- 
Tony Curtis, Systems Manager, VCPC,      | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | http://www.vcpc.univie.ac.at/

"Everything I am, I learned on the back of cereal boxes" ~ RJ, "Over the Hedge"


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

Date: Tue, 24 Mar 1998 04:57:22 -0600
From: jherrera@softmasters.com.ar
Subject: CGI HELP!!
Message-Id: <6f83eo$len$1@nnrp1.dejanews.com>

I would like to contact with someone who has made a PERL script to manage
file over the WEB, i made it but on Win95 work's fine in UNIX with apache get
me all files (including directories) as a files, i think about this problem
that is a permission problem.
If someone can help thanks....

Juan Herrera

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


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

Date: 24 Mar 1998 04:41:04 -0500
From: btl@saturn.superlink.net (Barbara Ling)
Subject: Cgi script for visitor referrals?
Message-Id: <6f7v3g$hpj@saturn.superlink.net>


Can some kind person please point me in the direction of
a cgi script that will allow a visitor to my site to
send comments to another person (ie, I think you'd like
this site)?        

Thank you in advance,
-- 
Barbara T. Ling               |   Teaching Businesses the Netiquette Way
The Internet Virtual Coach    |   C Code.  C Code Run.  Run, Code, RUN!
http://www.virtual-coach.com  |                   PLEASE!!!!
btl@virtual-coach.com         |   Internet Consultation and Website Design     


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

Date: 24 Mar 1998 12:10:04 +0200
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: Creating a unique id number?
Message-Id: <oeehg4o5rib.fsf@alpha.hut.fi>


Calle Dybedahl <qdtcall@esb.ericsson.se> writes:

> > my $id = $$.time;
> 
> This might cause collisions on a heavily loaded server (if the pids
> wrap around within a single second). Also, it is easily predictable

I want to see a server which can spawn 32767 processes in one second.

> which may cause security problems. I'd throw in a random number there
> somewhere.

Yes, this is another matter -- and a very important one.

-- 
$jhi++; # http://www.iki.fi/~jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen


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

Date: Tue, 24 Mar 1998 01:04:53 -0500
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
To: William Wiley <wwiley@bedriver.com>
Subject: Re: debugging Perl
Message-Id: <35174D0B.7E59F7E4@coos.dartmouth.edu>

William Wiley wrote:
> 
> I am using strict with my scripts and appropriate my declarations.
> Doing this I find that I can not use the perl debugger (perl -d) to
> debug scripts as  the variables are not in a scope the debugger
> accesses.  In addition if I use any kind of refference to a variable I
> can not find it through the debugger.

That's because you're only using commands which access the package symbol
table.  Try using the p or x commands.

-- 
 _ / '  _      /         - aka -             rjk@coos.dartmouth.edu
( /)//)//)(//)/(    Ronald J. Kimball           chipmunk@m-net.arbornet.org
    /                                   http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 24 Mar 1998 01:06:23 -0500
From: Uri Guttman <uri@sysarch.com>
To: William Wiley <wwiley@bedriver.com>
Subject: Re: debugging Perl
Message-Id: <x71zvslj1c.fsf@sysarch.com>

William Wiley <wwiley@bedriver.com> writes:

> Does anyone know of a usefull debugging environment for perl? Or am I
> stuck using print statements.

print statements are your friends. IMO the only guaranteed way to see
what is happening. all other debuggers are helpers.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----  8 Years of Perl Experience, Available Immediately
uri@sysarch.com  ---------  Resume and Perl Example at http://www.sysarch.com
Use the Best Search Engine on the Net  --------  http://www.northernlight.com


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

Date: 24 Mar 98 06:20:08 GMT
From: mikeh@minivend.com (Mike Heins)
Subject: Re: eval, do FILE
Message-Id: <35175098.0@news.one.net>

Daryl Tester <Daryl.Tester@au.com.steadycom> wrote:
>
> I came across this problem on the weekend, and it's messed with my
> world view of Perl.  Note that I'm not looking for a better way to do
> this, I'm trying to understand why _this_ way doesn't work.  Perl
> version
> is 5.004_04, running under Linux (2.0.18/30).
>
> According to the perlfunc man page:
>
>   "do 'stat.pl';   is just like   eval `cat stat.pl`;
>   except that it's more efficient, more concise, [etc etc]"

The blue camel amends that to say "rather like". Apparently it
is ahead of perlfunc(1).

>
> However, with the following (simplified from the code I was using):
>
> File dud.inc:
>   $template{'Oi'} = 1;
>
> and File dud:
>   #!/usr/bin/perl -w
>
>   use strict;
>   my %template;
>
>   # do 'dud.inc' if -r 'dud.inc';               # Line 6
>   eval `cat dud.inc` if -r 'dud.inc';           # Line 7
>
>   print (defined $template{'Oi'} ? "Woohoo!\n" : "D'oh!\n");

Apparently lexicals don't fall within the scope of do, and also
it looks like "use strict" doesn't apply.  This makes a bit of sense
to me -- observe Getopt::Std and its typical usage.

>
> I get 'Woohoo!' if I use the eval on line 7, and 'D'oh!' if I use the
> do on line 6.  I presume it's a namespace/scoping issue here (I've read
> what I think is the relevent docs until my forehead bled), but what
> exactly is going on here?

   print (defined $::template{'Oi'} ? "Line 6, I bet.\n" : "Line 7, I bet.\n");

>
> Apologies if I've posted to the correct newsgroup. :-)

Would that all posts were like yours:

    1. Informative subject line
    2. Includes short self-contained program demonstrating the problem
    3. Not easily found in the docs

As a result, I answered (sort of) and learned something. Thank you.

-- 
Mike Heins                          http://www.minivend.com/  ___ 
                                    Internet Robotics        |_ _|____
Just because something is           131 Willow Lane, Floor 2  | ||  _ \
obviously happening doesn't         Oxford, OH  45056         | || |_) |
mean something obvious is           <mikeh@minivend.com>     |___|  _ <
happening. --Larry Wall             513.523.7621 FAX 7501        |_| \_\


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

Date: Tue, 24 Mar 1998 18:05:22 +1200
From: Jay and/or Blaise <jay.blaise@clear.net.nz>
Subject: Fell at the last hurdle :(
Message-Id: <35174D22.988551E1@clear.net.nz>

OK I read the FAQ..
I went and downloaded the PERLTOUR... read it "(what I understood ':)'
)"
I downloaded perl for win92
I ran install.bat.. so far so good!
I ran widget.bat OK... (only after saying couldn't find
"c:\perl\bin\widget.bat.bat (note extra .bat)
this happens if i try test.bat etc!
Any ideas why I'm getting the extra .bat on the ends.
Oh and when I click perl.bat, it just sits at the prompt, but I guess
thats cause I havent sust the language yet and it's waiting for me to
type something in ;o)

Please help out a Perl newbie... it looks like the language I've been
looking for.
Cheers
Jay
-- 
Web Development: http://www.ipnz.com
Weblinks: http://www.ipnz.com/weblinks

Web Design:-:Web Hosting:-:Domain Registrations



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

Date: Mon, 23 Mar 1998 18:09:07 -1000
From: Dan Jezek <danjezek@pixi.com>
Subject: Form Input
Message-Id: <351731E3.6762D6BD@pixi.com>

I have a very simple program that I want to run.  I want to take input
from a HTML form
,have it run my perl program and write whatever's in the form to a file
on my comp (which is IBM, not unix.)

It's not working :-(

Here's the HTML form:

<FORM ACTION="c:\perl\bin\survey.pl" ...blah blah blah>

Here's the perl program:

#!/usr/local/bin/perl
##############################################

$input = <STDIN>;
open (OUTFILE,">test.txt") || die ("Error, Output file not found\n");

print OUTFILE ($input);


It works ok when I write the parameters on a command line in DOS, it
writes them to a file, but so far I haven't had success with the form. 
What am I doing wrong?  Once I figure this out, I can format or search
the input text any way I want, the problem is getting the form to pass
it's data into the perl program.


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

Date: Tue, 24 Mar 1998 07:50:07 GMT
From: tmornini@netcom.com (Tom Mornini)
Subject: Re: Form Input
Message-Id: <tmorniniEqBCFK.AJK@netcom.com>

Dan J. (danjezek@pixi.com) wrote:

: It works ok when I write the parameters on a command line in DOS, it
: writes them to a file, but so far I haven't had success with the form. 
: What am I doing wrong?  Once I figure this out, I can format or search
: the input text any way I want, the problem is getting the form to pass
: it's data into the perl program.

If it's running on NT, this could be a permissions problem.

-- Tom Mornini
-- InfoMania


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

Date: 24 Mar 1998 06:29:52 GMT
From: Zenin <zenin@archive.rhps.org>
Subject: Re: How to instrument Perl a subroutine
Message-Id: <890721365.615792@thrush.omix.com>

Andrew M. Langmead <aml@world.std.com> wrote:
: How about if you take a reference to the subroutine, use an anonymous
: subroutine to add code to the original sub (perhaps using "goto &SUB"
: to hide traces of the anonymous sub) and redefine the symbol table
: through a typeglob.

	Hmm, interesting.  But what if foo() calls bar()?  It would be nice
	to see the play by play as a debugging tool.  Something backwards
	from Carp::confess.  Seems like some of the more obscure debugger
	code could be used to build a pragma that would spit out information
	like:

	Package::Foo::new(args) called from main::, foo.pl line 42
	    foo(args) called from Package::Foo, Package/Foo.pm line 13
	        bar(args) called from Package::Foo, Package/Foo.pm line 666
	        dog(args) called from Package::Foo, Package/Foo.pm line 4711
	    cat(args) called from Package::Foo, Package/Foo.pm line 69
	system("sudo rm -rf /") called from main::, foo.pl line 43

-- 
-Zenin
 zenin@archive.rhps.org


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

Date: Tue, 24 Mar 1998 03:02:48 -0600
From: audttjk@dbs.com.sg
To: lars-n@hsr.no
Subject: Re: How to log input to different files in perl
Message-Id: <6f7sqq$fua$1@nnrp1.dejanews.com>

1. First, use CGI.pm to simplify your job.

2. Assuming your drop-down list is a CGI parameter called 'animals'.
And your options are 'cats','dogs','horses'.

3. After your form is submitted,  you can use something like the following
to perform  logging. Assuimg your log files are cats.log, dogs.log and
horses.log

----------------------------------------
use CGI;
my $form = new CGI;
my $animal = $form->param('animals');
open LOG, ">$animal.dog";

# do whatever you need to do with <LOG> say
print <LOG>, $form->param('answer submitted');
------------------------------------------
4. The idea is to associate the names of your log files with each element in
your drop down list.

Hope this helps,

Jit Kiat
audttjk@dbs.com.sg

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


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

Date: Tue, 24 Mar 1998 03:02:48 -0600
From: audttjk@dbs.com.sg
To: lars-n@hsr.no
Subject: Re: How to log input to different files in perl
Message-Id: <6f7ssl$a2r$1@nnrp2.dejanews.com>

1. First, use CGI.pm to simplify your job.

2. Assuming your drop-down list is a CGI parameter called 'animals'.
And your options are 'cats','dogs','horses'.

3. After your form is submitted,  you can use something like the following
to perform  logging. Assuimg your log files are cats.log, dogs.log and
horses.log

----------------------------------------
use CGI;
my $form = new CGI;
my $animal = $form->param('animals');
open LOG, ">$animal.dog";

# do whatever you need to do with <LOG> say
print <LOG>, $form->param('answer submitted');
------------------------------------------
4. The idea is to associate the names of your log files with each element in
your drop down list.

Hope this helps,

Jit Kiat
audttjk@dbs.com.sg

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


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

Date: 24 Mar 1998 11:15:05 GMT
From: njh4@aber.ac.uk (NIALL JAMES SELETZKY)
Subject: Multi-function Perl scripts
Message-Id: <6f84jp$3im$1@infoserv.aber.ac.uk>

Hi,

Can anyone tell me if it is OK to have 2 functions in a Perl script, where one opens an email thread, and writes to
it, and the other opens a file and writes (the same data) to that, for a log file.

Niall Seletzky


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

Date: Tue, 24 Mar 1998 11:07:14 +0000
From: Jerry Pank <jerryp.usenet@connected.demon.co.uk>
Subject: Not the usual ``won't run on my browser'' problem. Modules or me?
Message-Id: <$A043JAiP5F1Ewy0@connected.demon.co.uk>

As my ISP has at last promised to upgrade to 5.004. Yippee!

I'm now getting all excited about using all the lovely modules you guys
have built because it means I can stop doing everything ``long-hand''.

In preparation I've upgraded my local version to Garusamy Sarathy's
5.004 $bill port (win95) and started to play with all the modules.
At first glance all my scripts seem to run both from command line &
through my browser on localhost.

However when playing with HTML::* late in the night, my grin slowly
disappeared.

The following script (I've added the use strict), fails to run properly
on my webserver as shown in the script comments.

#!/bin/perl5 -w

# Why does this routine display OK on STDOUT from command line,
# yet only shows:
#    Begin...
# when run on my local server?
# This is the only program I'm having trouble with.
# All my other Perl stuff seems to run on //localhost

use HTML::Parse;
use strict;

print "content-type: text/plain\n\n";

my ($i,@link);

        # Show me something 
print "   Begin...\n";
        # Yup. Seen on STDOUT & on Browser

my $tree=parse_htmlfile("test.html");
        # Doh! Only seen on STDOUT :-(

my $link_ref = $tree->extract_links();
@link = @$link_ref;
        # ditto

for ($i=0; $i <= $#link; $i++) {
        print "$link[$i][0]\n";
}
        # ditto

print "\nTTFN";
        # ditto


Bah !

I'm new to using modules, so please excoriate me gently :-) 
-- 
Jerry Pank           mailto:jerryp.usenet@connected.demon.co.uk

To paraphrase Doug Gwyn, Perl was not designed to stop people from doing
stupid things, because that would also stop them from doing clever things.
As with GUIs, you infuriatingly penalize everyone else just because
some people have room-temperature IQs and shouldn't be allowed to feed
themselves.
-- Tom Christiansen <comp.lang.perl.misc> recently.


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

Date: Tue, 24 Mar 1998 09:25:01 GMT
From: stephenb@scribendum.win-uk.net (stephen benson)
Subject: Novice RegExpr problem -- how to slurp down big chunks of text for processing
Message-Id: <35177b26.6020106@nntp.ibmpcug.co.uk>

 I have a large body of FrontPage generated/maintained pages. I have
to produce one set with references to notes, another with those notes
included -- so parallel pages. FrontPage uses what it calls a webbot
to do the include which takes this form:


FP: 
<!--webbot bot="Include" u-include="ww_notes_to_5_1.html" tag="BODY"
startspan -->

My Perl: 
/^\<!--webbot bot=\"Include\" u-include=\"(\w+\.html*)\" tag=\"BODY\"
startspan\s*--\>$/
 .
 .
 .
 .
FP:
<!--webbot bot="Include" endspan i-checksum="51828" -->

My Perl: 
/^\<!--webbot bot=\"Include\" endspan i-checksum=\"(\d+)\"/


With a variable amount of text inbetween. I also have to extract the
HREF (ww_notes_to_5_1.html), and then the title from this next bit of
text, and write it in place (print "\<A HREF=\"$1\"\>$2\</A\>";), so
that there's now a link to the deleted include. 

The title I need  takes the form:

<strong>WW Note to
           5.1</strong>

contained in:

--[snip]---
<blockquote>
    <div align="left"><table border="0">
        <tr>
            <td><font size="2" face="Arial, Helvetica, Verdana"><a
href="" onClick="parent.bas.history.back(); return false;"
onMouseOver="self.status='Back'; return true;"><img
src="../../share_images/arrow_lft_sq_bl.gif" border=0></a>
<a href= "../../blank.html" target="bas"  
onMouseOver="self.status='Clear'; return true;"> <img
src="../../share_images/button_sq_redx.gif" border=0 ></a>
<a href="" onClick="parent.bas.history.forward(); return false;"
onMouseOver="self.status='Forward'; return true;"><img
src="../../share_images/arrow_rt_sq_bl.gif" border=0></a>
</font></td>
            <td width="10">&nbsp;</td>
            <td valign="top"><a name="c920b3cd" target="bas"><font
size="2" face="Arial, Helvetica, Verdana"><strong>WW Note to
            5.1</strong></font></a><font size="2" face="Arial,
Helvetica, Verdana"> </font></td>
        </tr>
    </table>
    </div>
</blockquote>
--[snip]---

Which I can't get with a huge range of attempts like:
/<strong>(WW Notes* to)\s*(\d*.*\d+)<\/strong>/   (with or without sm
appended)

I need to slurp the whole lot in at once (not line by line -- this is
where I'm having trouble finding examples to work from), extracting
the  URL, then scan it for the title and write the HREF. 
-- stephen benson
stephenb@scribendum.win-uk.net || stephen_benson@watsonwyatt.co.uk
http://www.ibmpcug.co.uk/~2i/ || http://www.scribendum.win-uk.net/
__________________________________________________________________


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

Date: Tue, 24 Mar 1998 07:31:56 GMT
From: tmornini@netcom.com (Tom Mornini)
Subject: Re: Perl Databases...
Message-Id: <tmorniniEqBBL8.9nn@netcom.com>

Bill Lewis (Bill.Lewis@mci.com) wrote:

: %info = $key => $value;

$info{$key}=$value;

-- Tom Mornini
-- InfoMania


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

Date: 24 Mar 1998 00:40:29 -0800
From: darrell@annapolis.net
Subject: Re: Perl to read  spreadsheet files
Message-Id: <6f7rht$k85@edrn.newsguy.com>

I have had a lot of success using OLE. You can take the data directly out in the
background.  Workds on 95 and NT.




In article <3516AECA.332BB2A9@enterprise.net>, Kevin says...
>
>Dear all,
>I need to write some scripts to get info from lotus spreadsheet files
>onto a website.
>Is there any way of reading the files directly ?
>My demo test at the moment involves exporting the sheet to txt and then
>displaying nice.
>I dont need the forumlae or anything....just values, but as these change
>on a fairly regular basis I can't trust the users to to the export - as
>they are all accountants !!!
>Getting the graphs in would be nice though !
>
>Any thoughts greatly appreciated
>TIA
>Kevin
>
>
>--
>=====================================================
>Don't tell my mother I'm a programmer.
>She thinks I'm a piano player in a brothel
>=====================================================
>Get me at:
>Home(GMT)  kluff@enterpise.net
>Work(GMT)  kevin.luff@hil.hftrust.com
>WWW        http://homepages.enterprise.net/kluff
>=====================================================
>
>


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

Date: Mon, 23 Mar 1998 22:50:08 -0800
From: Kim Lo <kiml@zplace.com>
Subject: Re: Question about DBM Array
Message-Id: <3517579F.101916C1@zplace.com>

At the command line, type: perl -v

lihong@public1.guangzhou.gd.cn wrote:

> I am using my workstation Perl.  Is there any way to
> know the version of perl. (not like perl5 which is stated
> in the first line of script#!/usr/local/bin/perl5), the
> first line in my script should be /usr/local/bin/perl.
> so what's its version?
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/   Now offering spam-free web-based newsreading





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

Date: 23 Mar 98 07:49:50 +0000
From: "Rick Townsend" <rick@slicks.demon.co.uk>
Subject: Re: reset a array?
Message-Id: <661.386T2505T4693101@slicks.demon.co.uk>

On 22-Mar-98 00:41:54, Steve Palincsar said :
 SP> Magnus "ShockMan" Blikstad wrote:
>> 
>> how do i reset a array, i need to do this in one of my CGI
>> scripts... i looked through the perl documents but i cant find
>> anything... any ideas?

 SP> @array_in_question = ();

When I tried this and tested the array for defined() or == "" the test
failed, printing out the first entry gave a '.' is this right?

Rick.

-- 
   /\\ rick@slicks.demon.co.uk             Apache \\     //
  // \\ A4000 Warp 040 40Mgz        Cybervision 64 \\   //
 //===\\ home page    http://www.slicks.demon.co.uk \\ //
//     \\                                 Team AMIGA \//
--   



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

Date: 24 Mar 1998 10:13:23 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: reset a array?
Message-Id: <slrn6hf1q3.tt9.Tom.Grydeland@mitra.phys.uit.no>

On 23 Mar 98 07:49:50 +0000,
Rick Townsend <rick@slicks.demon.co.uk> wrote:

>  SP> @array_in_question = ();
> 
> When I tried this and tested the array for defined() or == "" the test
> failed, printing out the first entry gave a '.' is this right?

You don't "test" arrays with defined() or == "".  Arrays aren't strings.

perldoc -f defined

On the other hand, use of defined() upon aggregates (hashes and arrays)
is not guaranteed to produce intuitive results, and should probably be
avoided.

Further down in that manpage are more hints.

>    /\\ rick@slicks.demon.co.uk             Apache \\     //

-- 
//Tom Grydeland <Tom.Grydeland@phys.uit.no>


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

Date: 23 Mar 1998 22:21:13 -0800
From: bruce@greatbasin.net (Bruce Robertson)
Subject: Trouble getting gethostbyaddr() to work
Message-Id: <x7zpighana.fsf@owl.greatbasin.net>

Okay, I give up.  What am I doing wrong?  The value of $nas_address
is, for example, 10.1.2.3.  Why does $nas end up null?

    $iaddr = pack('C4', split(/\./, $nas_identifier));
    $nas = (gethostbyaddr($iaddr, AF_INET))[0];
-- 
Bruce Robertson, President/CEO				     +1-702-348-7299
Great Basin Internet Services, Inc.			fax: +1-702-348-9412
PGP Key fingerprint = 03 2D A8 4A 37 07 FB 53  EB C9 02 5C E5 10 66 F2


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

Date: 23 Mar 1998 23:56:52 -0800
From: bruce@greatbasin.net (Bruce Robertson)
Subject: Re: Trouble getting gethostbyaddr() to work
Message-Id: <x767l4ed2z.fsf@owl.greatbasin.net>

Never mind, I figured it out.  Thanks anyway!
-- 
Bruce Robertson, President/CEO				     +1-702-348-7299
Great Basin Internet Services, Inc.			fax: +1-702-348-9412
PGP Key fingerprint = 03 2D A8 4A 37 07 FB 53  EB C9 02 5C E5 10 66 F2


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

Date: Tue, 24 Mar 1998 04:13:43 -0500
From: "John R. McNair, Jr." <pamdirac@mindspring.com>
Subject: trouble with \r
Message-Id: <35177947.49B5DF8D@mindspring.com>

I'm trying to use a generic text progress indicator, something like:

	Doing $i of $j ...

I don't want to be  flooded with these lines, however, so I'm trying to
use carriage-return instead of newline b/w the indicator lines.  It
worked fine for me in Perl 4 for VOS, but I'm having trouble with
5.004_04 for Linux.  If I do:
for($i=0; $i<5; $i++) {
	print "\r$i";
	sleep(1);
}

it will display nothing until it's done, and then the final $i, 4, will
be visible.  If I use "\n" instead of "\r", it will print the lines as
it's moving through the loop.  "\r" works if I single-step through the
debugger, but not if I run the program in the debugger (has anyone else
seen different behavior from single-step mode and run mode?).
	I've also tried crazy stuff like:
print chr(8), $i;
but that didn't work either.

	This is not that important, but it seems like this should be relatively
easy to do.


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

Date: 24 Mar 1998 10:24:18 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
To: pamdirac@mindspring.com
Subject: Re: trouble with \r
Message-Id: <7xzpigo30d.fsf@beavis.vcpc.univie.ac.at>

Re: trouble with \r, John <pamdirac@mindspring.com> said:

John> I don't want to be flooded with these lines, however,
John> so I'm trying to use carriage-return instead of
John> newline b/w the indicator lines.  It worked fine for

stdout is by default line-buffered so you have to unbuffer
it.

    use FileHandle;
    autoflush STDOUT 1;

hth
-- 
Tony Curtis, Systems Manager, VCPC,      | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | http://www.vcpc.univie.ac.at/

"Everything I am, I learned on the back of cereal boxes" ~ RJ, "Over the Hedge"


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

Date: 24 Mar 1998 11:22:31 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: Using perl code as a config file syntax? (Or, can require return more then one value?)
Message-Id: <slrn6hf5rm.tt9.Tom.Grydeland@mitra.phys.uit.no>

On Mon, 23 Mar 1998 19:45:40 -0500,
Phillip Lenhardt <philen@ans.net> wrote:
> My $0.02:

[...]
> directories to check for core dumps, but not so good for specifying the
> command line to use for moving/removing them (say, /bin/rm here and
> /sbin/rm there).

Actually, this point is a bit weak as you could've used unlink and
avoided the issue.  I'll give you the benefit of doubt and assume that
the actual issues and programs were different.

> 	-phil

-- 
//Tom Grydeland <Tom.Grydeland@phys.uit.no>


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

Date: Tue, 24 Mar 1998 07:20:49 GMT
From: mark@webz.com (Mark Schmick)
Subject: Re: What's up with the debugger?
Message-Id: <35175e46.7174030@news.flash.net>

It looks like I should extend the last question to a full-on bug
report--I downgraded to 5.003 and the debugger buggery went away.
Still .. any comments? Is this repeatable on platforms other than
Linux?

Perl 5.004_04
Redhat Linux, 2.0.27



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

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

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