[6785] in Perl-Users-Digest
Perl-Users Digest, Issue: 410 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 1 21:07:11 1997
Date: Thu, 1 May 97 18:00:22 -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 Thu, 1 May 1997 Volume: 8 Number: 410
Today's topics:
[DRAFT] RFD: comp.lang.perl.{data-structure,inter-proce (A. Deckers)
Re: Avoid writing a temp file (Martin Cohen)
dbmopen fails. (Bhasker Allam)
Re: Debugging warnings <psrc@corp.airmedia.com>
Help Use 1 file to edit another <mhammer@execpc.com>
Hexadecimal search and replace? (Timothy Lindgren)
Re: Loosing clpm regulars (was Re: Perl auto-replier) <usenet-tag@qz.little-neck.ny.us>
Re: Notice to antispammers PLEASE READ (Tad McClellan)
Re: Notice to antispammers (I R A Aggie)
Re: Perl auto-replier <stephen+usenet@farrell.org>
Perl code-writing standards (Mark Bradshaw)
Re: Perl code-writing standards (Matthew Cravit)
Re: Perl code-writing standards <amit@csd.sgi.com>
Re: Perl NT HELP!!! <billc@tibinc.com>
Re: port from solaris to WinNT 4.0 (Duncan Harris)
Re: Portland open-enrollment "Intro to Perl" class jun (Mike Kenney)
Q: Cutting a string by position (like cut(1) can) <apollock@bit.net.au>
Re: question: how to trim a string passed via hard refe <spammers_suck@[127.0.0.1]>
Re: Regexp bug or feature? (perl claims null string mat (Colin Kuskie)
Re: request for help <spammers_suck@[127.0.0.1]>
Re: RISC vs CISC or SunOS <karlt@ilinks.net.njem>
sybperl to oraperl conersion help sanjiv@west.bri.com
Re: Syntax checking? <ryung@ml.com>
Re: variable substitution (Tad McClellan)
Re: Why no regex char class for punc chars??? (Tad McClellan)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 1 May 1997 22:09:25 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: [DRAFT] RFD: comp.lang.perl.{data-structure,inter-process,programmer,regex}
Message-Id: <slrn5mi54a.od.I-hate-cyber-promo@nessie.mcc.ac.uk>
I have received enough positive responses to make me feel it's
worthwhile to move ahead with this. This draft contains a rationale for
all groups and the charter for the data structures group. The other
charters would be similar, except for the obvious changes.
I've dropped the *.porters group, since I haven't recieved any feedback
about this and think the porters should decide their own fate.
I have not and do not plan to add a *.cgi or *.www group, since this
would essentially duplicate the existing ciwac group. If anyone wants
to propose it, go ahead, but don't expect me to include it in any RFD I
put my name to.
Now, come on folks, please make a serious effort to contribute to this
initiative. I've heard a lot of complaints, most of which I share, but if
y'all just sit on your backsides, this isn't going to get anywhere.
I repeat that I will _not_ go ahead with an official RFD unless I a
significant number of regulars put their name forward as co-proponents,
and/or indicate that they would be willing to serve on the proposed
moderation panel (don't worry, you're not going to hand moderate the
group; please read on).
I envisage the moderation panel being composed of the same people for all
the groups, ie ther'll only be one moderation panel. Since all groups
will use the same script and the issues will be similar in all cases,
IMO this makes sense.
=> Please cc me on any followups. Mail with /perl/' in the subject or
=> newsgroups headers of a mail message will be routed to the appropriate
=> mailbox. I ask this not because I'm not going to follow the debate
=> here, but to have a complete list of comments; our feed is a bit odd
=> sometimes
===begin included text===
REQUEST FOR DISCUSSION
moderated comp.lang.perl.data-structure
moderated comp.lang.perl.inter-process
moderated comp.lang.perl.programmer
moderated comp.lang.perl.regex
Newsgroups lines:
comp.lang.perl.data-structure Using Perl data-structures (array, hash, object). (Moderated)
comp.lang.perl.inter-process Implementing inter-process communications in Perl. (Moderated)
comp.lang.perl.programmer General non-FAQ issues related to Perl programming. (Moderated)
comp.lang.perl.regex Using Perl regular expressions. (Moderated)
RATIONALE: all groups
Most Perl-related issues are currently discussed in
comp.lang.perl.misc (clpm). The latest statistics indicate that
this group receives more than one thousand articles from more
than 500 posters each week, a volume of traffic many readers find
overwhelming.
In addition, a large part of the traffic on clpm consists of
off-topic articles, many of them widely cross-posted through the
comp.* hierarchy and ammounting to little more than flame-wars,
articles asking questions that are answered in the FAQs, and
above all, a regular flow of articles asking questions related to
the Common Gateway Interface (CGI) but unrelated to Perl.
In these circumstances, a number of regular posters to the group
have stopped reading clpm, while new readers can find it
difficult to find relevant posts. Both facts result in a reduced
usefullness of the existing clpm newsgroup.
These comp.lang.perl.* groups are therefore proposed as high
signal-to-noise ratio newsgroups where readers are not subjected
to the types of articles described above. The intention is both
to provide a usefull resource for inexperienced Perl programmers,
and to attract and retain experienced programmers who can make a
substantial contribution to the group.
The thematic split is proposed in order to provide more
specialised groups where readers (and posters) can follow topics
in which they have a genuine interest without necessarily seeing
posts related to other aspects of Perl.
CHARTER: comp.lang.perl.data-structure
The group comp.lang.perl.data-structure will deal with issues
related to Perl's data-structures as described in the perldata,
perldsc, perllol, perlobj and related manual pages included in
the Perl distribution.
Any article which doesn't address issues related to Perl'd data
structures will be off-topic in this group.
The group shall be moderated using a Perl script, which shall be
overseen by a moderation panel. The script shall be configured to
reject any article:
+ whose subject or body doesn't contain one or more words from a
list designated by the moderation panel. Initially, this list
will contain the words "scalar, array, list, hash, string,
object, reference" and their plurals;
+ that is cross-posted to any groups other than
comp.lang.perl.announce, save for the blanket cross-posting
provisions described below;
+ that is deemed to contain a binary file. In so far as it is
practicable, the moderation script shall be configured so as to
pass PGP signatures, while rejecting articles containing binary
files.
+ that is deemed to contain text encoded using HTML or similar
schemes;
+ that contains more quoted than unquoted text. This condition
will not be applied to articles containing less than 20 lines
of body text, excluding the signature if one is found. Articles
without any unquoted text, not taking into account the
signature if one is present, will be rejected;
+ that contains a signature over 10 lines in length;
In the context of this charter, a signature is defined as
everything found after the last cut line, ie /^-- $/, of the
article body;
The moderators of comp.lang.perl.announce, *.answers and
news.announce.newgroups are hereby granted blanket permission to
cross-post to comp.lang.perl.data-structure as they see fit.
While permission to routinely cross-post to the group will not be
granted, the moderation panel will consider request for
individual cases if they deem it that this would be of
significant benefit to the readership of the group. This
provision applies especially, but is not limited to relevant
FAQs;
The moderation panel will consist of no fewer than 5 and no more
than 9 members, and shall always comprise an odd number of
members. In the case of a temporary abscence by a member of the
moderation panel, he or she shall nominate a replacement for the
duration of said abscence. New members may be appointed upon the
permanent departure of an existing member, or as the moderation
panel deems appropriate.
The moderation panel shall take all its decisions on the basis of
a simple majority vote among its current members.
The moderation script will be distributed to persons approved by
the moderation panel, solely for the purpose of installing it at
their site and injecting articles into their local news server
according to the provisions of this charter.
Sites shall receive articles submitted to the group by means of a
distribution list established for this purpose by the moderation
panel, all of whose members will be granted administrative rights
over this list.
Any site found to be injecting articles in contravention of this
charter will be unsubscribed from the abovementioned distribution
list at the earliest convenience of the moderation panel and
banned from re-subscribing for a period of no less than 6
calendar months.
END CHARTER
[snip other similar charters]
MODERATOR INFO: comp.lang.perl.data-structure
Moderator: TBA
Submission address: clp-data@perl.org
Administrative address: clp-data-request@perl.org
END MODERATOR INFO
[snip everything else]
===end included text===
Cheers,
Alain
--
[[ put 'perl' in the subject to ensure email gets routed to my mailbox]]
Perl information: <URL:http://www.perl.com/perl/>
Perl FAQ: <URL:http://www.perl.com/perl/faq/>
Perl archive: <URL:http://www.perl.com/CPAN/>
------------------------------
Date: 1 May 97 13:11:41 GMT
From: mcohen@arl.mil (Martin Cohen)
Subject: Re: Avoid writing a temp file
Message-Id: <3368968D.2B37@arl.mil>
Scott Chapal wrote:
[ edited ]
- How do I circumvent the need to write that temporary file
- and do all the filtering (dos2unix, tr, sed, grep) to get
- the data into an array, in a more elegant way?
-
- Thanks for any insights.
-
- --
- Scott E. Chapal____________________________________________________
- Database & Network Manager 912.734.4706
- J.W. Jones Ecological Research Center FAX:912.734.6650
- Rt. 2. Box. 2324. Newton, GA 31770 schapal@jonesctr.org
[ deleted much code ]
The following can be done in perl:
- # dos2unix; then replace tabs with semicolons;
- # then remove extraneous lines
- # This should be done in Perl proper.
- $rec =`dos2unix temp.out | tr '\t' ';' | sed '/^\$/d' | \
- grep -v Report | grep -v Pkno | \
- grep -v Total `;
s/\r\n/\n/g; # should do dos2unix.
tr/\t/;/; # should change all tabs into
semicolons.
next if (/Report|Pkno|Total|^\$/);# should delete lines starting with
dollar signs
# or containing the 3 key strings
[ deleted much code ]
- --
- Scott E. Chapal____________________________________________________
- Database & Network Manager 912.734.4706
- J.W. Jones Ecological Research Center FAX:912.734.6650
- Rt. 2. Box. 2324. Newton, GA 31770 schapal@jonesctr.org
--
Martin Cohen - AMSAA-North - Custom House Rm 800 Phila PA 19106-2976
------------------------------
Date: 1 May 1997 21:53:18 GMT
From: abr@wasp (Bhasker Allam)
Subject: dbmopen fails.
Message-Id: <5kb3ce$149@btree.is.brooktree.com>
Hi,
This the first time I am trying to use database stuff in perl.
I am trying to do the following:
dbmopen(%DBARRAY, "addrdb", 0666) ||
die "Cannot open data base: $!\n";
I get the following error:
AnyDBM_File doesn't define a TIEHASH method at dbcreate line 8
where line 8 happens to be the line mentioned above.
I am using 5.002 version of perl for SunOS 4.1.3.
Any help apprecieted. Thanks in advance.
Bhasker.
------------------------------
Date: Thu, 01 May 1997 18:45:19 -0400
From: Paul S R Chisholm <psrc@corp.airmedia.com>
Subject: Re: Debugging warnings
Message-Id: <33691CFF.70E4@corp.airmedia.com>
In <5gmtb5$ofh$1@mathserv.mps.ohio-state.edu>, ilya@math.ohio-state.edu
(Ilya Zakharevich, who's received a complimentary Cc of this posting,
as well as a copy of the home version of comp.lang.perl.misc) wrote:
> [A complimentary Cc of this posting was sent to Topher Eliot <eliot@kern1.dg.com>],
> who wrote in article <ELIOT.97Mar18144605@kern1.dg.com>:
> > Is there a way to arrange to run perl in debugging mode with warnings
> > enabled (i.e. perl -dw) so that when a warning is generated, I hit a
> > breakpoint, and can examine the program's state?
> I hope you know about $SIG{__WARN__} and $SIG{__DIE__}? I hope you
> know how to stop debugger from your code ($DB::single)?
I know about $SIG{__WARN__} and $SIG{__DIE__} (p. 139 of the Blue Camel).
I now know about setting $DB::single to "stop at the next statement as
though you'd used the debugger's s command." (p. 525)
(And I hope I've shown I know to look in the archives before asking a
question.-)
Okay, so now that I know that, what do I do? I tried:
DB<1> x %SIG
0 'BUS'
1 'DB::diesignal'
2 'INT'
3 'DB::catch'
4 '__WARN__'
5 'DB::dbwarn'
6 'SEGV'
7 'DB::diesignal'
8 '__DIE__'
9 'DB::dbdie'
DB<2> b DB::dbwarn
Subroutine DB::dbwarn not found.
DB<3> s
main::(logviewsvr.pl:21): my $req_fmt_month = 0;
DB<3> b DB::dbwarn
Subroutine DB::dbwarn not found.
In other words, I looked to see what the debugger had set to catch the
warning "signal" ... but I couldn't see it to set a breakpoint on it,
even after executing the first statement (wishful thinking).
I also tried "b $SIG{__WARN__}", which was accepted without a complaint,
but the L command now shows me:
21: my $req_fmt_month = 0;
break if ($SIG{__WARN__})
(that is, there's a conditional breakpoint on the line that was current
when I tried to set the breakpoint). Not what I had in mind.
So, Ilya, I appreciate your clues, but I still don't get it. Help? --PSRC
------------------------------
Date: Thu, 01 May 1997 17:59:47 -0500
From: Mike Hammernik <mhammer@execpc.com>
Subject: Help Use 1 file to edit another
Message-Id: <33692063.2047@execpc.com>
Hello
I would like to cat a file and use each line in that file to delete a
line in another file. My scenario is having a file with 1744 lines. I
want to delete lines in a file of 16000 lines that contains the first 2
fields in file_1. The files are in a load/unload format from a db.
file_1
abc|1-1|abcdefghijk|abc||24|
abc|1-3|lmnopqrstuv|abc||24|
def|10-19|qwertyuiop|def||24|
file_2
abc|1-1||abc||24|
abc|1-2||abc||24|
abc|1-3||abc||24|
.
.
.
abc|100-19||abc||24|
def|1-1||def||24|
.
.
etc
If i use sed as in
for i in `cat file_1`
do
sed '/'"$i"'/d' file_2>>file_3
done
It will go through and find a match on say line 10 but it will proceed
to go through all 16000 lines looking for another match. It simply takes
too long to run. Can someone help me to understand how the branch
command is used to stop at a match and start over with the next line of
input at the top of file_2
I've also tried PERL but I'm not far enough in the learning curve to
know how to read from 1 file and use the string to delete a line in
another.
The ultimate goal is to append file_2 back to file_1 so that I have
16000 lines with no duplication to reload a table with.
Thanks in advance
Mike Hammernik
------------------------------
Date: 1 May 1997 22:35:05 GMT
From: tim@regiononline.com (Timothy Lindgren)
Subject: Hexadecimal search and replace?
Message-Id: <5kb5qp$84l@news1.fast.net>
Greetings!
I have a large number of ascii text files that have a badly formed "new line"
character. The only way I have found to see the bad character is with a hex
editor.
The format for new line (Carrage Return) in HEX is " 0D0A ".
Can anyone help describe a routine that will open a file from command line,
then search for the bad hex value ( "0D0D0A" ) and replace it with the HEX
value of " 0D0A "?
Is there a command/function in SED that would find these and replace them with
a standard new-line (" \n ")?
Anyone?
Tim
------------------------------
Date: 1 May 1997 21:28:42 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: Loosing clpm regulars (was Re: Perl auto-replier)
Message-Id: <5kb1ua$kj2$1@news.netusa.net>
A. Deckers <I-hate-cyber-promo@man.ac.uk> wrote:
>I would like to know what regular readers of clpm think about adding a
>comp.lang.perl.moderated to the pre-RFD. As I doubt we could find
>enough human moderators willing to take on the job, I propose an
>auto-moderated group. Articles would have to include a "magic cookie"
>in a given header in order to be passed by the moderation script. IMHO,
>this should cut down the noise level to almost zero, as anyone who
The hierarchy which cannot be mentioned uses several other strong
tools, including arbitrary killing of stuff from certain providers.
Additionally they keep vigilant watch on who gets feeds and are not
averse to revoking feeds from sites that misbehave. I don't think
anything looser could keep noise down to zero. Robomoderated groups
will still get questions from the persistant clueless, but it may
help.
Elijah
------
I'd vote for it.
------------------------------
Date: Thu, 1 May 1997 15:16:36 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Notice to antispammers PLEASE READ
Message-Id: <4ntak5.hh8.ln@localhost>
Me (a3200@hotmail.com) wrote:
: > >> In any case, why exactly does a new server maintainer need real
: > >> addresses?
: >
: > The question is not "new server maintainer". It is "other USENET users."
: >
: I have an idea to stop all this, the reason we are all fighting is that
: Tom wants to put email-mungers real eMail addresses on a page, so other
: USENET users can contact the poster easily.
: What some don't like is the fact that these addresses being on a page
: are very very easy for spam bots to get and use.
: The simple way Tom can stop that is to split each address into 2 parts
: without using links, like so...
: <B>a3200 at hotmail.com</b>
: <B>Joe at did.com</b>
: This will make it hard for spam bots to read the addresses but the real
: users, ie. you and me can use the addresses easily.
: Just something to think about, Cya!
I would be very surprised if the harvesters don't already attempt
to unmunge addresses.
s/[ _-]*at[ _-]*/@/i;
would yield a significant number of addresses to send crap to...
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Thu, 01 May 1997 17:16:46 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: Notice to antispammers
Message-Id: <fl_aggie-ya02408000R0105971716460001@news.fsu.edu>
In article <E9IB23.L3C@nonexistent.com>, rsi+usenet@earthling.net wrote:
+ fl_aggie@hotmail.com (I R A Aggie) writes:
+ > So, TomC is now responsible for spam? heheheheheh
+ Not responsible for spam... but responsible for aiding and abetting in
+ the cause of spammers out of spite. Childish, really!
Childish? perhaps. But not any more childish than munging one's return
address.
+ > It's no more or less ethical than publishing the "Anarchist Cookbook",
+ > or selling nitrogen-based fertilizer. How many technological advances
+ > has Lucent developed that can be abused? should Lucent be held responsible
+ > for them?
+ This is a silly analogy. The primary purpose of the technological
+ advances in Lucent was not so it could be abused.
Ah, but what *safeguards* have you placed within your technology to
prevent abuse? If you haven't put them in, you're encouraging abusive
use of technology.
+ OTOH, publishing howto's for bombs is irresponsible. It may not be
+ illegal, but it is irresponsible.
What, sharing information and knowledge is irresponsible? are you, by
chance, a Luddite?
James - it's what you do *with* the information that counts...
--
Consulting Minister for Consultants, DNRC
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: Thu, 1 May 1997 23:58:27 GMT
From: stephen farrell <stephen+usenet@farrell.org>
Subject: Re: Perl auto-replier
Message-Id: <87sp06oicc.fsf@phaedrus.uchicago.edu>
bod@compusol.com.au (Brendan O'Dea) writes:
> In article <5k5tus$7qr$1@news.netusa.net>,
> Eli the Bearded <usenet-tag@qz.little-neck.ny.us> wrote:
> >rga <rga@io.com> wrote:
> >>Ronald.J.Kimball@dartmouth.edu (Chipmunk) wrote:
> [snip]
> >> I thought of ... hmmm .. maybe a group
> >> called <comp.lang.perl.newbie> ..
> >> But, then who would answer the questions ?
> >
> >Based on all the newbies who miss comp.unix.shell, etc, and
> >go straight to alt.unix.wizards, I doubt greenhorns are any good
> >at not polluting groups with stuff found in the FAQs.
>
> Weeeelllll, perhaps *that* is the solution: to create a new group
> called ``comp.lang.perl.wizards'' to attract such postings :-)
>
> You could robo-moderate it, bouncing all posts with a one or two page
> mini-faq giving pointers to the FAQ, documentation and correct groups.
>
> Regards,
> --
> Brendan O'Dea bod@compusol.com.au
> Compusol Pty. Limited (NSW, Australia) +61 2 9809 0133
i think this is a really good idea. i find that this newsgroup is
just too big for me to read anyway; i've been amazed at how much tom
christianson does to reply to so many posts, albeit sometimes curtly.
how about comp.lang.perl.beginners, comp.lang.perl.experts or some
such heirarchy?
--steve farrell
------------------------------
Date: Thu, 01 May 1997 20:28:15 GMT
From: not@hoople.demon.co.uk (Mark Bradshaw)
Subject: Perl code-writing standards
Message-Id: <3368fc3d.2474904@news.demon.co.uk>
Folks,
The company I currently work for are keen to introduce Perl as one of
the development languages which can be used. However in order to
do this we have to develop some minimal standards as to how to
structure code, what debugging routines to embed into the code, etc.
Are there any such standards already available or do we have to start
from scratch?
Thanks
Mark Bradshaw
------------------------------
Date: 1 May 1997 15:50:54 -0700
From: mcravit@shell3.ba.best.com (Matthew Cravit)
Subject: Re: Perl code-writing standards
Message-Id: <5kb6oe$8r@shell3.ba.best.com>
In article <3368fc3d.2474904@news.demon.co.uk>,
Mark Bradshaw <not@hoople.demon.co.uk> wrote:
>Folks,
>
>The company I currently work for are keen to introduce Perl as one of
>the development languages which can be used. However in order to
>do this we have to develop some minimal standards as to how to
>structure code, what debugging routines to embed into the code, etc.
>Are there any such standards already available or do we have to start
For things like code structure and such, the perlstyle manpage is probably
a good place to start. For debugging and other issues, I'd suggest starting
from whatever standards or guidelines are already in place for development
in other languages, and modifying them as appropriate for Perl.
/MC
--
--
Matthew Cravit, N9VWG | Experience is what allows you to
E-mail: mcravit@best.com (home) | recognize a mistake the second
mcravit@taos.com (work) | time you make it.
------------------------------
Date: Thu, 01 May 1997 17:50:22 -0700
From: amit kothari <amit@csd.sgi.com>
To: Mark Bradshaw <not@hoople.demon.co.uk>
Subject: Re: Perl code-writing standards
Message-Id: <33693A4E.446B@csd.sgi.com>
Mark Bradshaw wrote:
>
> Folks,
>
> The company I currently work for are keen to introduce Perl as one of
> the development languages which can be used. However in order to
> do this we have to develop some minimal standards as to how to
> structure code, what debugging routines to embed into the code, etc.
> Are there any such standards already available or do we have to start
> from scratch?
>
> Thanks
>
> Mark Bradshaw
i have developed perl standards. look up the link in my home page
http://www.geocities.com/ResearchTriangle/4960/perl_std.html
hope this helps
amit
==========================================================================
email : amit@csd.sgi.com
Ph: (415) 933 7841 (W) (408) 941 9863 (H)
Sillicon Graphics B-26,Sunnywale, California.
Home Page: http://www.geocities.com/ResearchTriangle/4960/
==========================================================================
------------------------------
Date: Thu, 01 May 1997 20:42:56 -0400
From: Bill Cowan <billc@tibinc.com>
To: customdesign@nstate.net
Subject: Re: Perl NT HELP!!!
Message-Id: <33693890.4E0B@tibinc.com>
TRG Custom Graphics wrote:
>
> Hi..
>
> I was wondering if anyone can give me some advice... (I'm not an
> idiot -- or at least, not completely). But I have a few cgi/perl
> scripts I've done on a Linux RHS 4.0 (I believe) with Apache 1.1.1 (I
> think?).. *sorry for the confusion*.. Anyway.. I am wanting to port over
> everything (especially my chat forums) to NT 4.0 with IIS..
> Thanks..
[SNIP]>
> Tim...
>
> customdesign@nstate.net
See Win32 Perl FAQ for suggestions about IIS and HTTP header problems.
Useful URLs for Win32 Perl (NT Perl)
------------------------------------
Win32 Perl for Windows NT:
http://www.activeware.com/ [also online web pages]
http://www.perl.com/CPAN/ports/win32/Perl5/
Searchable Archive for Perl-Win32-users Mailing List:
http://www.divinf.it/perl-win32/index.sht
Evangelo's Frequently Asked Questions (FAQ):
http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html
Database access via ODBC by Dave Roth's Win32::ODBC module:
Win32::ODBC Home Page with Online Documentation:
http://www.roth.net/odbc/
Also see FAQ for database questions.
Download from:
http://www.perl.com/CPAN/authors/Dave_Roth/
CPAN has Win32 specific modules at:
http://www.perl.com/CPAN/modules/by-category/
and follow category 22 for Windows.
Note: These URLs also point to other Win32 Perl resources.
-- Bill
-----------------------------------------------------------------------
Bill Cowan <billc@tibinc.com> Voice:919-490-0034 Fax:919-490-0143
Tiburon, Inc./3333 Durham-Chapel Hill Blvd Suite E-100/Durham, NC 27707
------------------------------
Date: 1 May 1997 23:42:28 GMT
From: duncan@sapio.co.uk (Duncan Harris)
Subject: Re: port from solaris to WinNT 4.0
Message-Id: <memo.970502004154.107A@sapio.compulink.co.uk>
In article <erich-2804971900180001@ppp-207-104-16-27.snrf01.pacbell.net>,
erich@powerwareintl.com (Eric Harley) wrote:
> In article <336526CC.2B71@virtualf.com>, Boris Kizelshteyn
> <boris@virtualf.com> wrote:
>
> > Hi!
> >
> > I'm porting a large perl system from PERL 4.0 on Solaris to PERL 5 on
> > WinNT 4.0. Can anyone provide me with useful sources of information
> > (or
> > the information itself). Will my code be mostly compatible, any
> > specific
> > things I should watch out for. Any information would be useful.
> >
> > Thanks,
> >
> > Boris Kizelshteyn
>
> $file = "D:\\PATH\\TO\\FILE\\FILE.TXT"; #YES!!!
> $file = "D:\\PATH\\TO\\FILE\\FILE.TXT"; #NO!!!
> $file = "/PATH/TO/FILE/FILE.TXT"; #NO!!!
I'm not sure about the number two above(?),
but you might be relieved to know that:
$file = "D:/PATH/TO/FILE/FILE.TXT";
also works UNLESS you are passing it to a shell (CMD.EXE).
--
Duncan Harris, Sapio Design Ltd, Manchester, U.K.
~~~~~~~~~~~ mailto:duncan@sapio.co.uk ~~~~~~~~~~~
Web on CD-ROM? Check out http://www.sapio.co.uk/
------------------------------
Date: 01 May 1997 15:01:24 -0700
From: mike@wavelet.apl.washington.edu (Mike Kenney)
To: tadmc@flash.net (Tad McClellan)
Subject: Re: Portland open-enrollment "Intro to Perl" class jun 9-11
Message-Id: <u867x2n97i.fsf@wavelet.apl.washington.edu>
In article <qji8k5.nk3.ln@localhost> tadmc@flash.net (Tad McClellan) writes:
>
> Randal Schwartz (merlyn@stonehenge.com) wrote:
>
> : I've just been informed by my crack production team that there's still
> ^^^^^^^^^^^^^^^^^^^^^
>
> I didn't know that there was much of a market for cracks...
>
> (though I am supplying one here ;-)
You realize that if Intel's lawyers read this they will now accuse
Randal of being a crack dealer :-) :-)
--
Mike
-----------------------------------------------------------------------------
Mike Kenney
UW Applied Physics Lab
mikek@apl.washington.edu (206) 543-1300 / (206) 543-6785 FAX
-----------------------------------------------------------------------------
------------------------------
Date: 2 May 1997 00:44:32 GMT
From: "Andrew Pollock" <apollock@bit.net.au>
Subject: Q: Cutting a string by position (like cut(1) can)
Message-Id: <01bc5691$feba4c40$011618cb@caesar.bit.net.au>
Hi,
How do you dissect a string based on column? (Like the way cut(1) works?)
I know all about splitting on whitespace, but I've got a string where
tokens don't always appear, and splitting on whitespace is impractical.
Thanks in advance
Andrew
--
----
Andrew Pollock Programmer/System Administrator
apollock@bit.net.au http://staff.bit.net.au/apollock
Brisbane Internet Technology
------------------------------
Date: 1 May 1997 17:30:20 -0700
From: zeadeATstanford.edu <spammers_suck@[127.0.0.1]>
Subject: Re: question: how to trim a string passed via hard reference?
Message-Id: <5kbcis$9bh@epic15.Stanford.EDU>
> Use ${$_[0]} rather than ${@_[0]}, though.
>
> David Black
> dblack@icarus.shu.edu
I was recently messing around with references to arrays and found that
@$ref[1] generated no warnings with the -w switch, yet @array[1]
would.
I have been wondering for awhile if something like @array[1] was ever
illegal in perl. I have a memory of way back when when first learning
perl that doing something like that caused a script to choke. But I
went back and it didn't even whimper in perl4. I was actually
surprised to see @$ref[1] work when I realized it (what I thought at
the time) was illegal syntax.
just rambling,
Micah
(note: lame-o spam block, reply to zeade...)
--
`which perl` -e 's;^;siC%by:n19%o>o2z4on19%`"t2z`fn3o.%.2o.z.2o.g4og.5o.g.;;\
s;$;4o.4%f%.2o.n`fP"Y2>bP"Y2>bz`fzd2>t%`"Y>%`Pz)2>bgfP"Y2>bn%p#f8%.oP"#n%p;;\
s;$;#p.o>%d>(z#n____`Y>bod>Pt%`Yf2">o%__n;;s;#;ppfz;g;s;p;fg;g;s;_;ofo%;g;;;\
s;z;2%;g;s;g;3%;g;s;f;3>;g;s;(\d+)(.);$2x$1;eg;y;t>%nC;\x278 \ng;;print;'
------------------------------
Date: 1 May 1997 08:23:01 -0700
From: colink@latticesemi.com (Colin Kuskie)
Subject: Re: Regexp bug or feature? (perl claims null string match)
Message-Id: <5kacgl$ui@defiant.latticesemi.com>
In article <ucohawmnfb.fsf@pandora.Informatik.Uni-Mainz.DE>,
Daniel Polani <polani@pandora.informatik.uni-mainz.de> wrote:
>in a script I am testing for a match of lines of the form
>
> 10111010|10010110|01111111|10100101
>
>and similar. I am using the following regexp
>
> /^[01]+(|[01]+)+/
>
>for the match (which seems to work), however perl claims that
>
> (|[01]+)+ matches null string many times at 'pe' line 10.
>
>I do not understand why that regexp should ever match a zero length
>string. Am I missing something, or is this a bug?
Let's take apart your regexp:
^ : Match at the beginning of the line
[01]+ : 1 or more 0's or 1's
(|[01]+)+ : Here's the problem.
pipe '|' means 'either this or that' in a regular expression:
a|b matches a or b
(a|b) matches a or b and remembers what it matched.
(|b) matches a null string or a b
If you want to match on the character, you have to escape it with a
backslash like so:
/^[01]+(\|[01]+)+/
>BTW: Any idea, why /^([01]+|)+[01]+/) takes much longer to run? Isn't
>the first term treated greedily?
Answer to second question, yes. Answer to first question, see above
about the null pattern match, and then read "Mastering Regular
Expressions" --> The 'Hip Owl' O'Reilly book from Jeffrey Friedl.
Hope this helped,
Colin Kuskie
colink@latticesemi.com
------------------------------
Date: 1 May 1997 17:15:08 -0700
From: zeadeATstanford.edu <spammers_suck@[127.0.0.1]>
Subject: Re: request for help
Message-Id: <5kbbmc$8sl@epic15.Stanford.EDU>
In comp.lang.perl.misc, mallela reddy (rkm@cs.wayne.edu) blibbers...
> Respected Sir/Madam,
>
> I am a student of Wayne State university
> presently working on a perl project(grad course) namely
> "pizza online delivery"(address is
> www.cs.wayne.edu/~rkm). In the project I have given a
> variable $discount (which is 95% or 90% or 75%
> depending upon the total amount you order)of the total
> dollars. In this calculation some times it is giving
> for example as $45.5625 or some times as $45 if I tried
> to give a chop to the $discount twice it is truncating
> but in this process i am loosing $1 or it is giving $45
> as above. please suggest me how to tackle the problem.
> I need something which might convert the variable
> $discount in to a standard datatype in the form of
> money i.e, $00.00(two digits to the right of decimal
> pointer. Please mail the suggestion to rkm@cs.wayne.edu
>
> Thanking you Sir,
> Sincerely,
> MALLELA REDDY
I don't recommend going chop chop. You're losing a possible whole
extra cent in rounding up, and also as you stated, if your sum is a
whole number, etc. you are chopping the wrong thing. Add by .005 and
use printf... If you need to store the value somewhere, look into
sprintf. Try the man pages. Hell, try looking in the perl book too ;)
It's interesting that some people seem to be learning perl before C
(as in this case, where they should have known about printf formats
already). Bleah, printf.
Here's an untested code snippet:
$sum = 160.3265; # whole lotta pizza
printf("That will be \$%.2f, please. Have a nice day!\n", $sum + .005);
huzzah,
Micah
(note: lame-o spam block in effect, reply to zeade...)
--
`which perl` -e 's;^;siC%by:n19%o>o2z4on19%`"t2z`fn3o.%.2o.z.2o.g4og.5o.g.;;\
s;$;4o.4%f%.2o.n`fP"Y2>bP"Y2>bz`fzd2>t%`"Y>%`Pz)2>bgfP"Y2>bn%p#f8%.oP"#n%p;;\
s;$;#p.o>%d>(z#n____`Y>bod>Pt%`Yf2">o%__n;;s;#;ppfz;g;s;p;fg;g;s;_;ofo%;g;;;\
s;z;2%;g;s;g;3%;g;s;f;3>;g;s;(\d+)(.);$2x$1;eg;y;t>%nC;\x278 \ng;;print;'
------------------------------
Date: 1 May 1997 22:50:09 GMT
From: "Karl Thomas" <karlt@ilinks.net.njem>
Subject: Re: RISC vs CISC or SunOS
Message-Id: <01bc5681$d64139a0$69c289ce@hitachi>
Chris Knape <cknape@net-link.net> wrote in article
<3366FBDE.5253@net-link.net>...
> So why do some apps run slower on Macs, even when the Chip may be faster
> (Doom II)? Game like Doom were written for Wintel and ported over to
> PowerPC (and 68000) for the MacOS.
Doom II was slower because the PowerMacs couldn't use the clunky 320x200
mode that the PC version used. But Doom II ran very well on a 6100/60 with
a 512K cache.
------------------------------
Date: Thu, 01 May 1997 19:33:01 -0600
From: sanjiv@west.bri.com
To: sanjiv@west.bri.com
Subject: sybperl to oraperl conersion help
Message-Id: <862532727.20823@dejanews.com>
Hi All,
We need some help for porting Sybperl code into Oraperl code. Are there
any tools. If you have attempted this, pls give some feedback and the
areas which we should watch out for. can anyone give an estimate of the
time it may take to convert a 5000 line sybperl code to oraperl...thanks
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Wed, 30 Apr 1997 15:23:58 -0400
From: Robert Yung <ryung@ml.com>
Subject: Re: Syntax checking?
Message-Id: <33679C4E.7627@ml.com>
Yes, perl -w.
TCM Online wrote:
>
> I'm a Perl newbie here.... just learning by example and hacking
> existing code..
>
> I've started off on a new project from the ground up and now get a
> run error stating I'm missing a right bracket... is there any good
> freeware syntax checkers that will find this for me?
>
> Thanks!
>
> Ernie Johnson
> TCM Online
>
> email tcm@tcmd.com
--
Robert Yung
Consultant @ Work
------------------------------
Date: Thu, 1 May 1997 15:18:44 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: variable substitution
Message-Id: <4rtak5.hh8.ln@localhost>
Bob Lockie (bjlockie@nortel.ca) wrote:
: I have 2 variables,
: one named $type and one named $index.
: I want to do the following inside a print statement.
: print "$type_ac$index\n";
: but Perl treats "$type_ac" as a variable name.
: I tried "$type\_ac" with no luck.
: I want to do this INSIDE :-) a print statement. :-)
: Is there a way to force Perl to take the variable name that
: I want it to?
print "${type}_ac$index\n";
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Thu, 1 May 1997 15:20:55 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Why no regex char class for punc chars???
Message-Id: <7vtak5.hh8.ln@localhost>
Jete Software Inc. (jete@dgs.dgsys.com) wrote:
: I was wondering why there is no regular express character class
: for punctuation characters?? or is there one and i am just unaware
: of it. I looked through the Camel 5 book and couldn't find it.
: This would work the same way that \w does (for [a-zA-Z_0-9])
: This way I can easily check for these characters without having
: to worry about meta-characters screwing things up. There should
: really be two classes 1) simply the punct. chars and 2) all of
: the printable characters.
: What is the most elegant way to perform this check ??
\W may be a reasonable approximation...
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
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 410
*************************************