[9505] in Perl-Users-Digest
Perl-Users Digest, Issue: 3099 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 8 18:07:21 1998
Date: Wed, 8 Jul 98 15:00:25 -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, 8 Jul 1998 Volume: 8 Number: 3099
Today's topics:
Re: -w on production code (was Re: better way of gettin (Greg Bacon)
Re: 2-byte code match problem <aas@sn.no>
Re: Abigail - Another Question for you. <dfsdf@ziplink.net>
Re: Bar and Line Charts in Perl fwong@loudoun.com
Choosing DBMS: friendly to Linux, Apache, Perl, Java gordo@pclink.com
Re: Do I understand this? <upsetter@ziplink.net>
Re: explaining the whys of referencing... WAS Re: on th <dgris@rand.dimensional.com>
Re: explaining the whys of referencing... WAS Re: on th (Larry Rosler)
fcntl - How do I call it with F_GETLK? <lrosen@alum.mit.edu>
Re: Form Data & cgi script help <maierc@chesco.com>
Re: HTML Tables in PERL from SQL query <maierc@chesco.com>
Re: manipulate /etc/passwd without expect ?? <aperrin@mcmahon.qal.berkeley.edu>
Re: Mix Perl and HTML? (Josh Kortbein)
Need slick code: How to CWD to executable's directory <chris@ixlabs.com>
Re: NEVER "call warn() and return undef" (Re: question <jdporter@min.net>
Re: NEVER "call warn() and return undef" (Re: question <jdporter@min.net>
Re: new charter and moderator for comp.lang.perl.announ <gnat@frii.com>
Re: Newbie Needs Help: Very Easy Seach <chad@tice.com>
Re: Oh man, DO I love Perl ! (References to things that (Abigail)
opendir and Novell 4.xx (was: How to get files in a dir <maierc@chesco.com>
Re: perl 5.004.04 on AIX 4.2.1 <Herve.Chibois@capway.com>
Re: Perl and OS/2??? (Ilya Zakharevich)
Re: Perl CGI and warnings [Was: Re: -w on production co (Larry Rosler)
Re: Perl CGI and warnings [Was: Re: -w on production co (Abigail)
Re: Perl CGI and warnings [Was: Re: -w on production co (Abigail)
Re: Searching a file <jdf@pobox.com>
Re: tough regexp - help needed otis@my-dejanews.com
Re: tough regexp - help needed otis@my-dejanews.com
Re: tough regexp - help needed (Abigail)
Re: tough regexp - help needed (Abigail)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 8 Jul 1998 21:42:28 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: -w on production code (was Re: better way of getting the last modified file?)
Message-Id: <6o0p44$61a$4@info.uah.edu>
In article <6o09g0$pj8$1@client3.news.psi.net>,
abigail@fnx.com (Abigail) writes:
: Unless you have formally proven your code to be correct, every invocation
: of your program is another testrun.
I shudder to think where that leaves perl. :-)
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: 08 Jul 1998 22:10:02 +0200
From: Gisle Aas <aas@sn.no>
Subject: Re: 2-byte code match problem
Message-Id: <m3af6kumsl.fsf@furu.g.aas.no>
abigail@fnx.com (Abigail) writes:
> UTF-8 is an encoding for UCS-2 and UCS-4. Currently, exactly 0 codepoints
> of UCS-4 which aren't part of UCS-2 have been assigned to.
>
> Which wider versions of Unicode are you referring to?
http://www.unicode.org/unicode/alloc/Pipeline.html
Characters and Scripts Accepted for Unicode:
00010200..00010227 Etruscan
00010230..0001024B Gothic
0001D103..0001D1D7 Western Musical Symbols
--
Gisle Aas
------------------------------
Date: Tue, 07 Jul 1998 17:43:27 -0400
From: Webcruiser <dfsdf@ziplink.net>
Subject: Re: Abigail - Another Question for you.
Message-Id: <35A2967F.1372@ziplink.net>
Please try to address these questions again. Also, now what is still
causing a leading white space to show up each time?
http://webcruiser.com/manager/mmadmin.htm
>
> What's the point of this? Have you any idea what
> @status="New";
> does?
No. Tell me what it does. All I want to do is start off the file with
the word "New". What is a better way?
> And
> $STATUS=@status[0];
> does something else than you think it does.
OK, what does this actually do?
>
> ++
> ++ Subroutine to get the status of a merchant:
> ++ sub getstatus {
> ++ $aidfile = "$filedirectory$AID.dta";
> ++ open(FILE,"<$aidfile");
> ++ @STATUS=<FILE>;
> ++ foreach (@STATUS) {s/^ //;} # Your suggested change.
> ++ $numlines=@STATUS; # my old routine to look for a leading
> ++ space.
> ++ for ($x=1; $x<$numlines; $x++){
> ++ if (substr($STATUS[$x],0,1) eq " "){
> ++ $STATUS[$x]=substr($STATUS[$x],1);
> ++ }
> ++ }
> ++ close FILE;
> ++ }
>
> Note that you read in the data into @STATUS, but you print out @status.
I know, but the print @status was only for the "Add Merchant"
subroutine. It has no coorelation to the rest of the program.
> There is of course no need for your for() after my foreach ().
I know. I will remove it.
>
> ++ Subroutine to send the updateed changes as made from the html form at
> ++ http://webcruiser.com/manager/mmadmin.htm
> ++
> ++ sub updatestatus {
> ++ $aidfile = "$filedirectory$AID.dta";
> ++ open(FILE,">$aidfile");
> ++ print FILE (@STATUS);
> ++ close FILE;
> ++ }
> ++
> ++ ----------------------------
> ++ Now, my question. What did you mean with these comments?
>
------------------------------
Date: Wed, 08 Jul 1998 21:37:31 GMT
From: fwong@loudoun.com
Subject: Re: Bar and Line Charts in Perl
Message-Id: <6o0oqr$9rt$1@nnrp1.dejanews.com>
In article <6nge9u$s5d29@alice.whitman.edu>,
kelly@whitman.edu (Kevin Kelly) wrote:
>
> I would like to make bar or line graphs that I can update daily and put on a
> web page. I know about the GD.pm module, but is there anything that will
> create a basic line or bar chart. I have been making these charts using
> Excel, but there is no way to automate the process.
>
> Kevin Kelly
> Systems/Operations Manager
> Whitman College
> kelly@whitman.edu
>
You could automate the Excel process by Recording an Excel macro that builds
the chart that you want, and then change the name of the macro to 'AutoOpen'
so it will execute the macro whenever the spreadsheet opens. Then you want
to run the "Save as HTML" option through code. See Microsoft technote
Q168561 for sample code to output everything including the graph to an HTML
file.
You'll need Excel 97 SR-1 to do this.
You could then kick-off Excel from perl with command-line arguments.
Francis Wong
Virtualogic
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Wed, 08 Jul 1998 21:43:09 GMT
From: gordo@pclink.com
Subject: Choosing DBMS: friendly to Linux, Apache, Perl, Java
Message-Id: <6o0p5d$a80$1@nnrp1.dejanews.com>
I know that this question probably doesn't have a simple answer, and in
fact I probably need lots of help just to formulate a better question,
and maybe I'm not asking in the right place, either.... Anyway, here
goes.
I am just in the process of setting up Apache 1.3 on a small Linux (home
office) server running RedHat 5.1. I need a database backend for Apache
and other uses, including Java and CORBA code and data repository. I
use Perl for most work so it's a plus if there already is a DBD module
out there for the database.
I would like to use Oracle because that's my normal working environment at
clients' but at $1000+ the cost is hard to justify, plus AFAIK Oracle doesn't
run on Linux (yet). So I'm looking for a less costly database that wouldn't
hamstring me if I eventually needed to move to a more capable system or even
to Oracle itself. And I must admit, I want the best one!:-) Am I just
kidding myself to think that such exists for Linux? There seems to be a
plethora of products out there.
Database need not be free of cost or licensing restrictions. Closer to
ANSI-92(?) is better and probably closer to Oracle 7.3 is even better though
I suppose that's a dream--until I started digging into this I didn't realize
just how proprietary much of Oracle's working and development environment is.
Thanks in advance for your opinions.
--
Gordon Pedersen 1412 Portland Ave
info systems design Saint Paul, Minnesota
gordo@pclink.com 55104, USA
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 8 Jul 1998 21:48:35 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Do I understand this?
Message-Id: <6o0pfj$40u@fridge.shore.net>
Tom Christiansen <tchrist@mox.perl.com> wrote:
: In comp.lang.perl.misc,
: geiger@cs.ucdavis.edu (Phillip George Geiger) writes:
: :I want to put some advertising banners on my web site.
: Gosh, that'll sure win you a lot of friends.
What planet do you live on?
--Art
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.ziplink.net/~upsetter/ska/calendar.html
--------------------------------------------------------------------------
------------------------------
Date: Wed, 08 Jul 1998 21:00:07 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: explaining the whys of referencing... WAS Re: on the fly subs with special tag markers
Message-Id: <6o0lp4$a56$1@rand.dimensional.com>
[posted to comp.lang.perl.misc and mailed to the cited author]
In article <MPG.100d4e2f1fbc74ac9896f3@nntp.hpl.hp.com>
lr@hpl.hp.com (Larry Rosler) wrote:
>Understanding and using references may be the boundary between novice
>and intermediate in Perl programming, like switching from snowplow turns
>to stem turns in skiing. Welcome to Middle School. :-)
Just curious, but where would you put your hypothetical division
between intermediate and advanced perl? Personally I'd say that
effective use of C<eval> and regular expressions separate the two,
but that's just my opinion :-).
Daniel
--
Daniel Grisinger dgris@perrin.dimensional.com
"No kings, no presidents, just a rough consensus and
running code."
Dave Clark
------------------------------
Date: Wed, 8 Jul 1998 14:34:55 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: explaining the whys of referencing... WAS Re: on the fly subs with special tag markers
Message-Id: <MPG.100d85d7d3756fe59896f8@nntp.hpl.hp.com>
In article <6o0lp4$a56$1@rand.dimensional.com> on Wed, 08 Jul 1998
21:00:07 GMT, Daniel Grisinger <dgris@rand.dimensional.com> says...
> In article <MPG.100d4e2f1fbc74ac9896f3@nntp.hpl.hp.com>
> lr@hpl.hp.com (Larry Rosler) wrote:
...
> >Understanding and using references may be the boundary between novice
> >and intermediate in Perl programming, like switching from snowplow turns
> >to stem turns in skiing. Welcome to Middle School. :-)
>
> Just curious, but where would you put your hypothetical division
> between intermediate and advanced perl? Personally I'd say that
> effective use of C<eval> and regular expressions separate the two,
> but that's just my opinion :-).
I use eval '...' and regexes effectively (for example, matching several
patterns specified at run time against a long list), and consider myself
an intermediate.
Perhaps the boundary is between Chapter 5 and Chapter 6 of the Panther.
I'm making at least some use of everything before then and *nothing*
after then. Of course, I may never make use of OOP, as I have yet to be
involved in a programming situation that benefits from it. I think I'm
stuck with Structured Programming forever.
Stem turns -> parallel turns; Middle School -> High School (continuing to
mix my analogies).
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 08 Jul 1998 15:49:44 -0400
From: "Larry P. Rosen" <lrosen@alum.mit.edu>
Subject: fcntl - How do I call it with F_GETLK?
Message-Id: <35A3CD58.7D4CD520@harp.gsfc.nasa.gov>
The perl fcntl() is just a wrapper to the c/unix
fcntl(). When you call the fcntl() in c/unix
with the F_GETLK, the 3rd argument is a pointer
to the flock data structure:
struct flock {
short l_type;
off_t l_start;
short l_whence;
off_t l_len;
pid_t l_pid;
};
The camel book says fcntl passes "a pointer to the
string value of SCALAR", where SCALAR is the third
argument to the function. I don't understand this
and don't understand how to use it. It also isn't
clear what the return value of fcntl will be when
a lock exists or when a lock doesn't exist.
Any help appreciated. Thanks.
Larry
------------------------------
Date: Wed, 08 Jul 1998 20:44:36 GMT
From: Charles Maier <maierc@chesco.com>
Subject: Re: Form Data & cgi script help
Message-Id: <35A20743.48A6@chesco.com>
clydeyboy@my-dejanews.com wrote:
>
> I have a form that people fill out which upon submit sends the data to a
> mailto cgi script. This script sends the form data via email to me and a
> carbon copy to the sender.
>
> The cgi script checks the required fields and makes sure data is entered into
> them. However, I would like this script to go one step further. I would
> like it to check a particular set of fields for duplicate entries.
>
> This set of fields will contain a single number (from 1-15). Each number
> should only be used once. There are 15 entry fields where these numbers will
> be entered. The method of entry is a drop down list with 1 being the
> default. The person using the form will pick one number for each field go to
> the next field and do the same until all of the 15 fields are filled out. I
> am trying to use perl to check these 15 fields for duplicates.
>
> One method I wanted to use is to have perl total the fields and compare the
> total to 120 (this is the amount they would add up to if each number was used
> only once). If this is true send a happy, you did it type message", if false
> send a try it again message.
>
> The hard part is figuring out how to get perl to reference the fields and
> realize they are really numbers and not words. I initially wrote a script
> using the form field names and perl did not add them up as numbers. The field
> names on the web form are CFpts01 for the first field and so on until
> CFpts15. Perl will not add these when I use them. I cannot tell it to add
> numbers because the numbers are determined by the person entering the form.
>
> I bought the Llama (Learning Perl 2nd edition) book and the Lizard (Perl for
> Win32 Systems) book. I must be a dingus because I cannot figure this out.
> As you can tell I am new at this and realize it is probably a simple solution
> for most perl people. Any help would be appreciated.
>
> Thanks
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
You do not tell us WHERE the variables are for PERL??? Do you store the
form variable in $variables?? in a %hash? in an @array?
You can't arithmetically ADD variable "names"... only the CONTENTS of
variables.
Typically.. form fields are put into a %hash. It is then a fairly simple
matter of summing them...... if that is what you need.
--
Chuck Maier
CDM Consulting Services
http://www.cdmcon.com
(610) 943-2726
------------------------------
Date: Wed, 08 Jul 1998 21:28:49 GMT
From: Charles Maier <maierc@chesco.com>
Subject: Re: HTML Tables in PERL from SQL query
Message-Id: <35A211A1.4E1F@chesco.com>
djgaus@nb.net wrote:
>
> I am pulling images & descriptions out of a SQL database through a query, row
> by row and placing them into a table which will be created on the fly with
> PERL. The cell properties will differ for each image & description. It will
> be a two columned table with multiple rows, most image/description cells will
> have colspans and rowspans of 1, however there are some which have colspans
> and/or rowspans of 2. I need a script which can take these on the fly and
> output them into a table. The problem is if an image comes up on the row
> first which has a colspan of 1, and the next one has a colspan of 2, I
> wouldn't want an 'empty' cell, I need to somehow hold this cell (in an array
> or list or something) till the next row. This would also apply for rowspans
> as well. I am sorry if I am not explaning this very well, basically I just
> want a dynamic 2 columned table which will consist of various rowspans &
> colspans, without any empty cells, which is being generated through an SQL
> query.
>
> Any help would be appreciated....
>
> Thanx,
> Jason L.
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
sounds like you need a program and/or a programmer. I am for hire ;o)
--
Chuck Maier
CDM Consulting Services
http://www.cdmcon.com
(610) 943-2726
------------------------------
Date: Wed, 08 Jul 1998 14:30:46 -0700
From: Andrew Perrin <aperrin@mcmahon.qal.berkeley.edu>
To: Chetan Ahuja <ahuja@argus.cem.msu.edu>
Subject: Re: manipulate /etc/passwd without expect ??
Message-Id: <35A3E505.A3520E36@mcmahon.qal.berkeley.edu>
Well, if all you want to do is manipulate /etc/passwd, yes, it's quite doable
-- i'd suggest taking a look at the /bin/passwd replacement in the 'Camel
book' and moving from there. If, however, you have any more complicated
problem (as we do: an NIS domain requiring password changing over an insecure
network), it's much more difficult. I'm happy to believe it's possible
without expect, but after spending far too much time trying we did the job
with expect in 2 hours.
Regards,
Andrew Perrin
UC Berkeley, Demography Department
Chetan Ahuja wrote:
> --
> Hi,
> The subject line says it all... (but I'll say it again anyway)
> Has anybody figured out a way to allow users to change their
> unix passwords through a perl script ( i.e. running as a cgi script).
> The idea of course is that mail users shouldn't need to learn how
> to use telnet (why not..?? but its not for me to ask) but be able to
> change their passwords through a web interface (what a cliche this phrase
> is turning out to be "through a web interface"). I am feeling too lazy to
> get Tcl/expect to work and then write a perl script to use expect and
> so on...
>
> I am aware of something called the htpasswd script written in perl
> which ( I think) changes the password to the http server.. can it
> be modified to change the unix password file... HAs anybody grappled with
> this problem before.?? Any help or pointers will be greately appreciated
>
> Thanks
> Chetan
>
> P.S. I'll appreciate it if you CC your reply to my email address also...
--
-----------------------------------------------------------------
Andrew J Perrin - aperrin@igc.apc.org - NT/Unix/Access Consulting
255 S Rengstorff Ave #130, Mountain View, California 94040 USA
Phone: 650-938-4740 | http://socrates.berkeley.edu/~aperrin
E-mail wheres-andy@socrates.berkeley.edu to find me.
SEIU1199---------------------------------------------------------
------------------------------
Date: 8 Jul 1998 19:50:42 GMT
From: kortbein@iastate.edu (Josh Kortbein)
Subject: Re: Mix Perl and HTML?
Message-Id: <6o0iii$er2$1@news.iastate.edu>
Mickey Coulter (mcoulter@tampabay.rr.com) wrote:
: Is there a product, besides Verigen ($$$) that allows mixed Perl & HTML on
: UNIX? I am aware of IISPerl for Win32 and like it a LOT. Would like
: something similarly priced for UNIX ;-)
I'm ignorant of the Windoze alternatives, so I'm not completely sure
what you're asking about, but you may want to investigage "server
side includes," which most good web servers should let you use.
They allow you to feed program-created HTML into a file when it's
requested, but before the users sees it.
Josh
--
__________________________________________
She had heard all about excluded middles;
they were bad shit, to be avoided.
- Thomas Pynchon
------------------------------
Date: Wed, 08 Jul 1998 14:31:42 -0700
From: Chris Schoenfeld <chris@ixlabs.com>
Subject: Need slick code: How to CWD to executable's directory
Message-Id: <35A3E53E.E1086266@ixlabs.com>
I have programs that need to cwd to the directory they live in, rather
than the user's cwd.
I usually just parse $0, but would like to know if there is a slicker,
less artistic way.
--
Thanks
Chris
------------------------------
Date: Wed, 08 Jul 1998 20:35:12 GMT
From: John Porter <jdporter@min.net>
Subject: Re: NEVER "call warn() and return undef" (Re: question about objects)
Message-Id: <35A3D9CB.7E0F@min.net>
Gisle Aas wrote:
>
> John Porter <jdporter@min.net> writes:
>
> > That's why Perl needs a robust exception mechanism --
> > as everyone will agree, I'm sure.
> I'm sure that not everyone will agree that Perl lack a robust
> exception mechanism today. What's un-robust with what we have?
I'm not sure you read what I wrote. I didn't say anything about
what perl has or doesn't have.
Even so, it seems that there is indeed some disagreement over
the robustness of perl's current exception mechanism.
--
John Porter
------------------------------
Date: Wed, 08 Jul 1998 20:37:36 GMT
From: John Porter <jdporter@min.net>
Subject: Re: NEVER "call warn() and return undef" (Re: question about objects)
Message-Id: <35A3DA5C.3C8F@min.net>
Mike Stok wrote:
>
> In article <35A37D98.2EFB@min.net>, John Porter <jdporter@min.net> wrote:
> >That's why Perl needs a robust exception mechanism -- as everyone will
> >agree, I'm sure.
>
> No. It depends what you use perl for and what you expect of it...
>
> You may be sure but I don't agree.
You are saying that Perl doesn't need a robust exception mechanism.
Is that what you mean?
If it had one, you wouldn't have to use it.
But if it didn't have one, you *couldn't* use it.
Which situation fits your philosophy better?
--
John Porter
------------------------------
Date: 08 Jul 1998 15:53:51 -0600
From: Nathan Torkington <gnat@frii.com>
Subject: Re: new charter and moderator for comp.lang.perl.announce
Message-Id: <5qk95o2emo.fsf@prometheus.frii.com>
cpierce1@cp500.fsic.ford.com (Clinton Pierce) writes:
> >Perl Journal, new modules, and commercial products that use Perl.
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> I'd like clarification on this part.
Glad to oblige.
> Our product contains 1% Perl code...may we advertize a new release on
> clpa?
Yes. If your product interfaces with Perl then you should be able to
post announcements of a new release to comp.lang.perl.announce. It's
not like there are thousands of programs that feature Perl. I hardly
imagine Microsoft rushing to add a "Save as Perl" option to all their
products simply so they can plug them in comp.lang.perl.announce.
comp.lang.perl.announce should be like a births, deaths, and marriages
for Perl. In the case of new releases, "births" includes
reincarnation, but I'm ecumenical enough to accept that. Not every
birth, death, or marriage is relevant to you personally, but each is
relevant to someone. You're not expected to read all the
announcements, merely scan (or automatically scan) for those that are
of interest.
Nat
------------------------------
Date: Wed, 8 Jul 1998 14:47:56 -0500
From: "Chad Hudson" <chad@tice.com>
Subject: Re: Newbie Needs Help: Very Easy Seach
Message-Id: <6o0igj$176$1@news.onramp.net>
Follow up
Forgot: Would also like the results to dispaly the description as well
So if search was "flag and US"
Results
F_USA.html Flag of the United States of America
Thanks
Chad
------------------------------
Date: 8 Jul 1998 21:38:58 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Oh man, DO I love Perl ! (References to things that go out of scope)
Message-Id: <6o0oti$13f$5@client3.news.psi.net>
Zenin (zenin@bawdycaste.org) wrote on MDCCLXXII September MCMXCIII in
<URL: news:899922517.608539@thrush.omix.com>:
++ Tom Christiansen <tchrist@mox.perl.com> wrote:
++ : All data should always be private. Totally. Once you start
++ : messing around with an objects internals and you are not that
++ : class, you have violated the abstraction. Don't do that.
++
++ I believe you where the first one I saw use the term, OOOP (Overly
++ Object Oriented Programming).
++
++ Abstraction is a good thing, when it has a purpose. Abstraction for
++ the sake of abstraction alone is often counterproductive. There is
++ a time and place for set/get methods, and a time and place for
++ direct public/protected field access. Chose the best tool and
++ design for the job at hand. Forcing the use of a particular methodology
++ without reguard for the task at hand isn't very Perlish.
I've worked on projects with thousands of objects (20k+ instances)
made by hundreds of programmers, ranging from lousy (many) to good (few).
I deeply hate non-private variables. It's a pain in the ass, and
often stands in the way of replacing a module by something more
flexible and/or more efficient.
Abigail
--
perl -we '$_ = q ?4a75737420616e6f74686572205065726c204861636b65720as?;??;
for (??;(??)x??;??)
{??;s;(..)s?;qq ?print chr 0x$1 and \161 ss?;excess;??}'
------------------------------
Date: Wed, 08 Jul 1998 21:22:36 GMT
From: Charles Maier <maierc@chesco.com>
Subject: opendir and Novell 4.xx (was: How to get files in a directory?)
Message-Id: <35A2102C.1EE7@chesco.com>
Tad McClellan wrote:
>
> John Chambers (jc@ral1.zko.dec.com) wrote:
> : brian d foy wrote:
> : >
> : > In article <359BAB97.9CCFC665@perrier.bmc.uu.se>, m94tne@student.tdb.uu.se posted:
> : >
> : > >What is the command for getting (all) files (as a list) in the current
> : > >directory?
>
> : Jeez, why didn't anyone even mention the much simpler solution:
> ^^^^
>
> I don't think Jesus reads this newsgroup... ;-)
>
> : @files = glob("*");
>
> Maybe because globbing is system specific and
> and opendir() and friends work on all perl ports?
>
> --
> Tad McClellan SGML Consulting
> tadmc@metronet.com Perl programming
> Fort Worth, Texas
Apparently.. this "opendir() and friends work on all perl ports" is not
true. I have a client that just installed Novell 4.xx and got their
(included) webserver. The documentation says that opendir does NOT work
in the Perl supplied with it. Anyone have any thoughts on this?? The
only reason I mention this is they may decide to move my supported apps
to this platform.
--
Chuck Maier
CDM Consulting Services
http://www.cdmcon.com
(610) 943-2726
------------------------------
Date: Wed, 08 Jul 1998 22:57:04 +0200
From: "Hervi CHIBOIS" <Herve.Chibois@capway.com>
To: Darren Henderson <darren@Quint.somtel.com>
Subject: Re: perl 5.004.04 on AIX 4.2.1
Message-Id: <35A3DD20.49D69F41@capway.com>
Hi Darren
Darren Henderson a icrit:
> I'm having some trouble getting perl 5.004.04 to compile under AIX 4.2.1.
>
AIX has a serious pb w/ dynamic loading. If you use GCC with AIX LD, don't think
ofusing dynamic loading w/ Perl.
If you managed to get GCC compile with its own ld, you should be on the right way.
Personnaly, i did not manage to.
Herve
------------------------------
Date: 8 Jul 1998 21:38:30 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl and OS/2???
Message-Id: <6o0osm$qoi$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Dorene Clark
<soswww@ibm.net>],
who wrote in article <133o1sd+aZIM090yn@ibm.net>:
>
> Can someone tell me if you can run a Perl script
> under OS/2?
Yes. FFAQ for the other info.
Ilya
------------------------------
Date: Wed, 8 Jul 1998 12:59:42 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl CGI and warnings [Was: Re: -w on production code (was Re: better way of getting the last modified file?)
Message-Id: <MPG.100d6f8616d561a39896f7@nntp.hpl.hp.com>
[This followup was posted to comp.lang.perl.misc and a copy was sent to
the cited author.]
In article <6o0ed7$gtl$1@srv38s4u.cas.org> on 8 Jul 1998 18:39:35 GMT,
lvirden@cas.org <lvirden@cas.org> says...
...
> Is there a way that the perl -Mdiagnostics -w output could be emailed to
> a script maintainer?
An oversight in my response: The function I presented does not capture
the output from 'use diagnostics;' in my test. I don't know where it
goes, as it doesn't get to STDOUT or STDERR.
BUT, you should *not* be using the diagnostics module in any case in
production code. It takes a while to load, and adds no value that you
(the maintainer) couldn't get from `perldoc perldiag` if needed.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 8 Jul 1998 21:26:10 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl CGI and warnings [Was: Re: -w on production code (was Re: better way of getting the last modified file?)
Message-Id: <6o0o5i$13f$1@client3.news.psi.net>
Larry Rosler (lr@hpl.hp.com) wrote on MDCCLXXII September MCMXCIII in
<URL: news:MPG.100d6f8616d561a39896f7@nntp.hpl.hp.com>:
++ [This followup was posted to comp.lang.perl.misc and a copy was sent to
++ the cited author.]
++
++ In article <6o0ed7$gtl$1@srv38s4u.cas.org> on 8 Jul 1998 18:39:35 GMT,
++ lvirden@cas.org <lvirden@cas.org> says...
++ ...
++ > Is there a way that the perl -Mdiagnostics -w output could be emailed to
++ > a script maintainer?
++
++ An oversight in my response: The function I presented does not capture
++ the output from 'use diagnostics;' in my test. I don't know where it
++ goes, as it doesn't get to STDOUT or STDERR.
Odd.
$ perl -Mdiagnostics -we '$_ = $_ + 2' > /dev/null
Use of uninitialized value at -e line 1 (#1)
(W) An undefined value was used as if it were already defined. It was
interpreted as a "" or a 0, but maybe it was a mistake. To suppress this
warning assign an initial value to your variables.
$ perl -Mdiagnostics -we '$_ = $_ + 2' 2> /dev/null
$
Looks like it goes to my STDERR....
Abigail
--
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'
------------------------------
Date: 8 Jul 1998 21:28:53 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl CGI and warnings [Was: Re: -w on production code (was Re: better way of getting the last modified file?)
Message-Id: <6o0oal$13f$2@client3.news.psi.net>
lvirden@cas.org (lvirden@cas.org) wrote on MDCCLXXII September MCMXCIII
in <URL: news:6o0ed7$gtl$1@srv38s4u.cas.org>:
++
++ 2. CGI is frequently installed in odd out of the way places and cannot
++ necessarily all be tested before installing an urgent upgrade to perl with
++ regards to security.
It sounds very odd to me that upgrading perl with regards to security is
considered "urgent", yet the CGI programs are installed in odd out of the
way places and cannot necessarily all be tested before installing.
Something is wrong with that picture.
Abigail
--
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-
------------------------------
Date: 08 Jul 1998 17:27:49 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: David Hamilton <ozslot@alphalink.com.au>
Subject: Re: Searching a file
Message-Id: <67h8q8pm.fsf@mailhost.panix.com>
David Hamilton <ozslot@alphalink.com.au> writes:
> I have read all the documentation I could find on this.
What have you read? "perlfaq6" provides a couple of examples of
reading a whole file into a scalar, and "perlfaq5" gives reasons not
to do so in many circumstances. And, finally, "perlvar" deals in
detail with the $/ variable (which is the key to your problock).
I found those references (and others) by searching the perl docs for
the literal expression "whole file".
> $email=($INPUT{'email'});
^ ^
These parentheses simply make your code obscure; they don't do
anything useful.
> open (REMOVED, "removed.txt");
How do you know that the open() succeeded? As rootbeer always says,
even if your code is "just an example" (or maybe *especially* if it
is) you must always check system calls for failure.
open(REMOVED, '<removed.txt')
or die "Can't open removed.txt for write: $!";
> $remfile = <REMOVED>;
You've now read the first line of REMOVED into that scalar, not the
whole file.
> unless ($remfile =~ /$email/)
You probably want to match only those cases where the email address is
the whole line, and you probably don't want it to be case-sensitive:
/^$email$/i
See "perlre" for explanations.
> open (REMVD, ">>removed.txt");
> print REMVD "$email\n";
> close (REMVD);
You might want to open the file for read/append in the first place,
rather than opening it and closing it and opening it again. Search
DejaNews for some thorough examples of such techniques. You'll also
find some ideas in the docs for tell(), truncate(), and seek().
I hope this all helps. Good luck.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: Wed, 08 Jul 1998 19:45:15 GMT
From: otis@my-dejanews.com
Subject: Re: tough regexp - help needed
Message-Id: <6o0i8c$tof$1@nnrp1.dejanews.com>
> >> ++ perl regular expression problem :)
> >> ++
> >>
> >> (Something with HTML)
> >>
> >> Don't apply regexs on the entire document - that won't work.
> >>
> >> use HTML::Parser;
> >
> >unfortunately this is not an option for me in this project.
> >while I posted this in a perl newsgroup (because it requires knowledge of
> >regular expressions, and a perl newsgroup is most probably the best for
that),
> >the code is actually java (OROMatcher package).
>
> [boggles...]
>
> the answer still is that regexen aren't not the way to go. but, if
> you needed a java solution, you should have said so and posted to
> an appropriate group. maybe another java person has already done what
> you need to do.
out of curiosity - why is the regexp not a solution?
I posted it here because I assumed (wrong?) that people reading this (perl)
newsgroup will have the best idea bout the appropriate regexp.
Thanks
Otis
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Wed, 08 Jul 1998 19:48:35 GMT
From: otis@my-dejanews.com
Subject: Re: tough regexp - help needed
Message-Id: <6o0iek$u9h$1@nnrp1.dejanews.com>
> > > Don't apply regexs on the entire document - that won't work.
>
> > while I posted this in a perl newsgroup (because it requires
> > knowledge of regular expressions, and a perl newsgroup is most
> > probably the best for that), the code is actually java (OROMatcher
> > package).
> >
> > So my original question still stands :)
>
> As does Abigail's original answer: a regex solution won't work, since
> your problem is not solvable is terms of regular expressions. Surely
why not? Abigail also thought I was using perl (logical assumption), so maybe
that is why he (she?) said that.
> someone has written an HTML parser in java?
the problem is that I don't want to parse all HTML, just get those matching
patters out of a file (any text file, not HTML files necessarily)
I am using OROMatcher package (java) which provides perl-like regular
expression matching, but I just need to hit the right rexexp :)
Thanks!
Otis
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 8 Jul 1998 21:31:47 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: tough regexp - help needed
Message-Id: <6o0og3$13f$3@client3.news.psi.net>
otis@my-dejanews.com (otis@my-dejanews.com) wrote on MDCCLXXII September
MCMXCIII in <URL: news:6o0iek$u9h$1@nnrp1.dejanews.com>:
++
++ > > > Don't apply regexs on the entire document - that won't work.
++ >
++ > > while I posted this in a perl newsgroup (because it requires
++ > > knowledge of regular expressions, and a perl newsgroup is most
++ > > probably the best for that), the code is actually java (OROMatcher
++ > > package).
++ > >
++ > > So my original question still stands :)
++ >
++ > As does Abigail's original answer: a regex solution won't work, since
++ > your problem is not solvable is terms of regular expressions. Surely
++
++ why not? Abigail also thought I was using perl (logical assumption), so maybe
++ that is why he (she?) said that.
I said:
Don't apply regexs on the entire document - that won't work.
Did I say anything about Perl?
Abigail
--
perl -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
print chr 0x$& and q
qq}*excess********}'
------------------------------
Date: 8 Jul 1998 21:33:54 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: tough regexp - help needed
Message-Id: <6o0ok2$13f$4@client3.news.psi.net>
otis@my-dejanews.com (otis@my-dejanews.com) wrote on MDCCLXXII September
MCMXCIII in <URL: news:6o0i8c$tof$1@nnrp1.dejanews.com>:
++
++
++ out of curiosity - why is the regexp not a solution?
Because HTML is basically CFL, and not a regular language.
That has been explained over and over again in the past. Use
dejanews.
Abigail
--
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.
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 3099
**************************************