[7305] in Perl-Users-Digest
Perl-Users Digest, Issue: 930 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 27 10:17:10 1997
Date: Wed, 27 Aug 97 07: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, 27 Aug 1997 Volume: 8 Number: 930
Today's topics:
Re: 'abandon' hope (was: Re: Need help: how to exit a s <seay@absyss.fr>
(stupid) pattern matching question denis@mathi.uni-heidelberg.de
Re: (stupid) pattern matching question (Michael Fuhr)
Re: (stupid) pattern matching question (Steve Lamb)
Re: [Q] Awk's "s in A" Hash Test In Perl? <tom@mitra.phys.uit.no>
Re: [Q] Awk's "s in A" Hash Test In Perl? <seay@absyss.fr>
Re: [Q] Awk's "s in A" Hash Test In Perl? <seay@absyss.fr>
Re: A Complex Regex Needed <seay@absyss.fr>
cgi and stdout <year9313@club.innet.be>
Re: cgi and stdout (Andreas Schmidt)
Re: cgi and stdout <seay@absyss.fr>
Fork Problem again kchadha@hotmail.com
Re: How can I get rid of carriage return in textarea (Maelstrom)
Re: How can I make traceroute CGI? <ramon@ramonc.icix.net>
Re: How to Check if a file has been required <fawcett@nynexst.com.spam-me-not>
How to print a PDF file automatically ? <pascal_amram@ml.com>
Re: How to print a PDF file automatically ? <seay@absyss.fr>
Re: HTML page after file transfer <icache@usa.net>
Is this a permissions problem Opening and reading a URL <jaydee@worsdall.demon.co.uk>
Re: Ok, everybody laugh at me ;) <seay@absyss.fr>
Re: Ok, everybody laugh at me ;) (Jim Esten)
Re: Parsing multiple arguments with Perl <jefpin@bergen.org>
perl and afs <weav@apollo.havant.ibm.com>
Re: perl and afs <seay@absyss.fr>
Perl module for mpilib <marius@funcom.com>
PERL on NT to access Performance Counters (Jerry Britton)
Re: Perl Regular Expression has a bug? <tom@mitra.phys.uit.no>
perldb.pl not in @INC <simon@century.demon.co.uk>
Re: read last line without reading previous lines, how? (Chip Salzenberg)
Setting the TZ time variable within Perl <ninofior@adel.tafe.sa.edu.au>
Re: Setting the TZ time variable within Perl <seay@absyss.fr>
Re: simple? question (Chip Salzenberg)
Re: spell checking <jefpin@bergen.org>
Re: Web PG Generator <jefpin@bergen.org>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 27 Aug 1997 10:11:59 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: 'abandon' hope (was: Re: Need help: how to exit a sub)
Message-Id: <3403E14F.21F53651@absyss.fr>
Tom Phoenix wrote:
>
> On Tue, 26 Aug 1997, Benjamin Sugars wrote:
> >
> > open(FILE, $file) or
> > abandon "couldn't open $file: $!\n";
>
> Seriously, the ability to make the sub abandon which would exit out of the
> caller's subroutine might be more useful, since it's more generalized than
> a new abandon built-in. Hmmm....
Are you talking about some sort of multi-level return ("goback?")? This
would allow someone to snoop on the stack with caller(), decide how many
levels back he wants to go, and call goback($levels, @values).
Using this one could work around the eval/die type of exceptions and
still not have every line booby-trapped with lots of error checking. If
program uses X.pm, then when X::something() fails, could do a
multi-level return that skipped all the X::sub() levels, and return an
error directly to first level that wasn't in package X.
Would this be enough to satisify those who don't like "die" in library
functions?
- doug
------------------------------
Date: Wed, 27 Aug 1997 14:09:43 +0200
From: denis@mathi.uni-heidelberg.de
Subject: (stupid) pattern matching question
Message-Id: <34041907.41C6@mathi.uni-heidelberg.de>
hi,
i am trying to find "IN A" in a line. with maybe more than one
space or tab between in and a. so i tried:
/IN\s+A/
but this didn't work. why?
bye
denis
------------------------------
Date: 27 Aug 1997 07:04:47 -0600
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: (stupid) pattern matching question
Message-Id: <5u18lf$37g@flatland.dimensional.com>
denis@mathi.uni-heidelberg.de writes:
> i am trying to find "IN A" in a line. with maybe more than one
> space or tab between in and a. so i tried:
>
> /IN\s+A/
>
> but this didn't work. why?
Without more information, we have no way of knowing why your code
doesn't work. Could you post the relevent section of your program,
along with the input you're feeding it and the output you get back?
BTW, it looks like you're doing some work with DNS -- there's a
module called Net::DNS that could be useful depending on what
you're doing.
--
Michael Fuhr
http://www.dimensional.com/~mfuhr/
------------------------------
Date: 27 Aug 1997 13:18:41 GMT
From: morpheus@calweb.com (Steve Lamb)
Subject: Re: (stupid) pattern matching question
Message-Id: <slrn608a9f.576.morpheus@web1.calweb.com>
denis@mathi.uni-heidelberg.de
in <<34041907.41C6@mathi.uni-heidelberg.de>> wrote:
>i am trying to find "IN A" in a line. with maybe more than one
>space or tab between in and a. so i tried:
> /IN\s+A/
>but this didn't work. why?
Not sure. Here is the test I just ran with Perl 5.003.
$blah="IN A";
print("Bah\n");
print("space\n") if $blah =~ /IN A/;
print("slash s\n") if $blah =~ /IN\sA/;
print("slash s plus\n") if $blah =~ /IN\s+A/;
print("slash s splat\n") if $blah =~ /IN\s*A/;
print("dot \n") if $blah =~ /IN.A/;
print("dot splat\n") if $blah =~ /IN.*A/;
{morpheus@morpheus:/home/morpheus/program/perl}perl 111.pl
Bah
space
slash s
slash s plus
slash s splat
dot
dot splat
As you can see it worked fine except for the tab, which, of course, my
string didn't have.
--
Steve C. Lamb | Opinions expressed by me are not my
http://www.calweb.com/~morpheus | employer's. They hired me for my
CC: from news not wanted or appreciated| skills and labor, not my opinions!
---------------------------------------+-------------------------------------
------------------------------
Date: 27 Aug 1997 10:23:40 +0200
From: Tom Grydeland <tom@mitra.phys.uit.no>
Subject: Re: [Q] Awk's "s in A" Hash Test In Perl?
Message-Id: <nqoen7gc9v7.fsf@mitra.phys.uit.no>
Jim Monty <monty@primenet.com> writes:
> I'm an awk programmer learning Perl. What is the equivalent in Perl
> of awk's "subscript in array" expression for testing the existence
> of a _subscript_ (NOT an element!) in an associative array?
Moving from awk to Perl? Did you check out a2p?
> For example, in awk, one might say
>
> secretword = name in words ? words[name] : "groucho"
> cat tester.awk
{
name in words? words[name] : "groucho"
}
> a2p tester.awk
#!/store/bin/perl
eval 'exec /store/bin/perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
# this emulates #! processing on NIH machines.
# (remove #! line above if indigestible)
eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_0-9]+=)(.*)/ && shift;
# process any FOO=bar switches
while (<>) {
defined $words{$name} ? $words{$name} : 'groucho';
}
Do you think that can help you?
> Jim Monty
--
//Tom Grydeland <Tom.Grydeland@phys.uit.no>
------------------------------
Date: Wed, 27 Aug 1997 10:34:40 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: [Q] Awk's "s in A" Hash Test In Perl?
Message-Id: <3403E6A0.3F1B2176@absyss.fr>
Jim Monty wrote:
>
> I'm an awk programmer learning Perl. What is the equivalent in Perl
> of awk's "subscript in array" expression for testing the existence
> of a _subscript_ (NOT an element!) in an associative array?
>
> For example, in awk, one might say
>
> secretword = name in words ? words[name] : "groucho"
perldoc -f exists
basically
$secretword = exists $words{$name} ? $words{$name} : "groucho";
- doug
------------------------------
Date: Wed, 27 Aug 1997 10:36:17 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: [Q] Awk's "s in A" Hash Test In Perl?
Message-Id: <3403E701.206C6721@absyss.fr>
Eric Bohlman wrote:
>
> Jim Monty (monty@primenet.com) wrote:
> : I'm an awk programmer learning Perl. What is the equivalent in Perl
> : of awk's "subscript in array" expression for testing the existence
> : of a _subscript_ (NOT an element!) in an associative array?
>
> : For example, in awk, one might say
>
> : secretword = name in words ? words[name] : "groucho"
>
> TMTOWTDI, but "defined($words{$name})" should do it.
No, defined() isn't good enough, because
$hash{$key} = undef;
creates an entry for $key, but gives it an undefined value. The
question was "does $key have an entry".
- doug
------------------------------
Date: Wed, 27 Aug 1997 10:40:41 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: A Complex Regex Needed
Message-Id: <3403E809.5A043697@absyss.fr>
oops. I forgot the closing slash.
> $record =~ m/([^\t]+)\t+[^\t]+\t+([^\t]+);
$record =~ m/([^\t]+)\t+[^\t]+\t+([^\t]+)/;
- doug
------------------------------
Date: Wed, 27 Aug 1997 12:22:34 +0200
From: tom van mierlo <year9313@club.innet.be>
Subject: cgi and stdout
Message-Id: <3403FFEA.2701@club.innet.be>
is it possible to check if a program returns an output
and if so, can you redirect it to a file ?
------------------------------
Date: 27 Aug 1997 11:48:44 GMT
From: schmidt@miserv2iai.kfk.de (Andreas Schmidt)
Subject: Re: cgi and stdout
Message-Id: <5u146s$jfh$1@nz12.rz.uni-karlsruhe.de>
In article <3403FFEA.2701@club.innet.be>, tom van mierlo <year9313@club.innet.be> writes:
|> is it possible to check if a program returns an output
|> and if so, can you redirect it to a file ?
hola tom,
there is a special form of the open command.
here is an example:
my $prog = "/tmp/a_program";
open(PROC,"$prog|") || die " could not execute \'$prog\'\n";
print "The output of program \'$proc\' is:\n";
while (<PROC>) {
print $_;
}
the special is the pipe symbol '|' at the end of the programname in the open
command. this tells perl that the open is not for an file but for a program.
hopethishelps
smiff
------------------------------
Date: Wed, 27 Aug 1997 14:16:28 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: cgi and stdout
Message-Id: <34041A9C.6D22BD17@absyss.fr>
tom van mierlo wrote:
>
> is it possible to check if a program returns an output
> and if so, can you redirect it to a file ?
I don't understand the question. You want your script to launch a
program that produces standard out, but redirect this output to a file?
It depends on how launch this program? What does CGI have to do with
this?
If you just used `program`, you could easily do `program >output` but
now you won't get the output of this program. `program | tee output`
will write everything to the file "output" and still give you a copy of
the output. With system(), you just add the ">output" at the end of the
string. For system() with a list, open(), fork()/exec() and the rest,
it gets kinda manual.
- doug
------------------------------
Date: Wed, 27 Aug 1997 08:42:53 -0600
From: kchadha@hotmail.com
Subject: Fork Problem again
Message-Id: <872689166.5950@dejanews.com>
HI,
I have the following program:
$| = 1;
&execute_sub;
print "abc\n";
sub execute_sub
{
if $pid=fork
{ while(1){
sleep(4);
if (waitpid($pid,0100))
{
print "completed";
last;
}
print "wait";
}
}
else
{ #child does some work here }
}
This prints "Completed" and then "abc" and then completed and abc
again ! I know this is a problem of output buffering and $|
but I can't figure out how to solve it !
Any ideas on how to solve this will be greatly appreciated !
Please e-mail replies to kchadha@hotmail.com
Thanks!
K. Chadha
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Wed, 27 Aug 1997 08:40:42 GMT
From: maelstrom@deathsdoor.com.REMOVETHIS (Maelstrom)
Subject: Re: How can I get rid of carriage return in textarea
Message-Id: <3403e70e.24804857@news.upnaway.com>
"Brendan Murphy" <info@arkson.com> wrote thus:
>
>How can I get rid of carriage return in textarea form to avoid messing up
>when the database cgi program build a file (db) where all the input should
>be on one line?
This is probably in the FAQ but try
$ARRAY{'value'} =~ s/\n//g;
--Maelstrom
"Furthermore, I have been locked away in a mental hospital
before and their `psychiatric care' (or torture) did not
reform me or brainwash me into conforming to the status quo.
They tried, but failed. They finally had to
declare that I was legally sane. How many people do you
know have been declared legally sane by the state of North
Carolina? Ha, ha, ha! I outwitted the system again."
Doctress Neutopia
------------------------------
Date: Tue, 26 Aug 1997 15:07:59 -0400
From: Ramon Castillo <ramon@ramonc.icix.net>
To: stormshield@hotmail.com
Subject: Re: How can I make traceroute CGI?
Message-Id: <3403298F.5DA3@ramonc.icix.net>
Probably this is not the more elegant way but it works.
open (TR,"traceroute 199.xx.xx.x 2>/dev/null |") ;
@TR = <TR>;
foreach $TR (@TR){
print;
}
Remember in Perl there are at least 10 ways to do it.
RC
------------------------------
Date: 27 Aug 1997 08:30:09 -0400
From: Tom Fawcett <fawcett@nynexst.com.spam-me-not>
Subject: Re: How to Check if a file has been required
Message-Id: <8jn2m37qr2.fsf@nynexst.com.spam-me-not>
Allen Choy <achoy@us.oracle.com> writes:
> Is there a way to verify if a file has been 'require'd or 'use'd?
if ($INC{$file}) { print "$file has been loaded\n" }
------------------------------
Date: Wed, 27 Aug 1997 09:56:18 +0200
From: Pascal AMRAM <pascal_amram@ml.com>
Subject: How to print a PDF file automatically ?
Message-Id: <3403DDA2.F58A752D@ml.com>
How to print a pdf file with perl ?
Background i have created a robot to grab several files from internet
and intranet and i want to print these files automatically ?
Thank you
------------------------------
Date: Wed, 27 Aug 1997 14:08:38 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: How to print a PDF file automatically ?
Message-Id: <340418C6.B3C88B6@absyss.fr>
Pascal AMRAM wrote:
>
> How to print a pdf file with perl ?
> Background i have created a robot to grab several files from internet
> and intranet and i want to print these files automatically ?
>
> Thank you
Isn't that more of a printer question? Either your printer should
autodetect the type of file and format it accordingly, or you'll have be
explict. I don't do much with printing, but I'd guess that ghostscript
understands pdf, so you could use that to convert your .pdf file to
postscript. Most printers understand post script, so you're home free.
- doug
------------------------------
Date: Wed, 27 Aug 1997 02:40:00 -0600
From: Keith Davis <icache@usa.net>
To: Steve <stachelczyks@sprynet.com>
Subject: Re: HTML page after file transfer
Message-Id: <3403E7E0.7536@usa.net>
Steve wrote:
>
> I have a Perl script which transfers a file and after that I would like
> to send a notification page of the files that were transferred. I'm
> using the CGI.pm module. When the script returns from the
> ReadFileContents procedure it ignores the start_html section of the
> program.
>
> Any suggestions?
>
> Also when I put a print statement in the script before the File transfer
> . The start_html section works and is displayed however the file
> transfer does not work. It looks like the browser does not interpret the
> header properly and instead of getting a popup window asking what I want
> to do with the file -- It tries to print it in the browser window.
>
> Here is the script in question:
>
> print "Content-Type: application/zip\n";
> print "Content-Disposition: inline;filename=$archive\n\n";
>
> &readFileContents;
>
> print start_html(-title=>'test'),
> "this is a test",
> end_html;
>
> Thanks in advance.
>
> sub readFileContents {
> local($/) = undef;
> open (FILE, $archive) || die "Cannot Open file for input";
> binmode (FILE);
> select (STDOUT);
> $| = 1;
> print <FILE>;
> close (FILE);
I could be misunderstanding your problem but - from my experience,
forcing the browser to "save" the file rather than "display" the file is
dependent on giving the file an extension for the browser to read;
extensions other than .htm, .html, or .txt will not be displayed, I
personally use a .zyg extension but zip should also force a "save as".
------------------------------
Date: Tue, 26 Aug 1997 22:51:00 +0100
From: Mark Worsdall <jaydee@worsdall.demon.co.uk>
Subject: Is this a permissions problem Opening and reading a URL
Message-Id: <zJZQVOAE$0A0EwOl@worsdall.demon.co.uk>
OK, well after experimetnation I definetely know I am using the wrong
type of thingy to read the contents of a webpage, eg below:-
# With the variable $visitorshome set to either of these:-
# $visitorshome = 'http://www.worsdall.demon.co.uk/index.html';
So how? using what?
Mark.
--
Mark Worsdall - Oh no, I've run out of underpants :(
Home:- jaydee@worsdall.demon.co.uk WEB site:- http://www.worsdall.demon.co.uk
Shadow:- webmaster@shadow.org.uk WEB site:- http://www.shadow.org.uk
------------------------------
Date: Wed, 27 Aug 1997 10:30:23 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: Ok, everybody laugh at me ;)
Message-Id: <3403E59F.4A431695@absyss.fr>
Jason Wood wrote:
>
> Here is a little (umm big) routine to convert $$money$$ into its correct
> form..
What are you trying to do? Take a generic X.Y number and ensure that Y
is between 0 and 99? Rounding numbers to arbitrary decimal depths has
been discussed lately, so maybe you want to go to DejaNews and see what
you can find. IIRC you can multiply by 100 so that you are working in
cents (not dollars), round/truncate whatever is left (to avoid
fractional pennies), and then divide by 100 to convert back to dollars.
Note that if a generic rounding functions might have a "round to even"
property. This is great for statistics, but horrible for money. You
want a well defined notion of who gets the fraction. hint - usually the
bank, not the customer.
- doug
------------------------------
Date: 27 Aug 1997 08:17:08 -0500
From: jesten@earth.execpc.com (Jim Esten)
Subject: Re: Ok, everybody laugh at me ;)
Message-Id: <5u19ck$ffo$1@earth.execpc.com>
....referring to your need to generate currency formatted
strings....
: laugh it up, actually, a better way to do this would be helpful
: I couldn't find any round functions to use, although I know they are there..
: I've know Perl for less than a year, so I haven't learned the shortcuts..
: Thanks, later
...sorry, can't work up a laugh - been there, done that :( ... but
here is the sub I use...
sub money { # takes a floating point number, inserts commas too
local ($_) = sprintf("%0.2f",@_);
1 while s/(.*\d)(\d\d\d)(\.\d\d)*/$1,$2$3/;
$_;
}
Then just tack on a dollar sign to the return value...
cheers,
Jim
B
B
B
B
B
B
------------------------------
Date: Wed, 27 Aug 1997 08:17:11 -0400
From: Anagrams of the Word 'A' <jefpin@bergen.org>
To: James Sablatura <jsab@insync.net>
Subject: Re: Parsing multiple arguments with Perl
Message-Id: <Pine.SGI.3.95.970827081559.22659D-100000@vangogh.bergen.org>
>Would someone be so kind as to let me know how I can pass multiple
>arguments to a perl script.
>
>I have done one argument successfully by doing:
>http://wwww.domain.com/cgi-bin/script.cgi?arg1
>
>and arg1 is stored in argv[0], but how can I pass multiple arguments
>so that I can access them like argv[1] or argv[2]?
Separate them with & signs...
www.domain.com/cgi-bin/script.cgi?foo&bar&fubar
argv[0] = foo
argv[1] = bar
argv[2] = fubar
----------------
| "You have the ability to annoy God!"
| - Joe Holbrook
----------------
Jeff "TechMaster" Pinyan | http://users.bergen.org/~jefpin
I do: HTML!! CGI!! Perl!! JavaScript!! jefpin@bergen.org
Got a JavaScript/CGI/Perl question or problem? Let me know!
webXS - the new eZine for WebProgrammers! TechMaster@bergen.org
Visit us @ http://users.bergen.org/~jefpin/webXS
------------------------------
Date: Wed, 27 Aug 1997 10:24:25 +0100
From: Nick Weavers <weav@apollo.havant.ibm.com>
Subject: perl and afs
Message-Id: <3403F249.794B@apollo.havant.ibm.com>
I have a perl script that attempts to ensure that it's input file
(passed in by the user) exists and is readable so I use the -e and
-r filetest operators. However, we work under AFS and I am finding that
if my token has expired the -r does not tell me that I cannot read the.
This is probably because -r reads the unix file permission bits and
doesn't know anything about AFS.
Is there someway I can make perl AFS aware, or is there perhaps a module
that might help me. (I took a look in the module list but could not see
anything published).
--
Nick Weavers
------------------------------
Date: Wed, 27 Aug 1997 14:11:08 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: perl and afs
Message-Id: <3404195C.F06FB85@absyss.fr>
Nick Weavers wrote:
>
> I have a perl script that attempts to ensure that it's input file
> (passed in by the user) exists and is readable so I use the -e and
> -r filetest operators. However, we work under AFS and I am finding that
> if my token has expired the -r does not tell me that I cannot read the.
>
> This is probably because -r reads the unix file permission bits and
> doesn't know anything about AFS.
>
> Is there someway I can make perl AFS aware, or is there perhaps a module
> that might help me. (I took a look in the module list but could not see
> anything published).
Did you switch to AFS since you last built perl? Or did you build on a
non-AFS system? I'm asking this because when building perl, there is a
bit about AFS. Since I don't use AFS, I don't remember the details.
Maybe you should try rebuilding and see if that helps.
- doug
------------------------------
Date: 27 Aug 1997 14:05:09 +0200
From: Marius Kjeldahl <marius@funcom.com>
Subject: Perl module for mpilib
Message-Id: <52yb5nltl6.fsf@ace.funcom.com>
Does anybody know if this exists? Yes, I know there is a module for
interfacing with PGP, but I need to use public key encryption for
encrypting arbitrary data to be put into a database and would prefer
to do all the necessary key handling etc. myself.
Marius
------------------------------
Date: Wed, 27 Aug 1997 12:00:09 GMT
From: ywamadam@xs4all.nl (Jerry Britton)
Subject: PERL on NT to access Performance Counters
Message-Id: <5u14sa$mtm$1@news2.xs4all.nl>
Anyone used Perl on NT to access the Performance Counters
(HKEY_PERFOMANCE_DATA)
?
------------------------------
Date: 27 Aug 1997 10:19:55 +0200
From: Tom Grydeland <tom@mitra.phys.uit.no>
Subject: Re: Perl Regular Expression has a bug?
Message-Id: <nqog1rwca1g.fsf@mitra.phys.uit.no>
Rael Dornfest <rael@zx81.dnai.com> writes:
> Or (if you are using Perl5) you could make things easier on yourself
> and use the Time module thusly:
>
> #!/usr/local/bin/perl
>
> use Time::localtime;
>
> $now = localtime;
>
> print "Time: ", join(/:/, $date->hour, $date->min, $date->sec), "\n";
=> Can't call method "hour" without a package or object reference at - line 4.
Oh, yes. the $date should've been $now. Let's fix that.
=> 81626
Come again? Let's see. Well, you can figure it out. (Hint: perldoc
-f join. The first argument to join is *not* usually a pattern match
operator.)
Is it too much trouble to test three-line scripts before posting them?
> /Rael Dornfest/ <title>Vice President & Webmaven</title>
--
//Tom Grydeland <Tom.Grydeland@phys.uit.no>
------------------------------
Date: Tue, 26 Aug 1997 10:00:16 +0100
From: Simon Peate <simon@century.demon.co.uk>
Subject: perldb.pl not in @INC
Message-Id: <EQaYzBAgspA0EAJj@century.demon.co.uk>
I have installed perl version 4 on two HP-UX systems, but on one of the
systems I get the following error message when I invoke the debugger:
perl -d <script>
Can't locate perldb.pl in @INC
Everything seems to work except the debugger on one of the machines.
Can anyone shed some light?
--
Simon Peate
------------------------------
Date: 27 Aug 1997 11:41:18 GMT
From: chip@rio.atlantic.net (Chip Salzenberg)
Subject: Re: read last line without reading previous lines, how?
Message-Id: <5u13ou$cno$1@news1.atlantic.net>
According to Mark A Johnson <mjohnson@ncs.com>:
>a similar question is: "how can i read a file from last line to
>first?"
If you are willing to make an assumption about maximum line length,
you can seek to the end minus that size, read the tail of the file,
and strip everything but the last line from what's been read.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
(Roller coaster on camera:) "Wow, this square quarter mile
has unbelievably good light rail transit!" // MST3K
------------------------------
Date: 27 Aug 97 11:18:27 GMT
From: "Nino Fioretti" <ninofior@adel.tafe.sa.edu.au>
Subject: Setting the TZ time variable within Perl
Message-Id: <0214259b$7520ee40$c8855c8f@ninofior>
My web server is located in a different time zone to me and when my various
CGI scripts send email I get the local Web Server time. Can someone tell me
how I can set a different time setting to the one in the server. The server
has an environment variable TZ=EST5EDT, whilst my local time has a setting
TZ=CST-9:30CDT.
How can I make this setting from within a CGI script?
Any ideas?
Regards,
Nino
------------------------------
Date: Wed, 27 Aug 1997 14:19:32 +0200
From: Doug Seay <seay@absyss.fr>
To: Nino Fioretti <ninofior@adel.tafe.sa.edu.au>
Subject: Re: Setting the TZ time variable within Perl
Message-Id: <34041B54.58074A28@absyss.fr>
Nino Fioretti wrote:
>
> My web server is located in a different time zone to me and when my various
> CGI scripts send email I get the local Web Server time. Can someone tell me
> how I can set a different time setting to the one in the server. The server
> has an environment variable TZ=EST5EDT, whilst my local time has a setting
> TZ=CST-9:30CDT.
> How can I make this setting from within a CGI script?
> Any ideas?
Do you mean "modify the TZ of the server" or "modify my own TZ
variable"? As a rule, modifying the TZ of your server will be bad. For
modifying your own, just change it like any other environment variable.
The info is in the man pages.
- doug
------------------------------
Date: 27 Aug 1997 11:39:31 GMT
From: chip@rio.atlantic.net (Chip Salzenberg)
Subject: Re: simple? question
Message-Id: <5u13lj$cl3$1@news1.atlantic.net>
According to Scratchie <upsetter@zip1.ziplink.net>:
> Why is it that sometimes I can write (for example) "print p;" and
>get a "<P>", but sometimes I need to write "print query->p;".
"print p;" works if &p has been imported. "use CGI ':standard'" imports
lots of subs, including &p; "use CGI" does not.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
(Roller coaster on camera:) "Wow, this square quarter mile
has unbelievably good light rail transit!" // MST3K
------------------------------
Date: Wed, 27 Aug 1997 08:12:29 -0400
From: Anagrams of the Word 'A' <jefpin@bergen.org>
To: Danny LaPrade <dannyl@computize.com>
Subject: Re: spell checking
Message-Id: <Pine.SGI.3.95.970827080738.22659A-100000@vangogh.bergen.org>
>Is there a way to somehow use perl to do spell checking?
What kind of spell checker? I have a search engine script that does three
different algorithms on a word:
Let's say the word is "ore"
It would match (where ? is any letter):
ore
?re
o?e
or?
?ore
o?re
or?e
ore?
roe
oer
Granted it would take a little while, but if you want to see a test run,
try surfing over to http://users.bergen.org/~jefpin/search.html and see if
you like it.
----------------
| Before you think UNIX is family-oriented, note that all children must die.
| - Cross-Platform Perl
----------------
Jeff "TechMaster" Pinyan | http://users.bergen.org/~jefpin
I do: HTML!! CGI!! Perl!! JavaScript!! jefpin@bergen.org
Got a JavaScript/CGI/Perl question or problem? Let me know!
webXS - the new eZine for WebProgrammers! TechMaster@bergen.org
Visit us @ http://users.bergen.org/~jefpin/webXS
------------------------------
Date: Wed, 27 Aug 1997 08:14:26 -0400
From: Anagrams of the Word 'A' <jefpin@bergen.org>
To: Jeff Hinds <jhinds@nospamidir.net>
Subject: Re: Web PG Generator
Message-Id: <Pine.SGI.3.95.970827081349.22659C-100000@vangogh.bergen.org>
>Has anyone built or run accross a CGI/PERL Instant Web Page Generator?
>Please let me know of any or anyone who can create one.
Geocities, and many online free w.p. services have one. I'll make you one
for free if you want... doesn't take too long.
----------------
| "You care... but I don't care."
| - Ken Mayers
----------------
Jeff "TechMaster" Pinyan | http://users.bergen.org/~jefpin
I do: HTML!! CGI!! Perl!! JavaScript!! jefpin@bergen.org
Got a JavaScript/CGI/Perl question or problem? Let me know!
webXS - the new eZine for WebProgrammers! TechMaster@bergen.org
Visit us @ http://users.bergen.org/~jefpin/webXS
------------------------------
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 930
*************************************