[13890] in Perl-Users-Digest
Perl-Users Digest, Issue: 1334 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 10 00:05:29 1999
Date: Tue, 9 Nov 1999 21:05:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942210311-v9-i1334@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 9 Nov 1999 Volume: 9 Number: 1334
Today's topics:
Re: "Cross-device link" *error* <steve@corp.airmedia.com>
Re: Binary FTP using Net::FTP package? <rootbeer@redcat.com>
command line args to "perl" <seshadri9@worldnet.att.net>
Re: command line args to "perl" (Maurice E. Jarrell)
Re: Connect msql database using perl <jeff@vpservices.com>
Help with Win32::Service michaelh@erols.com
Re: HELP: Insecure dependancy with mkdir () <rootbeer@redcat.com>
Re: Help: Pulling a File/Page from another server <rootbeer@redcat.com>
Re: How do I turn on NUM-LOCK on NT system? (Martien Verbruggen)
Re: Loading modules <rootbeer@redcat.com>
Re: matching (Thunderdust (TomH))
Re: matching <bwalton@rochester.rr.com>
Re: Multiplexing Server <jomagam@yahoo.com>
Re: MYSQL question <jomagam@yahoo.com>
Re: MYSQL question (brian d foy)
Re: Newbie Help: Splitting Large file into smaller fil (Tad McClellan)
OPEN to create a file == Permissions problem!! <fred@decatomb.com>
Re: OPEN to create a file == Permissions problem!! <rootbeer@redcat.com>
Re: perl and scroll in web pages. How? <rootbeer@redcat.com>
Re: perl as first language? (Damian Conway)
Re: perl as first language? <uri@sysarch.com>
Re: perl as first language? (Abigail)
Re: perl as first language? (Abigail)
PERLHUMOR: self-printing resume <bcl914@bellsouth.net>
PerlQt and Paw <mozo@wahoo.com.tw>
Re: Perlshop <uriel443nospam@mindspring.com>
Re: Problem: MySQL, variable scope, references <lr@hpl.hp.com>
radio button in HTML.......help <pavane@netsgo.com>
Re: radio button in HTML.......help <rootbeer@redcat.com>
Re: regular expression help <schuette@umr.edu>
Re: unix perl v/s win perl (Martien Verbruggen)
Re: Variables in Strings and Substituting a Path Name <lr@hpl.hp.com>
XS routines & stack <zed@linux.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 9 Nov 1999 21:12:44 -0500
From: "Steve Protopapas" <steve@corp.airmedia.com>
Subject: Re: "Cross-device link" *error*
Message-Id: <80ak7i$so8$1@nnrp03.primenet.com>
Elton <elton_taupinNOelSPAM@altavista.net.invalid> wrote in message
news:054f0654.8297b8f7@usw-ex0108-062.remarq.com...
> I have writen a script to move files from a directory
> /home/cpoole/uploads to /home2/cpoole/html
>
> The script fails when it trys to move fails to the home2
> partition.
>
> rename("$uploads/$cn/$word", "$customers2/$word") || die
> ("mv: $!");
>
> The die message indicated Cross-device link. What does this
> error mean and how do I fix it. When I do this at the prompt
> using the mv command I don't get this error.
>
> Thanks for any help!
>
> elton
>
>
> * Sent from AltaVista http://www.altavista.com Where you can also find
related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is
Beautiful
You can call "system" with the "mv" command. Be sure to check its return
code.
------------------------------
Date: Tue, 9 Nov 1999 19:25:20 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Binary FTP using Net::FTP package?
Message-Id: <Pine.GSO.4.10.9911091923090.15797-100000@user2.teleport.com>
On Tue, 9 Nov 1999, joneill wrote:
> I'm using the Net::FTP package to transfer files from an FTP site to
> my Win32 machine. The line feeds in the original file get changed to
> carriage return/line feeds in the downloaded file. It's important the
> I don't change the contents of these files at all and I think the
> answer is using binary transfer. I tried a couple of different things
> based on the sparse documentation, but nothing worked. I think it's
> there ... I just need a little guidance to the answer.
Search the Net::FTP docs for the word 'binary'. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 09 Nov 1999 22:44:46 -0800
From: Seshadri Sriperumbudur <seshadri9@worldnet.att.net>
Subject: command line args to "perl"
Message-Id: <3829145E.D7213CA0@worldnet.att.net>
Hi,
Where can I find more about all the command line args to "perl"; I mean,
shell % perl -p -i -e ....
I want to know what each one of the letters (p, i , e) stands for and
also about other letters. Is there a book, webpage which describes all
these things at one place?
Thanks,
Sesh
------------------------------
Date: 09 Nov 1999 22:03:28 -0600
From: mejarrell@worldnet.att.net (Maurice E. Jarrell)
Subject: Re: command line args to "perl"
Message-Id: <g0yfkn73.fsf@localhost.localdomain>
Seshadri Sriperumbudur <seshadri9@worldnet.att.net> writes:
> Where can I find more about all the command line args to "perl"; I mean,
>
try 'perldoc perlrun' at the command line. 'perldoc perl' will
get you a lot of other things to try. More are listed in the
FAQ for this group. ( Posted here twice weekly, er, I think )
HTH.
--Mo
------------------------------
Date: 10 Nov 1999 03:46:27 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Connect msql database using perl
Message-Id: <3828EA4A.4DE9E48D@vpservices.com>
Ong wrote:
>
> I am currently involve in web database development. The database that I am
> going to use is msql. Can u guys tell me how to connect to this database
> using perl?
Install and read the docs on DBI and DBD::msql.
> What are the important statement that are needed before
> extracting the data from the database using sql? Example for Win32:ODBC, the
> starting statement required are as below:
>
> use Win32::ODBC;
> $db = new Win32::ODBC("My-Net");
> $db->Sql($sql);
use DBI;
my $db = DBI->connect(
"DBI:msql:database=$database",
$user,
$passwd,
{RaiseError=>1}
);
$db->do($sql);
--
Jeff
------------------------------
Date: Wed, 10 Nov 1999 04:07:12 GMT
From: michaelh@erols.com
Subject: Help with Win32::Service
Message-Id: <3828ef69.2805984@news.erols.com>
If anyone has experience with this module, could you please email me?
------------------------------
Date: Tue, 9 Nov 1999 19:56:56 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: HELP: Insecure dependancy with mkdir ()
Message-Id: <Pine.GSO.4.10.9911091954260.15797-100000@user2.teleport.com>
On Tue, 9 Nov 1999, Jeremy James wrote:
> a work around might be something like,
>
> my $taintdir = <TAINTEDLOVE>;
>
> my ($outdir) = $taintdir =~ /^(.*)$/;
To quote from perlsec:
That means using a bit of thought--don't just blindly untaint
anything, or you defeat the entire mechanism.
Please, follow that advice. Thank you.
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 9 Nov 1999 19:26:44 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Help: Pulling a File/Page from another server
Message-Id: <Pine.GSO.4.10.9911091926220.15797-100000@user2.teleport.com>
On Tue, 9 Nov 1999, sangiro wrote:
> Subject: Help: Pulling a File/Page from another server
Use LWP, from CPAN. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 10 Nov 1999 02:07:36 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: How do I turn on NUM-LOCK on NT system?
Message-Id: <Ir4W3.171$Y86.3863@nsw.nnrp.telstra.net>
On 9 Nov 1999 21:15:11 -0000,
Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> On Tue, 09 Nov 1999 19:45:46 GMT Eric Farr wrote:
> > Can someone show me how I would force the number-lock on in Perl code on an
> > NT system?
> >
>
> print "PRESS THE Num Lock KEY NOW !!\n";
But that will only toggle it. He wants to switch it on.
print <<GARBAGE;
Press NumLock now if little led labelled 'Num lock' or
something equivalent is not emitting photons. If that
little led is emitting photons, please press any key
_but_ the NumLock key. Even your front door key will
be fine.
If you can't find that little led, please consult the
manual for your keyboard. If you can't find the manual
for your keyboard, please contact the manufacturer to
request one.
If the manufacturer does not respond within 3 minutes, please
post to comp.lang.perl.misc, and ask about something offtopic
which not necessarily has anything to do with your keyboard
at all, but which will get you some response at least.
GARBAGE
Martien
--
Martien Verbruggen |
Interactive Media Division | Think of the average person. Half of
Commercial Dynamics Pty. Ltd. | the people out there are dumber.
NSW, Australia |
------------------------------
Date: Tue, 9 Nov 1999 19:16:21 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Loading modules
Message-Id: <Pine.GSO.4.10.9911091915440.15797-100000@user2.teleport.com>
On Mon, 8 Nov 1999 26Red@depechemode.com wrote:
> In UNIX, the script is able execute perfectly but when I click on the
> file using Netscape browser, I get a server Error message.
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.cpan.org/
http://www.cpan.org/doc/FAQs/cgi/idiots-guide.html
http://www.cpan.org/doc/manual/html/pod/
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 09 Nov 1999 14:38:12 GMT
From: beans@bedford.net (Thunderdust (TomH))
Subject: Re: matching
Message-Id: <38282ecc.10735710@news.bedford.net>
The "until" breaks when it sees a "<PRE>", then the "while" will read
the next line, so it looks to me that this loop will miss setting
$temporary on half of the "<PRE>" lines.
On Tue, 09 Nov 1999 17:38:20 -0800, David Perrin
<dperrin@octane.bioc.uvic.ca> wrote:
>Hi.
>
>I'm a co-op student working on a Perl project.
...
> for($cnt = 0; $cnt <= $index_max_delta_id; $cnt++) {
...
> SONOFZORK: while(<NEWFILEB>) {
> if ($_ =~ "<PRE>") {
> $temporary = 1;
> }
...
> }
> until (($_ =~ "<PRE>") || ($_ =~ "Database: Non-redundant
>GenBank CDS")) {
> print NEWDELTA $_;
> $_ = <NEWFILEB>;
> }
> }
...
Schnoodlewinks-constantly leveling up warrior
Fluffy_the_Fly-lvl.7 warrior (x2)
Flame-QFG5 Paladin
------------------------------
Date: Tue, 09 Nov 1999 21:46:24 -0500
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: matching
Message-Id: <3828DC7F.EB10B09E@rochester.rr.com>
David Perrin wrote:
>
> Hi.
>
> I'm a co-op student working on a Perl project. I have two arrays and
> I'm comparing each element in one to each element in the other. If
> there is NOT a match of the element in the first array to any in the
...
> The problem I'm having is that it's grabbing the wrong lines and I can't
> figure out why. Here's the snippet that relates to what I'm talking
...
David, without an example that includes sample data it is quite
difficult to tell what might be wrong. "Grabbing the wrong
lines" isn't very descriptive. Nothing obvious jumps out, other
than that you seem to be parsing some HTML tags, and have not
included the case insensitivity flag in your matches. Since HTML
tags are case insensitive, it is possible you are missing stuff
due to the file having the other case than what you are looking
for. Also, your logic seems quite convoluted -- you might try
simplifying things. My first thought when you give the basic
description of your task is that you should be using hashes, not
arrays. That makes comparisons between lists of things much
much easier, assuming your data will all fit into memory. If
not, then a DBM-tied hash.
--
Bob Walton
------------------------------
Date: Tue, 09 Nov 1999 22:20:41 -0500
From: Balazs Rauznitz <jomagam@yahoo.com>
Subject: Re: Multiplexing Server
Message-Id: <3828E489.5A1176F2@yahoo.com>
Curtis Jones wrote:
> I had a piece of server software written in Perl, which used forks to
> allow for multiple simultaneous connections, but after a while, I
> realized I really needed a multiplexing server. It now uses IO::Select to
> check for an incoming connection, and process it without blocking other
> processes. Anyway - I need to be able to get the IP address of the client
> who is connecting to the server, and I can't seem to figure it out.
>
> Below is the little bit of code which does the actual socket stuff.
>
> -Curtis
> curtisj@BannerFusion.com
>
> -------------------------
> my $rh = new IO::Select();
> $rh->add( $s );
> &misc_print( "-> Waiting for connection." );
> while ( 1 ) {
> my ( $nr ) = IO::Select->select( $rh, undef, undef, 0 );
> foreach $sock ( @$nr ) {
> if ( $sock == $s ) {
> my $ns = $sock->accept();
> $rh->add( $ns );
> } else {
> my $buf = <$sock>;
> if ( $buf ) {
> $stats{'connect_count'}++;
> print "buf: $buf\n";
> $rh->remove( $sock );
> close( $sock );
> } else {
> $rh->remove( $sock );
> close( $sock );
> }
> }
> }
> sleep 0.5;
> }
check: perldoc -f getpeername.
Also I'd use select($rh, undef, undef, 0.5) and delete the line: sleep 0.5.
The resolution of sleep is 1 second (at least undef Linux).
chech perldoc -f select ....
Hope it helped: Balazs
------------------------------
Date: Tue, 09 Nov 1999 22:55:18 -0500
From: Balazs Rauznitz <jomagam@yahoo.com>
Subject: Re: MYSQL question
Message-Id: <3828ECA6.7FCD405@yahoo.com>
sxbktm@my-deja.com wrote:
> Can Mysql do select(distinct(count))?
> How about nested selects.
How about asking it on the MySQL mailing list ?
Pointers at www.mysql.com
-Balazs
Ps: Subselects are surely not supported.
------------------------------
Date: Tue, 09 Nov 1999 23:24:17 -0500
From: brian@smithrenaud.com (brian d foy)
Subject: Re: MYSQL question
Message-Id: <brian-ya02408000R0911992324170001@news.panix.com>
In article <3828ECA6.7FCD405@yahoo.com>, Balazs Rauznitz <jomagam@yahoo.com> posted:
> sxbktm@my-deja.com wrote:
>
> > Can Mysql do select(distinct(count))?
> > How about nested selects.
>
> How about asking it on the MySQL mailing list ?
> Pointers at www.mysql.com
why even do that? both questions are clearly covered in the docs,
which are even searchable at the above web site.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: Tue, 9 Nov 1999 17:25:10 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Newbie Help: Splitting Large file into smaller files
Message-Id: <slrn82h7q6.pub.tadmc@magna.metronet.com>
On Tue, 09 Nov 1999 14:10:48 -0800, S. Isaacs <Susan.Isaacs@ucop.edu> wrote:
>I am very new to PERL and need to split a large file into smaller
>files.
>Your help would be most appreciated,
It is best if you show us the code you have so far.
Please show your code next time.
Here it is anyway.
-------------------------------
#!/usr/bin/perl -w
use strict;
while (<DATA>) {
if ( m#\.\./NEWFILE ([^,]+)# ) { # need a new file
open(OUT, ">$1") || die "could not open '$1' $!";
}
print OUT;
}
__DATA__
./NEWFILE EDB0002,P=3,TITLE=Some text
another record
another record
another record
another record
./NEWFILE EDB0003,P=3,TITLE=Some text
another record
another record
./NEWFILE EDB0004,P=3,TITLE=Some text
another record
another record
another record
another record
another record
another record
another record
another record
-------------------------------
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 09 Nov 1999 21:48:43 -0400
From: "Frédérick Giasson" <fred@decatomb.com>
Subject: OPEN to create a file == Permissions problem!!
Message-Id: <3828CEFB.71A34EBC@decatomb.com>
Hello,
I have some problem with the OPEn function to create a file :
becose when i use this function :
open(CREATEINDEX,
"+>/usr/local/etc/httpd/htdocs/logoeps/logo/$Entreprise/index.html");
( where $Entreprise old the home dir of index.html )
this create the index.html file with read write access ( "+>" )
but when i create it i can't change his permissions, can't delete it,
and can't upload any other file in his home dire ( $Entreprise ).
what's my error or anyone ahve other idee to create a file? :)
thank's alot
and also reply in my mail box too please :
fred@decatomb.com
thank's alot
Fred
------------------------------
Date: Tue, 9 Nov 1999 20:02:13 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: OPEN to create a file == Permissions problem!!
Message-Id: <Pine.GSO.4.10.9911092000190.15797-100000@user2.teleport.com>
On Tue, 9 Nov 1999, Fr=E9d=E9rick Giasson wrote:
> open(CREATEINDEX,
> "+>/usr/local/etc/httpd/htdocs/logoeps/logo/$Entreprise/index.html");
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
> but when i create it i can't change his permissions, can't delete it,
> and can't upload any other file in his home dire ( $Entreprise ).
That's not a perl problem, but check the permission bits on the directory
which contains the file. If you're still not sure, ask your local expert
or webmaster.
Cheers!
--=20
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 9 Nov 1999 19:21:47 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: perl and scroll in web pages. How?
Message-Id: <Pine.GSO.4.10.9911091921030.15797-100000@user2.teleport.com>
On Tue, 9 Nov 1999, luisdlr wrote:
> I do not know how to do the scrolling in my web page using perl.
It sounds as if you want to get the user's browser to do something.
Perhaps you should search for the docs, FAQs, and newsgroups about
browsers and how to talk them into doing what you want. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 10 Nov 1999 02:37:35 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: perl as first language?
Message-Id: <80alpf$3cb$1@towncrier.cc.monash.edu.au>
mgjv@comdyn.com.au (Martien Verbruggen) writes:
>On 9 Nov 1999 19:04:29 GMT,
> Damian Conway <damian@cs.monash.edu.au> wrote:
>> abigail@delanet.com (Abigail) writes:
>>
>> >I disagree with Perl, for the same reason I don't recommend C. It's way
>> >too messy and there's too much rope. That's great for someone who knows
>> >what they are doing, but not good for someone who doesn't. First learn
>> >to program, then you know how to exploit the mess and ropes of Perl and C.
>>
>> Amen, sibling!
>But, Damian, your own book (OO Perl) shows some pretty good examples
>of how decent code can be written in Perl. It also explains a few of
>the dangers in the same, but that just comes back to learning things
>from a good source, instead of just diving in.
That's right - throw the excellence of my own book back in my face! ;-)
Seriously though, you *can* write very clean code in Perl, but to do so
you need a deep understanding of the traps, snares, and bottomless pits
of the language, in order to navigate around them. And that deep
understanding is precisely what beginners don't have, and why they
blunder into trouble.
Of course, I'm coming from the point of view of someone who daily
struggles to teach large classes (300+) of absolute novices how to
program. I have ceased to be astounded at how easily subtleties of
syntax and semantics can hopelessly befuddle them.
Which is why I'm currently supervising a PhD project that has looked
at these very issues. We just presented a paper:
McIver, L and Conway, D.M., "Grail: A Zeroth Programming Language",
Proc. International Conference on Computers in Education '99.
in which we describe a minimalist introductory language that avoids
most of the problems of syntactic and semantic "ropiness".
>Don't misunderstand me; I've already agreed that for educational
>puproses and general programming other languages than the ropey ones
>are more applicable. But I maintain that for sysadmin tasks it will
>probably be a waste of time to learn a heavily structured language
>first; because after that you will want to apply it to your day to day
>administration task, and you'll find out that you can't do bugger all.
>Or if you can do it at all, it looks and feels totally alien to the
>language at hand.
You may be right. I guess it just seems odd to be learning one's first
language in order to move straight into system administration. I'm sure
glad my sysadmin had a few languages and a lot of understanding under
his belt, before he started taking care of my machine :-)
Damian
------------------------------
Date: 09 Nov 1999 23:41:04 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: perl as first language?
Message-Id: <x7k8nryn4v.fsf@home.sysarch.com>
>>>>> "DC" == Damian Conway <damian@cs.monash.edu.au> writes:
DC> That's right - throw the excellence of my own book back in my face! ;-)
yeah, that's the ticket. bash him over the head with a case of OOP's! :-)
DC> Of course, I'm coming from the point of view of someone who daily
DC> struggles to teach large classes (300+) of absolute novices how to
DC> program. I have ceased to be astounded at how easily subtleties of
DC> syntax and semantics can hopelessly befuddle them.
yoiks!! have you looked at using elements of programming in perl
(published by manning who you know and love)? i am just getting into it
and the first chapters are aimed at those newbies. looking back on my
early computer education, i groked stuff quickly but i recall (in high
school) being confused by pl/i using () for both arrays and sub
calls. once i got past that, the rest of my career was easy. every
newbie has their own programming mental block that has to be
cracked. unfortunately there are hundreds of potential traps that we all
know and love.
DC> McIver, L and Conway, D.M., "Grail: A Zeroth Programming Language",
DC> Proc. International Conference on Computers in Education '99.
DC> in which we describe a minimalist introductory language that avoids
DC> most of the problems of syntactic and semantic "ropiness".
on the web anywhere? better (i hope and pray) than (pick one) pascal,
lisp, algol, c, pl/1 java, c++? all have been chosen by foolish
educators as first languages.
DC> You may be right. I guess it just seems odd to be learning one's first
DC> language in order to move straight into system administration. I'm sure
DC> glad my sysadmin had a few languages and a lot of understanding under
DC> his belt, before he started taking care of my machine :-)
before perl, all decent sysadmins used shell, sed, awk, unix utils,
etc. and cobbled together many useful scripts. i don't ever want to go
back to those bad old days. any sysadmin doing major shell stuff today
should be force to work on nt for the rest of their lives.
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: 9 Nov 1999 22:54:07 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: perl as first language?
Message-Id: <slrn82huq8.6es.abigail@alexandra.delanet.com>
Jean-Louis Leroy (jll@skynet.be) wrote on MMCCLXI September MCMXCIII in
<URL:news:m3so2fz3l9.fsf@enterprise.newedgeconcept>:
"" > I disagree with Perl, for the same reason I don't recommend C. It's way
"" > too messy and there's too much rope. That's great for someone who knows
"" > what they are doing, but not good for someone who doesn't. First learn
"" > to program, then you know how to exploit the mess and ropes of Perl
"" > and C.
""
"" The ropes don't need to be used. Nor boasted about.
That's not the point. Knowing how to avoid the ropes is difficult.
Witness this very group.
"" Let this sink in. He did not know about open(), yet he had done
"" significant work in Perl.
""
"" Thinking about it, I suppose he doesn't know about $_, regexes, $1,
"" local (but he knows about my all right), etc.
""
"" AND (I say again) YET HE HAS CODED COMPLICATED, SIGNIFICANT PARTS OF
"" OUR APP. IN PERL!
That isn't the same as knowing how to program.
I think this group shows clearly Perl is not a suitable first language.
Abigail
--
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
|perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
|perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
|perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 9 Nov 1999 23:00:17 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: perl as first language?
Message-Id: <slrn82hv5q.6es.abigail@alexandra.delanet.com>
Martien Verbruggen (mgjv@comdyn.com.au) wrote on MMCCLXII September
MCMXCIII in <URL:news:uh4W3.164$Y86.3863@nsw.nnrp.telstra.net>:
!! On 9 Nov 1999 19:04:29 GMT,
!! Damian Conway <damian@cs.monash.edu.au> wrote:
!! > abigail@delanet.com (Abigail) writes:
!! >
!! > >I disagree with Perl, for the same reason I don't recommend C. It's way
!! > >too messy and there's too much rope. That's great for someone who knows
!! > >what they are doing, but not good for someone who doesn't. First learn
!! > >to program, then you know how to exploit the mess and ropes of Perl and C.
!! >
!! > Amen, sibling!
!!
!! But, Damian, your own book (OO Perl) shows some pretty good examples
!! of how decent code can be written in Perl. It also explains a few of
!! the dangers in the same, but that just comes back to learning things
!! from a good source, instead of just diving in.
The ability to write decent code in a language isn't the same as the
language being suitable as a first language. With that argument, any
language would either be suitable as a first language, or it would
be impossible to write decent code in it.
!! Don't misunderstand me; I've already agreed that for educational
!! puproses and general programming other languages than the ropey ones
!! are more applicable. But I maintain that for sysadmin tasks it will
!! probably be a waste of time to learn a heavily structured language
!! first; because after that you will want to apply it to your day to day
!! administration task, and you'll find out that you can't do bugger all.
!! Or if you can do it at all, it looks and feels totally alien to the
!! language at hand.
Which leads to flocks of system administrators who can't program anything
beyond a 3 line csh script. I've seen and worked with them. They tend
to be promoted to managers.
Abigail
--
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 9 Nov 1999 23:50:35 -0500
From: "Brian Landers" <bcl914@bellsouth.net>
Subject: PERLHUMOR: self-printing resume
Message-Id: <mN6W3.5289$l23.18795@news1.atl>
I was bored, and working on a new resume for some perl jobs I'm trying for,
and I decided "why not do my resume IN perl?" You can read it or execute it.
la la la,
Brian
#!/usr/bin/perl
# --------------------------------------------------------------
my( $name ) = "BRIAN CLAY LANDERS, MCP";
my( %addr ) = (
POSTAL => 'xxx Collier Road #xxxx' .
'Atlanta GA 30318',
HOME => '404-xxx-xxxx',
CELL => '678-xxx-xxxx',
EMAIL => 'brian@bluecoat93.org',
WEB => 'http://www.bluecoat93.org'
);
# --------------------------------------------------------------
my( $skills ) = q(
Perl application design CGI programming
DBI database access Linux
mod_perl Apache
object-oriented & data structures Solaris
web server admin Netscape Enterprise
UNIX install, config, admin Oracle
TCP/IP, switching, routers Cisco IOS
);
# --------------------------------------------------------------
my( %work );
$work{ "1. SAPIENT CORPORATION" } = {
SUMMARY => q( IT Manager
Sapient Corporation/Studio Archetype
Atlanta, GA
),
DATES => [ "June 1998", "Present" ],
NOTE => "Studio Archetype was acquired by Sapient Corporation"
};
$work{ "2. STUDIO ARCHETYPE" } = {
SUMMARY => q( Web Developer
Studio Archetype
Atlanta, GA
),
DATES => [ "January 1998", "June 1998" ]
};
$work{ "3. MAXWEB" } = {
SUMMARY => q( Lead Programmer
MaxWeb, LLC
Lexington, KY
),
DATES => [ "December 1996", "December 1997" ]
};
# --------------------------------------------------------------
my( $education ) = q{
University of Kentucky
Lexington KY
Two years (4 semesters) Computer Science
Emphasis on C and C++ programming in a UNIX environment
};
# --------------------------------------------------------------
my( $references ) = q{
Joanna Schull - Director of IT & Operations
Atrieva Corporation
San Francisco, CA
(Formerly Corporate IT Manager, Sapient Corporation)
xxx-xxx-xxxx home
xxx-xxx-xxxx cell
xxxx@xxxx.net
Paul Stamps - Creative Director
MaxWeb, LLC
Lexington, KY
606-xxxxxxxx work
xxxx@xxxx.com
};
# --------------------------------------------------------------
# END OF RESUME - The following Perl is deliberately compacted
# for space, and is not written for clarity.
#
# You can run this resume using Perl to make it display itself.
# --------------------------------------------------------------
print "$name\n\n";
foreach(keys %addr)
{$a=lc($_);$a=~s/\b(.)/\U$1/g;print "$a\t$addr{$_}\n\n";};
print "\nWORK EXPERIENCE\n\n";
foreach(sort keys %work){
$a=lc($_);$a=~s/^\d\. file://g;$a=~s/\b(.)/\U$1/g;
chomp($work{$_}->{SUMMARY});$work{$_}->{SUMMARY}=~s/^\s*//mg;
print "$a\n",$work{$_}->{SUMMARY},join(" -
",@{$work{$_}->{DATES}}),"\n\n";
}
print "\n\nSKILLS\n";
foreach( (split(/ {2,}/,$skills))){chomp;print "$_\n";}
print "\n\n",join("\n",(EDUCATION,$education,REFERENCES,$references));
------------------------------
Date: Tue, 09 Nov 1999 00:19:41 +0800
From: mozo <mozo@wahoo.com.tw>
Subject: PerlQt and Paw
Message-Id: <3826F81D.9F07A290@wahoo.com.tw>
We got an idea trying to write an integrated interface for UI
development.
(under console and Xwindow graphic modes at the same time). We choose
PerlQt ( X )and Paw ( curses ) for basic perl modules, hope to offer
useful
common functions for programmers to write perl code once, and run on
both X and console text mode.
We use something like these to determine Qt or Paw to be used:
if (defined $ENV{DISPLAY}){
use Qt 2.00;
use Qt::app;
}else{
use Paw;
use Paw::Window;
...
}
But soon we discover that we can't use PerlQt and Paw modules at the
same
time. The problem is:
When the module determined that it is in console mode, we hope the code
will branch
to use Paw modules and do terminal initialization, but since the use
statements
run on "compile-time", the Qt modules seem to be included actually, and
cause the error :
"cannot connect to X server"
Later we change the "use" to "require", now the program seem to run
successfully in
console, but another error occur in X:
QPaintDevice: Must construct a QApplication before a QPaintDevice
Aborted (core dumped)
how can I solve this?
------------------------------
Date: Tue, 09 Nov 1999 23:51:33 -0500
From: Uriel Innocent & Sweet Angel <uriel443nospam@mindspring.com>
Subject: Re: Perlshop
Message-Id: <hvkoOP3YH=lUw0hl2y2JyojVucWv@4ax.com>
Transmission error #3 - Action is incorrect.
FIX:
correct HTML so that the 'ACTION' field is 'ENTER', the submit button
can be named 'dummy' and given the value of the text to appear on the
button.
Found on this page:
http://faq.web2010.com/perlshop_fixes.htm
On Tue, 26 Oct 1999 20:13:24 -0400, Arnold Goldman
<arnold@monstermakers.com> wrote:
>Hello:
>
>Wondering if my might be able to draw on the collective wisdom of this
>newsgroup. I have had PerlShop running on my website flawlessless for
>many months when all the sudden it reports, " Invalid Transmission #3
>received from: 207.86.135.21 If your connection was interrupted, you
>must Enter the shop from the beginning again." I have not touched the
>script in any way. Does anyone know what causes this problem? What could
>change at the server that might result in this error? This happened to
>me once before and in both cases the server would not own up to the
>problem and in the first instanced it miraculously fixed itself after
>two weeks of bitching and moaning. The would not tell me what they did
>to fix things. If anyone cares to see, the page is at
>http://216.22.158.174/cgi-bin/monstershop/catalog/index.html
>
>Any thoughts would be greatly appreciated.
>
>arnold@monstermakers.com
Sir Uriel... The Good Hearted Dark Angel
official porch N'er Do Well
and Keeper of the Webring
and Owner of the Bionic Tongue
http://www.mindspring.com/~uriel443
Mama's gonna worry, I've been a bad, bad, boy
No use saying sorry, it's something that I enjoy.
------------------------------
Date: Tue, 9 Nov 1999 18:14:09 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Problem: MySQL, variable scope, references
Message-Id: <MPG.129274cc989da57598a1ca@nntp.hpl.hp.com>
In article <80agte$rt7$1@nnrp1.deja.com> on Wed, 10 Nov 1999 01:14:25
GMT, salvadorej@my-deja.com <salvadorej@my-deja.com> says...
...
> ############# transfer hashes that correspond to row matches
> ############# from the SELECT statement into @queryhashes
> my $i=0;
> while(%queryhash = $qh->FetchHash())
> {
> $queryhashes[$i]=\%queryhash;
> $i++;
> }
push() would be much nicer than all that indexing stuff.
> ############# return the whole mess
> return @queryhashes;
> }
A conjecture that it would take too long for me to test:
All the references to hashes that you are storing are to the same hash.
The contents of each one are overwriting the contents of the previous
one. When the null return comes back, it wipes out the last contents,
so they are all empty.
Try using this:
while(my %queryhash = $qh->FetchHash())
so now each hash will have its own storage.
And try using 'use strict;' in your code, all the time.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 10 Nov 1999 11:40:53 +0900
From: "ÀÌÁØÇõ" <pavane@netsgo.com>
Subject: radio button in HTML.......help
Message-Id: <sjENAPyK$GA.289@news3.netsgo.com>
Hello
I set three radio buttons in html...
How can I get the button status(check or not) in perl..?
like this..
in Html
< input type="button" name="trflag" value="1">
<input type="button" name="trflag" value="2">
<input type="button" name="trflag" value="3">
in Perl
$jD{$_}=$post->param($_);
if ($jD{'trflag'} er '3') { $jD{'trflag'}='Hi'; } else
if ($jD..........
It doesn't work...
help
------------------------------
Date: Tue, 9 Nov 1999 19:59:50 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: radio button in HTML.......help
Message-Id: <Pine.GSO.4.10.9911091958261.15797-100000@user2.teleport.com>
On Wed, 10 Nov 1999, =C0=CC=C1=D8=C7=F5 wrote:
> I set three radio buttons in html...
> How can I get the button status(check or not) in perl..?
Use the CGI module.
> if ($jD{'trflag'} er '3') { $jD{'trflag'}=3D'Hi'; } else
> if ($jD..........
>=20
> It doesn't work...
Of course not; check the perlop and perlsyn manpages for some operators
and syntax which may do what you want. A good book for beginners would not
be bad, either; see perlbook.
Cheers!
--=20
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 09 Nov 1999 22:18:24 -0600
From: Matt Schuette <schuette@umr.edu>
Subject: Re: regular expression help
Message-Id: <3828F210.686AE4C9@umr.edu>
Larry Rosler wrote:
> A good try. But it would "break" if the regex failed to match. Before
> using the results of a match, you should ensure that the match
> succeeded.
I guess I'm overly optimistic in that regard =)
> Also, 'all text' might include newlines, so the regex should deal with
> that via the /s modifier.
Again, I made an assumption about the string...
> Also (a minor point) capturing a result you don't need is wasteful.
>
> if ($string =~ /(?:[^.]*\.){6}(.*)/s) {
I never knew about the "?:" modifier... looks like it could be handy. Thank
you for correcting my mistakes!!
Matt
------------------------------
Date: Wed, 10 Nov 1999 02:10:28 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: unix perl v/s win perl
Message-Id: <ou4W3.175$Y86.3863@nsw.nnrp.telstra.net>
On Tue, 9 Nov 1999 12:43:58 -0400,
=®Pantera©= <panteranet@entelchile.net> wrote:
> Only one question..
> Is the win version of perl the same that the unix version?!??!
Same version
> what's the diference!??
The operating system, which is very important. www.activestate.com has
some gotchas somewhere in some FAQ about what's not available on the
various dos menu systems (aka Windows).
Martien
--
Martien Verbruggen |
Interactive Media Division | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd. | enough features yet.
NSW, Australia |
------------------------------
Date: Tue, 9 Nov 1999 18:31:29 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Variables in Strings and Substituting a Path Name
Message-Id: <MPG.129278ddc5f5664898a1cb@nntp.hpl.hp.com>
In article <80aguk$rtl$1@nnrp1.deja.com> on Wed, 10 Nov 1999 01:15:03
GMT, sneswhiz@my-deja.com <sneswhiz@my-deja.com> says...
> Can anyone help me with the following program?
> I've indicated what the program does, and what I
> want it to do.
Would that all posters were as thoughtful to do that as you are!
> $a = "f:\\web page stuff";
> $b = "f:\\web page stuff\\a\\b.html";
These things are so much easier to handle using single quotes:
$a = 'f:\web page stuff';
$b = 'f:\web page stuff\a\b.html';
One has to overcome the C meme that single-quotes represent characters
while double-quotes represent strings. In Perl, each represent strings.
> $c = "../";
>
> $b =~ s/$a\\//;
> print "$b\n";
> # should print a\b.html (plus newline)
> # instead prints f:\web page stuff\a\b.html
> # (plus newline)
What is happening here is that the interpolated string (which, remember,
has only one actual backslash where you have typed two) is being
interpolated as if \w was a word-character class. There are three
solutions to this problem:
1. Worst? Use four (4) backslashes to represent each one you want to
match against. Strangely enough, you would have to do this even using
single-quotes. (Why is left as an exercise.)
2. Better? Use quotemeta() on the string before interpolating it.
3. Best? Kill metacharacter interpretation in the regex:
$b =~ s/\Q$a\E\\//;
> $b =~ s/f:\\web page stuff\\//;
> print "$b\n";
> # should print (and does so) a\b.html
> #(plus newline)
Here, each doubled backslash becomes one literal backslash, so all is
well.
> print "$cabc.html\n";
> # should print ../abc.html (plus newline)
> # instead prints .html (plus newline) since
> # $cabc is undefined
How is Perl to determine that you wanted to interpolate $c instead of
$cabc? Here's how:
print "${c}abc.html\n";
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 10 Nov 1999 15:47:45 +1100
From: Peter <zed@linux.com>
Subject: XS routines & stack
Message-Id: <3828F8F1.A01191F9@linux.com>
Hi,
I'm having a little problem, and wondering if anyone has the
answer. I want to know what is a good way to return large
amounts of information from a XS routine?
Here is an example of what I'm doing now, but it's a real
stack basher: (replies to zed@linux.com please).
XS (XS_IRC_ignore_list)
{
struct ignore *ig;
GSList *list = ignore_list;
int i = 0;
dXSARGS;
items = 0;
while (list)
{
ig = (struct ignore *) list->data;
XST_mPV (i, ig->mask);
i++;
XST_mIV (i, ig->priv);
i++;
XST_mIV (i, ig->chan);
i++;
XST_mIV (i, ig->ctcp);
i++;
XST_mIV (i, ig->noti);
i++;
XST_mIV (i, ig->invi);
i++;
XST_mIV (i, ig->unignore);
i++;
XST_mPV (i, ":");
i++;
list = list->next;
}
XSRETURN (i);
}
--
Peter. <zed@linux.com>
------------------------------
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 1334
**************************************