[10212] in Perl-Users-Digest
Perl-Users Digest, Issue: 3805 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 23 18:07:17 1998
Date: Wed, 23 Sep 98 15:00:19 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 23 Sep 1998 Volume: 8 Number: 3805
Today's topics:
Accessing DBF files (dbase III+) <mark@uninetwork.com>
ActiveState perl -i'*' -lpe "1;" "%1" doesn't work as s <jjfink@searle.monsanto.com>
Re: Array of hashes: a better way? <danboo@negia.net>
Re: Array of hashes: a better way? <uri@camel.fastserv.com>
Re: Can anyone tell me how to include the location of m <tapplega@utk.edu>
Re: Can't get cgi-lib.pl to work!? <tapplega@utk.edu>
Concatenating 3 strings leah_price@ibi.com
Re: Concatenating 3 strings <barnett@houston.Geco-Prakla.slb.com>
Re: date::manip and GMT/localtime <rra@stanford.edu>
DBD::Oracle on Linux? <dfetter@shell4.ba.best.com>
Need Perl function that always rounds an integer up. i. <vmp12@csufresno.edu>
Re: Need Perl function that always rounds an integer up <uri@camel.fastserv.com>
Re: Perl & Java - differences and uses <zenin@bawdycaste.org>
PERL 5 vs PERL 4 - strange socket behavior (D461-David_F_Haertig(Dave)83040)
PerlShop and CyberCash roy_tharpe@my-dejanews.com
Re: Poll: How Did You Learn Perl? (Brand Hilton)
Re: Poll: How Did You Learn Perl? <rra@stanford.edu>
Re: Poll: How Did You Learn Perl? (Matthew Bafford)
problems with dates being off by 1 day <troy.bull@uni.edu>
Re: Rotating an array. (Abigail)
Re: Rotating an array. (Ilya Zakharevich)
Re: Running CGI Perl scripts on NT Netscape Enterprise <library@byu.edu>
Re: send geroge reese (was Re: Call for Participation: <jeremy@cnri.reston.va.us>
Re: sock the heck out of port 23 <rra@stanford.edu>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 23 Sep 1998 17:39:50 -0400
From: Mark Cain <mark@uninetwork.com>
Subject: Accessing DBF files (dbase III+)
Message-Id: <36096AA6.D4426869@uninetwork.com>
Where can I find information regarding accessing dbf files with perl?
The FAQ does not contain the words 'dbf' or 'dbase' and the word
'database' usually points to DBM and never to dbf. Likewise, the docs
with 5.005_02 built for MSWin32-x86-object do not contain a reference.
If you can not point me to a place for reference, could you answer how
would I read the header of the file, determine the structure, and get at
the data?
Thanks,
Mark
------------------------------
Date: 23 Sep 1998 21:38:49 GMT
From: "Joel Finkle" <jjfink@searle.monsanto.com>
Subject: ActiveState perl -i'*' -lpe "1;" "%1" doesn't work as shell command
Message-Id: <01bde73a$71328e60$12322389@Joel.monsanto.com>
In ActiveState Perl, the command line
perl -i'*' -lpe "1;" file.txt "%1"
used as a command in the Explorer View/Options for a file type
generates an error message stating that it can not overwrite the file.
It works fine from the DOS command line, though (replacing "%1" with
the actual file name, which is what Windoze is supposed to do anyway...)
Any clues?
Joel Finkle
--
"That's the kind of wooly-minded liberal thinking that gets a man eaten!"
Principle Snyder, 'Buffy the Vampire Slayer'
------------------------------
Date: Wed, 23 Sep 1998 17:10:00 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: Array of hashes: a better way?
Message-Id: <360963A8.9EBF7D38@negia.net>
Uri Guttman wrote:
>
> >>>>> "AL" == Andre L <alecler@cam.org> writes:
>
> AL> while ( defined(my $line = <DATA>) ) {
> AL> chomp $line;
> AL> $i++, next if $line eq '';
> AL> my ($key,$value) = split /\s*=>\s*/, $line, 2;
> ^^^^^^^^
> i don't think this is was you meant. it won't return the 2 fields,
> probably just null strings. the split should be on '=>' or it should be
> a match like $line =~ /(\s+)=>(\s+)/
>
huh??? try these variations. one works and it's andre's. your first
suggestion includes extra spacing in the keys and values, while your
second suggestion returns a list of whitespace strings.
$line = 'eyes => blue';
my ($key,$value) = split /\s*=>\s*/, $line, 2; # andre
#my ($key,$value) = split /=>/, $line, 2; # uri 1
#my ($key,$value) = $line =~ /(\s+)=>(\s+)/; # uri 2
print "$key, $value";
cheers,
--
Dan Boorstein home: danboo@negia.net work: danboo@y-dna.com
"THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."
- Cosmic AC
------------------------------
Date: 23 Sep 1998 17:37:07 -0400
From: Uri Guttman <uri@camel.fastserv.com>
To: Dan Boorstein <danboo@negia.net>
Subject: Re: Array of hashes: a better way?
Message-Id: <saryaraecjg.fsf@camel.fastserv.com>
>>>>> "DB" == Dan Boorstein <danboo@negia.net> writes:
DB> Uri Guttman wrote:
>>
>> >>>>> "AL" == Andre L <alecler@cam.org> writes:
>>
AL> while ( defined(my $line = <DATA>) ) {
AL> chomp $line;
AL> $i++, next if $line eq '';
AL> my ($key,$value) = split /\s*=>\s*/, $line, 2;
>> ^^^^^^^^
>> i don't think this is was you meant. it won't return the 2 fields,
>> probably just null strings. the split should be on '=>' or it should be
>> a match like $line =~ /(\s+)=>(\s+)/
>>
DB> huh??? try these variations. one works and it's andre's. your first
DB> suggestion includes extra spacing in the keys and values, while your
DB> second suggestion returns a list of whitespace strings.
my bad. my eyes are defocused after going to a trade show this afternoon. i
can't tell the difference between S and s!
uri
--
Uri Guttman Speed up your web server with Fast CGI!
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: Wed, 23 Sep 1998 17:05:28 -0400
From: Toby Applegate <tapplega@utk.edu>
Subject: Re: Can anyone tell me how to include the location of my applet in perl?
Message-Id: <36096297.BF88BF50@utk.edu>
Hi,
If you simply put your HTML in a here document you will not have this problem.
ex:
print "Content-type: text/html\n\n";
print <<"EOF>;
<html>
<head>
<title>
blah
</title>
</head>
<body>
<applet code="http://www.whatever.com/blah.class">
.....more HTML
</body>
</html>
EOF
rest of script
Everything between print<<"EOF"; and EOF returns like Plain Old HTML to the
Browser. Make sure you do not put an ; after the unquoted EOF statement.
TMA
Kevin Carlson wrote:
> Hi. I've just written this script and it's having problems finding my applet.
> Can anyone please explain to me how to escape characters because I think this
> is my problem? Thanks! Kevin.
>
> #!/usr/bin/perl
> $counterfile = 'Counter.txt';
>
> open (Counter, "$counterfile");
> $Count = <Counter>;
> close(Counter);
> ++$Count;
> $rd = "";
> $rr = "";
> print "Content-type: text/html\n\n";
> print "<applet
> code=http://free.prohosting.com/~klc400/WelcomeBanner/Welcome.class width=395
> height=50>";
> print "<param name=AppBGImage value=black.gif>";
> print "<param name=AppTile value=true>";
> print "<param name=DelayBetweenChars value=40>";
> print "<param name=DelayBetweenRuns value=5000>";
> print "<param name=Font value=TimesRoman>";
> print "<param name=HorizCenter value=true>";
> print "<param name=Pointsize value=20>";
> print "<param name=Style value=bold>";
> print "<param name=text1 value=Greetings()>";
> print "<param name=text2 value=\"Welcome to My Site\">";
> print "<param name=text3 value=\"You are visitor #";
>
> @nums = split(//, $Count);
> foreach $num (@nums) {
> print $num;
> }
> print " since September 9/98.\">";
>
> print "<param name=TextCount value=3>";
> print "<param name=VertCenter value=true>";
> print "</applet>";
>
> open (Counter, ">$counterfile");
> print Counter $Count;
> close (Counter);
------------------------------
Date: Wed, 23 Sep 1998 17:16:47 -0400
From: Toby Applegate <tapplega@utk.edu>
Subject: Re: Can't get cgi-lib.pl to work!?
Message-Id: <3609653E.F7EB08E3@utk.edu>
Hi,
Will it run on the command line? Always try the command line first. Also,
do you have to push(@INC, "/cgi-bin/submit")? You may want to try placing
the ubitquitous unwebify subroutine or print "Content-type: text/html\n\n";
right into your own script. I agree that you should use CGI.pm. It just
lets you say print header and all that rot.
TMA
Brian Enderle wrote:
> I am attempting to build a cgi file using the cgi-lib.pl file but am
> unable to get even the simple following script to work:
>
> #!/usr/local/bin/perl
>
> push(@INC, "/cgi-bin/submit");
> require ("cgi-lib.pl");
>
> print &PrintHeader;
> print "hello!";
>
> When I try to run the script I just receive a '500 Server Error'
> cgi-bin/submit is the directory where my cgi scripts are stored and the
> server my provider is using is NCSA servers on BSD UNIX machines.
>
> Any help would be greatly appreciated
>
> Brian Enderle
>
> PS: I would prefer replys be sent to my e-mail at
> benderle@mindspring.com
------------------------------
Date: Wed, 23 Sep 1998 20:59:16 GMT
From: leah_price@ibi.com
Subject: Concatenating 3 strings
Message-Id: <6ubnf4$82f$1@nnrp1.dejanews.com>
I would like to concatenate three strings. The first two are variables, the
third is a text string.
$subject = $a.$b; works.
But when I try to add the text string it doesn't work. Am I doing something
wrong?
$subject = $a.$b."String";
I've also tried:
$temp=$a.$b;
$subject=$temp."String";
Thanks.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Wed, 23 Sep 1998 16:29:36 -0500
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Concatenating 3 strings
Message-Id: <36096840.E7CF1F6C@houston.Geco-Prakla.slb.com>
leah_price@ibi.com wrote:
>
> I would like to concatenate three strings. The first two are variables, the
> third is a text string.
>
> $subject = $a.$b; works.
>
> But when I try to add the text string it doesn't work. Am I doing something
> wrong?
>
> $subject = $a.$b."String";
>
> I've also tried:
> $temp=$a.$b;
> $subject=$temp."String";
>
> Thanks.
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
Well, demangling the pseudo code you have above, I get it to work fine.
1. $subject = $a . $b . 'works.';
-- What is the ; doing where you have it????
2. 2 & 3 worked fine for me (I think). See my example below.
#!/usr/local/bin/perl -w
###########################################################################
$a = "This ";
$b = "really ";
$subject = $a.$b . 'works.';
print $subject, "\n";
$subject = $a.$b."String";
print $subject, "\n";
$temp=$a.$b;
$subject=$temp."String";
print $subject, "\n";
__END__
HTH.
Cheers,
Dave
--
Dave Barnett Software Support Engineer (281) 596-1434
I don't mind going nowhere, as long as it's an interesting path.
------------------------------
Date: 23 Sep 1998 14:35:36 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: date::manip and GMT/localtime
Message-Id: <yl1zp2cy1j.fsf@windlord.stanford.edu>
Steve <syarbrou@ais.net> writes:
> Has anyone used Date::Manip to convert GMT to localtime? If so, how do
> you go about doing that?
I would usually use Date::Parse to do this, as it's considerably
lighter-weight.
use Date::Parse;
$time = str2time ($date, 'GMT');
$localtime = localtime $time;
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 23 Sep 1998 21:11:56 GMT
From: David Fetter <dfetter@shell4.ba.best.com>
Subject: DBD::Oracle on Linux?
Message-Id: <3609641c$0$25484@nntp1.ba.best.com>
Kind people,
I've just gotten my Oracle 8.0.5 pre-release for Linux CD, and have
been trying to get it useful quickly.
Oracle is set up, DBI-1.0.2 is installed under Perl 5.005_02, and
DBD::Oracle (0.54) compiles, but when I do 'make test' I get:
PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib
-I/usr/lib/perl5/5.00502/i586-linux-thread -I/usr/lib/perl5/5.00502 -e
'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests
@ARGV;' t/*.t
t/base..............ok
t/general...........dubious
Test returned status 0 (wstat 11, 0xb)
Undefined subroutine &Test::Harness::WCOREDUMP called at
/usr/lib/perl5/5.00502/Test/Harness.pm line 288.
make: *** [test_dynamic] Error 2
What is going wrong here, and how can I fix it?
Cheers,
David.
--
David Fetter 888 O'Farrell Street Apt E1205
shackle@ren.glaci.com San Francisco, CA 94109-7089 USA
http://www.best.com/~dfetter +1 415 567 2690 (voice)
print unpack ("u*",q+92G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R"@``+)
If I haven't seen further, it is by standing in the footprints of giants
------------------------------
Date: Wed, 23 Sep 1998 11:36:55 -0700
From: Vince <vmp12@csufresno.edu>
Subject: Need Perl function that always rounds an integer up. i.e. 283.34 = 284.
Message-Id: <36093FC6.C369CA8D@csufresno.edu>
I'm looking for a Perl function that works like the floor(x) function in
C. If you aren't
familiar with C, floor(x) acts like floor(283.34) would equal 284. All
floor(x) does is
always round up x.
Does anyone know if there is a function in Perl that does this and if
not is there a possible
work around?
Thanks.
------------------------------
Date: 23 Sep 1998 17:46:06 -0400
From: Uri Guttman <uri@camel.fastserv.com>
To: Vince <vmp12@csufresno.edu>
Subject: Re: Need Perl function that always rounds an integer up. i.e. 283.34 = 284.
Message-Id: <sarvhmeec4h.fsf@camel.fastserv.com>
>>>>> "V" == Vince <vmp12@csufresno.edu> writes:
V> I'm looking for a Perl function that works like the floor(x) function in
V> C. If you aren't
V> familiar with C, floor(x) acts like floor(283.34) would equal 284. All
V> floor(x) does is
V> always round up x.
V> Does anyone know if there is a function in Perl that does this and if
V> not is there a possible
V> work around?
use int() and basic math.
and floor does not round, it floors!
hth,
uri
--
Uri Guttman Speed up your web server with Fast CGI!
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: 23 Sep 98 21:06:25 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <906584966.948845@thrush.omix.com>
[posted & mailed]
bjohnsto_usa_net@my-dejanews.com wrote:
: What do you mean by lambda style function?
: Do you have any links to information about them or books in which they are
: described.
Lambda functions, ala Lisp, Scheme, Perl, and friends:
http://turing.wins.uva.nl/~kamps/scheme/html/r4rs_6.html#SEC30
After reading a few debates in the JVM groups, it's pretty clear
they are impossible to represent directly in Java byte code, which
is a problem for many non-Java languages that wish to have a Java
byte code backend.
: I feel sure that perl could be implemented in byte code.
Maybe, but not easily.
: I am not sure what the efficiency would be.
Yep.
: You are drawing a distinction between a Perl written in Java to a perl which
: generates Java Byte code.
Yes, I am. A perl that can create Java byte code would be very
useful, but near impossible. Perl opcodes and Java byte codes are
different in the extreme. Java byte codes are close to a RISC
instruction set, but not quite close enough to be of general use.
: I only intended to mean a Perl which is written is Java and 'interprets' perl
: source code.
Which I can't really see as useful. If you are already platform
independent (Java byte code), why add another (large) layer?
>snip<
: Many existing language independent systems seems to have problems with
: complexity and features.
Agreed. I personally attest this to bloated committees myself.
: Is there a CORBA interface for Perl?
Yes, although it is not as clean as one might like. CORBA is huge
(see your above quote), and harder to implement then it should be.
: Although I must say recently bought a book on CORBA and after reading about
: half I have developed an interest in Java specific technologies.
:
: I think that the right track for Java is to evolve the language and virtual
: machine together to be as powerful, efficient and simple as possible.
Which is fine, just don't lock the specs in a safe someplace to
insure that it is as hard as possible to replicate the interface in
another language.
: It seems to me that serialization which allows the reconstruction of a live
: object must be virtual machine specific.
I disagree. The fact that a few companies sell C/C++ libs to
function with Java serialized objects (despite JavaSoft's extreme
reluctance to give out information on the spec) proves this.
It's a data spec like any other. There is no reason that one can
not speek to it from any other language as long as the spec is
freely available.
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Wed, 23 Sep 1998 20:55:24 GMT
From: dfh@dwroll.lucent.com (D461-David_F_Haertig(Dave)83040)
Subject: PERL 5 vs PERL 4 - strange socket behavior
Message-Id: <Ezr8sC.CJD@drnews.dr.lucent.com>
Keywords: socket
Hi -
Are there any differences in socket-based code between PERL 4
and PERL 5?
I have a PERL 4 server that has been running fine for years.
Under PERL 5 it behaves oddly.
Basic code structure is (many details left out):
socket()
bind()
listen()
while (accept(CLIENT, LISTEN)) {
unless (fork()) {
unless (fork()) {
print CLIENT "Something"
shutdown(CLIENT, 2)
close(CLIENT)
exit
}
exit
}
close(CLIENT)
wait
}
All is well under PERL 4. Changing only the #! line in the program
to point to PERL 5 causes problems.
The server starts just fine. 'netstat' shows a LISTEN on the port.
Client connects. Server spits a few lines of text down to the client
and the client prints it. So far, so good. Client then prints the
text again, and again, and again, and again ... and losing a few lines
of text every iteration to boot - same lines each time. Meanwhile,
on the server end I see an apparent runaway child process handling the
connection. CPU time is rapidly being sucked into the child program.
'netstat' shows one LISTEN and one CLOSE_WAIT. What's this CLOSE_WAIT?
I could easily blame my server as a bug-ridden looper if the connection
was ESTABLISHED, but it's not. I'd assume that the CLOSE_WAIT state
is the result of my child handler trying to exit. I can only drop the
connection by a 'kill' on the child process.
The client end is a C program that remains unchanged between connections
to the PERL 4 and PERL 5 servers.
I've duplicated this PERL 5 server behavior on a natively compiled
PERL on Solaris 2.6, and on a NCR S5R4 natively compiled PERL.
Any suggestions?
Thanks,
--
Dave Haertig
haertig@lucent.com
--
Dave Haertig
haertig@lucent.com
------------------------------
Date: Wed, 23 Sep 1998 20:58:17 GMT
From: roy_tharpe@my-dejanews.com
Subject: PerlShop and CyberCash
Message-Id: <6ubnd9$82a$1@nnrp1.dejanews.com>
Has anyone successfully integrated PerlShop and CyberCash on Solaris. I've
had moderate success at completing the transaction from the storefront to
CyberCash, but PerlShop does not seem to complete its processing correctly.
That is, it does not clean up it's tokens, temp_orders, or temp_customers
correctly. I know that I need to get back into the perlshop.cgi from the
directpaycredit.cgi but I just haven't figured it out yet. I thought I would
post to the group to see if anyone had successfully done this sort of
integration and might have any *perls* of wisdom to impart.
Regards,
Roy
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 23 Sep 1998 20:53:11 GMT
From: bhilton@tsg.adc.com (Brand Hilton)
Subject: Re: Poll: How Did You Learn Perl?
Message-Id: <6ubn3n$7tn4@mercury.adc.com>
In article <360923EC.8E9919D0@min.net>, John Porter <jdporter@min.net> wrote:
> From what resource(s) did you learn Perl?
>
> . Llama v.1
> . Llama v.2
> . Camel v.1
> . Camel v.2
> . Other book (give name)
> X Docs included in the distribution
> . Something on the WWW
> . Studying existing code
> . Class/tutor
Almost exclusively from the man pages at first (thanks, Tom C.) and
comp.lang.perl.misc (thanks Tom Phoenix, Tom C., Randal, Mike Stok,
and many more). More recently, _Mastering_Regular_Expressions_ and
_Advanced_Perl_Programming_, and now _The_Perl_Cookbook_. I have
Camel v.2 as a reference, but still mostly grep the man pages. I got
Llama v.2 at the conference so my manager would stop giving ...21 Days
to the newbies :-)
--
_____
|/// | Brand Hilton bhilton@adc.com
| ADC| ADC Telecommunications, ATM Transport Division
|_____| Richardson, Texas
------------------------------
Date: 23 Sep 1998 14:24:57 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Poll: How Did You Learn Perl?
Message-Id: <yl4stycyja.fsf@windlord.stanford.edu>
John Porter <jdporter@min.net> writes:
> So here's a poll for everyone. From what resource(s) did you learn
> Perl?
> . Studying existing code
This one. I didn't even open a Perl book until much later, and although I
own a copy of both the Camel and the Lama, it's mostly just so that I have
them if I want them; I pretty much never use them.
The man pages had all of the information I needed to understand the
existing code as I was learning it, and I still use them constantly. Much
more convenient than books.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Wed, 23 Sep 1998 17:53:09 -0400
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: Poll: How Did You Learn Perl?
Message-Id: <MPG.10730d06c758f81e9896b3@news.south-carolina.net>
In article <360923EC.8E9919D0@min.net> on Wed, 23 Sep 1998
12:38:04 -0400, John Porter (jdporter@min.net) pounded in the
following text:
=> Matt Knecht wrote:
=>
=> I learned from the Pink Camel.
=>
=> So here's a poll for everyone.
=>
=> From what resource(s) did you learn Perl?
s/did you learn/are you learning/;
=>
=> . Llama v.1
=> X Llama v.2
I actually read the first 3 or 4 chapters sitting in Barnes and
Nobel trying to decide which to buy. :)
=> . Camel v.1
=> X Camel v.2
I read it as a bedtime story. (Strange huh?)
=> . Other book (give name)
=> X Docs included in the distribution
I first learned of Perl going through the stuff in the RedHat
dist.
=> X Something on the WWW
Various places.
=> X Studying existing code
=> . Class/tutor
=> X clp.*
Everyday. :)
Also, I've found my knowledge in C(\+\+)? helped me considerably.
Unfortunately, Perl has made me forget a lot of my C(\+\+)?. :)
--Matthew
------------------------------
Date: Wed, 23 Sep 1998 15:35:28 -0500
From: "Troy Bull" <troy.bull@uni.edu>
Subject: problems with dates being off by 1 day
Message-Id: <6ubm21$e7i@news.uni.edu>
I have an online calendar program I got off the www. It gets heavy use at
my site. The problem is this, 99% of the time everything appears find, once
and a while, dates are displayed 1 day off.
We have the newest version of Perl (we just got the new version a few days
ago).
Anyone have any ideas
--
Troy Bull
Sr. Programmer Analyst
University of Northern Iowa
http://bull.its-is.uni.edu
------------------------------
Date: 23 Sep 1998 21:13:02 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Rotating an array.
Message-Id: <6ubo8u$dl1$1@client3.news.psi.net>
Casper Kvan Clausen (ckc@dmi.dk) wrote on MDCCCXLIX September MCMXCIII in
<URL: news:Pine.GSO.3.92.980923163020.6326Z-100000@edb>:
++
++ I'm mainly asking this to see what sorts of strange and twisted answers
++ you guys can come up with, since, given the fickle nature of Usenet, I
++ doubt any answers will appear in time to make into my code.
++
++ I am currently using splice() as follows:
++
++ #!/usr/bin/perl -w
++
++ $rot = 2; @a = @words;
++
@a = @a [$rot .. $#a, 0 .. $rot - 1];
Abigail
--
perl -we '$_ = q ?4a75737420616e6f74686572205065726c204861636b65720as?;??;
for (??;(??)x??;??)
{??;s;(..)s?;qq ?print chr 0x$1 and \161 ss?;excess;??}'
------------------------------
Date: 23 Sep 1998 21:58:11 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Rotating an array.
Message-Id: <6ubqtj$pm4$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Casper Kvan Clausen
<ckc@dmi.dk>],
who wrote in article <Pine.GSO.3.92.980923163020.6326Z-100000@edb>:
> The problem is this: Given an array A of n elements, how do you most
> efficiently construct a new array B containing the same elements, but
> rotated so that B[0] = A[n-m], B[1] = A[n-m+1] ... B[m] = A[n]?
>
> I am currently using splice() as follows:
Splice is designed to be as effective as it can be. I do not know how
far you can rotate your array to the right until the buffer with SV*
will be contracted, but:
if you rotate right by some amount, then rotate left and right by
smaller amounts, the substitutions will be done in place.
Consult Devel::Peek for details. In fact I could do it myself ;-)
perl -MCPAN -eshell
cpan> install Devel::Peek
cpan> q
Now
==================================================================
#!/usr/bin/perl -w
use Devel::Peek;
sub rotate (\@$) {
my ($a,$rot) = @_;
if ($rot > 0) {
push @$a, @$a[0..($rot-1)];
splice @$a,0,$rot;
} elsif ($rot < 0) {
splice @$a, 0, 0, @$a[$rot..-1];
splice @$a,$rot;
}
}
@a = (0..9);
rotate @a, 4;
Dump \@a;
rotate @a, -3;
Dump \@a;
rotate @a, 2;
Dump \@a;
__END__
==================================================================
gives
==================================================================
>perl -w /tmp/rotate.pl
SV = RV(0x12d40c) at 0xea904
REFCNT = 1
FLAGS = (TEMP,ROK)
RV = 0xea8c8
SV = PVAV(0x109488) at 0xea8c8
REFCNT = 2
FLAGS = ()
IV = 0
NV = 0
ARRAY = 0xd3898 (offset=4)
ALLOC = 0xd3888
FILL = 9
MAX = 23
ARYLEN = 0x0
FLAGS = (REAL)
Elt No. 0
SV = IV(0xd51a0) at 0xeaa3c
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 4
Elt No. 1
SV = IV(0xd51a4) at 0xeaa48
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 5
Elt No. 2
SV = IV(0xd51a8) at 0xeaa54
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 6
Elt No. 3
SV = IV(0xd51ac) at 0xeaa60
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 7
SV = RV(0x12d40c) at 0xea904
REFCNT = 1
FLAGS = (TEMP,ROK)
RV = 0xea8c8
SV = PVAV(0x109488) at 0xea8c8
REFCNT = 2
FLAGS = ()
IV = 0
NV = 0
ARRAY = 0xd388c (offset=1)
ALLOC = 0xd3888
FILL = 9
MAX = 26
ARYLEN = 0x0
FLAGS = (REAL)
Elt No. 0
SV = IV(0xd5190) at 0xc9050
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 1
Elt No. 1
SV = IV(0xd513c) at 0xea910
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 2
Elt No. 2
SV = IV(0xd5140) at 0xea91c
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 3
Elt No. 3
SV = IV(0xd51a0) at 0xeaa3c
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 4
SV = RV(0x12d40c) at 0xea904
REFCNT = 1
FLAGS = (TEMP,ROK)
RV = 0xea8c8
SV = PVAV(0x109488) at 0xea8c8
REFCNT = 2
FLAGS = ()
IV = 0
NV = 0
ARRAY = 0xd3894 (offset=3)
ALLOC = 0xd3888
FILL = 9
MAX = 24
ARYLEN = 0x0
FLAGS = (REAL)
Elt No. 0
SV = IV(0xd5140) at 0xea91c
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 3
Elt No. 1
SV = IV(0xd51a0) at 0xeaa3c
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 4
Elt No. 2
SV = IV(0xd51a4) at 0xeaa48
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 5
Elt No. 3
SV = IV(0xd51a8) at 0xeaa54
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 6
==================================================================
As you see the ARRAY field changes, but the ALLOC one does not (only
offset of ARRAY inside the ALLOC area changes).
Hope this helps,
Ilya
------------------------------
Date: Wed, 23 Sep 1998 14:50:46 -0600
From: BYU Library <library@byu.edu>
Subject: Re: Running CGI Perl scripts on NT Netscape Enterprise 3.01 server
Message-Id: <36095F26.413F36FD@byu.edu>
BYU Library wrote:
> I just installed perl onto my NT server running NS ES 3.01. I have made
> associations of the .pl files and application/x-perl in Explorer. My
> test perl scripts run fine from the command line. When I try to run
> them from a CGI directory, it gives:
> Server Error
>
> This server has encountered an internal error which prevents it from
> fulfilling your request. The most likely cause is a
> misconfiguration. Please ask the administrator to look for messages in
> the server's error log.
>
> My log file has the following errors:
> [23/Sep/1998:14:20:24] failure: for host webspirs.lib.byu.edu trying to
> GET /cgi-bin/test.pl, send-cgi reports: could not send new process
> (Error Number is unknown)
> [23/Sep/1998:14:20:24] failure: cgi_send:cgi_start_exec
> c:\netscape\SuiteSpot\cgi-bin\test.pl failed
>
> I was able to get perl to run under IIS, but I can't find my notes. Any
> help?
>
> Bill
> library@byu.edu
I guess I overlooked the online documentation. I have to setup a Shell CGI
directory on NT for it to use the NT file associations. Ooops! I am used
to UNIX, not NT. It's working now.
Bill
------------------------------
Date: 23 Sep 1998 17:17:48 -0400
From: Jeremy Hylton <jeremy@cnri.reston.va.us>
Subject: Re: send geroge reese (was Re: Call for Participation: Python Conference)
Message-Id: <51d88m7clf.fsf@bitdiddle.cnri.reston.va.us>
Uri Guttman <uri@camel.fastserv.com> writes:
> >>>>> "JH" == Jeremy Hylton <jeremy@cnri.reston.va.us> writes:
>
> JH> Call for Participation
>
> JH> 7TH INTERNATIONAL PYTHON CONFERENCE
> JH> http://www.foretec.com/python/workshops/1998-11/
>
> let's send george reese. he'll teach them a thing or two about OO and
> debating.
>
That's not such a bad idea <0.5 wink> (not George in particular).
There is an introdction to Python tutorial being held the first
morning of the conference (and an introduction to JPython in the
afternoon). The occasionaly debate might be more productive, and I
imagine that Perl programmers could learn a thing or two about OO from
Python (even if they contain to use Perl).
Jeremy
------------------------------
Date: 23 Sep 1998 14:38:30 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: sock the heck out of port 23
Message-Id: <ylyarabjc9.fsf@windlord.stanford.edu>
MadMonkey <samblack@earthlink.net> writes:
> I'm having a weird problem. I wrote a simple little prog that should
> connect to the server I tell it to on the port I tell it to.
> --- it does--- except for port 23.
That's because telnet has a fairly sophisticated protocol and isn't just
text commands like most of the rest. If you really want to talk telnet,
you'll need to read RFC 854 (and possibly RFC 855-861) and understand
telnet option negotiation. Which is ugly as hell.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 3805
**************************************