[18474] in Perl-Users-Digest
Perl-Users Digest, Issue: 642 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 6 09:06:02 2001
Date: Fri, 6 Apr 2001 06:05:17 -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: <986562316-v10-i642@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 6 Apr 2001 Volume: 10 Number: 642
Today's topics:
Re: Re: Newbies welcome snarky@hotmail.com
Re: 7 needed books [Was: Re: Hmmm... Which PERL Book Is <wayne.keenan@ntlworld.com>
Re: Any good way to split a very large string? <pillgrim@mail.ru>
Re: Anyone know how to handle CVS files With " in them? <ubl@schaffhausen.de>
Re: Hash Referencing question <temp1@williamc.com>
Help needed compiling DB_File on HP-UX 11 daniel.cutter@polizei.brandenburg.de
help needed converting beteen sybase::ctlib and win32:: <dbrock248@home.com>
Re: hide the source for my Perl program (I read the faq <tm@kernelconsult.com>
Re: How do I get html from a website? <moiraine{NOSPAM}@qwest.net>
Re: maximum value of a list <alun.moon@unn.ac.uk>
modify [not replace] code of a routine at runtime? usenet@dbedge.com
Re: Multiple pages within one CGI (David Efflandt)
Re: Multiple pages within one CGI <webmaster@webdragon.unmunge.net>
Re: new user <moiraine{NOSPAM}@qwest.net>
parsing question <rayj00@yahoo.com>
Re: perl hacker wanted <moiraine{NOSPAM}@qwest.net>
Re: perl hacker wanted <sue@pennine.com>
please help <gglackin@nospam.eircom.net>
Re: please help <ubl@schaffhausen.de>
Re: please help <gtoomey@usa.net>
Re: Q: Units of Measurement in Convert-Units (Mark Jason Dominus)
Re: Remove every other character? <joe+usenet@sunstarsys.com>
request help to read one line from tcp socket into mysq <david.armstrong@ntlworld.com>
Secured demo scripts (Er Galvăo Abbott)
Re: Secured demo scripts (Anno Siegel)
Seeking Perl Script for Notice Board <nospam@demon.net>
Re: Seeking Perl Script for Notice Board daniel.cutter@polizei.brandenburg.de
Re: speed of strings and arrays? (Anno Siegel)
Re: Wrapper To Log Output Of Win32 cmd.exe <e_bachmann@hotmail.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 06 Apr 2001 11:35:21 GMT
From: snarky@hotmail.com
Subject: Re: Re: Newbies welcome
Message-Id: <ZRhz6.142393$47.2080661@news.bc.tac.net>
Logan Shaw (logan@cs.utexas.edu) wrote on MMDCCLXXIV September MCMXCIII
> Pretty soon, well... you know
> :} what happens to trees in the winter when their branches collect too
> :} much ice.
Abigail added...
> Yeah, the branches break off.
Wow! I guess someone should let the authorities in Quebec and the North-Eastern US that it _wasn't_ the _ice_ that knocked all of the trees and power pylons down a couple of years ago.
There they are thinking that the reason the majority of trees in hundreds of square kilometers were knocked down was the ice that cumulatively froze to the trees and power lines etc.
But you say that if it _was_ the ice then the only thing that would have fallen down would be the branches.
I am SOOOO glad you set us straight on this matter.
snarky
ps (Does this mean that if I freeze($tree) then all of $tree's braches fall off? Cool.)
:-)
==================================
Posted via http://nodevice.com
Linux Programmer's Site
------------------------------
Date: Fri, 06 Apr 2001 09:50:51 +0100
From: "wayne.keenan" <wayne.keenan@ntlworld.com>
Subject: Re: 7 needed books [Was: Re: Hmmm... Which PERL Book Is Best Suited For This???
Message-Id: <3ACD836B.FDAE0101@ntlworld.com>
the perl cookbook
mastering algorithms with perl
advanced perl programming
mastering regular expressions
zen and the art of motor cycle maintenance, or, learning perl
lvirden@cas.org wrote:
> According to wayne.keenan <wayne.keenan@ntlworld.com>:
> :there are 7 books u NEED, 1 & 2 on the list is Programming Perl and the 2nd
> :is Object Orientated Perl by Damien Conway,
> :without out them, life is a cheese ball.
>
> What are the other 5 books?
>
> --
> --
> "See, he's not just anyone ... he's my son." Mark Schultz
> <URL: mailto:lvirden@cas.org> <URL: http://www.purl.org/NET/lvirden/>
> Even if explicitly stated to the contrary, nothing in this posting
------------------------------
Date: Thu, 5 Apr 2001 03:29:54 +0300
From: "Aleksandr Guidrevitch" <pillgrim@mail.ru>
Subject: Re: Any good way to split a very large string?
Message-Id: <9ak2u3$5q2de$1@ID-82007.news.dfncis.de>
May be you're right :)
> AG> Sorry, I mean references :) (perlref)
>
> which is still meaningless unless you can make a regex return references
> to inside a string. you can do that with substr but not directly with
> m///.
>
> and if you do the while m///g loop like i said, you won't need refs as
> you will only process one element at a time and that should fit into
> memory just fine.
>
> uri
>
> --
> Uri Guttman --------- uri@sysarch.com ----------
http://www.sysarch.com
> SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX
Consulting
> The Perl Books Page -----------
http://www.sysarch.com/cgi-bin/perl_books
> The Best Search Engine on the Net ----------
http://www.northernlight.com
------------------------------
Date: Fri, 06 Apr 2001 11:01:42 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Anyone know how to handle CVS files With " in them?
Message-Id: <3ACD9405.B926975D@schaffhausen.de>
Wyzelli schrieb:
>
> "Gary Blake" <gary@tigerstripes.co.uk> wrote in message
> news:k5az6.5644$bL6.1097917@news2-win.server.ntlworld.com...
> > Anyone know how to handle CVS files With " in them?
> >
>
> Do you mean CSV? Where the data would normally look like:
>
> "stuff","more stuff","other stuff and so on"
>
> And you have:
>
> "stuff","more stuff","other stuff with " and so on"
>
> ?
>
> I normally strip the leading and trailing " and then split on "," but there
> is a Module Text::CSV I think ... a CPAN search should help.
Isn't there even a CSV driver for DBI? Anyway, you can find that one at
CPAN, too.
->malte
------------------------------
Date: Fri, 06 Apr 2001 11:45:38 GMT
From: PropART <temp1@williamc.com>
Subject: Re: Hash Referencing question
Message-Id: <3ACDAB4D.3933565E@williamc.com>
Gregory Toomey wrote:
>
> Thanks guys. I've always found referencing/dereferencing confusing.
>
> Mabe I need a strongly typed language like ML.
>
> Gregory Toomey
I'd suggest reading perlreftut *before reading perlref.
Maybe even instead of perlref...
perlreftut is very straightahead and clear, while perlref begins with
a discussion of soft references that is guaranteed to confuse a novice
who is shaky on refs...
Really, an hour with perlreftut will give you the basics.
Also, if you can get a copy of the Advanced Perl Programming from the
library, one of the opening chapters also has a good introduction.
Don't be put off by the title.
--williamc
------------------------------
Date: 6 Apr 2001 12:14:27 GMT
From: daniel.cutter@polizei.brandenburg.de
Subject: Help needed compiling DB_File on HP-UX 11
Message-Id: <9akbv3$bk9$1@news.netmar.com>
I’m administering an Intranet-Server on HP-UX 11 with perl 5.005_03. The
large amount of data on the server is making the installation of a search
engine necessary. I’ve decided to use perlfect search, as it’s written in
perl.
to get their I need Berkeley DB and DB_File. I got Berkeley DB version 3.2.9
from the sleepycat web site and compiled it, as recommended in the DB_File
(1.76) documentation with the +z compiler switch. The library is called
libdb.sl. When compiling DB_File though, I got an error from ld, that I don’t
know how to handle:
LD_RUN_PATH="/usr/local/BerkeleyDB.3.2/lib" ld -o
blib/arch/auto/DB_File/DB_File.sl -b version.o DB_File.o -L/usr/local/
BerkeleyDB.3.2/lib -ldb
ld: (Warning) At least one PA 2.0 object file (version.o) was detected. The
linked output may not run on a PA 1.x system.
ld: Invalid loader fixup in text space needed in output file for symbol
"$000000DC" in input file "/usr/local/BerkeleyDB.3.2/lib/lib
db.sl(env_open.o)"
*** Error exit code 1
What am I doing wrong? Can anybody help?
Thanks
Daniel Cutter
dcutter@polizei.brandenburg.de
----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net
------------------------------
Date: Fri, 06 Apr 2001 12:36:15 GMT
From: "Dbrock" <dbrock248@home.com>
Subject: help needed converting beteen sybase::ctlib and win32::odbc
Message-Id: <3Liz6.143117$W05.27833298@news1.rdc1.mi.home.com>
Hello,
I'm a newbie to Perl, and Data access, I was wondering if someone could
help me out... I have a script that reads a text file defines fields that i
wish to retrieve, and posts to a odbc source.. ie.. (sql or MS Access) this
script is written using SYBASE::CTLIB... I wish to use WIN32::ODBC... I
have not fully comprehended the syntax of the win32::odbc yet... I'm still
at the beginning of my learning curve... Below is an example of the script;
I am hopeful that someone will help me along my way in the conversion
between the two modules... Any pointers, suggestions, or code examples would
be very helpful... I have done some extensive searching for example code,
without very much luck... I have grasped the connection, form query, and
inserting fields to odbc source... I am currently having problems with
retrieving results from my transaction and printing them to screen...
I have started to convert the script to win32::odbc, i am having trouble
interpreting the two "ct_callback statments" and all past
"$X->ct_execute("use database");"... once again any help would be great...
Thank You...
Darrick Brockway
mailto://darrick.brockway@eds.com
sample follows:
use Sybase::CTlib;
$uid = 'sa';
$pwd = 'sa';
$srv = 'odbc-server';
ct_callback(CS_CLIENTMSG_CB, \&msg_cb);
ct_callback(CS_SERVERMSG_CB, "srv_cb");
$X = Sybase::CTlib->ct_connect($uid,$pwd,$srv);
%months = qw(
January 01
February 02
March 03
April 04
May 05
June 06
July 07
August 08
September 09
October 10
November 11
December 12);
$linenumb = 0;
#uudecode filter
$lnum = 0;
while (<>) {
$logfile[$lnum] = $_;
#print ("$lnum $logfile[$lnum]");
$lnum = $lnum + 1;
}
$client = "";
$server = "";
$start = "";
$end = "";
$btype = "";
$type = "";
$size = 0;
$status = "";
$i = 0;
$verify =0;
#print ("-----$filename-----\n");
while ($logfile[$i] ne "") {
while ($logfile[$i] =~ /'/) {
$logfile[$i] =~ s/'/./;
}
if ($logfile[$i] =~ /\bJob Operation - Verify/) {
$verify = 1;
}
# server
if ($logfile[$i] =~ /\bJob server:/) {
chomp ($server = $logfile[$i]);
$server =~ s/Job server: //;
}
# client
if ($logfile[$i] =~ /\bJob name:/) {
chomp ($client = $logfile[$i]);
$client =~ s/Job name: //;
$client =~ s/ -.*//;
}
# start
if ($logfile[$i] =~ /\bJob started:/) {
chomp ($tempstring = $logfile[$i]);
$tempstring =~ s/Job started: //;
$tempstring =~ s/\w*, //;
$tempstring =~ s/,//;
$tempstring =~ s/:/ /;
$tempstring =~ s/at //;
@datetemp = split (/ /, $tempstring);
$datetemp[0] = $months{$datetemp[0]};
if ($datetemp[5] eq "PM") { $datetemp[3] = $datetemp[3] + 12;}
if ($datetemp[5] eq "AM") {
if ($datetemp[3] eq 12) { $datetemp[3] = 0;}}
$start = $datetemp[2] . "-" . $datetemp[0] . "-" . $datetemp[1]
. " " . $datetemp[3] . ":" . $datetemp[4];
}
# end
if ($logfile[$i] =~ /\bJob ended:/) {
chomp ($tempstring = $logfile[$i]);
$tempstring =~ s/Job ended: //;
$tempstring =~ s/\w*, //;
$tempstring =~ s/,//;
$tempstring =~ s/:/ /;
$tempstring =~ s/at //;
@datetemp = split (/ /, $tempstring);
$datetemp[0] = $months{$datetemp[0]};
if ($datetemp[5] eq "PM") { $datetemp[3] = $datetemp[3] + 12;}
if ($datetemp[5] eq "AM") {
if ($datetemp[3] eq 12) { $datetemp[3] = 0;}}
$end = $datetemp[2] . "-" . $datetemp[0] . "-" . $datetemp[1]
. " " . $datetemp[3] . ":" . $datetemp[4];
}
# type
if ($logfile[$i] =~ /\bJob type:/) {
chomp ($type = $logfile[$i]);
$type =~ s/Job type: //;
}
# btype
if ($logfile[$i] =~ /\bBackup Type:/) {
chomp ($btype = $logfile[$i]);
$btype =~ s/Backup Type: //;
$btype =~ s/ -.*//;
}
# size
if ($verify == 0) {
if ($logfile[$i] =~ /\bProcessed /) {
chomp ($tempsize = $logfile[$i]);
$tempsize =~ s/Processed //;
$tempsize =~ s/,//g;
$tempsize =~ s/ bytes.*//;
$size = $size + $tempsize;
}}
# status
if ($logfile[$i] =~ /\bJob completion status:/) {
chomp ($status = $logfile[$i]);
$status =~ s/Job completion status: //;
}
$i = $i + 1;
}
#print ("$client\n");
#print ("$server\n");
#print ("$type\n");
#print ("$btype\n");
#print ("$size\n");
#print ("$status\n");
#print ("$start\n");
#print ("$end\n");
$statement = "INSERT INTO table VALUES
('$client','$server','$type','$btype',$size,'$status','$start','$end','";
$i = 0;
while ($logfile[$i] ne "") {
$statement = $statement . $logfile[$i];
$i = $i + 1;
}
$statement = $statement . "')";
$X->ct_execute("use database");
while(($rc = $X->ct_results($restype)) == CS_SUCCEED) {
next if($restype == CS_CMD_DONE || $restype == CS_CMD_FAIL ||
$restype == CS_CMD_SUCCEED);
if(@names = $X->ct_col_names()) {
# print "@names\n";
}
if(@types = $X->ct_col_types()) {
# print "@types\n";
}
while(@dat = $X->ct_fetch) {
# print "@dat\n";
}
}
if ($client ne "") {
$X->ct_execute("$statement");
while(($rc = $X->ct_results($restype)) == CS_SUCCEED) {
next if($restype == CS_CMD_DONE || $restype == CS_CMD_FAIL ||
$restype == CS_CMD_SUCCEED);
if(@names = $X->ct_col_names()) {
# print "@names\n";
}
if(@types = $X->ct_col_types()) {
# print "@types\n";
}
while(@dat = $X->ct_fetch) {
# print "@dat\n";
}
}
}
sub msg_cb {
my($layer, $origin, $severity, $number, $msg, $osmsg, $dbh) =
@_;
printf STDERR "\nOpen Client Message: (In msg_cb)\n";
printf STDERR "Message number: LAYER = (%ld) ORIGIN = (%ld) ",
$layer, $origin;
printf STDERR "SEVERITY = (%ld) NUMBER = (%ld)\n",
$severity, $number;
printf STDERR "Message String: %s\n", $msg;
if (defined($osmsg)) {
printf STDERR "Operating System Error: %s\n", $osmsg;
}
CS_SUCCEED;
}
sub srv_cb {
my($dbh, $number, $severity, $state, $line, $server,
$proc, $msg) = @_;
# If $dbh is defined, then you can set or check attributes
# in the callback, which can be tested in the main body
# of the code.
printf STDERR "\nServer message: (In srv_cb)\n";
printf STDERR "Message number: %ld, Severity %ld, ",
$number, $severity;
printf STDERR "State %ld, Line %ld\n", $state, $line;
if (defined($server)) {
printf STDERR "Server '%s'\n", $server;
}
if (defined($proc)) {
printf STDERR " Procedure '%s'\n", $proc;
}
printf STDERR "Message String: %s\n", $msg; CS_SUCCEED;
}
------------------------------
Date: Fri, 06 Apr 2001 04:19:16 GMT
From: TM <tm@kernelconsult.com>
Subject: Re: hide the source for my Perl program (I read the faq but...)
Message-Id: <20010406.4191678@mis.configured.host>
Compile thez script
or
Crypt it
HTH
>>>>>>>>>>>>>>>>>> Message d'origine <<<<<<<<<<<<<<<<<<
Le 30/03/2001, =E0 15:11:00 h, "=D0yl@=F1" <stingpd@tiscalinet.it> vous =
a =E9crit=20
sur le sujet suivant hide the source for my Perl program (I read the faq=
=20
but...):
> I want to make a cgi for a web site, and I need to hide the source cod=
e,=20
so
> I decided to use ''source filter'' (faq number 3) but the problem is t=
hat
> the file that crypts the source code needs to stay in the same dir whe=
re=20
the
> code that I want to hide is. So this filter is not good for me....
> what else can i do, where can I hide the module that makes the encrypt=
?
------------------------------
Date: Fri, 06 Apr 2001 02:32:50 -0700
From: A_Geekette <moiraine{NOSPAM}@qwest.net>
Subject: Re: How do I get html from a website?
Message-Id: <3ACD8D42.E7A7A95A@qwest.net>
Todd Smith wrote:
<snip>
> It won't work! I can 'telnet www.yahoo.com 80', but not 'telnet
> www.gamesville.com 80'
> How do they block out telnets to HTTP but allow browsers?
Because telnet uses port 23 by default instead of port 80.
And, HTTP isn't a different protocol than telnet.
Hypertext Transfer Protocol-used to transfer hypertext.
Terminal emulation protocol-used to connect disimilar OS's over TCP/IP
(or hell, is it 21...I always get the two mixed....hm...)
--
Geekette
"Try Not. Do or do not. There is no try."
-If you don't know who said this,
I don't want to talk to you. ;-)
"Nothing is impossible, no matter how improbable."
-Anonymous
------------------------------
Date: 06 Apr 2001 13:57:48 +0100
From: Alun Moon <alun.moon@unn.ac.uk>
Subject: Re: maximum value of a list
Message-Id: <upueqb2yb.fsf@unn.ac.uk>
(Off topic reply, but I couldn't resist)
merlyn@stonehenge.com (Randal L. Schwartz) writes:
> It pays to look into the CPAN from time to time. List::Util has been
> there for many moons.
There's not that many of my family using Perl...
cheers
Alun Moon
:-)
------------------------------
Date: 6 Apr 2001 03:10:24 GMT
From: usenet@dbedge.com
Subject: modify [not replace] code of a routine at runtime?
Message-Id: <9ajc30$ft1$1@news.netmar.com>
After coming up empty on my search of the comp.lang.perl.misc list archives,
a
quick run the FAQ and checking the O’Reilly collection I turn to clpm…
At runtime or compile time, I would like to get access to the source code, or
op-codes for a sub routine. I have access to the symbol table at run time
and can check if a routine exists with:
print “$method\n”
if eval (“defined( *” . $class . “::” . $method . “{CODE})”)
I just want to find out more about the routine… Ideally, I could prepend or
append a block of code into the existing routine on the fly. Could I do this
with an XS extension? I have built a work around that takes the name of a
sub:
1) Renames a method but keeps anything else in the name space the same
2) Creates a new method with the old name
3) The new method calls the old method with any parameters that were destined
for the old method…
It’s kind of like autoload, but for modifying existing routines rather than
creating a new one… Of course, autoload could be used this way; it may just
make code less readable, though my creation certainly could make code less
readable if it were misused…
Thanks-
Ryan Erwin
----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net
------------------------------
Date: Fri, 6 Apr 2001 04:15:14 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Multiple pages within one CGI
Message-Id: <slrn9cqgmp.1m9.efflandt@efflandt.xnet.com>
On 4 Apr 2001, Scott R. Godin <webmaster@webdragon.unmunge.net> wrote:
>
>[follow-ups set appropriately]
>
>In article <slrn9cnt7r.mj.efflandt@efflandt.xnet.com>,
> efflandt@xnet.com (David Efflandt) wrote:
>
> | CGI.pm is really just a script. You can put it wherever you want to and
> | point to the system path of the directory containing it with a use lib
> | statment (which unshifts that path on the @INC search list).
> |
> | use lib '/home/username/mymodules';
> | use CGI;
> |
> | I had to do that once when I wanted to use functions that were not in the
> | old CGI.pm v2.36 that was on the system. Of course it has to at least be
> | Perl 5.
> |
>
>Along these lines I've been tossing an idea around in my head for the
>past day or three..
>
>Is it possible to actually include a Perl module's body copy *within*
>your script and still "use" it ?
>
>for example if I am aware of a short module that's not installed on my
>ISP, and that I don't really wish to pester them about, and don't have
>telnet access myself, would it be possible to copy/paste the module's
>content into the main script itself, and utilize the nature of the
>package of the module to separate its functionality (while still
>allowing the use Module; syntax above in the main package? (or would
>that even be necessary at this point?)
You don't really need telnet access to install a module that is just Perl
code (you would need access for one that needs binaries). If you have
some way to extract the files from the package, you can FTP the necessary
.pm files to an appropriate directory. As an example for a module like
MIME::Lite, you would put Lite.pm in a dir called MIME and 'use lib'
should point to the parent dir of MIME (not MIME itself).
use lib '/home/username/mymodules';
use MIME::Lite;
Would search /home/usremane/mymodules first for MIME/Lite.pm
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
------------------------------
Date: 6 Apr 2001 09:42:54 GMT
From: "Scott R. Godin" <webmaster@webdragon.unmunge.net>
Subject: Re: Multiple pages within one CGI
Message-Id: <9ak32u$d7l$3@216.155.32.55>
In article <slrn9cqgmp.1m9.efflandt@efflandt.xnet.com>,
efflandt@xnet.com (David Efflandt) wrote:
| You don't really need telnet access to install a module that is just Perl
| code (you would need access for one that needs binaries). If you have
| some way to extract the files from the package, you can FTP the necessary
| .pm files to an appropriate directory. As an example for a module like
| MIME::Lite, you would put Lite.pm in a dir called MIME and 'use lib'
| should point to the parent dir of MIME (not MIME itself).
|
| use lib '/home/username/mymodules';
| use MIME::Lite;
|
| Would search /home/usremane/mymodules first for MIME/Lite.pm
and then one must beg one's ISP to add the script to the proper group
(such as nobody or www) so that the module can be accessed by the CGI
script. *sigh*
I'd thought of that already, and I'm aware of 'use lib' (I use it on my
ISP's system for prototyping) but I'm after something else here. :)
(Re: my question) Sure, it'd make my scripts HUGE, but in the case where
I cannot get ANY damned support from one of the hosting providers I'm
'trying to work with' in the process of adding a CGI I created to help
support one of the Unreal Tournament websites they host, it's easily a
viable alternative. These guys are seriously pissing me off -- five
MONTHS since I finished the prototype and I can't even port the damn
thing (from DBD::CSV to DBD::mysql) to access their MySQL server
directly cuz they won't do any of the module installs/updates (and 99%
of them aren't even INSTALLED on their system so there's 100% lack of
worry over conflicts with existing scripts.) nor will they allow telnet
access for me to do so with a local install. (some of them do need
compiling, but not all.. which would at least allow me to test SOME
segments of this thing.)
bleh, to say the least with some admirable restraint. :P
SO anyway, um, about my question? :)
--
unmunge e-mail here:
#!perl -w
print map {chr(ord($_)-3)} split //, "zhepdvwhuCzhegudjrq1qhw";
# ( damn spammers. *shakes fist* take a hint. =:P )
------------------------------
Date: Fri, 06 Apr 2001 02:44:35 -0700
From: A_Geekette <moiraine{NOSPAM}@qwest.net>
Subject: Re: new user
Message-Id: <3ACD9003.A5E5C8C4@qwest.net>
What does the script look like.
What machine does it work under?
Anders Goeransson wrote:
<snip>
> I now try to run a little script (which I've gotten from a friend) and
> it works fine on a machine using MKS tools. On the above perl I get
> the following messages:
>
<snip>
>
>
> How do I get all these explicit packages names.
>
> regards Anders
--
Geekette
"Try Not. Do or do not. There is no try."
-If you don't know who said this,
I don't want to talk to you. ;-)
"Nothing is impossible, no matter how improbable."
-Anonymous
------------------------------
Date: Fri, 06 Apr 2001 08:57:16 -0400
From: RayJ <rayj00@yahoo.com>
Subject: parsing question
Message-Id: <3ACDBD2C.3070905@yahoo.com>
How would I parse input in this form:
0a 3f bb 23 b7......etc.
Now, the input is obviously in hex.
I need to be able to take the 0a for example,
and be able to manipulate either the 0 or the a
as well as the 0a as a whole. By manipulate,
I mean us the field for indexing, addressing,
etc.
Also, I need to do a hex to binary and decimal conversion.
Thanks.
Ray
------------------------------
Date: Fri, 06 Apr 2001 02:52:26 -0700
From: A_Geekette <moiraine{NOSPAM}@qwest.net>
Subject: Re: perl hacker wanted
Message-Id: <3ACD91D9.623AEB00@qwest.net>
I don't see what the big deal is about job posting.
I mean...wouldn't it be nice to get paid for hacking?
I sure as hell would like to get paid.
Post away with your jobs...if it's good enough, and you're not some
sleezball co like Intel, I wouldn't mind. However, if you are a sleezball
co., then go to hell.
No under the table shit tho...no way.
Look, if it's about the whole Open source thing....I understand that...I'm
not a complete capatalist, but to eat I need money. A lot of you may be
living the hi life and everything, but me...I'm jumping for joy if I can go
out and buy a couple of books, or a hardware upgrade (which I'm sorely in
need of now). I love open source and uphold it mercilessly, but I'm willing
to sell my skills, because I'm poor. I don't know about you, but food is
something I like to have around.
When I get a good paying job that allows me to work my schedule around
school, maybe I'll even be able to *gasp* get some sort of motorized
transport. Ooooh...wouldn't that be luxery.
So, what's the job?
Bart Lateur wrote:
> Uri Guttman wrote:
>
> >if this was a real jobs
> >post it would have been off topic and excused by the clueless author as
> >why not post a perl job where the perl hackers hang out.
>
> I've been searching all over the Net today, for over an hour, looking
> for a site with the rules that say that job offerings are indeed not
> allowed in the comp.* or comp.lang.* hierarchy. It came out zilch. Does
> anybody have an URL?
>
> --
> Bart.
--
Geekette
"Try Not. Do or do not. There is no try."
-If you don't know who said this,
I don't want to talk to you. ;-)
"Nothing is impossible, no matter how improbable."
-Anonymous
------------------------------
Date: 6 Apr 2001 04:54:45 -0700
From: Sue Spence <sue@pennine.com>
Subject: Re: perl hacker wanted
Message-Id: <9akaq501vvc@drn.newsguy.com>
In article <3ACD91D9.623AEB00@qwest.net>, A_Geekette says...
>
>I don't see what the big deal is about job posting.
You would if this group became inundated by 100s of postings dumped here
robotically by recruitment agencies. There are sites and newsgroups devoted to
techie jobs. Please seek them out if you are interested in getting paid for
programming.
>I mean...wouldn't it be nice to get paid for hacking?
Yes, it is.
------------------------------
Date: Fri, 6 Apr 2001 10:47:23 +0100
From: "Bob Smith" <gglackin@nospam.eircom.net>
Subject: please help
Message-Id: <uggz6.6334$_W2.6818@news.indigo.ie>
Hi,
I am writing a cookie based application to build up stats/profiles on
visitors to our sites. The problem is that if cookies have been disabled
then
I just a new session entry for every page visited.
Is their any way to detect if a browser has cookies disabled??.
I have tried to set a cookie and then immediately try to read it. but it
always
exists - regardless of cookies being available or not
Thanks
Bob
------------------------------
Date: Fri, 06 Apr 2001 13:09:56 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: please help
Message-Id: <3ACDB214.7DE5C20F@schaffhausen.de>
Bob Smith schrieb:
>
> Hi,
>
> I am writing a cookie based application to build up stats/profiles on
> visitors to our sites. The problem is that if cookies have been disabled
> then
> I just a new session entry for every page visited.
>
> Is their any way to detect if a browser has cookies disabled??.
>
> I have tried to set a cookie and then immediately try to read it. but it
> always
> exists - regardless of cookies being available or not
Since there probably isnt a Perl module called CGI::Cookies::CheckWhetherEnabled
this might not be Perl related.
Well, solutions would be to either use JavaScript, or set a cookie and redirect
to yourself to see whether it was set or see whether there is some cool environment
variable that tells you or use some other method for session persistency.
->malte
------------------------------
Date: Fri, 6 Apr 2001 22:51:01 +1000
From: "Gregory Toomey" <gtoomey@usa.net>
Subject: Re: please help
Message-Id: <VLiz6.10600$45.59799@newsfeeds.bigpond.com>
"Bob Smith" <gglackin@nospam.eircom.net> wrote in message
news:uggz6.6334$_W2.6818@news.indigo.ie...
> Hi,
>
> I have tried to set a cookie and then immediately try to read it. but it
> always
> exists - regardless of cookies being available or not
This statment does not ring true.
The cookie protocol is a stateful. The algorithm to detect a cookie might
look like:
1. The user calls your cgi Perl program
2. This program returns a cookie in the HTML header, which may be stored by
the browser.
3. The user calls another of your cgi Perl programs, which would send the
cookie
4. This program tests to see if a cookie has been returned.
Have a look at http://www.cookiecentral.com for more details
gtoomey
------------------------------
Date: Fri, 06 Apr 2001 06:13:29 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: Q: Units of Measurement in Convert-Units
Message-Id: <3acd5e88.246e$f1@news.op.net>
Abigail already suggested that you look at the 'units' program in the
Perl Power Tools distirbution, or at
http://perl.plover.com/units/
I second this suggestion. It solves a number of these problems (not
all of them) in a much more general way.
It would be very easy to abstract the functionality into a module.
I have included a relevant part of the manual for your amusement.
units understands complicated compound units formed by
multiplying or dividing other units. For example, if (for
some (inexplicable) reason) you wanted to convert kilo-
calories per Ohm-statcoulomb to Tera-abamperes, you could
do that. As a more useful example, how fast is 55 miles
per hour in feet per second?
You Have: 55 mi/hr
You Want: ft/sec
* 80.6667
/ 0.0123967
It's 80.6667 feet per second.
What is the speed of light in furlongs per fortnight?
You Have: c
You Want: furlongs / fortnight
* 1.80262e+12
/ 5.54749e-13
The speed of light is 1.8 trillion furlongs per fortnight.
What is the acceleration due to gravity, in miles per hour
per second?
You Have: gee
You Want: miles per hour per second
* 21.922
/ 0.0456163
Every second an object falls, its speed increases by about
22 mph.
You can abbreviate miles per hour per second to any of
miles/hour/second
mi/hr/sec
mi/hr/s
mi/(3600 s2)
units understands the usual metric prefixes (deci-,
centi-, kilo-, etc.) and most common (and many uncommon)
units of measurement and abbreviations (`amp' for
`ampere', `N' for `newton', `ft' for `feet', etc.) An
integer suffixed to a unit of measurement denotes the unit
raised to a power, so, for example, `cm2' denotes square
centimeters. White space or a hyphen between two units
multplies the units, so that `Newton-meters' denotes New-
ton-meters. The word `per' or a slash between two units
denotes division, so that `Joules/second' and `Joules per
second' denote Joules per second.
(etc.)
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: 06 Apr 2001 08:46:08 -0400
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Remove every other character?
Message-Id: <m3vgoiqjqn.fsf@mumonkan.sunstarsys.com>
Joe Schaefer <joe+usenet@sunstarsys.com> writes:
> sub mask {
> my $string = $str;
> return "$string" & ("\xff\x00" x length $string);
> }
Actually, mask() doesn't "remove every other character",
but just replaces them with \x00 characters. Here's a
version that strips them out (of course it only works right
if the original string doesn't have any \x00 char's to begin
with):
sub mask {
my $string = $str;
$string &= "\xff\x00" x length $string;
$string =~ tr/\x00//d;
return $string;
}
--
Joe Schaefer "Arguments are to be avoided; they are always vulgar and often
convincing."
-- Oscar Wilde
------------------------------
Date: Fri, 6 Apr 2001 08:29:36 +0100
From: "David Armstrong" <david.armstrong@ntlworld.com>
Subject: request help to read one line from tcp socket into mysql
Message-Id: <egez6.124$cF4.22711@news6-win.server.ntlworld.com>
Could i respectfully request some help as a newbie to perl ( only 1 week
into it)
could someone please give me an example of reading a single line from a tcp
socket connecton
this is a real time internet feed and is a comma deliminated row one record
per row
I would like to read it either as a row then parse it using chomp ,split etc
just getting the row into a variable would be a great help.
the code i have so far is below
do not take any notice of the database code this is the area of confusion
===== code ======
#!perl -w
#for test using socket input from
$remote_host = "linus.chemeketa.edu";
$port = "10152";
$hostname = '127.0.0.1'; # localhost
$portdb ="3306"; # default mysql port
$database = "track"; # database name
$user = "dsa"; # database user name
$password = "12345"; # database password
$table ="trackpos"; # database table
use strict;
use DBI;
use DBD::mysql;
use IO::Socket;
my %serial_port_buffers; # Used for buffering input from each port.
$s = IO::Socket::INET->new(
Proto => "tcp",
PeerAddr => "$remote_host",
PeerPort => "$port",
)
or die "Cannot connect to $port at $remote_host : $@\n";
# output print testing
# for test this line produces text output correctly works ok
#while (<$s>) {print} # for testing socket only
#end of first hurdle
#........................................................
#now add in database and connect the two together !
# read only the socket and put socket output split by comma's into database
variables
# and put into database tables , seems easy enough how wrong can i get !.
#$dbh = DBI->connect("DBI:mysql:$database:$hostname:$portdb",
# $user, $password,
# { RaiseError => 1, AutoCommit => 0 });
# my $sth = $dbh->prepare(q{
# INSERT INTO $table (callsign,id,lat,lon,msg) VALUES (?,?,?,?,?)
# }) || die $dbh->errstr;
while ( <$s> ) {
$line = $s->getc();
chop;
my ($callsign,$id,$lat,$lon,$msg) = split /,/;
print "callsign is-,$callsign\n";
print "id is-,$id\n";
print "lat-,$lat\n";
print "lon-,$lon\n";
print "msg-,$msg\n"
# $sth->execute($callsign,$id,$lat,$lon,$msg) || die $dbh->errstr;
}
# $dbh->commit || die $dbh->errstr;
# $dbh ->close
===== code =============
all help is much appriciated
Regards
David
------------------------------
Date: Fri, 06 Apr 2001 06:08:43 GMT
From: erabbott@DONTSPAMterra.com.br (Er Galvăo Abbott)
Subject: Secured demo scripts
Message-Id: <3acd5d0e.18682061@news.terra.com.br>
Hi there.
Does someone have a solution to expire a perl sctipt in a specific
amount of time, like a demo software?
Or...
Does someone knows about a solution to "lock" a perl script if one or
more lines of it are changed?
I've seen some scripts that gives an Error if you change some specific
lines of it...
Does anyone have practical or even teorical examples?
Thanks in advance,
Er Galvăo Abbott
Webdeveloper
er@DONTSPAMTHEmatrix.com.br
-----------------------------------------
To send me an e-mail just remove
the CAPITAL TEXT.
-----------------------------------------
------------------------------
Date: 6 Apr 2001 09:20:15 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Secured demo scripts
Message-Id: <9ak1of$k2m$1@mamenchi.zrz.TU-Berlin.DE>
According to Er Galvăo Abbott <erabbott@DONTSPAMterra.com.br>:
> Hi there.
>
> Does someone have a solution to expire a perl sctipt in a specific
> amount of time, like a demo software?
That's trivial. Compare time() to a preset time and bail out
if its too late. The preset time can either be compiled in when
you distribute the demo or at installation at the user. In the
latter case, a re-installation gives the user another grace period.
> Or...
>
> Does someone knows about a solution to "lock" a perl script if one or
> more lines of it are changed?
>
> I've seen some scripts that gives an Error if you change some specific
> lines of it...
If the user can change the script they can change anything you
have built in to check for changes. You can, of course, MD5 the
original source and check that, but a determined user will find
that and change it too. The same goes, of course, for time
limitations.
Anno
------------------------------
Date: Fri, 6 Apr 2001 09:19:14 +0100
From: "Mark Ryan" <nospam@demon.net>
To: comp.lang.perl.misc
Subject: Seeking Perl Script for Notice Board
Message-Id: <ALLN769798EBF@allen-coding.co.uk>
Hi People,
My company wishes to have a customer support notice board on the web site,
and presently I have no real knowledge of Perl scripting, could someone
point me to a source which is pre-written?
--
Regards,
Mark Ryan - IT Administrator,
Thermo Allen Coding Ltd., Unit 6, Little Mundells,
Welwyn Garden City, Hertfordshire. AL7 1LD.
Tel +44 (0) 1707 379500 Fax +44 (0) 1707 320225
Email: it.admin@thermoallen-coding.co.uk
Web Site: http://www.thermoallen-coding.co.uk
------------------------------
Date: 6 Apr 2001 12:12:14 GMT
From: daniel.cutter@polizei.brandenburg.de
Subject: Re: Seeking Perl Script for Notice Board
Message-Id: <9akbqu$bha$1@news.netmar.com>
In article <ALLN769798EBF@allen-coding.co.uk>, Mark Ryan <nospam@demon.net>
writes:
>My company wishes to have a customer support notice board on the web site,
>and presently I have no real knowledge of Perl scripting, could someone
>point me to a source which is pre-written?
Try http://www.discusware.com
It's free and good. Installs itself easily too.
Daniel
----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net
------------------------------
Date: 6 Apr 2001 08:00:58 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: speed of strings and arrays?
Message-Id: <9ajt3q$gaa$1@mamenchi.zrz.TU-Berlin.DE>
According to Dan Sugalski <dan@tuatha.sidhe.org>:
> Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
[array implementation in Perl]
> > No, it's for real. A Perl array is an actual array (of pointers to the
> > scalar values). The push and pop operators work on the upper end of
> > the array and take unit time (unless push requires re-allocation).
> > shift and unshift operate at the beginning and the rest of the array
> > is copied every time. Again, arrays are rarely so big that it matters.
>
> This isn't entirely true. Perl keeps a pointer to the 'real' beginning of
> the array under the hood. If you shift and then unshift, perl doesn't copy
> anything because it doesn't need to. It's only when you unshift things
> such that there is no 'extra' space on the beginning that perl has to move
> things.
Ah, thanks. So in general a Perl array lives somewhere in the middle
of an allocated bit of storage and is moved only when it hits the ends.
Good to know.
Anno
------------------------------
Date: Fri, 6 Apr 2001 10:08:45 +0200
From: "Erik Bachmann" <e_bachmann@hotmail.com>
Subject: Re: Wrapper To Log Output Of Win32 cmd.exe
Message-Id: <iQez6.35$ZG5.2090@news.get2net.dk>
"Simon Andrews" <simon.andrews@bbsrc.ac.uk> wrote in message
news:3ACC8795.B5DD97DF@bbsrc.ac.uk...
> Josh Geller wrote:
> > I have a perl script which runs fine when called under the WINNT
> > cmd.exe.
> > I want to snag the output of this and write it to a file.
> >
> > To this end, I have written a tiny perl script which goes like this:
>
> Why not just open a Command Prompt and do
> perl myscript.pl > log.file
Or even
perl myscript.pl 1> log.file 2>errors.txt
Just like under UNIX
:-)
Erik Bachmann
--
Erik Bachmann, Grydehřjvej 62, DK-4000 Roskilde, Denmark, Europe
Voice.:(+45) 46789899 E-mail: e_bachmann@hotmail.com Homepage:
http://www.e-bachmann.dk
Clickety [CLICK] Software http://www.clicketyclick.dk
------------------------------
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 V10 Issue 642
**************************************