[16787] in Perl-Users-Digest
Perl-Users Digest, Issue: 4199 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 1 14:05:48 2000
Date: Fri, 1 Sep 2000 11:05:25 -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: <967831525-v9-i4199@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 1 Sep 2000 Volume: 9 Number: 4199
Today's topics:
Re: ** how to detect the length of stay ** <jeff@vpservices.com>
Re: `pos' after !//g (Anno Siegel)
another appending (that is write over) files <star@sonic.net>
Re: Bug in Perl regular expressions? jba_lixx@my-deja.com
Can I reach my modem through Perl? <news@nettenna.com>
Re: Changing Scripts from UNIX to NT <techsupp@helpconsulting.net>
Re: Changing Scripts from UNIX to NT <lauren_smith13@hotmail.com>
Chicago Perl Talks by Damian Conway, October <spug@halcyon.com>
Re: dbi odbc placeholder problem dr_dubosc@my-deja.com
Error msg in PPM "search" (Bryce Pursley)
Re: Error msg in PPM "search" <elephant@squirrelgroup.com>
Re: finle handles in recursive procedures <elephant@squirrelgroup.com>
Re: finle handles in recursive procedures (Mike Stok)
Generating seperate html from form data <gallantknave@my-deja.com>
Re: Generating seperate html from form data <bcaligari@my-deja.com>
Re: Getting slices of this ...(not pizza) <ren.maddox@tivoli.com>
Re: How long does flock take? <elephant@squirrelgroup.com>
Re: interchanging variables (Anno Siegel)
Re: Is it possible to store a password in a perl progra <mattbee@soup-kitchen.net>
Re: Is it possible to store a password in a perl progra (Abigail)
Re: learning perl <camerond@mail.uca.edu>
Re: learning perl <justin.flavin@ntlworld.com>
Re: learning perl <bill.kemp@wire2.com>
Re: learning perl <techsupp@helpconsulting.net>
Re: learning perl (Abigail)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 01 Sep 2000 09:22:45 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: ** how to detect the length of stay **
Message-Id: <39AFD7D5.221A54D1@vpservices.com>
I'm a good man wrote:
>
> how can i know how long a user has connected/read to a page?
1. ask them
2. stand behind them with a stopwatch while they browse
Seriously, those are the only ways.
--
Jeff
------------------------------
Date: 1 Sep 2000 15:22:21 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: `pos' after !//g
Message-Id: <8oohjd$oac$1@lublin.zrz.tu-berlin.de>
Daniel Chetlin <daniel@chetlin.com> wrote in comp.lang.perl.misc:
>On 1 Sep 2000 07:48:13 -0000,
> Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>>Perldoc perlre doesn't mention '/c'. What is it?
>
>From perlop:
>
> =item m/PATTERN/cgimosx
>
> =item /PATTERN/cgimosx
>
> [snip]
>
> Options are:
>
> c Do not reset search position on a failed match when /g is in effect.
[instructive example snipped]
Learning about a new m/// switch in my old days. Whoda thunk!
Thanks, to nobull too.
Anno
------------------------------
Date: Fri, 01 Sep 2000 17:23:50 GMT
From: arthur <star@sonic.net>
Subject: another appending (that is write over) files
Message-Id: <B5D3E2A2.7B65%star@sonic.net>
Good Morning People,
Colin Keith gave me this line to help me:
open(FH, "</files/saved/copies/$my_unique_user_id.dat");
my($cgi) = CGI->new(\*FH);
I am confused by the path:/files/saved/copies/$my_unique_user_id.dat
Should that be the path on my server?
He also gave me this line: $cgi->param('varable_name');
but I am unclear how to use it.
I want to add the above to the following program and have it save the new
copy of dat as 'name'
----------
#!/usr/bin/perl -w
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
use IO File;
use strict;
use File::Copy;
print header;
print start_html('A Simple Example'),
#I get the variable 'name' so I have somewhere to hold the new data
#permanently
start_form,
"The name of your game is: ",textfield('name'),
p,
#'question' is the variable that holds the new data that I want saved as
#'name' Another program uses 'dat' so that name can not change. But the data
#I want saved
"What are your questions? ",textfield('question'),
p,
submit,
end_form,
hr;
if (param()) {
print "The name of your game is: ",em(param('name')),
p,
"Your questions are: ",em(param('question')),
p,
#I open the file Handle HOPE that is the document 'dat' I want to
#write over dat with the new 'question' from the form yet save the new data
# as 'name'
open (HOPE, ">/home/www_pages/star/dat") || die print "cant open: $!\n";
(my $question = param('question')) =~ s/,/","/g;
if ( $question !~ /^".+"$/ ) {
print " WARNING: No quotes around your questions\n";
die;};
print HOPE $question;
close HOPE;
print end_html;
}
It is a great learning experience,
~arthur
star@sonic.net
------------------------------
Date: Fri, 01 Sep 2000 16:45:10 GMT
From: jba_lixx@my-deja.com
Subject: Re: Bug in Perl regular expressions?
Message-Id: <8oomeg$u9q$1@nnrp1.deja.com>
Thanks everyone!
*slaps his head for not noticing this error himself*
Guess that's what happens if you have to debug other people's code. :)
Jens
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 1 Sep 2000 10:23:27 -0700
From: "Dave Ressler" <news@nettenna.com>
Subject: Can I reach my modem through Perl?
Message-Id: <nCRr5.194$i%1.156627@news.uswest.net>
I'm anxious to be able to ask my modem to dial a number for me using Perl.
Can someone point me in the right direction if this is possible? I'm using
Windows 2000 and the Phone Dialer that comes with it is terrible!
Thanks,
Dave
------------------------------
Date: Fri, 1 Sep 2000 12:54:35 -0400
From: "tech" <techsupp@helpconsulting.net>
Subject: Re: Changing Scripts from UNIX to NT
Message-Id: <09Rr5.2$lj6.30@interramp>
Hi,
They are correct, we just finished writing a web server that executes perl
scripts. The only requirement is that the URL contain the .cgi or .pl in
it. As for the shebang line (#!/usr/bin/perl) it's not needed but I'd just
leave it in. It's ignored.
If I can help any more just holler.
Cheers!
Ken
Http://www.helpconsulting.net
Home of:
visiPerl+ 2.0 - The Ultimate PERL IDE
OfficeTalk - How do you talk in your office?
<kenny9939@my-deja.com> wrote in message news:8onav8$cv7$1@nnrp1.deja.com...
> We recently switched hosting companies and the new servers they use are
> all NT. I am attempting to convert my UNIX CGI and Perl scripts to work
> on the new NT servers and have a few questions concerning paths to perl
> and absolute paths to directories on the NT. The tech support for the
> new servers says that the scripts don't have to be in a specific
> directory and don't require a path to perl. They are executed simply by
> having a .pl or .cgi extension. Does this mean that the traditional
> first line that points to perl (#!/usr/local/bin/perl) should be
> deleted? How about paths to features like mail and date?
> ($mailCmd= '/usr/sbin/sendmail';$dateCmd = '/bin/date';) Would these
> paths now need to be something like C:\usr\directory?
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Fri, 1 Sep 2000 09:48:30 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: Changing Scripts from UNIX to NT
Message-Id: <8oomha$tt7$1@brokaw.wa.com>
Homer Simpson <homer.simpson@springfield.nul> wrote in message
news:8onkad$7vr$0@216.39.131.168...
>
> The shbang line can be removed or left alone. It's not necessary on Win32
> systems and is ignored as a comment.
>
> If you use -w in your scripts you can include the local path (eg
> c:\perl\bin\perl.exe -w ) but you'll need to confirm with the server
operator
> what that exact path is...
Huh?
1) The shebang line should *not* be removed. It is not ignored as a
comment. It is still the place you need to hang your -w's and -T's.
2) You don't need to specify the local path if you are running with -w.
'#!perl -w' and '#!usr/own/damn/perl -w' work equally well under Windows.
The path specified on the shebang line is unimportant in most cases. The
exception to this blanket statement is when server-type programs load perl,
they may read the shebang line for perl's path (Apache, for example).
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: 1 Sep 2000 17:01:30 GMT
From: Seattle PERL Users Group <spug@halcyon.com>
Subject: Chicago Perl Talks by Damian Conway, October
Message-Id: <8oonda$uec$1@brokaw.wa.com>
Keywords: damian conway oop chicago chicago.pm parsing perl mongers quantum
* * * Free Chicago talk by Damian Conway * * *
Dr. Damian Conway, celebrated Perl Guru and author of "Object Oriented
Perl", will be in Chicago in early October, continuing his Perlish rampage
across America that began last spring.
He'll be giving a free talk to the Chicago Perl Mongers on October 8th,
from 3-5pm, in the CitiBank Tower.
The talk is entitled "Quantum Superpositions and the First Virtue", and
yes, this is the stupefyingly comical yet technically inspirational
talk made famous at this summer's YAPC and TPC 4.0 conferences. Damian's
official abstract of the talk follows below, but here's what Steven Lembark
of Chicago.pm had to say about it in a recent posting:
> You will get to see Damian Conway explain how to adapt quantum
> computing to Perl, and vice versa. Along the way, he'll touch
> on confectionary physics, parallel programming, motor racing,
> ancient Latin, winter sports, advanced OO, modern German, cruelty
> to animals, and the *original* Copenhagen.pm.
Send email to Steven Lembark (lembark@wrkhors.com) of Chicago.pm for
more details. Attendee reviews of his earlier SPUG presentation of this
talk will become visible soon at http://www.halcyon.com/spug/.
* * * October Perl Seminars in Chicago, by Damian Conway * * *
Damian will also be presenting two fee-based training seminars in Chicago
from 10/9-10/11, entitled "Advanced Object Oriented Perl" and "Beyond
Regexes: Text Parsing with Perl Modules".
These seminars are being organized through Consultix, which is the contact
for additional course information and registration services. There's a
10% discount for those who register early (which proves that laziness is not
*always* a virtue! 8-).
The abstract for the Quantum Superpositions talk follows. Detailed
information on Damian's October Perl Seminars is available at:
http://www.consultix-inc.com
*========================================================================*
| Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# |
| Email: tim@consultix-inc.com Web: http://www.consultix-inc.com |
|Training- TIM MAHER: Unix, Perl DAMIAN CONWAY: Adv. Perl, OOP, Parsing |
|CLASSES 9/11: Perl&Modules 10/9: Adv OO-Perl&Parsing 10/16: Int. Perl |
I========================================================================*
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Quantum Superpositions and the First Virtue
Dr. Damian Conway, Monash University, Australia
Abstract
Take two quantized disjunctive/conjunctive equiprobable scalar
datastructures, add a dash of multidimensional polymorphism, a
handful of redefined operators, and a pinch of breadth-first optree
evaluation. Simmer gently in the Principle of Least Effort. Decant
into a grandiosely named module. Now serve vector operations (prime
generation, list membership, list extrema, etc.) without loops
or recursion.
(Tim Maher asked me if it's meant to be a parody lecture. I know it
looks that way, but actually it's just like my Coy paper at last year's
TPC: serious science and useful Perl techniques smuggled into
unsuspecting brains hidden behind a dazzlingly stupid idea - Damian)
------------------------------
Date: Fri, 01 Sep 2000 17:35:08 GMT
From: dr_dubosc@my-deja.com
Subject: Re: dbi odbc placeholder problem
Message-Id: <8oopca$208$1@nnrp1.deja.com>
In article <TJdl5.103$DT4.3369474@nnrp2.clara.net>,
newsgroups@ckeith.clara.net (Colin Keith) wrote:
> In article <8n3fst$ats$1@nnrp1.deja.com>, dr_dubosc@my-deja.com wrote:
> >###THIS EXECUTES .....
> >my $rc = $dbh->do(q |delete from mytable where id = 30 |,undef)
> >###BUT THIS DOESN'T.....
> >#my $rc = $dbh->do(q |delete from mytable where id = ? |,undef, 30 )
>
> >It doesn't work if I explicitly prepare and execute the query,
either.
> There goes answer 1 :)
>
> >The (access driver) complaint is of a type mismatch in the parameter.
>
> Urm, do you have more success if you use bind_param() to tie a value
to a
> placeholder?
>
> Is it something really daft like the fact that placeholders get '
quoted ?
> so you're trying to say "where id = '30' " in an INT column ? If this
is the
> case you shouldn't get an error if you match on a text type column,
say
> ('select * from mytable where jobowner = ?', undef, 'bob')
Thanks very much for your response ... sorry I've taken so long to get
back.
I thought one of the chief advantages of placeholders was that the
quoting was automatically handled. I don't know in advance which fields
will be selected, so it would save a lot of jiggerypokery going to the
db to find out what type the field is, coming back, and quoting
appropriately. I'm doing it that way, but I don't want to. I know this
is off-topic, but why oh why does SQL require quoting anyway? Either
the db *knows* the type of a field, in which case it can 'quote' it for
you, or it doesn't, (primitive interface to csv or something) in which
case you can't do anything about type errors, period.
Thanks, R.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 01 Sep 2000 16:29:57 GMT
From: hbpursle@duke-energy.com (Bryce Pursley)
Subject: Error msg in PPM "search"
Message-Id: <39afd7aa.3980233@news.infoave.net>
I just installed ActiveStates ActivePerl 5.6 build 617. I was testing
PPM and all seemed 'OK' until I got to the search function. I tried
the following command with the results noted:
C:\WINNT>ppm
PPM interactive shell (2.1) - type 'help' for available commands.
PPM> search file
Undefined subroutine &main::RepositorySummary called at
C:\ActivePerl\bin\ppm.bat line 494, <> line 1.
C:\WINNT>
Can someone tell me what's going on. I even tried reinstalling
everything just in case something got cobbled up the first time but I
get the same message.
Bryce
------------------------------
Date: Fri, 01 Sep 2000 17:10:48 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: Error msg in PPM "search"
Message-Id: <MPG.141a8093c7ded810989747@localhost>
Bryce Pursley <hbpursle@duke-energy.com> wrote ..
>I just installed ActiveStates ActivePerl 5.6 build 617. I was testing
>PPM and all seemed 'OK' until I got to the search function. I tried
>the following command with the results noted:
>
>C:\WINNT>ppm
>PPM interactive shell (2.1) - type 'help' for available commands.
>PPM> search file
>Undefined subroutine &main::RepositorySummary called at
>C:\ActivePerl\bin\ppm.bat line 494, <> line 1.
>
>C:\WINNT>
I'm not seeing it in 2.0 (which came with 616)
e:\home\elephant>ppm
PPM interactive shell (2.0) - type 'help' for available commands.
PPM> search file
Packages available from
soap://www.activestate.com/cgibin/SOAP/ppmserver.plex?class=PPM::SOAPSer
ver:
DB_File [1.72 ]
File-Slurp [98.071901] single call read and write file routines; read
directories
File-Tools [2 ] This module is a wrapper for the various File
moudles.
PPM>
>Can someone tell me what's going on. I even tried reinstalling
>everything just in case something got cobbled up the first time but I
>get the same message.
maybe fire of an email to ActiveState telling them the error .. might be
a bug in PPM.pm .. not exporting RepositorySummary properly
alternatively .. you should be able to just go to line 494 of ppm.bat
and add a PPM:: in front of RepositorySummary so it looks like this
my %summary = PPM::RepositorySummary("location" => $loc);
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Fri, 01 Sep 2000 15:08:28 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: finle handles in recursive procedures
Message-Id: <MPG.141a63e235e1f8a989741@localhost>
mgopi@csa.iisc.ernet.in <mgopi@csa.iisc.ernet.in> wrote ..
>can i use my() function to create a file handle variable so that recursive
>call
>to the sub uses different file handles.
>i don't think i am able to do that.
you're right .. you can't 'my' a filehandle
>is there any other way in perl to use different file handles in recursive
>invocation of subroutine
>s
yes .. localise the typeglob for the filehandle
sub recursiveSub
{
local *FILEHANDLE;
# we now have our own version of FILEHANDLE to use
}
check out the perlsub manual for conversation
perldoc perlsub
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Fri, 01 Sep 2000 15:29:34 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: finle handles in recursive procedures
Message-Id: <yXPr5.29677$K5.464267@typhoon.austin.rr.com>
In article <8oo2sk$oc5$1@news.netmar.com>, <mgopi@csa.iisc.ernet.in> wrote:
>hello,
>can i use my() function to create a file handle variable so that recursive
>call
>to the sub uses different file handles.
>i don't think i am able to do that.
>is there any other way in perl to use different file handles in recursive
>invocation of subroutine
One way to do it is to use FileHandle objects, you can say
use FileHandle;
my $fh;
[...]
$fh = FileHandle->new( ... );
and it will work as expected. This and other approaches are covered in
perlfaq5 under:
How can I make a filehandle local to a subroutine? How do
I pass filehandles between subroutines? How do I make an
array of filehandles?
You might use
perldoc perlfaq5
to read this.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ |
GPG PGP Key 1024D/059913DA | Fingerprint 0570 71CD 6790 7C28 3D60
stok@colltech.com (CT - work) | 75D2 9EC4 C1C0 0599 13DA
------------------------------
Date: Fri, 01 Sep 2000 16:53:05 GMT
From: gallantknave <gallantknave@my-deja.com>
Subject: Generating seperate html from form data
Message-Id: <8oomt6$uv6$1@nnrp1.deja.com>
Hello everyone,
I'm a beginner at this, so don't shake your head at your monitor if my
question seems too elementary.
Here it goes.
I'm in the process of creating a bulletin board which creates an index
page for all the information entered from my form page. From the index
page, users will be able to click on a <a href> link to another html
page which stores their individual message. (I know, its a standard
bulletin board.)
Here is where I am now and my problem. I have created the index page
with all the reference messages placed in a table(such as: user name,
title, time; but not their comments). I know how to set up the <a href>
link but don't know how to , when clicked, send the user to his or her
individual message. Another words, how do you create another html page
which houses the individual message, from the script? Is this info
stored in one file and accessed from that file, or can you create a
seperate html file into a directory giving that file a different name
each time a message is posted so it can be accessed by the <a href>
tag?
I have downloaded and tried to figure out the code from other bulletin
boards but getting nowhere fast. Could someone steer me in the right
direction?
Thanks,
Knave
--
I'm not a nay sayer, I'm just a fan.
Knave
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 01 Sep 2000 17:36:25 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: Re: Generating seperate html from form data
Message-Id: <8oopeo$20u$1@nnrp1.deja.com>
In article <8oomt6$uv6$1@nnrp1.deja.com>,
gallantknave <gallantknave@my-deja.com> wrote:
> Hello everyone,
>
> I'm a beginner at this, so don't shake your head at your monitor if my
> question seems too elementary.
>
> Here it goes.
>
> I'm in the process of creating a bulletin board which creates an index
> page for all the information entered from my form page. From the index
> page, users will be able to click on a <a href> link to another html
> page which stores their individual message. (I know, its a standard
> bulletin board.)
>
> Here is where I am now and my problem. I have created the index page
> with all the reference messages placed in a table(such as: user name,
> title, time; but not their comments). I know how to set up the <a
href>
> link but don't know how to , when clicked, send the user to his or her
> individual message. Another words, how do you create another html page
> which houses the individual message, from the script? Is this info
> stored in one file and accessed from that file, or can you create a
> seperate html file into a directory giving that file a different name
> each time a message is posted so it can be accessed by the <a href>
> tag?
>
> I have downloaded and tried to figure out the code from other bulletin
> boards but getting nowhere fast. Could someone steer me in the right
> direction?
>
> Thanks,
> Knave
html can be generated dynamically. do you think that amazon has an
html file for all you go through? Probably you want your messages to
be stored in some sort of database and a script that when called with
certain parameters (say, through a form), your database will be queried
and hopefully returns the right information.
Randal L Schwartz wrote a very good (albeit pathetically pompous)
introductory text to perl (book is called "Learning Perl") which helps
one learn to walk before trying to run. Now I'm going through Sriram
Srinivasan's "Advanced Perl Programming" (awesome book). Imperative to
have is Wall/Christiansen/Schwartz's "Programming Perl" which I can't
do without as a reference. About cgi / db management from perl I'm
still completely clueless and hunting for some good texts (tried to
talk my boss into buying "CGI programming with perl" (guelich,
cundavaram, birznieks) and "programming the perl dbi" (descartes,
bunce)).
Brendon
Brendon
++++
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 01 Sep 2000 10:03:24 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Getting slices of this ...(not pizza)
Message-Id: <m31yz440jn.fsf@dhcp11-177.support.tivoli.com>
abigail@foad.org (Abigail) writes:
> Ren Maddox (ren.maddox@tivoli.com) wrote on MMDLVI September MCMXCIII in
> <URL:news:m3snrm4dmy.fsf@dhcp11-177.support.tivoli.com>:
> ==
> ==
> == The best I could come up with is that a list slice has magic that if
> == the slice is comprised entirely of undefs, then the result is an empty
> == list rather than a list of undefs, but if any of the resulting
> == elements are not undef, then all of the undefs are left in place.
>
> Yeah, and it's documented that way.
Hmm... maybe you are referring to a different document, but the only
thing I found was the part I previously quoted, which includes the
statement "A slice of an empty list is still an empty list." and then
includes two somewhat contradictory examples:
@c = (0,1)[2,3]; # @c has no elements
@a = (1)[1,0]; # @a has two elements
Neither of these demonstrate a slice of an empty list, so they are not
explained by the preceding statement.
I think the behavior is very DWIMy, which is great, but it does seem
like it could be better documented.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Fri, 01 Sep 2000 15:18:09 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: How long does flock take?
Message-Id: <MPG.141a662c4ce87bcc989742@localhost>
Lincoln Marr <lincolnmarr@nospam.europem01.nt.com> wrote ..
>I'm using flock to lock my files which are pipe delimited flat text files.
>When a user adds a record to this file I use flock() in my script to make
>sure nobody else can touch it at the same time. However the first field of
>my record in the database is an index given by time() - and naturally I
>cannot have identical indexes. If it takes more than a second to lock the
>file, erase the data, close it, open it again for writing (with another
>lock) and print all the data to it, then i've got no problems.
you've got a problem then .. if this took a second then we would all
have the problem (with the language) .. so we're all glad it's you and
not us *8^)
why not use Time::HiRes to put a *real* timestamp in there .. it's
standard in 5.6 - not sure about earlier perls so you might need to get
it from CPAN .. goes down to microseconds
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 1 Sep 2000 17:59:43 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: interchanging variables
Message-Id: <8ooqqf$ohk$1@lublin.zrz.tu-berlin.de>
Ren Maddox <ren.maddox@tivoli.com> wrote in comp.lang.perl.misc:
>abigail@foad.org (Abigail) writes:
>
>> Nice try, but you're fooling yourself.
>>
>[pulled up from below script]
>> NUL characters don't show up easily on a terminal - but they are still there.
>
>Oops... well, not that it's really worth pursuing, but I suppose that
>if we disallow nulls in the input, we can simply toss them out of the
>output....
Trailing NULs on strings become a real concern when you use strings
with vec(). The rules are, that vec( $str, $i, ...) returns 0 when
$i points beyond the end of the string. This easily leads to a
situation where trailing zeroes on two otherwise equal strings are
implied in one, and explicitly there in the other. To use eq to check
equality in the "vec sense", you must trim trailing zeroes, usually
with s///. If all strings have a common maximal length, strings can
be extended on creation: vec( $str, $max, ...) = 0; Then all NULs
will be explicit in future it you leave string lengths alone.
Anno
------------------------------
Date: Fri, 01 Sep 2000 16:21:10 +0000
From: "Matthew Bloch" <mattbee@soup-kitchen.net>
Subject: Re: Is it possible to store a password in a perl program
Message-Id: <vPPr5.4755$WT1.104200@news2-win.server.ntlworld.com>
In article <8oo3kt$51j@netnews.hinet.net>, u8526505@ms27.hinet.net ()
wrote:
> I wrote a script to access my pop3 mailbox but I don't want to enter the
> password each time when accessing the server.How can I save my password
> in a safe way ,just like using outlook express(I'm not sure if it is
> safe though)
Safe, just like Outlook hahaha! At the end of the day your computer has
to be able to read it, so it's impossible to store the password anywhere
that a human couldn't (I think outlook just puts a file called
username.pwd in c:\windows with the password just trivially scrambled).
It depends how accessible your computer is-- if it's a UNIX machine, you
could just hardwire the password into the script and set the permissions
to 700 (i.e. so only you can read it).
This might do what you want:
srand(123456);
$a="secret";
$a =~ s/(.)/@{[ garb($1) ]}/g;
print $a;
sub garb { return chr(ord($_) ^ rand(255)); }
The idea being that if you feed $a through the same translation, it'll
come out with your original string. Not very sophisticated, and you gotta
make sure your keep the number in srand() the same, but hey...
--
Matthew > http://www.soup-kitchen.net/
> ICQ 19482073
------------------------------
Date: 01 Sep 2000 17:00:34 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Is it possible to store a password in a perl program
Message-Id: <slrn8qvo3u.8ac.abigail@alexandra.foad.org>
u8526505@ms27.hinet.net (u8526505@ms27.hinet.net) wrote on MMDLVIII
September MCMXCIII in <URL:news:8oo3kt$51j@netnews.hinet.net>:
'' I wrote a script to access my pop3 mailbox but I don't want to enter the
'' password each time when accessing the server.How can I save my password
'' in a safe way ,just like using outlook express(I'm not sure if it is safe
'' though)
Well, you could put the password in a password encrypted file. ;-)
Abigail
--
$_ = "\x3C\x3C\x45\x4F\x54";
print if s/<<EOT/<<EOT/e;
Just another Perl Hacker
EOT
------------------------------
Date: Fri, 01 Sep 2000 10:10:02 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: learning perl
Message-Id: <39AFC6CA.2BC6E7A3@mail.uca.edu>
Simon Voorwinde wrote:
>
> Where's is the best place to learn perl ?
Most likely in front of a computer, optionally beside a book (see
www.perl.com/pub/language/critiques/index.html and/or
www.sysarch.com/cgi-bin/perl_books for good examples).
Cameron
--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu
------------------------------
Date: Fri, 1 Sep 2000 16:17:23 +0100
From: "Justin Flavin" <justin.flavin@ntlworld.com>
Subject: Re: learning perl
Message-Id: <8oohbo$9sn$1@newsg3.svr.pol.co.uk>
I'm learning Perl at the moment, and this seems to be working for me:
1. Buy Perl In 24 Hours
2. Work through each chapter from chapter 1 right through - don't skip
anything.
3. At the same time, make notes in whatever text editor you're using. I'm
using windoze, so i'm
using WordPad - i'm coloring in the code, highlight important bits etc etc
4. At the same time, i've got a dos prompt up and running, and another
notepad window open.
In notepad, anytime I come across a code snippet in the book I TYPE IT IN
and run it.
5. I then change the code snippet e.g. instead of a single if, what happens
if i try a nested if
6. At the start of each code segment I do a little comment e.g.
#Increment and decrement
# The following code segment shows how to use the ++ and --
increment/decrement operators
$counter=10;
$counter++;
print $counter;
print "\n";
$counter--;
print $counter;
By doing things this way, the stuff is REALLY starting to sink in. I started
doing things this way a few days ago, and i'm now
getting to grips with hashes, but the previous stuff is really starting to
stick in my head.
That's the important thing about Perl (or indeed any language) - its no good
just reading about it - YOU'VE GOT TO CODE - and you've got to make LOTS of
notes....
Hope this might help..
oh btw - i'll move on to the Camel book later - it's just that Perl in 24
hours, whilst not in depth, it's short/snappy and a good
intro to Perl.
Regards,
Justin Flavin
future Perl monger (i hope!)
Simon Voorwinde <svavevav@idx.com.au> wrote in message
news:39af9495@news1.idx.com.au...
> Where's is the best place to learn perl ?
>
>
------------------------------
Date: Fri, 1 Sep 2000 16:19:52 +0100
From: "W Kemp" <bill.kemp@wire2.com>
Subject: Re: learning perl
Message-Id: <967821804.3470.0.nnrp-02.c3ad6973@news.demon.co.uk>
>Very nice..
>
> Did you memrorize before going to the computer?
twas a joke ( a bit like 'how did you find the exam'- easy it was just sat
there on the desk)
Serious stuff at the end ...
>In article <967812079.29553.0.nnrp-09.c3ad6973@news.demon.co.uk>, "W
>Kemp" <bill.kemp@wire2.com> wrote:
>> Simon Voorwinde wrote in message <39af9495@news1.idx.com.au>...
>> >Where's is the best place to learn perl ?
>> >
>> I started learning perl when I was in the south of France. Lovely
>> mountains, with a clear river cascading down into a lovely valley
>> full of
>> vinyards. Where better?
Everybody learns things in different ways - your best learning style is
probably different from mine.
But even if you learn best by hacking around and playing with an old PC in
your bedroom you need to read decent books to make sure you are doing things
right (Perl won't always tell you).
There is a lot of rubbish on the internet, and a lot of it is out of date
(even book reviews!). So it will be wise to get a decent book at some
stage - although perhaps after hacking about if you can de-learn bad habits
later.
Don't believe what you read on the internet. Don't believe me...
------------------------------
Date: Fri, 1 Sep 2000 12:51:04 -0400
From: "tech" <techsupp@helpconsulting.net>
Subject: Re: learning perl
Message-Id: <J5Rr5.1$lj6.91@interramp>
Two really good books in IMHO are;
Learning Perl from O'Reily
and
PERL and CGI for the WWW by Elizabeth Castro
This are excellent starting points.
Cheers!
Ken
http://www.helpconsulting.net
Home of:
visiPerl+ 2.0 - The Ultimate Perl IDE
OfficeTalk - How do you talk in your office?
"Simon Voorwinde" <svavevav@idx.com.au> wrote in message
news:39af9495@news1.idx.com.au...
> Where's is the best place to learn perl ?
>
>
------------------------------
Date: 01 Sep 2000 17:01:52 GMT
From: abigail@foad.org (Abigail)
Subject: Re: learning perl
Message-Id: <slrn8qvo6d.8ac.abigail@alexandra.foad.org>
Simon Voorwinde (svavevav@idx.com.au) wrote on MMDLVIII September
MCMXCIII in <URL:news:39af9495@news1.idx.com.au>:
// Where's is the best place to learn perl ?
On a comfy chair.
Abigail
--
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");
------------------------------
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 4199
**************************************