[16781] in Perl-Users-Digest
Perl-Users Digest, Issue: 4193 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 31 18:10:43 2000
Date: Thu, 31 Aug 2000 15:10:27 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <967759826-v9-i4193@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 31 Aug 2000 Volume: 9 Number: 4193
Today's topics:
how to encrypt source code? <dsa@dassda.com>
Re: how to encrypt source code? <lauren_smith13@hotmail.com>
Re: how to encrypt source code? (Greg Bacon)
Re: how to encrypt source code? (Abigail)
Re: how to encrypt source code? (Craig Berry)
Re: interchanging variables <aqumsieh@hyperchip.com>
Re: interchanging variables <russ_jones@rac.ray.com>
Re: Jumping to the previous row with DBI (Hasanuddin Tamir)
looking for developers/testers for zope-like program <chris@aepnet.com>
Re: Mail::MH -- Dead or merely sleeping? (Abigail)
MAS90, Word, and Perl closetgeekla@my-deja.com
net::smtp error nosrep@my-deja.com
open web file <sean@access-management.com>
Re: output fun <sariq@texas.net>
Re: pack function <tim@ipac.caltech.edu>
Re: Partner Required. Perl Programmer <russ_jones@rac.ray.com>
Re: Partner Required. Perl Programmer <russ_jones@rac.ray.com>
Re: Partner Required. Perl Programmer <russ_jones@rac.ray.com>
Perl Installation Question spyder_md_2010@my-deja.com
Re: Q. relating to perlfaq(4) / sort <lr@hpl.hp.com>
Re: regexp and accentuated letters <lr@hpl.hp.com>
Re: regexp and accentuated letters (Abigail)
Re: Regexp help required marty_t@my-deja.com
Re: replace some word in text file <lr@hpl.hp.com>
Re: replace some word in text file (Anno Siegel)
Sending control characters over TCP Socket (K. Bruner)
Re: Sorting a Tab Delimited Text File By Second Field (Hasanuddin Tamir)
Re: timelocal() is wrong? <aqumsieh@hyperchip.com>
Re: timelocal() is wrong? <russ_jones@rac.ray.com>
Using SQL_LONGVARCHAR in DBI:ODBC in a INSERT statement <info@digitaltango.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 1 Sep 2000 02:15:24 +0800
From: DT <dsa@dassda.com>
Subject: how to encrypt source code?
Message-Id: <MPG.14192197ddf92e989682@news.cyberway.com.sg>
how to encrypt source code? thanks!
------------------------------
Date: Thu, 31 Aug 2000 11:25:30 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: how to encrypt source code?
Message-Id: <8om7r4$ii1$1@brokaw.wa.com>
DT <dsa@dassda.com> wrote in message
news:MPG.14192197ddf92e989682@news.cyberway.com.sg...
> how to encrypt source code? thanks!
This is a common enough question that it's been answered in the FAQ.
perlfaq3: How can I hide the source for my Perl program?
or at the command prompt:
perldoc -q hide
Lauren
--
print grep ord $_,map{y/a-zA-Z//d;$x.="+ $_";chr(eval $x)}
'J74u43-s2tA1-84n33o45th1er5-12-P3e13-82r48l21H13-a6-76
c40k25er2wx8-y6z13-81'=~m#([^!\n]{3})#g#tr/-0-9//d;print
------------------------------
Date: Thu, 31 Aug 2000 18:44:10 GMT
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: how to encrypt source code?
Message-Id: <sqt9rq3jc5d165@corp.supernews.com>
In article <MPG.14192197ddf92e989682@news.cyberway.com.sg>,
DT <dsa@dassda.com> wrote:
: how to encrypt source code? thanks!
<URL:http://home.hiwaay.net/~gbacon/perl/encrypt>
--
We must believe in free will. We have no choice.
------------------------------
Date: 31 Aug 2000 20:26:23 GMT
From: abigail@foad.org (Abigail)
Subject: Re: how to encrypt source code?
Message-Id: <slrn8qtfpt.8ac.abigail@alexandra.foad.org>
DT (dsa@dassda.com) wrote on MMDLVII September MCMXCIII in
<URL:news:MPG.14192197ddf92e989682@news.cyberway.com.sg>:
"" how to encrypt source code? thanks!
Use a well known Unix feature:
$ > source.pl
And it's now unreadable.
Abigail
--
:$:=~s:$":Just$&another$&:;$:=~s:
:Perl$"Hacker$&:;chop$:;print$:#:
------------------------------
Date: Thu, 31 Aug 2000 20:17:57 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: how to encrypt source code?
Message-Id: <sqtfblm5c5d27@corp.supernews.com>
DT (dsa@dassda.com) wrote:
: how to encrypt source code? thanks!
crypt _password_ <source.file >encrypted.file
:)
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "Every force evolves a form."
| - Shriekback
------------------------------
Date: Thu, 31 Aug 2000 18:29:13 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: interchanging variables
Message-Id: <7almxds2ro.fsf@merlin.hyperchip.com>
Ankur Banerjee <ankban4@indiainfo.com> writes:
> HI,
> How do i interchange values of three variables $a,$b,$c WITHOUT using
> this expression:-
> ($a,$b,$c)=($b,$c,$a);
I wonder why!!!
($d, $e, $f) = ($a, $b, $c);
($a, $b, $c) = ($e, $f, $d);
A silly question deserves a silly answer.
--Ala
------------------------------
Date: Thu, 31 Aug 2000 15:32:27 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: interchanging variables
Message-Id: <39AEC0DB.4BEF1785@rac.ray.com>
Paul Eckert wrote:
>
> Abigail wrote:
> > --
> > ($;,$_,$|,$\)=("\@\x7Fy~*kde~box*Zoxf*Bkiaox"," "x25,1,"\r");
> > {vec($_=>1+$"=>$^F<<$^F)=ord($/^substr$;=>$"=int rand 24=>1);
> > print&&select$,,$,,$,,$|/($|+tr/ //c);redo if y/ //>$^F**2};
>
> I just tried running your signature above!
> I can't believe how cool this latest one is.
> I think I learn more from figuring out (if I can) how these work
> and what they are doing than from anything else in this group!
> Keep it up!
>
Damn! That ain't natural! Pretty amazing. I'm with Paul, keep it up!
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
Quae narravi, nullo modo negabo. - Catullus
------------------------------
Date: Fri, 01 Sep 2000 08:48:05 GMT
From: hasant@trabas.co.id (Hasanuddin Tamir)
Subject: Re: Jumping to the previous row with DBI
Message-Id: <slrn8qt4rg.me6.hasant@borg.intern.trabas.co.id>
On Wed, 30 Aug 2000 15:11:52 +0200, Hans.X.Eriksson@etx.ericsson.se wrote:
> Hello!
>
> Does anyone know if it is possible to go to the prevoius row when using
> the Perl DBI interface? I.e. -- Is it possible to "go back" when a
> $sth->fetchrow has been issued?
DBI is a *generic* interface. You're asking
about specific DBMS feature.
san
--
trabasLabs * hasant@trabas.com * http://www.trabas.com
Zero Point * hasant@zp.f2s.com * http://www.zp.f2s.com
------------------------------
Date: Thu, 31 Aug 2000 14:40:05 -0700
From: chris reaume <chris@aepnet.com>
Subject: looking for developers/testers for zope-like program
Message-Id: <39AED0B3.9E52DF81@aepnet.com>
Hello,
So I finally wrote something I want to release, but as I've never
done so before and the code hasn't even been read by anyone else yet, I
suspect I'm probably missing something. Having said that, let me try to
give you some idea of what I'm talking about. My program, the "Core
Object Rendering Engine" is to perl as zope is to python.. Now, I
confess I wasn't aware of zope's existence until recently, so there are
probably some major differences I'm not aware of as I haven't yet had
the time to play with zope.. but they serve the same purpose I believe.
that is, content management, extensible templating language, supports
cgi, fcgi and mod_perl, all data accessible via a single tree of tied
hashes, uses MySQL and/or BerkeleyDB, etc.. I've got some basic
templates for chatrooms, guestbooks, really dumb shopping cart/billing
tables, and even mailboxes (uses Mail::POP3 and Mail::Tools). It comes
with a few frills too, a module and some templates to manage the
master.passwd file on a freebsd machine and some templates and daemons
to crunch radius detail log files..
Currently, it still needs better authentication, optimization, and
some Angels sent from God to help write documentation :) If I had more
time, there would be more documentation, or if I could wait a little
longer before releasing it there might be more.. unfortunately, things
are changing at my place of employment and my position could be changed
in rather unpleasant ways that would leave me with less time to write
code, and more time fixing inherently broken windows machines, so I need
to get this out there sooner rather than later..
Anyway, you can download it from
http://www.aepnet.com/~chris/Core-0.10.tar.gz
you can get a feel for what it's like at http://www.aepnet.com/core
Thanks,
chris
P.S. Ok, I realize somewhat belatedly that the name could be
problematic, mostly the lack of an obvious difference between the
namespace used by my program, "Core" and the namespace used internally
by perl, "CORE" so I may have to find a better name..
------------------------------
Date: 31 Aug 2000 20:31:54 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Mail::MH -- Dead or merely sleeping?
Message-Id: <slrn8qtg48.8ac.abigail@alexandra.foad.org>
John Reinhagen (welcomerain@savageoasis.fc.net) wrote on MMDLVII
September MCMXCIII in <URL:news:slrn8qt105.h2u.welcomerain@ct.fowkq>:
..
.. I'm one of a small group of programmers who would like to implement some
.. Perl objects to deal with various entities for the MH mail client --
.. folders, messages, sequences, and so on. Sadly, the existing Mail::MH entry
.. in CPAN gives every appearance of being an orphan; the author link doesn't
.. work (who's this MRG chap?), the code isn't available, and it doesn't
.. promise to support OO. These facts make it less than useful for our purposes.
..
.. Is MRG around, and if so, could I get his contact information? Failing
.. that, is there a procedure for adopting CPAN orphans?
You could always write Mail::NH::TNG.
Abigail
--
perl -wle 'eval {die [[qq [Just another Perl Hacker]]]};; print
${${${@}}[$#{@{${@}}}]}[$#{${@{${@}}}[$#{@{${@}}}]}]'
------------------------------
Date: Thu, 31 Aug 2000 21:09:34 GMT
From: closetgeekla@my-deja.com
Subject: MAS90, Word, and Perl
Message-Id: <8omhht$fre$1@nnrp1.deja.com>
I have read several books now in search of the answers I am now here to
seek. I have nearly all of the O'Reilly Perl books:
Learning Perl
Programming Perl
Advanced Perl Programming
Learning Perl for Win32
Learning Perl TK
Perl Cookbook
CGI Programming with Perl
Perl in a nutshell
Mastering Alogorithms with perl
I also have read several perldocs and I have even consulted a perl guru.
No one seems to know how I can solve the problem specified below.
The accounting department here uses MAS90 and each month or week (or
whatever it was) they make reports. Several people in the company need
to see these and print them. They can't simply print them out and give
them to their intended recipients because everyone gets between 4 and 30
reports depending on who they are. So as of right now they are being
e-mailed to the specified people as txt files and recipients must then
open them in word and manually change the font to Courier 8pt with a
LANDSCAPE layout so that they can print these reports. MAS90 uses tabs
and spaces and equal signs to line up all of the rows and columns, so
courier has been the only font that works and only at 8 pt.
HELP!
Thanks,
ClosetGeekLA
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 31 Aug 2000 21:09:47 GMT
From: nosrep@my-deja.com
Subject: net::smtp error
Message-Id: <8omhi9$frl$1@nnrp1.deja.com>
Hey all, I get this error in my browser when I run a script that
uses 'use Net::SMTP' yet everything seems ok when I check it out. Any
help is appreciated.
Software error:
[Thu Aug 31 17:07:39 2000] SMTP.pm: Can't locate Net/SMTP.pm in @INC
(@INC contains: (normal path stuff here)
Thanks in advance.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 31 Aug 2000 15:07:07 -0700
From: "Sean Scannell" <sean@access-management.com>
Subject: open web file
Message-Id: <ZBAr5.85$WH4.68667@news.pacbell.net>
Why does the following die:
open (TEMP, 'http://www.foo.com/bar.html') || die
I guess I can fetch the file via LWP, but just wondering.
------------------------------
Date: Thu, 31 Aug 2000 13:28:41 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: output fun
Message-Id: <39AEA3D9.6B5734FC@texas.net>
Bart Lateur wrote:
>
> ankban4@my-deja.com wrote:
>
> >Without using the formatting features , how do i print an output like
> >this . i tried but my code is too huge and ugly.
> >
> > ABCDEFGFEDCBA
> > ABCDEF FEDCBA
> > ABCDE EDCBA
> > ABCD DCBA
> > ABC CBA
> > AB BA
> > A A
>
> $_ = 'ABCDEFG';
> while(length) {
> printf "%-7s%6s\n", $_, scalar reverse substr $_, 0, 6;
> chop;
> }
printf() was my initial idea, but I decided that since the manpage says:
=item printf FORMAT, LIST
that it breaks the "Without using the formatting features" rule.
- Tom
------------------------------
Date: Thu, 31 Aug 2000 11:27:49 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: pack function
Message-Id: <39AEA3A5.35960EA9@ipac.caltech.edu>
mgopi@csa.iisc.ernet.in wrote:
> can anybody explain what exactly a perl function does. does it find the bit
> pattern of the argument and puts them in an array or what.
> thanx in advance
The 'pack' function is copiously explained in the 'perlfunc' document that came
with your perl distribution. In short, pack/unpack translate to/from machine
dependant representations of various data types from/to perl's internal
representation. E.g.
$a = pack("f",3.14159);
$a is not numerically interpretable by perl, but would look like a 'float' to a
C program running on the same machine.
$pi = unpack("f",$a);
$pi can be used by perl as a number.
There are many pack translation templates available. For us to tell you more,
you'll need to post specific, short-but-not-too-short, code. But please read the
documents thoroughly first, including the very informative FAQs.
--
-- Tim Conrow tim@ipac.caltech.edu 626-395-8435
------------------------------
Date: Thu, 31 Aug 2000 15:38:30 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: Partner Required. Perl Programmer
Message-Id: <39AEC246.DF45CEB7@rac.ray.com>
Uri Guttman wrote:
>
> damn, i am pissed off!! i am so upset that i can't get this job. i have
> some much sweat to offer. i would sweat gallons for this place (and make
> rob drink it all).
>
How many hours a day can you piss? I'd get in for a piss equity, but
sweat, hell, that ain't worth spit.
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
Quae narravi, nullo modo negabo. - Catullus
------------------------------
Date: Thu, 31 Aug 2000 15:41:48 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: Partner Required. Perl Programmer
Message-Id: <39AEC30C.EB7179F2@rac.ray.com>
"Godzilla!" wrote:
>
> Look at that! Took me less than ten minutes
> to hack Mozilla 4.75 to make it do what I
> wish. I should visit Mountain View and
> offer my services, for a pretty penny.
>
So it only took you ten minutes to figure out how to make the Mozilla
news reader reply to a message? Abusing our medication, are we?
Iesu I hate it that my spell checker keeps trying to change "Godzilla"
to "Goodwill." If there's one thing I hate worse than a spelling
error, it's a lying spell checker.
It tried to change "Mozilla" to "Mazola" though, which I thought was
pretty good!
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
Quae narravi, nullo modo negabo. - Catullus
------------------------------
Date: Thu, 31 Aug 2000 15:44:13 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: Partner Required. Perl Programmer
Message-Id: <39AEC39D.13B2F69@rac.ray.com>
"Tony L. Svanstrom" wrote:
>
> Paul Eckert <peckert@epicrealm.com> wrote:
>
> > Did you catch that, Uri? Not only do they want to offer nothing, but
> > they don't want you to complain, either. This is sure a good deal for
> > somebody :). Maybe the troll?
> >
> > Rob, try emailing your request to: callgirl@la.znet.com
>
> I gotta ask, whom would get that e-mail? *L*
>
Someone who lives under a bridge, whose nose is long as a poker, and
who really doesn't care for billy goats gruff.
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
Quae narravi, nullo modo negabo. - Catullus
------------------------------
Date: Thu, 31 Aug 2000 18:19:14 GMT
From: spyder_md_2010@my-deja.com
Subject: Perl Installation Question
Message-Id: <8om7ib$32l$1@nnrp1.deja.com>
I'm having trouble getting Perl 5.6.0 setup for distribution as a
Solaris package. I'm compiling it on a Solaris 8 machine. My problem
stems from that fact that I want to install Perl into a privileged area
on a machine which users are not allowed to touch. I gave the Configure
script the -Dsiteprefix=/usr/local option but the problem seems to be
that once on the client machine when I compile a module the module
itself gets installed under /usr/local but its man pages still go into
the privalaged area. According to the INSTALL doc if one sets a
$siteprefix then both $siteman1 and $siteman3 directories should be set
as well. This doesn't appear to be the case. Since $siteman isn't a
valid Configure script option if I simply add installsiteman1=whatever
to $archlib/Config.pm will it even have any effect? Any thoughts would
be appreciated. Here's the output of the make install (this is the
second go around hence the unchanged stuff):
bash-2.03# make install
Skipping /usr/local/lib/perl5/site_perl/5.6.0/Net/TFTP.pm (unchanged)
Skipping /usr/priv/man/man3/Net::TFTP.3 (unchanged)
Writing
/usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris/auto/Net/TFTP/.packlist
Appending installation info to
/usr/priv/lib/perl5/5.6.0/sun4-solaris/perllocal.pod
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 31 Aug 2000 12:07:05 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Q. relating to perlfaq(4) / sort
Message-Id: <MPG.14184cb046f30efd98ad0c@nntp.hpl.hp.com>
In article <m3hf814jiy.fsf@dhcp11-177.support.tivoli.com> on 31 Aug 2000
09:01:09 -0500, Ren Maddox <ren.maddox@tivoli.com> says...
...
> How do you handle numeric comparison of arbitrary precision numbers?
> I suppose you could just find the maximum magnitude and prepend with
> 0s, though you also have to handle negative numbers....
Presuming that the 'arbitrary precision numbers' are being represented
as strings, you can easily use
sprintf "%${len}s"
to right-adjust to $len characters, left-padded with spaces, which work
just as well as zeros because of the handy nature of the ASCII character
set. So you need to know the maximum length, or just pick one
arbitrarily.
As for negative numbers (more precisely, signed numbers), there is some
discussion of that in the place referenced by Abe Timmerman:
For more information: "A Fresh Look at Efficient Perl Sorting"
(Appendix B:)
http://www.hpl.hp.com/personal/Larry_Rosler/sort/sorting.html
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 31 Aug 2000 11:19:17 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: regexp and accentuated letters
Message-Id: <MPG.1418417d9346ebaa98ad09@nntp.hpl.hp.com>
In article <mn5tqs4cr75dv4v7h72tc9rijhv5bacm9p@4ax.com> on Thu, 31 Aug
2000 17:38:35 GMT, Bart Lateur <bart.lateur@skynet.be> says...
> Stéphane BAUSSON wrote:
>
> >I would like to know if it is possible in perl to grep a file with word
> >with accentuated letter but without giving accentuated word in the
> >regexp
> >
> >Exemple: with pattern e, the result should be e, e acute accent, e grave
> >accent, et ...
>
> I've done that. Convert your search word into a pattern but replace "e"
> with "[eéêèë]" for example. The pattern for "eleve" becomes
> "[eéêèë]l[eéêèë]ve", which will match "élève". A hash for the
> replacement works nicely.
"[eéêèë]l[eéêèë]v[eéêèë]"
And you'd better put back the 'e' in the string in the next line:
> %accented = ( a => "aáâàãäå", e => "éêèë", ... );
> $pattern =~ s/([aeiouy])/[$accented{$1}]/g;
>
> You probably want case independent searching as well.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 31 Aug 2000 20:10:39 GMT
From: abigail@foad.org (Abigail)
Subject: Re: regexp and accentuated letters
Message-Id: <slrn8qtes8.8ac.abigail@alexandra.foad.org>
Bart Lateur (bart.lateur@skynet.be) wrote on MMDLVII September MCMXCIII
in <URL:news:mn5tqs4cr75dv4v7h72tc9rijhv5bacm9p@4ax.com>:
;;
;; I've done that. Convert your search word into a pattern but replace "e"
;; with "[eéêèë]" for example. The pattern for "eleve" becomes
;; "[eéêèë]l[eéêèë]ve", which will match "élève". A hash for the
;; replacement works nicely.
;;
;; %accented = ( a => "aáâàãäå", e => "éêèë", ... );
;; $pattern =~ s/([aeiouy])/[$accented{$1}]/g;
;;
;; You probably want case independent searching as well.
But why do this for each pattern if you can just use a module and
overload your regexes?
package accented;
use strict;
use overload;
sub import {
overload::constant qr => sub {
local $_ = $_ [1];
return $_ unless $_ [2] eq 'qq';
s/a(?!e)/[aáâãäå]/g;
s/ae/(?:ae|æ|[aáâãäå]e)/g;
s/c/[cç]/g;
s/e/[eèéêë]/g;
s/i/[iìíîï]/g;
s/n/[nñ]/g;
s/o/[oòóôõöø]/g;
s/ss/(?:ss|ß)/g;
s/u/[uùúûü]/g;
s/y/[yýÿ]/g;
s/A(?!E)/[AÁÂÃÄÅ]/g;
s/AE/(?:AE|Æ|[AÁÂÃÄÅ]E)/g;
s/C/[CÇ]/g;
s/E/[EÈÉÊË]/g;
s/I/[IÌÍÎÏ]/g;
s/N/[NÑ]/g;
s/O/[OÒÓÔÕÖØ]/g;
s/U/[UÙÚÛÜ]/g;
s/Y/[YÝ]/g;
return $_;
}
}
1;
__END__
$ perl -Maccented -wle '$re = qr /Eleve/; print $re'
(?-xism:[EÈÉÊË]l[eèéêë]v[eèéêë])
$
Just don't use character classes yourself.... ;-)
Abigail
--
map{${+chr}=chr}map{$_=>$_^ord$"}$=+$]..3*$=/2;
print "$J$u$s$t $a$n$o$t$h$e$r $P$e$r$l $H$a$c$k$e$r\n";
------------------------------
Date: Thu, 31 Aug 2000 20:48:27 GMT
From: marty_t@my-deja.com
Subject: Re: Regexp help required
Message-Id: <8omgaj$e5v$1@nnrp1.deja.com>
Thanks for all your help, I shall spend the next couple of weeks
reading the links and hopefully working out how to write the silly
things. hehe
Thanks again,
Marty T
In article <8ohpu2$5m7$10$1@news.t-online.com>,
"Dietmar Staab" <dietmar.staab@t-online.de> wrote:
> In article <MPG.1415f687376e7f3998acfc@nntp.hpl.hp.com>, Larry Rosler
> <lr@hpl.hp.com> wrote:
> > In article <8ohj2f$nrd$18$1@news.t-online.com> on Wed, 30 Aug 2000
> > 02:02:18 +0100, Dietmar Staab <dietmar.staab@t-online.de> says...
> >> In article <8ohf97$g0u$1@nnrp1.deja.com>, marty_t@my-deja.com
wrote:
> >> > Thanks for this, but can anyone tell me how to write regular
> >> > expressions please.
> >>
> >> perls documentation is your source
> >>
> >> perldoc perlre
> >>
> >> give's all you need to write regular expressions. ;-)
> >
> > I hope the smiley is because you realize how bad that advice is.
It is
> > truly sadistic to suggest that one learn about regular expressions
from
> > perlre, which is a reference manual, not a tutorial.
>
> don't know if it's a bad advice to understand the syntax before
writing
> regular expressions ... but I'm not sadistic.
>
> I've searched for some links - hope they will help
>
> http://www.cclabs.missouri.edu/things/instruction/perl/perlcourse.html
> http://virtual.park.uga.edu/humcomp/perl/regex2a.html
> http://www.netcat.co.uk/rob/perl/win32perltut.html#77-
BasicRegularExpressions
>
> http://www.perl.com/reference/query.cgi?regexp
>
> The completest source for regexps is the book mentioned by Larry.
Other
> books like "Programming Perl" offer a few pages about regular
expressions,
> but less detailed (I think reading the "Programming Perl" book isn't
a bad
> choice, even for learning the basics about regexps).
>
> D.
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 31 Aug 2000 11:49:44 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: replace some word in text file
Message-Id: <MPG.141848a11a4735fe98ad0b@nntp.hpl.hp.com>
In article <MPG.1418c1a8ed309c2a989739@localhost> on Thu, 31 Aug 2000
09:24:01 GMT, jason <elephant@squirrelgroup.com> says...
> Keith Calvert Ivey <kcivey@cpcug.org> wrote ..
...
> >But the normal Perl idiom for slurping a whole file would be
> >
> > { local $/; $File = <FILE>; }
>
> someone showed me a neater WTDI that - for some reason - I'd never
> thought of before .. I like it because it saves the separate 'my'
> declaration which always looks clumsy
>
> my $file = do { local $/; <FILE> };
>
> syntactic sugar .. yummy
Extra calories are bad for you. As demonstrated by bookmarking some
time ago, this causes an extra copy of the string from within the block
to outside it. An implementation deficiency, no doubt; AKA an
optimization opportunity.
The fastest way turned out to be (as posted by Anno Siegel):
read FILE, $File, -s FILE;
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 31 Aug 2000 20:15:10 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: replace some word in text file
Message-Id: <8omece$lte$1@lublin.zrz.tu-berlin.de>
Larry Rosler <lr@hpl.hp.com> wrote in comp.lang.perl.misc:
[how to slurp a file]
>The fastest way turned out to be (as posted by Anno Siegel):
>
> read FILE, $File, -s FILE;
Yes, I took an immediate liking to this when it came up.
The standard { local $/; $file = <FILE> } jumps through a hoop of
curlies, just to be able to localize $/, so as to fool line-oriented
<> into thinking the whole file is a single line. Better use read()
which doesn't know about lines.
Anno
------------------------------
Date: 31 Aug 2000 18:12:32 GMT
From: napalm@drachma.ugcs.caltech.edu (K. Bruner)
Subject: Sending control characters over TCP Socket
Message-Id: <slrn8qt87e.iup.napalm@drachma.ugcs.caltech.edu>
I'm trying to write a small TCP client program. It's a replacement for a
tcl script and all it does is connect to the host server and give it one
line of data and then disconnect. My perl version sends the exact same
data but the server doesn't like it. I compared the output of the perl
client and the tcl client, and the tcl client adds \013 at the end. I
have tried to get my perl client to do the same but to absolutely no
avail. I'm using Socket.pm. I've tried adding \013, \x0d, $CR $LF,
$CRLF, everything to the string I'm sending the server, but I can't get
the \013 to show up when it reaches the server! Rewriting the server
not to expect the \013 is not possible.
This is perl 5.005_02. Both client and server are SGIs running Irix 6.5.
I've also tried using IO::Socket.pm.
Here's the relevant client code.
while (1) {
...
$line = join('|', @line);
if ($thehost eq $theserver) {
socket(SERVER, PF_INET, SOCK_STREAM, getprotobyname('tcp'));
$internet_addr = inet_aton('localhost') ||
warn "Couldn't get Internet address for localhost: $!";
$paddr = sockaddr_in($portnum, $internet_addr);
connect(SERVER, $paddr) ||
warn "Couldn't connect to localhost:$portnum: $!";
} else {
socket(SERVER, PF_INET, SOCK_STREAM, getprotobyname('tcp'));
$internet_addr = inet_aton($theserver) ||
warn "Couldn't get Internet address for $theserver: $!";
$paddr = sockaddr_in($portnum, $internet_addr);
connect(SERVER, $paddr) ||
warn "Couldn't connect to $theserver:$portnum: $!";
}
# Here's where I've tried appending six billion control characters to
# $line before sending
print SERVER "$line"
|| warn "problem writing to socket $theserver:$portnum: $!";
close(SERVER) || warn "Error closing socket $theserver:$portnum: $!";
sleep(60);
}
-Karen
------------------------------
Date: Fri, 01 Sep 2000 08:48:13 GMT
From: hasant@trabas.co.id (Hasanuddin Tamir)
Subject: Re: Sorting a Tab Delimited Text File By Second Field
Message-Id: <slrn8qt9km.me6.hasant@borg.intern.trabas.co.id>
On Wed, 30 Aug 2000 21:36:52 -0400, smc150@buffnet.net wrote:
> What is the best way to sort a tab delimited file with many records by the
> second field, in this situation a date?
Well, this group is certainly in read-write mode. Didn't you know that?
And you don't seem to use write-only mode program.
san
--
trabasLabs * hasant@trabas.com * http://www.trabas.com
Zero Point * hasant@zp.f2s.com * http://www.zp.f2s.com
------------------------------
Date: Thu, 31 Aug 2000 18:15:46 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: timelocal() is wrong?
Message-Id: <7aog29s3e2.fsf@merlin.hyperchip.com>
"Jonah" <jjk@onlink.net> writes:
> well slap me stupid,
>
> print scalar localtime timelocal 0,0,0,31,1,100;
>
> output: Sat Mar 2 00:00:00 2000
Just to ley you know: March 2nd was a Thursday.
--Ala
------------------------------
Date: Thu, 31 Aug 2000 16:23:09 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: timelocal() is wrong?
Message-Id: <39AECCBD.4D8DB1AF@rac.ray.com>
Jonah wrote:
>
> Why does this return a value?
>
> my $seconds = timelocal(0, 0, 0, 31, 1, 100);
>
On a slightly related subject, how can you get the "timelocal" value
of a number that's before the "epoch?" timelocal(0,0,0,2,8,-148) for
example? I get "Can't handle date (0, 0, 0, 2, 8, -148)" with
timelocal() and with timelocal_nocheck(). Interestingly, I get exactly
the same message, including the "-148" with timelocal(0,0,0,2,8,1752).
I'm interested in seeing how many seconds timelocal thinks is between
September 2 and September 14, 1752, and in finding out if it's the
same number in traditionally Catholic (Italy, for example) countries
and in traditionally Protestant (British Empire) countries.
(On a unix box in the US or UK, you can do 'cal 9 1752' for an
interesting result. I'm trying to see if Perl honors that convention,
and I wonder if and when it honors it in countries that went gregorian
when gregorian was in beta, compared to us non-papists that waited for
the general release.)
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
Quae narravi, nullo modo negabo. - Catullus
------------------------------
Date: Thu, 31 Aug 2000 18:29:30 GMT
From: "Etienne Laverdiere" <info@digitaltango.com>
Subject: Using SQL_LONGVARCHAR in DBI:ODBC in a INSERT statement
Message-Id: <euxr5.221996$1h3.3914827@news20.bellglobal.com>
Hi all,
In DBI:OBDC
can I make this kind of statement? I need to explicitly defined all the Bind
DataType to SQL_LONGVARCHAR. I am saying ALL because I need a generic
function.
So, everything will be sql_longvarchar.
So I use this SQL statement :
INSERT INTO products (IDMag, IDMapping, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
VALUES (125, 42, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Plus these bind_param :
handle->bind_param(1, '074299229916', { TYPE => SQL_LONGVARCHAR })
handle->bind_param(2, 'Barbie Ocean Discovery', { TYPE => SQL_LONGVARCHAR })
handle->bind_param(3, '0.0', { TYPE => SQL_LONGVARCHAR })
handle->bind_param(4, 'Gameboy', { TYPE => SQL_LONGVARCHAR })
handle->bind_param(5, 'Adventure', { TYPE => SQL_LONGVARCHAR })
handle->bind_param(6, 'Help Barbie search for sunken treasure with Sandy the
dolphin and her ocean friends! Save the undersea animals when you and Barbie
find the treasure hidden deep in the ocean. Play games to uncover clues and
pieces of the treasure map. ', { TYPE => SQL_LONGVARCHAR })
handle->bind_param(7, '39.99', { TYPE => SQL_LONGVARCHAR })
handle->bind_param(8, 'Mattel', { TYPE => SQL_LONGVARCHAR })
handle->bind_param(9, '50.0', { TYPE => SQL_LONGVARCHAR })
handle->bind_param(10, '074299229916.jpg', { TYPE => SQL_LONGVARCHAR })
It seems that all the binding is not welcome by my ODBC:Access database.
Thanks for answering.
Etienne Laverdiere
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 V9 Issue 4193
**************************************