[16080] in Perl-Users-Digest
Perl-Users Digest, Issue: 3492 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 27 14:10:44 2000
Date: Tue, 27 Jun 2000 11:10:23 -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: <962129423-v9-i3492@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 27 Jun 2000 Volume: 9 Number: 3492
Today's topics:
Re: Number of Unique Values <russ_jones@rac.ray.com>
Oracle minimum install for perl DBI on Linux <hellbunnie@irelands-web.ie>
Perl/cgi newbie questions <rickh@burgoyne.com>
Re: perl/Tk again...what widget called a function? <aqumsieh@hyperchip.com>
Re: Pricelist... How to ? <alan-silver@prestwich-smile-gemach.freeserve.furryferret.co.uk>
Redirect <cobroautomotive.msn@email.msn.com>
Re: Redirect <news@webneeds.com>
Re: regex - slurp file and extract email addresses <csorensen@uptimeresources.net>
Re: regex - slurp file and extract email addresses <csorensen@uptimeresources.net>
Re: regex - slurp file and extract email addresses (Bart Lateur)
Script cron problems gulgan@my-deja.com
Re: Simple regular expression question (Tad McClellan)
Re: Solution needed <tokyo@impcourt.org>
Re: Solution needed <cooljazz.nospam@flash.net>
Staus of Perl Compiler and other questions <andrew.mclaren@swx.ch>
Re: Staus of Perl Compiler and other questions <care227@attglobal.net>
Re: Syntax Question Not Found in Camel (Tad McClellan)
Re: Teen Volenteers WANTED (Bart Lateur)
Re: Unable to access an array from within a class (Bart Lateur)
Upgrading 5.6 to use 64 bit kfraney@my-deja.com
Re: Who's the man? You can be(ginner) (Bart Lateur)
Re: Who's the man? You can be(ginner) <aqumsieh@hyperchip.com>
Re: Who's the man? You can be(ginner) (Tad McClellan)
Re: Who's the man? You can be(ginner) (Randal L. Schwartz)
Win-95, perl, & almost any database <joel@cts.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 27 Jun 2000 11:22:52 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: Number of Unique Values
Message-Id: <3958D4DC.A4F7D155@rac.ray.com>
Abigail wrote:
>
> Gwyn Judd (tjla@guvfybir.qlaqaf.bet) wrote on MMCDXCII September MCMXCIII
> [] >%% What is the significance of this number? It (2492 September 1993)
> [] >%% doesn't make much sense to me.
> [] >
> [] >
> [] >You aren't the first to ask in this group. Nor the second or third.
> [] >Not even the tenth.
> []
> [] you mean it is in the FAQ?
>
> No. But it's on dejanews.
>
Now I get it! It's (yet another) excuse for Abigail to be rude to
people! Thanks, I just needed it to be explained to me.
Abby, if you don't want people to ask you why you're wearing clown
shoes, just don't wear them.
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
Quae narravi, nullo modo negabo. - Catullus
------------------------------
Date: Tue, 27 Jun 2000 17:24:24 GMT
From: Kathryn Cassidy <hellbunnie@irelands-web.ie>
Subject: Oracle minimum install for perl DBI on Linux
Message-Id: <3958E367.E18EB1A8@irelands-web.ie>
Hi all,
I'm trying to set up a linux machine so that I can access a remote
Oracle 8.0.5 server using DBD::Oracle. I don't want to have to install
all of oracle on my machine, but I can't seem to find any reliable
information about what files I need to copy over in order to get
DBD::Oracle to compile. Any info I could find was about Oracle 7 and
doesn't seem to apply. I've copied over just about all the files from
the machine
with Oracle installed on it, but I still can't get it to work.
I just get the following when I run perl Makefile.PL
The ORACLE_HOME environment variable must be set.
It must be set to hold the path to an Oracle installation directory
on this machine (or a compatible archtecture).
See the README.clients file for more information.
$ORACLE_HOME is set.
Has anyone done this before? Can you let me know what files you
required? Alternatively, does anyone know of a good website where I can
find this info?
Thanks,
Kathryn.
------------------------------
Date: Tue, 27 Jun 2000 11:44:33 -0600
From: rickh <rickh@burgoyne.com>
Subject: Perl/cgi newbie questions
Message-Id: <3958E801.AE4569BD@burgoyne.com>
I am trying to learn Perl/cgi on a caldera linux box. I have a sample
program that was copied from the MySQL & mSQL O'REILLY book. the sample
program is shown below.
#!/usr/bin/perl -w
print <<HTML;
Content-type: text /html\n\n
<HTML><HEAD><TITLE></title><head><BODY>
<p> Environment Variables
<p>
HTML
foreach (keys %ENV) {print "$_: $ENV{$_}<br>\n";}
Print <<HTML;
</body></html>
HTML
When I access this program through my web browser, I get an "internal
error. Looking at the error_log it would appear that the Print <<HTML
lines are the problem. the error message indicates that they are not
numeric and appearently the << is the numeric left shift operator.
Question is What was the Print <<HTML line supposed to do?
Regards
Rick
------------------------------
Date: Tue, 27 Jun 2000 15:24:01 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: perl/Tk again...what widget called a function?
Message-Id: <7aem5jdu5p.fsf@merlin.hyperchip.com>
Aaron <alager@csuchico.edu> writes:
> I read it once before, but I can't locate it again now when I need to
> know how to do it. Within a generic function, how do I know what widget
> called the function?
What do you mean by a "generic function"?
What do you mean by "what widget called the function"?
How does a widget call a function?
Perhaps you mean a method call, something like:
$widget->method();
In this case, the first argument to method() is a reference to the
widget itself.
sub method {
my $widget = shift;
...
}
But this assumes that you have access to the internals of the widget,
which is very possible, but is not recommended unless you know what you
are doing.
Your question is not clear. Show us your code, and what you are trying
to achieve, and we'll help you further.
--Ala
PS. You might want to post Perl/Tk related questions to
comp.lang.perl.tk instead.
------------------------------
Date: Tue, 27 Jun 2000 15:57:41 +0100
From: Alan Silver <alan-silver@prestwich-smile-gemach.freeserve.furryferret.co.uk>
Subject: Re: Pricelist... How to ?
Message-Id: <cbnlc0AlDMW5EwPm@prestwich-smile-gemach.freeserve.co.uk>
In article <Xk_55.1031$WU.9868@nntp1.chello.se>, Martin Jörgensen
<major@chello.se> writes
>I am currently working on a site which will contain prices from lots of
>computer hardware resellers worldwide. I therefore need an easy way to keep
>the prices on the site updated.
>
>What I need is this:
>- The resellers should be able to edit their own prices (or better, a script
>that reads from their page automatically)
The former is easy. Have a log-in feature on a non-public web page. The
resellers can log in and you only display their records. They can add,
modify and delete records.
>- I want a top 10 of the prices, meaning the 10 cheapest.
A simple SQL statement will do this ...
Select top 10 productid, price from pricelist order by price desc
>- I want to do the whole database searchable.
Depends what you mean. Database are by their very nature searchable. SQL
statements will extract the required information (see the previous
comment for an example). What you want can certainly be done, but you
need to supply more info before we can give a detailed answer.
>
>Are there any scripts out there which will do this (or some of it) ? And
>which language will do the better job ?
There's no best or absolutes. Most languages will handle this easily. I
favour ASP as it's fast and very easy. ASP has strong database support
built in from the bottom, and if you program in VBScript it's very
simple[1]. There are huge numbers of samples and examples awaiting you,
so you'll have no problem learning it.
Hope this helps
[1] I'm not saying that other languages won't be easy, but VBScript is
about the easiest language I've ever learnt and it comes built-in with
ASP.
P.S. Please be a little more careful about which newsgroups you post to.
This question is not relevant to ASP components, and having posted in a
Java database group, it's pointless posting to a general Java group as
well. Follow-ups set.
--
Alan Silver
Please remove the "furryferret" if replying by e-mail
------------------------------
Date: Tue, 27 Jun 2000 12:07:19 -0400
From: "Gary Cohen" <cobroautomotive.msn@email.msn.com>
Subject: Redirect
Message-Id: <OCCAOFF4$GA.281@cpmsnbbsa07>
I am trying to use a Perl script for CGI Programming.
The idea is that the user (using an HTML form) logs in on one page, and then
a perl script will validate the login and then redirect the user to either a
valid or invalid login page. I would rather use an ASP page to display valid
info but how do I get perl to redirect me to that ASP Page?
I tried this:
print redirect(-location=>"http://location/index.asp" ,-nph=>1);
But I get an error 302 saying Location has moved or something. I tried it
with other internet pages and it didnt work still. What is up with this? The
Perl script works except for this.
Gary
------------------------------
Date: Tue, 27 Jun 2000 11:28:59 -0600
From: "Dan Manion" <news@webneeds.com>
Subject: Re: Redirect
Message-Id: <cA565.27$%%5.1572@news.uswest.net>
Umm if that is the actual line of code from the program you're writing I'll
have about as much success showing you you're error as I helping you find
the "any" key on your keyboard =)
Let see if this makes sense.
my $link_i_want_to_redirect_to = "www.thisisabigoldtest.com/page.asp";
print redirect(-location=>$link_i_want_to_redirect_to,-nph=>1);
If you leave location as the link you are going to it will try to bounce the
users browser to http://location which will of course die. Hope this helps!
"Gary Cohen" <cobroautomotive.msn@email.msn.com> wrote in message
news:OCCAOFF4$GA.281@cpmsnbbsa07...
> I am trying to use a Perl script for CGI Programming.
>
> The idea is that the user (using an HTML form) logs in on one page, and
then
> a perl script will validate the login and then redirect the user to either
a
> valid or invalid login page. I would rather use an ASP page to display
valid
> info but how do I get perl to redirect me to that ASP Page?
>
> I tried this:
>
> print redirect(-location=>"http://location/index.asp" ,-nph=>1);
>
> But I get an error 302 saying Location has moved or something. I tried it
> with other internet pages and it didnt work still. What is up with this?
The
> Perl script works except for this.
>
> Gary
>
>
------------------------------
Date: 27 Jun 2000 12:34:36 EDT
From: Chris Sorensen <csorensen@uptimeresources.net>
Subject: Re: regex - slurp file and extract email addresses
Message-Id: <3958D78B.D642A955@uptimeresources.net>
I realize that the whitespace/something/@/something/whitespace
expression isn't ideal .. but (and forgive me if I'm just too dense to
get it) it seems like it would catch most email addresses .. and
probably suffice for this specific task.
I'm not arguing that there aren't better (more thorough) ways to search
for email addresses, but if I can't even write an expression this basic,
HOW will I write a more complex expression. (whew .. that was a long
sentence!)
My goal is to learn how to write this simple expression .. then keep
expanding on it until I have what I need.
Tom Phoenix wrote:
>
> On 26 Jun 2000, Chris Sorensen wrote:
>
> > If I don't ask .. how will I lean the syntax of regular expressions ..
>
> No one is saying that you're not allowed to ask. But what you're trying to
> do can't be done with simple patterns.
>
> > I haven't seen an email address that looks like this joe
> > blow@something.net ... there's usually an _ between the joe and blow
>
> How about this one:
>
> <"fred and barney"@redcat.com>
>
> Okay, now you _have_ seen a valid e-mail address with a space in it. :-)
>
> Now, if you still want to find out the format of e-mail addresses, you can
> read RFC-822.
>
> Cheers!
>
> --
> Tom Phoenix Perl Training and Hacking Esperanto
> Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 27 Jun 2000 12:41:09 EDT
From: Chris Sorensen <csorensen@uptimeresources.net>
Subject: Re: regex - slurp file and extract email addresses
Message-Id: <3958D914.9B93A363@uptimeresources.net>
thank you .. now there are two books I need to pickup today :p
Mastering Regular Expressions and the Perl Cookbook
Drew Simonis wrote:
>
> Chris Sorensen wrote:
> >
> > If I don't ask .. how will I lean the syntax of regular expressions .. I
> > keep checking all the books I have (camel, llama, pocketbook) and I'm
> > having a hard time understanding how to correctly describe an email
> > address .. so I asked a question
> >
>
> Mastering Regular Expressions. Its the Owl book (the Hip Owl? heh)
>
> In fact, the book ends with an example regualr expression to match
> an email address. Its a 16,000+ byte regular expression. Just shows
> the scope of such a match when you want to get an email address "from
> the wild".
>
> That book is tops on my chart, and one I'm really enjoying reading.
> It has an entire (huge) chapter on regular expressions with Perl, well
> worth the investment.
------------------------------
Date: Tue, 27 Jun 2000 16:35:17 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: regex - slurp file and extract email addresses
Message-Id: <395cd733.31028890@news.skynet.be>
Thomas Plehn wrote:
>If something like
>
>Name Address fred and barney@something.com hompage-url
>
>is possible, you can't get the valid email-address "fred and
>barney@something.com" from an normal line of text seperated by spaces.
Spaces ARE allowed, but only if that phrase is between quotes.
"fred and barney"@something.com
is legal, AFAIK.
>Even MSOutlook assumes that email-addresses contain no spaces to mark them
>blue in an email-text.
You don't tkae MSOutlook as THE reference, do you? If Microsoft fails to
correctly understand a 20 year oldstandard, it only proves how
incompetent they are.
--
Bart.
------------------------------
Date: Tue, 27 Jun 2000 16:26:01 GMT
From: gulgan@my-deja.com
Subject: Script cron problems
Message-Id: <8jakhv$h33$1@nnrp1.deja.com>
I have croned a script as root (let's not get into the discussion as to
why it's a long sotry) and it doesn't seem to be running with root
permissions. It runs fine at command line but it fails when trying to
run via cron. Any ideas?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 27 Jun 2000 09:58:50 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Simple regular expression question
Message-Id: <slrn8lhcoq.9n6.tadmc@magna.metronet.com>
On Tue, 27 Jun 2000 07:55:26 GMT, jason <elephant@squirrelgroup.com> wrote:
>Kenny Lim writes ..
>>ie.
>>
>>(m/{([\w]{8})+\-([\w]{4})+\-([\w]{4})+\-([\w]{4})+\-([\w]{12})}|{([\w]{8})+\
>>-([\w]{4})+\-([\w]{4})+\-([\w]{4})+\-([\w]{12})}/ig)
>the pipe character (|) is a special character in Perl's regex (and most
>regexes) .. so it needs to be escaped
And conversely, hyphen is *not* a special character, so you
shouldn't hide them behind backslashes.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 27 Jun 2000 10:17:59 -0700
From: Tokyo Rose Butler <tokyo@impcourt.org>
Subject: Re: Solution needed
Message-Id: <3958E1C7.F5BC1513@impcourt.org>
Hi Drew,
Actually, we're not using anything right now. At this point, I'm just
updating all the information they submit monthly. However my new job doesn't
allow me to do this. I'm not looking for a programmer, I was hoping someone
would know of a script that was already available, that would be customizable
for something like what we need. I am not a programmer but I have customized
a few scripts for other non-profits that I volunteer with. I'm looking for
some suggestions that may help save me some time and help this group as well.
I've looked into using databases but don't honestly know much about them. I
need to be able to allow each chapter to update only their own information,
as such each chapter must be allowed to have their own password. Does that
make sense? As I mentioned, I'm just a volunteer and know so much, and was
hoping for some direction here.
Thanks for your help, I really truly do appreciate it.
KW
Drew Simonis wrote:
> Tokyo Rose Butler wrote:
> >
> > Hello there,
> >
> > I work with a non-profit organization and we're looking for a solution
> > to one of our problems. Our web site lists our board members and our
> > chapter's individual information. We're looking for a way to allow each
> > of our board members and our chapters to update their own information by
> > just filling in a form.
>
> I wrote something exactly like that. Its really quite trivial,
> assuming that you are storing their information in a database.
> A bit more bothersome if you have to edit HTML on the fly, but
> not very hard.
>
> Why not post what you've tried so far and I'm sure many will be
> glad to assist. (You did not that this isn't a place to solicit
> programers, didn't you? This is a technical newsgroup, not the
> monster board)
------------------------------
Date: Tue, 27 Jun 2000 17:38:53 GMT
From: "Cooljazz" <cooljazz.nospam@flash.net>
Subject: Re: Solution needed
Message-Id: <NE565.55$7%3.6151@news.flash.net>
I, too, would be interested in a similar script. I would like to be able to
have people enter names and addresses into a form and have them update on a
page "address.html." Drew, if you'd be willing to post your script, you'd
make at least two people very happy.
Regards,
Jonathan
Tokyo Rose Butler <tokyo@impcourt.org> wrote in message
news:3958E1C7.F5BC1513@impcourt.org...
> Hi Drew,
>
> Actually, we're not using anything right now. At this point, I'm just
> updating all the information they submit monthly. However my new job
doesn't
> allow me to do this. I'm not looking for a programmer, I was hoping
someone
> would know of a script that was already available, that would be
customizable
> for something like what we need. I am not a programmer but I have
customized
> a few scripts for other non-profits that I volunteer with. I'm looking
for
> some suggestions that may help save me some time and help this group as
well.
>
> I've looked into using databases but don't honestly know much about them.
I
> need to be able to allow each chapter to update only their own
information,
> as such each chapter must be allowed to have their own password. Does
that
> make sense? As I mentioned, I'm just a volunteer and know so much, and
was
> hoping for some direction here.
>
> Thanks for your help, I really truly do appreciate it.
>
> KW
>
> Drew Simonis wrote:
>
> > Tokyo Rose Butler wrote:
> > >
> > > Hello there,
> > >
> > > I work with a non-profit organization and we're looking for a solution
> > > to one of our problems. Our web site lists our board members and our
> > > chapter's individual information. We're looking for a way to allow
each
> > > of our board members and our chapters to update their own information
by
> > > just filling in a form.
> >
> > I wrote something exactly like that. Its really quite trivial,
> > assuming that you are storing their information in a database.
> > A bit more bothersome if you have to edit HTML on the fly, but
> > not very hard.
> >
> > Why not post what you've tried so far and I'm sure many will be
> > glad to assist. (You did not that this isn't a place to solicit
> > programers, didn't you? This is a technical newsgroup, not the
> > monster board)
>
------------------------------
Date: Tue, 27 Jun 2000 14:55:27 GMT
From: aml <andrew.mclaren@swx.ch>
Subject: Staus of Perl Compiler and other questions
Message-Id: <8jaf8l$ch3$1@nnrp1.deja.com>
I've been trying to determine the status of the Perl -> C compiler, but
am a bit confused about what it currently is. The man pages accessed
via perl.com still flag the B:: module as 'experimental', and in the
full module list this has an Alpha/Beta test status. However, it is
released as a core module, the manpage for the perlcc frontend implies
everything is OK, and it even made it into the Perl in a Nutshell book
published early in 1999. Am I simply seeing some out of date references?
While on this, I've tried running it, and get a couple of messages I
don't understand, and haven't been able to find any documentation about.
<class> has method new: - -u<class> assumed
I imagine that it is guessing that the class has an object constructor,
and is flagging some option because of that. I have a lot of other
classes whose constructors are not 'new' - should I be doing something
special with these?
and lots of messages of the form...
No definition for sub Fcntl::F_SETOWN (unable to autoload)
Do I need to do anything with these?
Thanks and regards
Andrew
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 27 Jun 2000 11:21:46 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Staus of Perl Compiler and other questions
Message-Id: <3958C68A.B76CDA7C@attglobal.net>
aml wrote:
>
> I've been trying to determine the status of the Perl -> C compiler, but
> am a bit confused about what it currently is. The man pages accessed
> via perl.com still flag the B:: module as 'experimental', and in the
> full module list this has an Alpha/Beta test status. However, it is
> released as a core module, the manpage for the perlcc frontend implies
> everything is OK, and it even made it into the Perl in a Nutshell book
> published early in 1999. Am I simply seeing some out of date references?
From what I've read, look for coverage of the perlcc and friends in
the next edition of Programming Perl.
From the beta sample chapter on the ORA website, I read this:
::The standard but currently experimental perlcc(1) command knows how
::to convert Perl source code into a byte-compiled Perl program. All
::you have to do is: (...)
Check out: http://www.oreilly.com/catalog/pperl3/ for more detail.
------------------------------
Date: Tue, 27 Jun 2000 11:06:06 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Syntax Question Not Found in Camel
Message-Id: <slrn8lhgmu.9r6.tadmc@magna.metronet.com>
On Tue, 27 Jun 2000 08:30:02 -0500, spurcell <skpurcell@hotmail.com> wrote:
>Subject: Syntax Question Not Found in Camel
^^^^^
>I was reading Andrew Johnstons book "Effective Perl Programming" last night,
^ ^^
^ ^^
You should probably wait until the effects of the psychedelics
wear off before posting to Usenet, heh, heh.
You seem to be referring to 3 (or is it 2?) *different* books
as if they were the same book.
I do not know of any Perl book authored by "Andrew Johnstons",
or even by "Andrew Johnston's".
1) "Programming Perl" (aka "Camel"), Wall, Christiansen, Schwartz
2) "Effective Perl Programming", Joseph Hall
3) "Elements of Programming with Perl", Andrew Johnson
>$dir ||= './';
When you have a question about PERL OPerators, you should type:
perldoc perlop
See the "Assignment Operators" section.
>I have never ran into the or equal operator. Can someone help explain what
>that does?
The answer is already on your hard drive. Why should we
explain it again? Is the explanation given there unclear?
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 27 Jun 2000 16:25:25 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Teen Volenteers WANTED
Message-Id: <395bd538.30522481@news.skynet.be>
Craig Berry wrote:
>: '' Do you know c-c++, HTML, JAVA, JAVASCRIPT, xml or any other computer
>: '' languages?
>: '' Are you a teenager?
>: '' Are you a web guru?
>: '' Wanna get recognition?
>:
>: Translated: want to work hard for no pay?
>
>Hey, beats working hard for little pay at McDonald's. Dan ought to invest
>in a spell-checker, though.
Hey? Do you know of a spell checker that is aware of the fact that XML
and HTML are not computer languages?
--
Bart.
------------------------------
Date: Tue, 27 Jun 2000 16:24:50 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Unable to access an array from within a class
Message-Id: <395ad43d.30271694@news.skynet.be>
Abe Timmerman wrote:
>> : bless {
>> : "arrayRef" => @array
>Nope, an array in scalar context will return it's length. So
>$obj->{arrayRef} will only hold the length of the array it was supposed
>to be a reference to.
This isn't scalar context.
@array = (1, 2, 3);
%hash = ( item => @array );
print join(", ", %hash), "\n";
-->
2, 3, item, 1
--
Bart.
------------------------------
Date: Tue, 27 Jun 2000 17:06:19 GMT
From: kfraney@my-deja.com
Subject: Upgrading 5.6 to use 64 bit
Message-Id: <8jamtr$j4u$1@nnrp1.deja.com>
I recently upgaded to perl5.6, but I am not sure if I am using the 64
bit capablility. I installed using the defaults, so I don't think I am.
How do I upgrade to use 64 bit capablility with out uninstalling /
reinstalling?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 27 Jun 2000 15:23:26 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Who's the man? You can be(ginner)
Message-Id: <395dc6af.26801203@news.skynet.be>
Tony Curtis wrote:
> my $addr = 'tony.curtis@erewhon.com';
> my ($localpart) = split /@/, $addr, 2;
Now there's a useless 3rd parameter.
If you worry about optimization and avoiding useless splitting, well,
perl will do it for you.
--
Bart.
------------------------------
Date: Tue, 27 Jun 2000 15:55:42 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Who's the man? You can be(ginner)
Message-Id: <7abt0ndsow.fsf@merlin.hyperchip.com>
Aaron <alager@csuchico.edu> writes:
> while <STDIN> {
This can be abbreviated to:
while <> {
> $full_name=split /\@/;
You didn't test this did you?
This doesn't return what you expect. You are getting the result of
split() in a scalar context, which returns the number of element split()
returns. Also, -w would have told you so.
Moreover, you don't need to escape the @.
> ($f_name, $l_name) = split /\./, $full_name;
> $proper_name = \U$f_name . ' ' . \U$l_name;
Why not use uc() instead of \U? \U uppercases everything until \E or the
end of the string. You don't have any \E's.
> print "$proper_name\n";
> }
> it uses a lot of variables but it's clear as to what it is doing.
And it doesn't produce the correct output.
Please test all your code snippets before posting to the
newsgroup. Wrong code will confuse newbies more than help them.
--Ala
------------------------------
Date: Tue, 27 Jun 2000 11:35:39 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Who's the man? You can be(ginner)
Message-Id: <slrn8lhieb.a9o.tadmc@magna.metronet.com>
On Tue, 27 Jun 2000 15:55:42 GMT, Ala Qumsieh <aqumsieh@hyperchip.com> wrote:
>
>Aaron <alager@csuchico.edu> writes:
>
>> while <STDIN> {
>
>This can be abbreviated to:
>
> while <> {
1) Neither of those win a golf contest for generating syntax errors
(which is what they both do :-)
2) <STDIN> and <> are not equivalent (generally).
They are equivalent only if @ARGV is empty (or contains hyphen).
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 27 Jun 2000 09:47:09 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Who's the man? You can be(ginner)
Message-Id: <m1wvjb2hrm.fsf@halfdome.holdit.com>
>>>>> "Tad" == Tad McClellan <tadmc@metronet.com> writes:
Tad> 2) <STDIN> and <> are not equivalent (generally).
Tad> They are equivalent only if @ARGV is empty (or contains hyphen).
And ARGV is not currently open.... :)
print "Just another Perl hacker,"
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: 27 Jun 2000 17:53:50 GMT
From: "Joel Fentin" <joel@cts.com>
Subject: Win-95, perl, & almost any database
Message-Id: <01bfe060$8340af80$754b5ecc@joel>
Windoz-95 is installed and working.
Perl 5.6.0 is installed and working.
MySQL is installed and working.
I have several mysql files.
I have several comma delimited files.
I have several Access files.
I have not been able to connect to any driver.
I can't get DBD-mysql to install.
I can't get ODBC to install.
I would like to be in contact with one who has suceeded on a win-32
machine.
--
joel at cts dot 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 3492
**************************************