[10733] in Perl-Users-Digest
Perl-Users Digest, Issue: 4332 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 1 12:07:20 1998
Date: Tue, 1 Dec 98 09:00:23 -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, 1 Dec 1998 Volume: 8 Number: 4332
Today's topics:
Re: array value find and replace/update (Tad McClellan)
Associative Arrays? <anagaraj@eccms1.dearborn.ford.com>
Re: Batch Mailing <newsposter@cthulhu.demon.nl>
Connecting to DB2 Database (Jens Hilgers)
Connection to DB2 Database (Jens Hilgers)
Connection to Microsoft SQL Server (Jens Hilgers)
Connection to Microsoft SQL Server (Jens Hilgers)
Re: Connection to Microsoft SQL Server <hendrik.woerdehoff@sdm.de>
Re: does perl support | piping? (was Re: localtime () - (Larry Rosler)
Re: Filter to sort incoming mail? (Daniel E. Macks)
Re: Help - replacing a substring ronald_f@my-dejanews.com
Re: how to delete from /patt1/ to /patt2/ without inclu (Andrew M. Langmead)
Re: how to delete from /patt1/ to /patt2/ without inclu (Tad McClellan)
Re: how to delete from /patt1/ to /patt2/ without inclu (Andrew M. Langmead)
Re: local & unwind-protect (Was: Re: regexp on multiple <s1204672@aix2.uottawa.ca>
Re: localtime () - perl's bug ? (Larry Rosler)
Re: localtime () - perl's bug ? (Daniel E. Macks)
Re: localtime () - perl's bug ? <jhi@alpha.hut.fi>
Re: Multiplayer Roleplaying Game, Web-Based, Written in wyndo@cxo.com
Re: Multiplayer Roleplaying Game, Web-Based, Written in <garethr@cre.canon.co.uk>
Re: Need 5.003 source code for UNIX (Tad McClellan)
NO DOC NOWHERE!! (Was: emulating sed's "/start/,/stop/< (David Combs)
Re: Perl compiler? (Can you get one?) <aidan@salvador.blackstar.co.uk>
Re: Perl DBI error <fty@utk.edu>
Re: Perl in HTML - without FORM wyndo@cxo.com
Re: Perl5.005 in HP-UNIX? (EXCHANGE:MTL:1T83)
Re: post to perl using javascript <mcwebber@my-dejanews.com>
Re: post to perl using javascript (Kenny A. Chaffin)
Re: read html (Tad McClellan)
Re: RegExp and Authentication Help. (Tad McClellan)
Script question... <jsack@ctron.com>
Re: seek, tell, offset question (Tad McClellan)
Re: target help (Nnickee)
Re: Where can I learn more about SQL with PERL? mpeppler@mbay.net
Re: Why I can execute a command in Perl but not in CGI/ wyndo@cxo.com
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 1 Dec 1998 10:24:04 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: array value find and replace/update
Message-Id: <475147.0h5.ln@flash.net>
Vili (vili.ga.ga@altavista.net) wrote:
: I would like to match a line in my data file and replace/update it
: with a new value...
Perl FAQ, part 5:
"How do I change one line in a file/
delete a line in a file/
insert a line in the middle of a file/
append to the beginning of a file?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 01 Dec 1998 11:11:57 -0500
From: Ashwini Nagaraj <anagaraj@eccms1.dearborn.ford.com>
Subject: Associative Arrays?
Message-Id: <3664154D.490281B9@eccms1.dearborn.ford.com>
Hi,
I am creating a report which is getting data from an Oracle Db. So, I
am using DBI. The situation is, the fields to be seen are Server,
metric, value. Metric fld contains Messg Delivered, Messg Received,
Messg Delivery time, etc in the table. I have to do a min, max, avg for
values for all these metrics. The report format should contain all
these details in order of servers.
I have done seperate queries for diff metrics & stored in diff arrays.
How can I use Associative arrays to solve the problem? If there is a
different way of solving this, please let me know.
Thank you
------------------------------
Date: Tue, 01 Dec 1998 11:19:04 +0100
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: Batch Mailing
Message-Id: <3663C296.EB17ECF0@cthulhu.demon.nl>
James Richardson wrote:
>
> Merrill Lynch wrote in message <01be1d19$ab1ac9c0$f0aed083@zuriw14956>...
> >To the network and mail deamons among you.
> >
> >Anyone got a clue how I can send an email to someone, and when they open
> >the thing, I get an email back.
> >
>
> No, you can't do this, as the action on opening the message is entirely
> client dependant. No dounbt you could write some sneaky VB script program,
> but it wouldn't work on anything other then M$ machines. How to do that
> wouln't be talked about on this group.
Actually, it _is_ possible to add a header line that tells the other side
to reply a confirmation on receipt and/or reading. Ofcourse, it's up to
the client to decide whether it wants to do that (I usually disable it).
The can't remember the exact names of the headers right now. But the RFC
for mail messages should tell you (rfc822?). Ofcourse, this doesn't have
anything to do with comp.lang.perl.misc.
Erik
------------------------------
Date: Tue, 01 Dec 1998 15:28:32 GMT
From: jens@gamers.de (Jens Hilgers)
Subject: Connecting to DB2 Database
Message-Id: <36640ad4.22582041@news.ndh.net>
Hi all,
is there a way to get a connection to a DB2 Databse on an AS/400 Host,
other than with the DBI::DB2 which requires the UDB Developer Tools
from IBM ?
Any comments are welcome,
Greets,
sam
------------------------------
Date: Tue, 01 Dec 1998 16:58:06 GMT
From: jens@gamers.de (Jens Hilgers)
Subject: Connection to DB2 Database
Message-Id: <3663ecc0.14882930@news.ndh.net>
Hi all,
somebody in here knows how i can manage to get on a DB2 Database ? The
DBI DB2 Module requires the UDB Developers Edition, which i don't have
a the moment.
Any comments are welcome.
Greets,
Jens Hilgers
------------------------------
Date: Tue, 01 Dec 1998 16:02:40 GMT
From: jens@gamers.de (Jens Hilgers)
Subject: Connection to Microsoft SQL Server
Message-Id: <36641294.24566394@news.ndh.net>
Hi all,
next Question - is there a perl module to connect to a MS SQL Server ?
thx and regards,
jens hilgers
------------------------------
Date: Tue, 01 Dec 1998 16:58:07 GMT
From: jens@gamers.de (Jens Hilgers)
Subject: Connection to Microsoft SQL Server
Message-Id: <36640f82.23780674@news.ndh.net>
Hi all,
next question:
is there a perl module to connect to Microsoft SQL Database ?
many thx,
jens hilgers
------------------------------
Date: Tue, 01 Dec 1998 17:39:22 +0100
From: Hendrik Woerdehoff <hendrik.woerdehoff@sdm.de>
Subject: Re: Connection to Microsoft SQL Server
Message-Id: <36641BBA.3D0C@sdm.de>
Jens Hilgers wrote:
> next Question - is there a perl module to connect to a MS SQL Server ?
>
> thx and regards,
>
> jens hilgers
Yes! DBI and DBD::Sybase :-)
Well, if you are running your Perl under Win32 you can always use
Win32::ODBC or DBI/DBD::ODBC. Or try your luck with Win32::OLE.
Yours
Hendrik
Pursuant to US Code, Title 47, Chapter 5, Subchapter II, Sec. 227,
any and all unsolicited commercial E-mail sent to this address
is subject to a download and archival fee in the amount of $500
US (per infraction). E-mailing denotes acceptance of these terms.
--
Hendrik W"ordehoff |s |d &|m | software design & management
| | | | GmbH & Co. KG :
woerdehoff@sdm.de | | | | Thomas-Dehler-Str. 27 >B)
Tel/Fax (089) 63812-337/515 81737 M"unchen :
------------------------------
Date: Tue, 1 Dec 1998 08:04:22 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: does perl support | piping? (was Re: localtime () - perl's bug ?)
Message-Id: <MPG.10cdb35d37c2bddf98993a@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <slrn7678t8.95d.dformosa@godzilla.zeta.org.au> on 1 Dec 1998
08:07:04 GMT, David Formosa <dformosa@zeta.org.au> says...
> In article <MPG.10cd0f52ee46069a989936@nntp.hpl.hp.com>, Larry Rosler wrote:
> >I can't imagine what you are thinking of! Here is an expansion of a
> >snippet I posted yesterday, that shows how a program can disambiguate
> >*any* year input (including each of the Y2K bugs):
> >
> > $year = ($year % 100 > 69 ? 1900 : 2000) + $year % 100
> > if $year < 1900 || $year >= 19100;
>
> # Crist was born in 1AD
> $year=1;
> #Your snipplet gives.
> 2001
>
> # My Grandmother was born on 01/01/18
> $year=18;
> #Your snipplet gives.
> 2018
How about the last sentence of the post that you selectively quoted from
above:
"The CONTEXT for the two-digit disambiguation is the Unix epoch, which
will do perfectly well for almost all of our programs."
As I stated explicitly in a previous post, the Unix epoch will not do
at all for historical or astronomical programs.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 1 Dec 1998 16:07:30 GMT
From: dmacks@mail1.sas.upenn.edu (Daniel E. Macks)
Subject: Re: Filter to sort incoming mail?
Message-Id: <741482$cpd$2@netnews.upenn.edu>
QM (modnar_q@yahoo.com) said:
:
: Hi, I'd like to know if there are filters available which can autosort my
: incoming mail according to source address, into different folders. I'm using
: unix. I guess what I need is a perl script and a "pipe" in my .forward. Any
: ideas or suggestions?
procmail? It ain't perl but it's already written and quite feature-full.
dan
--
Daniel Macks
dmacks@a.chem.upenn.edu
dmacks@netspace.org
http://www.netspace.org/~dmacks
------------------------------
Date: Tue, 01 Dec 1998 11:29:36 GMT
From: ronald_f@my-dejanews.com
Subject: Re: Help - replacing a substring
Message-Id: <740juk$63u$1@nnrp1.dejanews.com>
In article <36634D5B.9F454533@enhanced-performance.com>,
Dale Sutcliffe <dales@enhanced-performance.com> wrote:
> I would like to replace the a substring (| with &) in a string. How can I do
it without prior knowledge of location of the substring or without
> tearing apart the string?
If I understand you right, you want only replace one character by another one.
In this case, tr is useful:
$string =~ tr/|/&/;
--
Ronald Fischer <ronald_f@my-dejanews.com>
http://ourworld.compuserve.com/homepages/ronald_fischer/
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 1 Dec 1998 15:00:38 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: how to delete from /patt1/ to /patt2/ without including the lines?
Message-Id: <F3AKD2.JI4@world.std.com>
romani_c@bigfoot.com (Cesar Romani) writes:
>perl -ni -e 'print unless /patt1/ .. /patt2/' file
>How can I do that without including the lines.
The range operator returns a sequence number when true. You can test
if it is greater than 1 to avoid 'patt1' and you can look for the the
special "E0" terminator appended to the final iteration to avoid
'patt2'.
perl -ni -e 'print unless $i=/patt1/../patt2/ and $i > 1 and $i !~ "E0"' file
--
Andrew Langmead
------------------------------
Date: Tue, 1 Dec 1998 09:17:03 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: how to delete from /patt1/ to /patt2/ without including the lines?
Message-Id: <f91147.q65.ln@flash.net>
Cesar Romani (romani_c@bigfoot.com) wrote:
: I want to delete from /patt1/ to /patt2/ without including those lines,
: I know, it exists an easy solution if one deletes from /patt1/ to /patt2/
: including the lines containing the patterns:
: perl -ni -e 'print unless /patt1/ .. /patt2/' file
: How can I do that without including the lines.
You can keep track of whether you are "in the delete range"
or not yourself:
--------------------
#!/usr/bin/perl -w
$in_range = 0; # haven't seen start pattern yet
while (<>) {
$in_range = 0 if /patt2/; # found end pattern
print unless $in_range;
$in_range = 1 if /patt1/; # found start pattern
}
--------------------
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 1 Dec 1998 14:54:07 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: how to delete from /patt1/ to /patt2/ without including the lines?
Message-Id: <F3AK27.EEE@world.std.com>
Peter John Acklam <jacklam@math.uio.no> writes:
>Maybe not the most efficient way since the regexes are evaluated
>twice, but it does the job
>perl -ni -e 'print if ! ( /patt1/ .. /patt2/ ) || /patt1/ || /patt2/' file
It also has the side effect of deleting lines with patt2 that weren't
preceded by patt1.
--
Andrew Langmead
------------------------------
Date: 01 Dec 1998 11:39:27 -0500
From: David Huggins-Daines <s1204672@aix2.uottawa.ca>
Subject: Re: local & unwind-protect (Was: Re: regexp on multiple lines, etc.)
Message-Id: <87hfvfg6kg.fsf@aix2.uottawa.ca>
dkcombs@netcom.com (David Combs) writes:
> In article <73fbat$gc$1@gellyfish.btinternet.com>,
>
> Suppose in that "do something", ten levels down
> in subroutine calls (well, ten levels UP the growing
> call-stack-direction), something blows up.
>
> And somewhere down the stack is a catch. (some caller of caller
> of caller of US).
>
> Does the local automatically get unwound?
Try it:
#!/usr/bin/perl -lw
use strict;
sub recursive {
local $_ = $_.'foo';
$_ .= ' hopping through the forest' and die $_
if length $_ > 16;
recursive();
}
$_ = 'Little Bunny ';
eval { recursive };
chomp $@ and print $@;
print;
--
perl -e 's/cream/a/ieeeeeeeeeeeeeeeeeeeeeee and die, horribly'
------------------------------
Date: Tue, 1 Dec 1998 07:58:07 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: localtime () - perl's bug ?
Message-Id: <MPG.10cdb1eb82829daf989939@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
You tried to make the same point in three submissions, so I'll answer
the first, which is the longest and shows most clearly how wrongheaded
your analysis is.
In article <oee90gsp6kr.fsf@alpha.hut.fi> on 01 Dec 1998 11:14:28 +0200,
Jarkko Hietaniemi <jhi@alpha.hut.fi> says...
> Clive Newall <crn@itga.com.au> writes:
...
> > clock cycle saved made significant difference. As did every byte of
> > precious memory saved. Often forgotten in these days of software bloat
> > and 100+MHz processors.
>
> The space argument doesn't hold. Why?
>
> Because: please explain why waste whole ints for seconds, minutes,
> hours, day-of-months, months, years, day-of-years,
> is-daylightsaving-times? 9 ints? shorts would have worked for all of
> those, and chars for all except the day-of-year.
>
> Why not pack the whole thing into bitfields? I count only
> 6+6+5+5+4+7+9+1 = 43 bits needed (assuming here 7 bits for years since
> 1970, which gives us 59 years past the Y2K38, I'm being generous here)
>
> Currently the struct tm is hogging 9*32 = 288 bits, egads, 245 wasted
> bits... Okay, okay, let's align that into two 32 bit integers: 64
> bits. That's still 224 wasted bits.
<HISTORY LESSON>
You are thoroughly confused about the purpose of a 'struct tm'. The
information it contains can be -- AND IS -- stored externally in a 32-
bit 'time_t'. The only useful computation that can be done with a
'time_t' (except for conversion to and from the components of a 'struct
tm') is addition/subtraction of an integer, and difference of two
'time_t's.
A 'struct tm' is *never* stored external to the program, and there is
typically exactly one of them in any program. (The documentation of the
<time.h> functions specifies that the input-or-output 'struct tm' is
static and can be overwritten by other function calls.) Therefore its
size is a non-issue. Its purpose is to break the components of a
'time_t' into values convenient for computation, which means 'int's.
This allows fastest access and least accessing code *with the hardware
of the time* which was 'word'-oriented.
The nature of the hardware underlies many design decisions in C,
including the implementation-specific sizes of various int types (all
that is required is that char <= short <= int <= long -- they can all be
the same if the implementor decides that is the most effective
space/time tradeoff!) and the waffling as to whether a 'char' is by
default signed or unsigned.
C was ported successfully to [partial list] 12-bit (PDP5 and PDP8), 16-
bit (PDP11), 32-bit (VAX), 36-bit (GE/Honeywell), 60-bit (CDC), and 64-
bit (Cray) environments, along with baggage such as 'sizeof' to provide
some measure of code portability. In each environment, the components
of a 'struct tm' were 'int's, because that provided the most compact and
the fastest accessing code.
The world is much simpler now, and Java took the dramatic step of
implementing an abstract 32-bit machine and pinning down all the
implementation-dependent details -- because hardware is now cheap(er)
and processors are fast(er).
</HISTORY LESSON>
...
> But as I said, I'm wasting my breath.
No, your brain, I fear.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 1 Dec 1998 16:06:02 GMT
From: dmacks@mail1.sas.upenn.edu (Daniel E. Macks)
Subject: Re: localtime () - perl's bug ?
Message-Id: <74145a$cpd$1@netnews.upenn.edu>
Jarkko Hietaniemi (jhi@alpha.hut.fi) said:
:
: Clive Newall <crn@itga.com.au> writes:
:
: > clock cycle saved made significant difference. As did every byte of
: > precious memory saved. Often forgotten in these days of software bloat
:
: Oh yes, that's explains why struct tm has to be, what, 9 integers or
: 288 bits (or 576 bits, in Crays and other ILP64 systems) wide, while,
: ummm, about 43 bits would suffice.
No, the compressed form of a date is the secs-since-epoch (beating
your plan by 11 bits). I don't know the exact library implementation
of the date calculations, but it's just a bunch of math manipulations
of the secs-since-epoch. Math means it's a bunch of ints. So why go to
the space and time of converting 'em to something else (packs bits,
BCD, year+=1900, etc.) when you can just hand 'em to the caller and
document what they are?
Although we (at least most:) appreciate your input, the point you just
made isn't so salient that it merits 3 postings.
dan
--
Daniel Macks
dmacks@a.chem.upenn.edu
dmacks@netspace.org
http://www.netspace.org/~dmacks
------------------------------
Date: 01 Dec 1998 18:07:58 +0200
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: localtime () - perl's bug ?
Message-Id: <oeen257onfl.fsf@alpha.hut.fi>
lr@hpl.hp.com (Larry Rosler) writes:
> [Posted to comp.lang.perl.misc and copy mailed.]
>
> You tried to make the same point in three submissions, so I'll answer
Not all of those were meant to enter the world, I cancelled all of them
except one because I noticed that I blathered too much ...
USENET news distribution is too good. :-)
> <HISTORY LESSON>
[snip]
> </HISTORY LESSON>
Okay, I will be quiet.
--
$jhi++; # http://www.iki.fi/~jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen
------------------------------
Date: Tue, 01 Dec 1998 14:39:48 GMT
From: wyndo@cxo.com
Subject: Re: Multiplayer Roleplaying Game, Web-Based, Written in Perl.
Message-Id: <740v3i$evr$1@nnrp1.dejanews.com>
> How does "public play" equate to "you have to pay to use this beta"?
> If anything, the statement "we will open BLAH to the public tomorrow"
> implies to me you won't have to pay, more than it implies that you will. :)
Probably from subscription information at our site, which would be my fault
for being unclear. You do not have to pay to beta test. It is a "pay" game,
and it is a "beta" version, but most any bug anybody is going to find will
crop up within a week of play, and that week is already free. Past a week, it
really becomes "playing" instead of "testing" which is where a subscription
would begin. Plus, we post free time to people who actually *are* interested
in testing. In short, you *don't* have to pay us to beta test our game, but
it was my fault for not explaining this.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 1 Dec 1998 16:07:56 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
To: wyndo@cxo.com
Subject: Re: Multiplayer Roleplaying Game, Web-Based, Written in Perl.
Message-Id: <si1zmjdew3.fsf@cre.canon.co.uk>
wyndo@cxo.com wrote:
> Past a week, it really becomes "playing" instead of "testing"
You're dreaming if you think you can test an interactive online game in
a week.
--
Gareth Rees
------------------------------
Date: Tue, 1 Dec 1998 10:42:50 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Need 5.003 source code for UNIX
Message-Id: <aa6147.3l5.ln@flash.net>
Mail Server Administrator (Postmaster@moody.edu) wrote:
: Where can I get Perl 5.003 source code for UNIX?
http://www.perl.com
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 1 Dec 1998 16:41:04 GMT
From: dkcombs@netcom.com (David Combs)
Subject: NO DOC NOWHERE!! (Was: emulating sed's "/start/,/stop/<do something>"?)
Message-Id: <dkcombsF3Ap0H.Mxn@netcom.com>
In article <73vnl0$7ca$1@monet.op.net>, Mark-Jason Dominus <mjd@op.net> wrote:
>In article <5iiv37.432.ln@flash.net>, Tad McClellan <tadmc@flash.net> wrote:
>> s/foo/bar/ if /startHere/i .. /stopdoingitHere/i;
>
>To emulate sed, you need to use the little-known `...' operator
>instead of the more common `..' operator.
>
Nice, but there is NO DOC on this feature!
Look:
583 ==/david3/from_netcom-dir2/perl-stuff/perl5.005_51==> egrepin ' \.\.\. ' *.{c,h}
deb.c:89: PerlIO_printf(Perl_debug_log, i ? "0x%lx => ... " : "0x%lx => ",
deb.c:92: PerlIO_printf(Perl_debug_log, i ? " => ... " : " => ");
gv.c:359: * Inheriting AUTOLOAD for non-methods works ... for now.
==> op.h:77: /* On flipflop, we saw ... instead of .. */
perl.c:1500:"-n assume 'while (<>) { ... }' loop around your script",
perl.h:169: * if (x) STMT_START { ... } STMT_END; else ...
perl.h:2040:/* Done with PERLVAR macros for now ... */
perlsfio.h:1:/* The next #ifdef should be redundant if Configure behaves ... */
pp_ctl.c:1575: POPLOOP2(); /* Stack values are safe: release loop vars ... */
pp_ctl.c:1576: PL_curpm = newpm; /* ... and pop $1 et al */
pp_ctl.c:1664: POPSUB2(); /* release CV and @_ ... */
pp_ctl.c:1666: PL_curpm = newpm; /* ... and pop $1 et al */
pp_ctl.c:1741: POPLOOP2(); /* release loop vars ... */
pp_ctl.c:1745: POPSUB2(); /* release CV and @_ ... */
pp_ctl.c:1748: PL_curpm = newpm; /* ... and pop $1 et al */
pp_hot.c:1935: POPSUB2(); /* Stack values are safe: release CV and @_ ... */
pp_hot.c:1936: PL_curpm = newpm; /* ... and pop $1 et al */
sv.c:4949: /* output mangled stuff ... */
sv.c:4955: /* ... right here, because formatting flags should not apply */
thrdvar.h:87:PERLVAR(Tdelaymagic, int) /* ($<,$>) = ... */
Ah ha! ONE locate of " ... " that applies. So, look around:
584 ==/david3/from_netcom-dir2/perl-stuff/perl5.005_51==> cd pod
585 ==/david3/from_netcom-dir2/perl-stuff/perl5.005_51/pod==> egrepin flipflop *.pod
586 ==/david3/from_netcom-dir2/perl-stuff/perl5.005_51/pod==> cd ..
<snip>
588 ==/david3/from_netcom-dir2/perl-stuff/perl5.005_51==> egrepin flipflop *.{c,h}
==> op.h:77: /* On flipflop, we saw ... instead of .. */
==> opcode.h:875: "flipflop",
589 ==/david3/from_netcom-dir2/perl-stuff/perl5.005_51==>
OK, that's it -- the ENTIRE doc on " ... ", or on "flipflop".
Wonderful...
And, cannot find it in blue camel, cookbook index, ed 1 of little
ref-book, ... (Randal's effective perl will arrive in a few days,
maybe it has something).
"little known" sure must be true!
David
------------------------------
Date: 1 Dec 1998 15:49:54 GMT
From: Aidan Rogers <aidan@salvador.blackstar.co.uk>
Subject: Re: Perl compiler? (Can you get one?)
Message-Id: <741372$4j9$1@nclient3-gui.server.ntli.net>
Knut Brobakken <knut@webcom.no> wrote:
> Aidan Rogers wrote in message <740jil$3sl$1@nclient3-gui.server.ntli.net>...
>>After all these replies, I have a related question. Is it possible to get a
>>compiler for Perl? It's all very well having a script that will run fine on
>>any system that has Perl installed on it, but is it possible to compile to
>>a binary executable?
> Yes indeedy, it is possible to compile Perl scripts to free-standing exe-files , at least if you use perl2exe (evaluation version at http://www.demobuilder.com) and Perl for Win32.
> But to REALLY unleash the power of Perl, you should consider getting the Perl Resource Kit From O'Reilly (ISBN 1-56592-409-6). It includes lots and lots of utilities, tips and documentation (among these one registered version of Perl2Exe!), and costs only $149.
> I'm using it, and it's marvellous! Hopefully, you're using Perl for Win32, because if not, it's not much good.......
> Also check out http://www.activestate.com for the latest news on ActivePerl and related tools.
Thanks Knut. Very briefly, can Perl for windows do all the other Windows
related programming things like opening windows, etc, etc?
Aidan
------------------------------
Date: Tue, 01 Dec 1998 09:33:50 -0500
From: Jay Flaherty <fty@utk.edu>
Subject: Re: Perl DBI error
Message-Id: <3663FE4E.1DD12E21@utk.edu>
Tim wrote:
>
> I am issuing the command:
>
> INSERT INTO table_name ("description") VALUES
> ("Item is from Puetro Rico")
>
> the prepare works, but the execute is returning an error with
> a helpful message: Unknown error. It DOES get inserted into the
> database correctly. Altering the word "from" to a non-SQL keyword
> gets rid of the error.
>
> Empress is able to handle this fine, the problem is when I use the
> DBI. Is there a way to 'escape' the word 'from' so DBI doesn't 'catch'
> this error.
You could try using $dbh->quote() like so:
my $field = "description";
my $value = $dbh->quote("Item is from Puetro Rico");
my $sth = $dbh->do( qq(INSERT INTO table_name ($field)
VALUES ($value)) )
or die "Unable to execute statement: $dbh->errstr\n";
You could, of course use the prepare/execute methods if you prefer the
DBI 2 step ;-)
Jay
------------------------------
Date: Tue, 01 Dec 1998 15:40:47 GMT
From: wyndo@cxo.com
Subject: Re: Perl in HTML - without FORM
Message-Id: <7412lr$i76$1@nnrp1.dejanews.com>
In article <bbd72.570$E67.1054@news.get2net.dk>,
"Jxrgen Vig Jensen" <jvj@greennet.gl> wrote:
> I want to execute a perl-program just by pressing a hyperlink.
> Without any inputfields.
>
> I have placed the html- and .pl on a linux web-server - and want to use it
> by ie4 in windows95.
>
It's just a normal link. If you WANT to pass in parameters, you can do it
without a form as well:
<a href="mycgi.pl">click here</a>
or with paramters...
<a href="mycgi.pl?parm1=x&parm2=y&parm3=z">click here</a>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 01 Dec 1998 10:43:09 -0500
From: "Yao, Hsin (EXCHANGE:MTL:1T83)" <hsinyao@americasm01.nt.com>
Subject: Re: Perl5.005 in HP-UNIX?
Message-Id: <36640E8D.74D14536@americasm01.nt.com>
>
> Yao, Hsin (EXCHANGE:MTL:1T83) <hsinyao@americasm01.nt.com> writes:
>
> > Has anyone succesfully installed PERL5.005_02 with thread in a HP-UX ver
> > 10? I am having a lot of difficulty doing so. Suggestions for any useful
> > pointers are appreciated.
>
> It may well be possible to do this, but you should be warned that Perl
> 5.005_02 is not stable for threaded applications. The threading in 5.005
> was experimental, which translates to pre-alpha, and there were several
> serious bugs.
If such is the case, is there anyway to make PERL thread-save with
previous versions or with 5.005 compiled without thread?
Thank you!
- Hsin Yun -
------------------------------
Date: Tue, 01 Dec 1998 16:05:58 GMT
From: "McWebber" <mcwebber@my-dejanews.com>
Subject: Re: post to perl using javascript
Message-Id: <GtU82.973$r6.11116815@news.rdc1.fl.home.com>
You should probably try a JavaScript newsgroup where you'll find info on the
onClick function.
--
McWebber
Help on your web page | http://html.mcwebber.net/
Newsgroup postings are not an invitation for mail - Post publicly to reply
Under no circumstances will I ever purchase anything offered to me as the
result of an unsolicited e-mail message
Casema wrote in message <74044s$ru7$2@sun4000.casema.net>...
>I am posting this question to the three relevant newsgroups and hope to get
>an answer....
>How do you post to a perl proggie using javascript?
>so,
>
><FORM ACTION="http:www.test.com/cgi-bin/test.pl" METHOD="POST">
>
>has to become
>
>function posting() {
> ###statements to post to same address as in form action###
>}
>
>so that the result would be exactly thesame when read by the perl proggie.
>
>Thanks,
>
>Michel
>
>
>
------------------------------
Date: Tue, 1 Dec 1998 09:14:50 -0700
From: kenny@kacweb.com (Kenny A. Chaffin)
Subject: Re: post to perl using javascript
Message-Id: <MPG.10cdc3e8fd77379498a1ec@news.dimensional.com>
In article <GtU82.973$r6.11116815@news.rdc1.fl.home.com>, mcwebber@my-
dejanews.com says...
> You should probably try a JavaScript newsgroup where you'll find info on the
> onClick function.
>
> --
> McWebber
> Help on your web page | http://html.mcwebber.net/
> Newsgroup postings are not an invitation for mail - Post publicly to reply
> Under no circumstances will I ever purchase anything offered to me as the
> result of an unsolicited e-mail message
>
> Casema wrote in message <74044s$ru7$2@sun4000.casema.net>...
> >I am posting this question to the three relevant newsgroups and hope to get
> >an answer....
> >How do you post to a perl proggie using javascript?
> >so,
> >
> ><FORM ACTION="http:www.test.com/cgi-bin/test.pl" METHOD="POST">
> >
> >has to become
> >
> >function posting() {
> > ###statements to post to same address as in form action###
> >}
> >
> >so that the result would be exactly thesame when read by the perl proggie.
> >
> >Thanks,
> >
> >Michel
> >
> >
> >
>
>
>
This was posted to a javascript newsgroup....that's where I'm reading it,
but what the hell's a proggie? Is that like a dickey or a prickie or ??
<grin>
--
KAC
Website Design, Programming, Graphics --> http://www.kacweb.com
kenny@kacweb.com
------------------------------
Date: Tue, 1 Dec 1998 09:23:35 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: read html
Message-Id: <nl1147.q65.ln@flash.net>
Bill G. (roxanne@compusnet.com) wrote:
: I'm a beginner with Perl and I'm trying to write cgi that will read the
: html page at a given URL,
: parse it and then send it to a requester as an HTML document. The part I
: don't understand
: how to do is to read in the HTML from a specified URL. If anyone could
: give me a hint,
use LWP::Simple;
: I
: would certainly appreciate it. This is probably an easy thing to do, if
: you know how.
It is easy if you use the already invented wheel ;-)
Get the above Perl module.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 1 Dec 1998 09:59:55 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: RegExp and Authentication Help.
Message-Id: <rp3147.5f5.ln@flash.net>
Colin Cyr (ccyr@home.com) wrote:
: Tad McClellan wrote:
: >
: > Colin Cyr (ccyr@home.com) wrote:
: >
: > : $data = "243";
: > : $data =~ /^\d$/; # How'd I add the additional condition that
: > : # it is a Real number (Nothing less than 1)?
: >
: > You seem to be using a non-standard meaning of "real number".
: >
: Okay, so maybe I have to stop writing my messages at 3AM... This isn't
: the first time people have had trouble understanding them. ;) The other
: thing I wasn't expecting was the degree in which you wanted me to
: specify _ever_ detail, however I can see the requirement if you want to
: help me use a precise regexp.
If you don't specify something (eg. no leading zeros) then
that means you don't care. That is, the programmer is free
to choose whatever alternative they want to, which may not
be the alternative that _you_ want.
If you care about "it", then you must specify "it", else
you may not get "it". ;-)
Being Lazy and Impatient, most programmers will choose
whichever is easier to do (eg. allow leading zeros).
: Let's start with the RegExp.
: Format:
: - Each section must be separated with a period (".").
: - An identifier, composed of sections and section separators ("."), can
: not start or end with a section separator.
: Section Definition:
: - Each section must be composed of a Rational (Q) number (see this is
: where I errored in the first message).
: - Being a rational number, it must be a positive, non-zero, integer (by
: definition).
: - Each section must be stated in its most minimal form. This means that
: there can be absolutely no padding of any form.
Much better!
: > Your regex above will match one of only ten strings. Did
: > you mean to allow more than one digit? /^\d+$/;
: And it looks like the above will almost wirk, but it fails on the cannot
: be zero or have non-signifigant zeros.
Since you didn't specify that, you didn't care about that.
Now that you have changed your mind, the solution will need
to be reworked...
Much cheaper to "get it right" the first time. But that implies
getting the Specification right the first time ;-)
: >
: > : $data =~ /????/; # Nothing I've tried will allow me to verify
: > : # this. Each section must be a Real, and the
: > : # string cannot start or end with a period.
: >
: > To verify that each "section" consists of only digit characters:
: >
: > print "$data is OK\n" if $data =~ /^\d+(:?\.\d+)*$/;
: I will need to further digest the above.
See below.
: > You need to be more rigorous in describing what you want if
: > you want to get a directly usable answer...
: And now you have it. ;) See above.
The quality of the code provided is in direct proportion to
the quality of the specification.
Now that we have a "better" spec, we can get a better solution ;-)
---------------------
#!/usr/bin/perl -w
while (<DATA>) {
chomp;
# all on one line if ( /^[1-9]\d*(\.[1-9]\d*)*$/ )
if ( /^ # beginning of the string
[1-9]\d* # non-zero digit optionally followed by more digits
(:? # start grouping without memory
\. # group must start with a literal dot character
[1-9]\d* # then non-zero digit optionally followed by more digits
) # end the group
* # the whole group can occur zero or more times
$ # end of the string
/x ) # m//x lets me put these comments here
{print " VALID: $_\n"}
else
{print "INVALID: $_\n"}
}
__DATA__
3.3.2.1.4
123.004.12
123.000.12
123.0.12
123
.123
123.
---------------------
output:
VALID: 3.3.2.1.4
INVALID: 123.004.12
INVALID: 123.000.12
INVALID: 123.0.12
VALID: 123
INVALID: .123
INVALID: 123.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 01 Dec 1998 10:32:27 -0500
From: Jeff Sack <jsack@ctron.com>
Subject: Script question...
Message-Id: <36640C0B.2F98@ctron.com>
I was wondering if anyone could help me out with this one (maybe there
is already a utility that'll do this?)
I need to monitor all files under a certain directory (including
subdirectories). I need the script to keep an eye out for files and
report any files that are accessed (opened) and the time accessed. I've
been experimenting with the Perl command stat (using 8th index of its
return value), but haven't been having a whole lot of luck with it. Any
ideas? Suggestions? I know this is probably a very simple script, so
if anyone can at least point me in the right direction, I'd greatly
appreciate it.
Thanks.
Please email any response to jsack@ctron.com. I've been having some
difficulty with the news server...
------------------------------
Date: Tue, 1 Dec 1998 10:22:05 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: seek, tell, offset question
Message-Id: <d35147.0h5.ln@flash.net>
Ken McNamara (conmara@tcon.net) wrote:
: while (!eof(infile)) {
: $readline = <infile>
You seldom need to explicitly test for end-of-file in Perl.
You can replace the above two lines with:
while (defined ($readline = <INFILE>)) { # UPPER case for filehandles
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 01 Dec 1998 14:49:22 GMT
From: nnickee@nnickee.com (Nnickee)
Subject: Re: target help
Message-Id: <366800e4.89977068@news.centuryinter.net>
On Mon, 30 Nov 1998 19:47:02 -0800, Dale Sutcliffe
<dales@enhanced-performance.com> wrote:
>I would like the option to display results in either a separate frame or a new window, depending upon the users' selection.
>I've tried:
>print "Location: ".$str."\n\ntarget=\"Display\"\n\n";
>
>(display is the name of the second frame)
>and for the new window:
>
>print "Content-type: text/html\ntarget=\"_blank\"\n\n";
>
>Neither seem to work.
How about in the <form... tag?
<FORM ACTION="cgi-bin/my-ww.pl" target="wwresults" METHOD="POST">
This does work, but is it close enough to what you're wanting?
Nnickee
------------------------------
Date: Tue, 01 Dec 1998 16:42:15 GMT
From: mpeppler@mbay.net
Subject: Re: Where can I learn more about SQL with PERL?
Message-Id: <741694$lfv$1@nnrp1.dejanews.com>
In article <73rg40$l9h$2@client3.news.psi.net>,
abigail@fnx.com wrote:
> Oliver Moffat (oliverm@bway.net) wrote on MCMXV September MCMXCIII in
> <URL:news:366051AB.D6D5B06C@bway.net>:
> ++ Any suggstions would be apreciated.
> ++
> ++ Where's a good on-line beginners tutorial? (in HTML, please)
> ++
> ++ Any good books I can get at the Library or <groan>buy</groan>?
>
> One can get a set of Sybase manuals for around $1000. :)
And those manuals are also available on the web: http://sybooks.sybase.com
But they're not exactly tutorials if you know nothing about SQL.
Michael
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 01 Dec 1998 15:35:12 GMT
From: wyndo@cxo.com
Subject: Re: Why I can execute a command in Perl but not in CGI/Perl ?
Message-Id: <7412be$i11$1@nnrp1.dejanews.com>
> sub test {
> print "<PRE>"; # for later CGI program
> system("ping -h");
> print "</PRE>";
> }
As a thought, try adding:
$|=1;
To the top to turn off buffering.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 4332
**************************************