[6325] in Perl-Users-Digest
Perl-Users Digest, Issue: 947 Volume: 7
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 14 09:17:11 1997
Date: Fri, 14 Feb 97 06:00:30 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 14 Feb 1997 Volume: 7 Number: 947
Today's topics:
Re: "Scalar-list context magic sucks" and other sins of (Jonathan King)
Re: advise with require in perl5 <jander@jander.com>
Re: bincancel:15 large binaries:AR909:@@NCM (Richard E. Depew)
Case insensitive comparison <rupesh@whowhere.com>
Re: Computer Parts Website majewski@ngpsun.ngpc.state.ne.us
Database/Perl/SysAdmin/HTML WANTED aure@cid.com
dbm modules (HCI)
Hanging perl processes on NT? <dpc@generics.co.uk>
Help! Sockets: equiv of sendto & recvfrom (David Walker)
Re: HELP: Pattern Matching Problem (Jeffrey)
Re: How can i search in a html file on a remote server? <roychri@total.net>
Re: howto match newlines? (Tom Grydeland)
Re: howto match newlines? <ajohnson@gpu.srv.ualberta.ca>
matchine multiline C constants (Justin C Lloyd)
matching multiline C constants (Justin C Lloyd)
Re: MLDBM issues - is it transparent? <imran@science.gmu.edu>
Re: Need help with substituion pattern matching [Tom!] (Jeffrey)
Re: OK I know that I am a newbie But I need HELP!! (Tad McClellan)
Re: OK I know that I am a newbie But I need HELP!! (Mike Stok)
Re: perl script bug <e8726057@student.tuwien.ac.at>
Re: PerlXS (Andy Wardley)
Re: PING in Perl for Win32 (Gmeiner Juergen)
Re: PING in Perl for Win32 <I.J.Wiskerke@research.kpn.com>
Re: POP Mail module. PLEASE HELP! (Daniel Macks)
Porting Perl from UNIX to NT (Sara Young)
Sig{'ALRM'} question (Sara Young)
Re: Simple simple question <roychri@total.net>
Stderr file problems (?) <JF6@sprynet.com>
tied filehandle - 'file control' how to? (Helmut Jarausch)
using "$var" considered harmful?! (was Re: Q: opening a (Russell Schulz)
Re: using "$var" considered harmful?! (was Re: Q: openi (Tad McClellan)
Re: what does this line do? <whutch@interactive.wsj.com>
Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 14 Feb 1997 10:19:32 GMT
From: king@cogsci.ucsd.edu (Jonathan King)
Subject: Re: "Scalar-list context magic sucks" and other sins of Perl (was: Re: Q: opening a file...)
Message-Id: <5e1e7k$o7h@news1.ucsd.edu>
Keywords: python, perl, typing
In article <855523415.15377@dejanews.com> aaron_watters@msn.com writes:
>
>From: king@cogsci.ucsd.edu (Jonathan King)
> ... munch munch gulp ...
>
> ... mention of Unix World Python Tutorial by me ...
>
>The matrix multiplication/Perl stuff was from tchrist (with permission)
>as attributed in my Unix World Online article,
Actually, I was disputing neither permission nor source; I just
didn't know how old the code was, which makes some difference
because the ability to omit "->" in some situations came in slightly
later than other perl5 features.
>and the matrix
>multiplication Python code by me is now entirely historical since
>Numerical Python now permits matrices to be multiply by m1 * m2 (ie,
>matrices are builtin numeric types, if the extension is present).
Actually, the matrix multiplication code is still a perfectly fine
example of what Python code looks like. And there is a lot to like
there. As far as Numerical Python goes, Perl has an approxmiate
equivalent in PDL, whose next version is coming up in the very near
future.
>Nevertheless I sympathize with the sentiments of the poster.
Including the sentiments that both Perl and Python should have
strong static typing? Or the sentiment that Python's regexes were,
at my last notice, vastly inferior to Perl's? Or that using
white-space as a statement delimiter in an imperative language is a
bit dicey? I'm a pretty sentimental guy. :-)
jking
------------------------------
Date: 14 Feb 1997 08:55:08 -0500
From: Jim Anderson <jander@jander.com>
Subject: Re: advise with require in perl5
Message-Id: <lo8rxzk3.fsf@jander.com>
rmariott@tiac.net (Bob Mariotti) writes:
>
> several of my perl scripts use the SAME subroutines. Rather than
> include all the code in each, it makes mucho sense to require them in
> the scripts. At the beginning of the scripts there are several
> require "filename.pl"; lines but when executed a message stating that
> the code at line # did NOT return a positive value.
> These subroutines function if included in their entirety without
> require and even with require, as seen in several examples, the
> subroutines end with 1; }
> I tried all of the things I would think of or find reference to.
> And yes, I searche the perl faq's extensively without finding any
> references.
>
> Can anyone shed some light on this? It must be a simple error.
> Thanks in advance.
===================
sub routine1 {
....
}
sub routine2 {
...
}
1;
===================
--
Jim Anderson jander@jander.com
PGP Public Key Fingerprint: 0A 1C BB 0A 65 E4 0F CD
4C 40 B1 0A 9A 32 68 44
------------------------------
Date: Fri, 14 Feb 97 11:01:09 GMT
From: red@redpoll.mrfs.oh.us (Richard E. Depew)
Subject: Re: bincancel:15 large binaries:AR909:@@NCM
Message-Id: <ARMM-Report-909.a@redpoll.mrfs.oh.us>
Keywords: ARMM - Automated Retroactive Minimal Moderation
Large binary posts do not belong in unmoderated discussion groups.
Please read this entire message, the Bincancel FAQ, and the complete
report (see below) before following up to or responding to this article.
As a service to, and with the cooperation of, other news administrators,
I run a program that searches for, and issues advisory cancels for,
large binaries in the akr, biz, comp, humanities, misc, news, rec,
sci, soc, and talk hierarchies.
I have issued 15 cancels for large binary files (average size 210,080
characters - total size 3,151,198 characters) posted to 8 different
unmoderated discussion groups in the comp, misc, news, and rec
hierarchies as follows:
5 rec.collecting.coins
2 news.newusers.questions
2 misc.test
2 comp.os.ms-windows.win95.misc
1 rec.sport.pro-wrestling
1 rec.models.railroad
1 comp.os.ms-windows.nt.admin.misc
1 comp.lang.perl.misc
This pointer is being posted to each affected group listed above,
with the exception of test groups. Follow-ups are directed to
news.admin.net-abuse.usenet.
If you want to see exactly which file was deleted from a particular
group, read the full report in news.admin.net-abuse.bulletins. The
full report can also be found in news.lists.filters and alt.retromod.
Look for AR909 in the subject, or, if your reader supports it,
use <URL:news:ARMM-Report-909@redpoll.mrfs.oh.us>.
The criteria used to search for this batch of large binaries were:
NEWSGROUPS: Unmoderated akr, biz, comp, humanities, misc, news,
rec, sci, soc, or talk (except for comp.binaries.apple2,
comp.bugs.2bsd, and rec.games.bolo)
BINARY: base64, binhex, uuencode, and xbtoa encoded files, etc.
SIZE: > 100,000 characters [(size * (# of parts - .5)), if multi-part]
If you must post a binary to Usenet, please post it *only* to an
appropriate binaries newsgroup such as one in the alt.binaries
sub-hierarchy, and do *not* crosspost it to non-binaries groups.
Then, if you like, post something in the appropriate discussion
group telling people where to find the binary in the binaries group
(a pointer to the binary). This will permit news administrators
and users to decide for themselves whether to receive the binary
files.
For more information about binary cancels, see the bincancel FAQ,
<URL:http://ursula.uoregon.edu/~geniac/binfaq.txt>.
Please direct public feedback to news.admin.net-abuse.usenet and private
feedback to red@redpoll.mrfs.oh.us. In the interests of preventing
cross-posted flame wars, please honor the followup-to header and do
*not* cross-post your reply to multiple groups. Thank you for your
cooperation.
Best wishes,
Dick
--
Richard E. Depew, Munroe Falls, OH red@redpoll.mrfs.oh.us (home)
It's over, and can't be helped, and that's one consolation, as they
always say in Turkey, when they cut the wrong man's head off''
-- Charles Dickens, _The Pickwick Papers_
------------------------------
Date: Fri, 14 Feb 1997 01:16:55 -0800
From: Rupesh Kapoor <rupesh@whowhere.com>
Subject: Case insensitive comparison
Message-Id: <33042D87.248F@whowhere.com>
Hi,
Its probably an easy question. What is the operator/function to compare
two strings in a case insensitive way (or is it an option to cmp
operator?). Don't want to lowercas-ify both strings for efficiency
reasons.
Thanks
Rupesh
------------------------------
Date: Thu, 13 Feb 1997 17:34:58 -0600
From: majewski@ngpsun.ngpc.state.ne.us
Subject: Re: Computer Parts Website
Message-Id: <3303A522.63DC@ngpsun.ngpc.state.ne.us>
Apologies for the top post. It was posted to this
newsgroup by ACCIDENT. Please disregard and
accept my sincere apologies for cluttering things
up with it.
Terry
>majewski@ngpsun.ngpc.state.ne.us wrote:
>
> National Parts Depot is dedicated to the business of replacement
> parts distribution for computers scanners, monitors and printers. A
--
Terry Majewski
Nebraska Game and Parks Commission Phone 402.471.5549
System Administrator/Webmaster http://www.ngpc.state.ne.us/
majewski@ngpsun.ngpc.state.ne.us
http://www.ngpc.state.ne.us/majewski/
------------------------------
Date: Fri, 14 Feb 1997 08:40:12 GMT
From: aure@cid.com
Subject: Database/Perl/SysAdmin/HTML WANTED
Message-Id: <33062427.345220967@news.earthlink.net>
Subject: Positions available:
Programmers with Database and/or System
Administration experience. The database work
will partially consist of managing and improving the
Ultimate Band List. System administrators need to
be familiar with Solaris (required) and Windows
NT (recommended) systems.
HTML Programmers - should have experience
with HTML 3, including Netscape and Internet
Explorer features. The ideal applicant will be
technically competent, with an aptitude for site
presentation, layout and organization.
We are looking for intelligent, creative, experienced
people to work full- or part-time at our Pasadena,
California office. Experience with Java, Javascript, Perl,
Adobe Photoshop, and/or Shockwave Lingo is important
and should be clearly noted on the application.
-Aurelius Prochazka, PhD
Creative Internet Design
200 E. Del Mar Blvd. #109
Pasadena, CA 91105
(818) 564-9132
http://www.cid.com/
------------------------------
Date: 13 Feb 1997 23:55:38 -0800
From: bohandas@best.com (HCI)
Subject: dbm modules
Message-Id: <5e15pq$rof@shellx.best.com>
I went to CPAN to get some modules - I want DBM for NT - and all the
modules were in some form I could not recognize. I wanted a modname.pm,
and all I found were ILYAZ or whatever, and ILYAZ was filled with other
odd looking files.
What is that ILYA stuff and where or how do I get a modname.pm for NT?
bohandas@best.com
------------------------------
Date: Fri, 14 Feb 1997 11:47:42 +0000
From: Diarmuid Coyle <dpc@generics.co.uk>
Subject: Hanging perl processes on NT?
Message-Id: <330450DE.6A13@generics.co.uk>
Hi folks,
I am using perlNT to do some CGI with Netscape Enterprise Server on NT.
Most of
the time it all works fine but when I am generating a report from a
database and I decide
to abort half way through I get perl.exe processes left hanging on the
NT server. I cant even
kill them off from the console. In the perl script I write to a logfile
and providing the
perl script completes the logfile can be deleted, if I abort in the
middle from Netscape it
aborts but refuses to delete the logfile saying its still in use by
another process.
Is there some way I can tell perl to clean up when its told to die by
the Netscape server? Or am I
going about this the wrong way.
Many thanks
Diarmuid Coyle
------------------------------
Date: Fri, 14 Feb 1997 10:34:05 GMT
From: davidw@prl.philips.co.uk (David Walker)
Subject: Help! Sockets: equiv of sendto & recvfrom
Message-Id: <E5L9Ct.KM8@prl.research.philips.com>
Porting a C program to perl.
Using sendto and recvfrom to communicate between a C server and
multiple perl clients. The perl eqivs, send and recv, won't emulate
sendto and recvfrom.
When I do a send from a perl client:
send ( S, $my_pack, 0, $destpaddr ) || die "Cannot send\n" ;
and then do a recv on the client it receives the packet it just sent! My
C server also receives the packet.
recv ( S, $my_pack, $pack_len, 0 ) || die "Cannot receive $!\n" ;
Any pointers will be much appreciated.
davidw
--
########################################################################
# # Philips Research Labs #
# David Walker # Cross Oak Lane #
# # Redhill #
# davidw@prl.research.philips.com # Surrey RH1 5HA #
# "My opinions are... Oooo, Donuts" # tel: 01293 815174 #
# # fax: 01293 815500 #
########################################################################
------------------------------
Date: 13 Feb 1997 12:17:56 GMT
From: jfriedl@tubby.nff.ncl.omron.co.jp (Jeffrey)
To: Geert Nijs <geert.nijs@fys.kuleuven.ac.be>
Subject: Re: HELP: Pattern Matching Problem
Message-Id: <JFRIEDL.97Feb13211756@tubby.nff.ncl.omron.co.jp>
Geert Nijs <geert.nijs@fys.kuleuven.ac.be> wrote:
|> Again a pattern matching problem:
|>
|> String= "these!are!all!words!geert@fys.kuleuven.ac.be"
|>
|> Goal: extract everything after the last ! sign
|> so I want to get 'geert@fys.kuleuven.ac.be'
The simple way is to match with m/!([^!]*)$/ and then use $1, a'la
($addr) = $string =~ m/!([^!]*)$/;
It says that you want '!', followed by a bunch of non-'!' which leads all
the way to the end of the line. If the initial '!' is not the string-final
one, the rest of the regex will fail, therefore leaving the match for later
(when the intial '!' *is* the string-final one).
If the strings are sort of long, or have a fair number of '!' in them, and
efficiency is important, you might consider
1) reversing the string
2) matching the simple m/([^!]*)/
3) reversing $1
a'la:
$x = reverse ((reverse $string) =~ m/([^!]*)/);
This can be quite a bit faster. As for why, that goes to how the Perl regex
engine works on a match. (I have an article in _The Perl Journal_ which
explains it in detail.)
Of course, the best way all around would be simply to use rindex().
Jeffrey
----------------------------------------------------------------------------
Jeffrey Friedl <jfriedl@omron.co.jp> Omron Corp, Nagaokakyo, Kyoto 617 Japan
See my Jap<->Eng dictionary at http://www.wg.omron.co.jp/cgi-bin/j-e
O'Reilly's Regular Expression book: http://enterprise.ic.gc.ca/~jfriedl/regex/
------------------------------
Date: Wed, 12 Feb 1997 14:16:52 -0500
From: Christian Roy <roychri@total.net>
Subject: Re: How can i search in a html file on a remote server??
Message-Id: <33021724.5415@total.net>
Repo wrote:
>
> Hello reader,
>
> I have to search +/- 10,000 url's. Batching the list of url's works.
> Finding a particulair word in a html file is also working.
> But how do i get on the remote server and and search there index.htm
> for example. I tryed to find some examples on the net but i could not
> find some.
>
> I'am using win95 and perl build 303.
>
> Thanx in advance
>
> Robert e Bakker
There is a "webget" script that you may want to use...
go see :
http://enterprise.ic.gc.ca/~jfriedl/perl/
Good Luck!
------------------------------
Date: 14 Feb 1997 09:57:12 GMT
From: tom@palver.nospam.eiscat.no (Tom Grydeland)
Subject: Re: howto match newlines?
Message-Id: <TOM.97Feb14105714@palver.nospam.eiscat.no>
In article <slrn5g6dq3.h0h.dave@fast.thomases.com> dave@fast.thomases.com (Dave Thomas) writes:
> On 13 Feb 1997 15:15:54 GMT, Christoph Ender <chrender@rbg.informatik.th-darmstadt.de> wrote:
> > File to change contains:
> > ------------------------------------------------------------------------
> > printf(
> >
> >
> > "text");
> > ------------------------------------------------------------------------
This answer is to Christoph Ender, not to Dave Thomas. I followup to
Dave's posting so as to use some of his comments.
To change that through one of the s/// commands, you'll have to have
it all in one string. That's why you can't get the substitute to
work, while Dave, who does
> $v = 'printf(
>
>
> "text");
> ';
>
> $v =~ s/printf\(\s*"/printf("/gs;
> print "$v";
makes it work.
Perl's input in line-oriented by default. You'll have to make perl
read larger chunks. Try looking for $/ somewhere in the docs.
(Of course, you'll instantly have problems with greedy quantifiers if
there are more parentheses in your file, but you'll find it out.)
> Maybe there's something wrong with your test program??
> | Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
//tom
------------------------------
Date: Thu, 13 Feb 1997 12:10:45 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: howto match newlines?
Message-Id: <33035925.42EE3D9@gpu.srv.ualberta.ca>
Christoph Ender wrote:
! Hi!
!
! There has been a discussion about stripping text between <a>
! and </a> including newlines some time ago. I've practically
! the same problem, but none of the solutions seems to work
! for me.
!
! File to change contains:
! -------------------------------------------------------------
! printf(
!
!
! "text");
! --------------------------------------------------------------
! I'm looking for an expression that will cut out anything between
! '(' and the first '"', including the newlines and spaces, so
! that the above input will result in printf("text");
!
! The expression
! 's#(printf\()\s*("text"\);)#$1$2#'
! works perfectly on
! printf( "text");
!
! Then I tried to extend it in several ways to get rid of the newlines:
[snip alternates]
i would use a negated character class in your case, that will
match a newline (unless a newline is in the negated class)
$var='printf(
"text");';
$var=~s/(printf\()[^"]*("[^"]*")/$1$2/;
print $var;
this puts the 'printf(' into $1, then matches everything following
which is not a ", then puts the quoted string with quotes into $2.
output is your requested:
printf("text");
cheers,
andrew
------------------------------
Date: 9 Feb 1997 07:06:29 GMT
From: lloyd@cs.fsu.edu (Justin C Lloyd)
Subject: matchine multiline C constants
Message-Id: <5djt1l$h3m@news.fsu.edu>
Currently, I use a simple Perl script for generating a summary of the types of
lines in a C program (i.e. code, comment, blank, etc.) Here is the part that
checks for comments:
while (chop($line = <FP>)) {
...
elsif ($line =~ /^\s*\/\*/) {
while ($line !~ /\*\//) {
$cmt++;
chop($line = <FP>);
}
$cmt++;
}
Is there a better way of doing this?
JcL
--
Justin C. Lloyd ______________________________________________________________
Graduate Teaching Assistant phone: 904/644-0559
Department of Computer Science email: lloyd@cs.fsu.edu
Florida State University www: http://www.cs.fsu.edu/~lloyd
P + L = :)
------------------------------
Date: 9 Feb 1997 07:09:32 GMT
From: lloyd@cs.fsu.edu (Justin C Lloyd)
Subject: matching multiline C constants
Message-Id: <5djt7c$h4s@news.fsu.edu>
Currently I use a Perl script to give a basic summary of the types of lines in
a C program. Here is the part that matches and counts comments:
while (chop($line = <FP>)) {
...
elsif ($line =~ /^\s*\/\*/) {
while ($line !~ /\*\//) {
$cmt++;
chop($line = <FP>);
}
$cmt++;
}
Is there a better way to do this?
JcL
--
Justin C. Lloyd ______________________________________________________________
Graduate Teaching Assistant phone: 904/644-0559
Department of Computer Science email: lloyd@cs.fsu.edu
Florida State University www: http://www.cs.fsu.edu/~lloyd
P + L = :)
------------------------------
Date: Thu, 13 Feb 1997 22:30:54 -0400
From: Imran Shah <imran@science.gmu.edu>
Subject: Re: MLDBM issues - is it transparent?
Message-Id: <3303CE5E.95E65B9@science.gmu.edu>
Ken Williams wrote:
> use Fcntl;
> use lib "/home/ken/temp/MLDBM-1.22";
> use MLDBM(DB_File);
>
> tie (%db, MLDBM, 'testmldbm2', O_CREAT|O_RDWR, 0640) or die $!;
> $db{'002340'} = {'001' => "blah blah blah ",
> '006' => "I am six!",
> 'hiya'=> "Howdy!"};
> untie (%db);
>
> tie (%db, MLDBM, 'testmldbm2', O_RDONLY, 0640) or die $!;
Your code removed, try this:-
while(($k,$v) = each (%$db)){
print "$k\n";
while (($k1,$v1) = each (%$v)){
print "$k1 $v1\n";
}
}
Read MLDBM.pm and the man page.
--
// Imran Shah imran@science.gmu.edu
// Graduate Student
//
// Computational Sciences &Informatics Off (703) 993.3614
// Mail Stop 5C3 Fax (703) 993.1980
// George Mason University Res (757) 623.8725
// 4400 University Drive
// Fairfax, Va 22030-4444
// U. S. A.
------------------------------
Date: 13 Feb 1997 16:06:32 GMT
From: jfriedl@tubby.nff.ncl.omron.co.jp (Jeffrey)
To: tadmc@flash.net (Tad McClellan)
Subject: Re: Need help with substituion pattern matching [Tom!]
Message-Id: <JFRIEDL.97Feb14010632@tubby.nff.ncl.omron.co.jp>
[mail and post]
Tad McClellan <tadmc@flash.net> wrote:
|> This sounds similiar to something from the perl FAQ:
|>
|> 4.28) How can I split a [character] delimited string except when inside
|> [character]?
|
|> undef @fields;
|> push(@fields, defined($1) ? $1:$3) while
|> m/"([^"\\]*(\\.[^"\\]*)*)"|([^,]+)/g;
Going to the FAQ is a right idea, but unfortunately, even after years and
YEARS of trying to get that answer changed (one I wrote, yet has typos and
errors both mine and the administrators), this wrong answer is still there
(Tad kindly fixed one of the typos when copying it from
http://www.perl.com/perl/faq/Q4.28.html, but it still doesn't deal with
empty fields, for example).
[* Tom, someone in charge, I'm _begging_, PLEASE change it! *]
Here's what I recommend now:
@fields = ();
push(@fields, $+) while $text =~ m{
"([^\"\\]*(?:\\.[^\"\\]*)*)",? ## standard string, w/ possible comma
| ([^,]+),? ## anything else, w/ possible comma
| , ## lone comma
}gx;
## final empty field for trailing comma
push(@fields, undef) if substr($text, -1, 1) eq ',';
Jeffrey
----------------------------------------------------------------------------
Jeffrey Friedl <jfriedl@omron.co.jp> Omron Corp, Nagaokakyo, Kyoto 617 Japan
See my Jap<->Eng dictionary at http://www.wg.omron.co.jp/cgi-bin/j-e
O'Reilly's Regular Expression book: http://enterprise.ic.gc.ca/~jfriedl/regex/
------------------------------
Date: Fri, 14 Feb 1997 06:23:05 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: OK I know that I am a newbie But I need HELP!!
Message-Id: <9fl1e5.qn.ln@localhost>
OK we know that you are a newbie But we need a Subject!!
Aaron-Technical Support (aaron@longsword.com) wrote:
: I totally blew my buffer today. My boss saw me reading "Learning Perl" and
: asked me to write a script. OK, no prob; I wrote a functional script. It
: uses `grep blah blah blah` to look up some info in six different error
: logs. The script I wrote works but unfortunatly I only retrievs the
: specific error code that I am looking for in the logfile (i.e. 1 line) when
: I need to retrive "2" specific lines from the log (the date and time of the
: log entry and the error code) from among the multiple lines in the log.
: Am
: I just over looking something here?
Yes. You are overlooking giving us enough information to answer
your question ;-)
What's missing is how to identify the second line that you want.
The line before the match? The line after the match? Three lines
before the match? The line any number of lines before the match
that looks like a date (and tell us what 'looks like a date' means
to you)?
Some other way? ...
We would also be able to give a better answer if we knew the format
of these log files that you are processing. Post a few example
records...
: I anyone would be kind enough to respond (thank you, thank you) please do
: so by email.
^^^^^^^^
This is seen as a very selfish thing to ask for on Usenet. Don't do that!
If we email you the answer then the thousands of people who read the
newsgroup regularly will not get the benefit of the answer.
It is OK to ask for an email _in addition_ to posting, though many (most?)
will ignore that, and just post the answer.
Ask it here, get the answer here...
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 14 Feb 1997 13:47:42 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: OK I know that I am a newbie But I need HELP!!
Message-Id: <5e1qdu$2ji@news-central.tiac.net>
In article <5e0p98$foc@fridge-nf0.shore.net>,
Nathan V. Patwardhan <nvp@shore.net> wrote:
>Well, let's see some code. I presume you're parsing it somehow, right?
>It's *impossible* for us to know what you're doing if you don't include
>anything for us to analyze.
Are you a cunning AI program let loose by someone at MIT?
Mike :-)
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Fri, 14 Feb 1997 08:21:12 +0100
From: Klaus Johannes Rusch <e8726057@student.tuwien.ac.at>
Subject: Re: perl script bug
Message-Id: <33041268.4201@student.tuwien.ac.at>
RKing wrote:
>
> Hello,
>
> I'm running a perl script on unix under perl 4.036 and I can't figure this out.
>
> This is the message I keep getting when I run ./ in unix:
>
> Literal @thepoint now requires backslash at ./wilma line 217, within
> string Execution of ./wilma aborted due to compilation errors.
>
> @thepoint is part of my e-mail.
>
> Literal @thepoint now requires backslash at ./wilma line 217, within
> string Execution of ./wilma aborted due to compilation errors.
>
> # heres the code, it's my e-mail addy:
>
> <ADDRESS>
> <A HREF=mailto:"rking@thepoint.net">rking@thepoint.net</A>
> </ADDRESS>
>
> Can anyone tell me why I'm getting this error msg?
You need to escape the @ sign as \@
Klaus Johannes Rusch
--
e8726057@student.tuwien.ac.at, KlausRusch@atmedia.net
http://www.atmedia.net/KlausRusch/
------------------------------
Date: 14 Feb 1997 08:36:50 -0000
From: abw@peritas.com (Andy Wardley)
Subject: Re: PerlXS
Message-Id: <5e1872$9j0@aoxomoxoa.peritas.com>
>I followed example one to the tee. When I got
>to the part where I ran the "perl test1.pl" I received the following
>error:
>From perlxstut:
> Invoking the test script via ``make test'' did something very important.
> It invoked perl with all those -I arguments so that it could find the
> various files that are part of the extension.
>
> It is very important that while you are still testing extensions that you
> use ``make test''. If you try to run the test script all by itself, you
> will get a fatal error.
However, I think there is an error earlier in the same document (example 1)
where it says:
> Now we run the script and we should see the following output:
>
> % perl hello
> Hello, world!
> %
This is clearly conflicting the later advice. Maybe this is what hung
you up?
A
--
Andy Wardley <abw@peritas.com> http://www.peritas.com/~abw
A responsible and professional individual who has no need for silly
comments, inane banter or bizarre "in-jokes" in his signature file.
------------------------------
Date: 14 Feb 97 09:08:34 GMT
From: gmeinerj@ZUMtOBEL.co.at (Gmeiner Juergen)
Subject: Re: PING in Perl for Win32
Message-Id: <gmeinerj.855911314@sapnv>
enc@pobox.com (Paul Downing) writes:
>>use Net::Ping;
>>$hostname = 'mail.premier.net';
>>$timeout = 10;
>>print ("Mail.premier.net is alive.\n") if pingecho($hostname, &timeout);
^
^ $timeout
Which should give something like "unknown subroutine" ...
>This is the script. I am working on a 486 DX/133 (AMD), 16 MB, and
>Win95 OSR2. I have also tried it on NT 3.51 and 4.0 to no avail. I
>keep getting this message: "Error: Parse exception". Yes, the address
>exists :)
"Parse exception" --- are you sure you are using Perl5? (HINT: Version
4 missed a lot of now valid constructs)
regards,
juergen.
------
UCE-mail me for FREE emacs source code!!!!!
------------------------------
Date: Fri, 14 Feb 1997 10:08:31 GMT
From: "Yvo Wiskerke" <I.J.Wiskerke@research.kpn.com>
Subject: Re: PING in Perl for Win32
Message-Id: <01bc1a5f$233f2f50$32443f8b@g2903>
Paul Downing <enc@pobox.com> wrote in article
<3303d031.838032@207.126.101.80>...
> I am trying to get a simple little Perl script to work. In fact it is
> the example out of the "Programming Perl" book.
>
> >#!/usr/local/bin/perl
>
> >use Net::Ping;
>
> >$hostname = 'mail.premier.net';
> >$timeout = 10;
> >print ("Mail.premier.net is alive.\n") if pingecho($hostname, &timeout);
>
It seems you made at least one mistake:
...pingecho($hostname, &timeout);
must be
...pingecho($hostname,$timeout);
Yvo
------------------------------
Date: 10 Feb 1997 04:53:21 GMT
From: dmacks@netspace.org (Daniel Macks)
Subject: Re: POP Mail module. PLEASE HELP!
Message-Id: <5dm9k2$hpf@cocoa.brown.edu>
mojo (mojo@oregoncoast.com) wrote:
: Is there a POP mail module for perl?
Is there a list of modules posted every week or so?
Answers:
yes (Mail::POP3Client)
yes (and it's also on CPAN)
dan
--
Daniel Macks
dmacks@a.chem.upenn.edu
dmacks@netspace.org
http://www.netspace.org/~dmacks
------------------------------
Date: Thu, 13 Feb 1997 18:52:33 GMT
From: syoung@actcom.co.il (Sara Young)
Subject: Porting Perl from UNIX to NT
Message-Id: <E5K1rM.1qo@actcom.co.il>
How hard is it to port Perl scripts from UNIX to NT? Will I be able to do
such a thing, as a UNIX programmer (no experience with NT)?
Thanks in advance,
Sara
------------------------------
Date: Thu, 13 Feb 1997 10:00:56 GMT
From: syoung@actcom.co.il (Sara Young)
Subject: Sig{'ALRM'} question
Message-Id: <E5JD5K.62A@actcom.co.il>
Is it possible to cause an alarm to do the equivalent of a next statement?
I have a loop that does something. If there is an alarm, I want it to go
on to the next iteration.
I am running on System V.
Please Cc responses to my email address (syoung@actcom.co.il).
Thank you very much,
Sara
------------------------------
Date: Wed, 12 Feb 1997 10:47:41 -0500
From: Christian Roy <roychri@total.net>
Subject: Re: Simple simple question
Message-Id: <3301E61D.1379@total.net>
Joe Schulte wrote:
>
> Okay, this is bugging the hell out of me, and it really shouldn't be that
> hard. Problem is, neither of the books I have tells me how to do it...
> I'm reading a number from a file. Only thing in the file is that number.
> No problem. Except when I use 'chop' to read it, it becomes a string. I
> want to now manipulate this as a number. How? The command must exist -
> hell, even AppleBASIC had the val()_ command.
> So, how do I convert a number to a string and vice versa?
>
When I want to convert a String into a Int, I do
$Int = $String + 0;
When I want to convert Integer to String I do :
$String = "$Integer";
Good Luck!
------------------------------
Date: Thu, 13 Feb 1997 20:21:39 -0500
From: Joel Frey <JF6@sprynet.com>
Subject: Stderr file problems (?)
Message-Id: <3303BE23.9F6@sprynet.com>
I recently bought a book on programing Cgi with perl and when I try to
run a script I kepp egtting the same message "Error: Failure to create
CGI Stderr file". Im runing Fnord as my server to test with but I have
accsess to Website, Alibaba, and winHTTPd(fro win 3.1). Im runing Win
95. I have perl.exe in the dir listed in the program. The dir is in
autoexec.bat and there is a copy of the perl in the dir c:\ .
If you can help me I would appreacat(sp) it.
Please send me a copy of responces(sp) to me by E-mail as well as posts
because I'm not yet a regular reader.
Thanks in advance.
Joel Frey
--
"Do not compute the totality of your poultry population until
all the manifestations of incubation have been entirely completed."
-- William Jennings Bryan
------------------------------
Date: 14 Feb 1997 10:56:26 GMT
From: jarausch@numa1.igpm.rwth-aachen.de (Helmut Jarausch)
Subject: tied filehandle - 'file control' how to?
Message-Id: <5e1gcq$f9g$1@news.rwth-aachen.de>
Hi,
I have a problem accessing functions in the package a filehandle is tied to.
given
package Numeric_Input;
sub TIEHANDLE {...}
sub READLINE {...}
sub MyFCTL {...} # quite abstract like flush or set translate mode etc
package main;
tie *GIN,'Numeric_Input',"Geometry.dat";
anywhere later I would like to invoke MyFCTL with the object ref
that has been returned by TIEHANDLE when
it has been invoked.
So
(what must be in here)->MyFCTL
How can I find this ref ?
Thanks for any hints.
--
Helmut Jarausch
Lehrstuhl f. Numerische Mathematik
Institute of Technology
RWTH Aachen
D 52056 Aachen, Germany
------------------------------
Date: Thu, 13 Feb 1997 22:38:45 -0700
From: Russell_Schulz@locutus.ofB.ORG (Russell Schulz)
Subject: using "$var" considered harmful?! (was Re: Q: opening a file RW without deleting it.)
Message-Id: <19970213.223845.5F8.rnr.w164w_-_@locutus.ofB.ORG>
Randal Schwartz <merlyn@stonehenge.com> writes:
> Just like (from one of my books, bleh):
>
> open HANDLE, "$filename";
>
> Why are those quotes there?!? (In reality, because I had originally
> written "<$filename", but then realized that the "<" was mostly
> redundant.) This is yes, technically correct, but extrapolates to
> mostly bad behavior. Just like your "scalar".
exactly what `mostly bad behavior'?
over and over in the group I see people write code like
$var1="$var2";
and always people respond
why are the quotes there???
like they're HARMFUL or something. I find that I do this a lot when
I'm expecting to add in another variable, or I want to have constant
text around the string, or I just don't know what I'm going to do with
it exactly.
it's a lot easier to go to
$var1="using: $var2" or $var1="$prefix$var2"
or similar, common (to me) extensions, than if I didn't put the quotes
there to begin with (or religiously removed them when they weren't
necessary).
I find it all much like warning people about escaping obscure punctuation
on the right hands of regexes when they don't need to, or putting extra {}
in C where they don't need to, or using () around conditionals in Pascal
where you don't need to -- they just make maintenance that much easier,
and lead to fewer surprises.
--
Russell_Schulz@locutus.ofB.ORG Shad 86c
------------------------------
Date: Fri, 14 Feb 1997 06:30:23 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: using "$var" considered harmful?! (was Re: Q: opening a file RW without deleting it.)
Message-Id: <vsl1e5.ao.ln@localhost>
Russell Schulz (Russell_Schulz@locutus.ofB.ORG) wrote:
: Randal Schwartz <merlyn@stonehenge.com> writes:
: > Just like (from one of my books, bleh):
: >
: > open HANDLE, "$filename";
: >
: > Why are those quotes there?!? (In reality, because I had originally
: > written "<$filename", but then realized that the "<" was mostly
: > redundant.) This is yes, technically correct, but extrapolates to
: > mostly bad behavior. Just like your "scalar".
: exactly what `mostly bad behavior'?
: over and over in the group I see people write code like
: $var1="$var2";
: and always people respond
: why are the quotes there???
: like they're HARMFUL or something.
Well, some feel that using more CPU cycles than you need to _is_ harmful...
Variable interpolation is _much_ slower that using a simple variable.
: I find that I do this a lot when
: I'm expecting to add in another variable, or I want to have constant
: text around the string, or I just don't know what I'm going to do with
: it exactly.
: it's a lot easier to go to
: $var1="using: $var2" or $var1="$prefix$var2"
: or similar, common (to me) extensions, than if I didn't put the quotes
: there to begin with (or religiously removed them when they weren't
: necessary).
: I find it all much like warning people about escaping obscure punctuation
: on the right hands of regexes when they don't need to, or putting extra {}
: in C where they don't need to, or using () around conditionals in Pascal
: where you don't need to -- they just make maintenance that much easier,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Putting in double quotes (escaping, etc...) that don't _do_ anything
makes maintenance that much _harder_.
You need to spend time to figure out that it isn't doing anything...
: and lead to fewer surprises.
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Wed, 12 Feb 1997 14:37:41 -0800
From: William Hutchison <whutch@interactive.wsj.com>
To: Raymond Cheung <ycheung@Bayou.UH.EDU>
Subject: Re: what does this line do?
Message-Id: <33024635.2AA6@interactive.wsj.com>
Raymond Cheung wrote:
>
> I don't understand this line:
>
> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>
> it appears in a cgi script. Could someone explain it?
> Thanks.
>
> --
> +-------------------------------------------------------------------------+
> | Raymond Cheung -+
It is the dreaded URL decoding, described eloquently at
http://www.jmarshall.com/easy/cgi/
and
news:comp.infosystems.www.authoring.cgi
Bill
------------------------------
Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Jan 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.
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 V7 Issue 947
*************************************