[7363] in Perl-Users-Digest
Perl-Users Digest, Issue: 988 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 7 05:22:12 1997
Date: Sat, 6 Sep 97 21: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 Sat, 6 Sep 1997 Volume: 8 Number: 988
Today's topics:
[Q] Strange pack() results (Nicholas J. Leon)
Re: C++Builder means Future. <JohnP@MStarMedia.com>
Re: C++Builder means Future. <rmelson@primenet.com>
Re: Can I specify fonts? <petri.backstrom@icl.fi>
Re: Can I specify fonts? <dmunn@novell.com>
flock() time <jfitz@oaktree.net>
Getting rid of ] and [ in perl <mweber@vt.edu>
Re: Getting rid of ] and [ in perl <fawcett@nynexst.com.SPAMMERS-OFF-EARTH-NOW>
Re: How do I embed C in Perl (dave)
HTML Table to Array (John Steele)
Incredibly basic Newbie question <Fred@nospam.com>
Re: Incredibly basic Newbie question (Dave Schenet)
Re: LWP::Simple malloc error (Erik E. Rantapaa)
Re: oraperl on perl 5? (John D Groenveld)
Re: Pattern matching problem with \n (Ha_Ha_X)
PERL COMMAND Equivalent to Unix COMM (BDMA (B.D.M.A.))
Perl Expert/Knowledge based system? (Bruce Spedding)
Re: Perl's support on Win NT <petri.backstrom@icl.fi>
Re: Perl5.004.01 debugger doesn't work (Mick Ghazey)
Re: script.pl to script.bat? <youngej@magpage.com>
Re: What's the difference b/w Oraperl versions? (John D Groenveld)
Re: What's wrong with my 'if' statement? <fawcett@nynexst.com.spam-me-not>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 6 Sep 1997 19:54:35 GMT
From: nicholas@neko.binary9.net (Nicholas J. Leon)
Subject: [Q] Strange pack() results
Message-Id: <slrn613d7o.17b.nicholas@neko.binary9.net>
Hi again, neighbors.
I was writing a perl module to handle [uw]tmp files (since the package
advertised on CPAN cannot be located) and I've run across some
confusion.
It's creating the pack string that equals the structure of utmp. From
my /usr/include/utmp.h:
/* size of user name */
#if 1
#define UT_LINESIZE 12
#define UT_NAMESIZE 8
#define UT_HOSTSIZE 16
struct utmp
{
short ut_type; /* type of login */
pid_t ut_pid; /* pid of login-process */
char ut_line[UT_LINESIZE]; /* devicename of tty -"/dev/"
,null-term */
char ut_id[4]; /* inittab id */
time_t ut_time; /* login time */
char ut_user[UT_NAMESIZE]; /* username, not null-term */
char ut_host[UT_HOSTSIZE]; /* hostname for remote login... */
long ut_addr; /* IP addr of remote host */
};
Cool, so I can up with this:
#!/usr/local/homes/nicholas/bin/perl
use strict;
my $PACK="SLA12A4LA8A16L";
my $PACKSIZE=length(pack($PACK,0));
my $buff;
my @info;
print "$PACKSIZE\n";
open(UTMP,"</etc/utmp") || die $!;
while (sysread(UTMP,$buff,$PACKSIZE)) {
@info=unpack($PACK,$buff);
print join(",",@info)."\n";
}
Well, that didn't work:
nicholas@neko:...perl/samples > utmp
54
1,1311965184,~,~~,2150236160,4runlev,el,0
0,8,,,12626,,,0
0,524288,,,844234752,,,0
0,0,,0,R3,,0
0,_co,nsol,101,s;,4,0
0,0,,ttyp,48,p0,>4nicholas:tty,1396322387
12334,0,<,tt,3240057,p1,d4nicholas:t,810776948
21306,12590,,c,1887007860,2,p2=4nicholas,2037675066
12371,841896762,,@e,1953759232,yp3,p3M.4nichol,1635021665
11887,1634625890,ry9.net:",@,1059,ttyp4,p4/4nich,1935764591
24948,1768042095,nary9.net:",,74661888,ttyp5,p5W04ni,1819240547
29537,779051380,binary9.net:,",,
Ok, well, let's verify that structure in utmp.h:
#include <utmp.h>
main() {
struct utmp u;
printf("%d\n",sizeof(u));
printf("%d %d %d %d %d %d %d %d\n",
sizeof(u.ut_type),
sizeof(u.ut_pid),
sizeof(u.ut_line),
sizeof(u.ut_id),
sizeof(u.ut_time),
sizeof(u.ut_user),
sizeof(u.ut_host),
sizeof(u.ut_addr));
}
and that outputted:
nicholas@neko:...perl/samples > gg
56
2 4 12 4 4 8 16 4
Which if you add up the individual sizeof's, you get 54. So I'm
missing an element someplace (I /do/ have the pack sizes/symbols
correct, right?):
#!/usr/local/homes/nicholas/bin/perl
use strict;
my $PACK="S L A12 A4 L A8 A16 L";
my @part=split / /,$PACK;
for (@part) {
print "$_ = ".length(pack($_,0))."\n";
}
which gave me:
nicholas@neko:...perl/samples > utmps
S = 2
L = 4
A12 = 12
A4 = 4
L = 4
A8 = 8
A16 = 16
L = 4
Which is the same. So even if I'm missing a few bytes at the end of
the structure, the first record should be parsed correctly.
I then started messing with the individual sizes:
my $PACK="SLA13A5LA8A16L";
And lo and behold!
nicholas@neko:...perl/samples > utmp
56
1,1311965184,~,~~,873562154,runlevel,,0
8,0,,R1,0,,,0
8,0,,R2,0,,,0
8,0,,R3,0,,,0
8,6227969,console,s,873562171,,,0
7,8912896,ttyp0,p0,873562174,nicholas,:ttyS0:S.0,0
7,12320768,ttyp1,p1,873563108,nicholas,:ttyS0:S.1,0
7,31653888,ttyp2,p2,873563453,nicholas,:ttyS0:S.2,0
7,65355776,ttyp3,p3,873574093,nicholas,tao.binary9.net:,162
7,69419008,ttyp4,p4,873574276,nicholas,tao.binary9.net:,162
7,74661888,ttyp5,p5,873574615,nicholas,tao.binary9.net:,162
So here's my question: why does it work this way? I changed the size
of the first two strings (the first being commented as null-term'd,
the second non-null-term'd), when I don't think I should have to.
I have a feeling this answer is going to be pretty simple, but I can't
seem to get it.
------------------------------
Date: Sat, 06 Sep 1997 20:26:07 -0400
From: John Palmieri <JohnP@MStarMedia.com>
Subject: Re: C++Builder means Future.
Message-Id: <3411F49F.C90A6740@MStarMedia.com>
John Allen wrote:
> Frank C. Earl wrote:
> >
> > On Wed, 16 Apr 1997 16:46:45 -0700, 34110s96@student.csi.cuny.edu
> > wrote:
> >
> > >I just got C++Builder and I have never seen a powerful RAD tool
> like
> > >this one. Forget about the Visual Crap. C++Builder is the King
> of the
> > >Hill and not Marketing hype of Microsoft.
> >
> > And if only it was on Linux, we'd be in hog-heaven. Thing is, it's
> on
> > MS-Windows.
> >
> > --
>
> If only it was built using Star Division's StartView then it could be
> on
> all
> platforms!
>
> --
> --
> ----------------------------------------------------------------------------
>
> Disclaimer: IBM are not responsible for anything I say or do in a
> public
> fora.
> -----
> -------------------------------------------------------------------------
It will be on IBM's AS/400 which is a UNIX derivitive. I think
BORLAND is biding it's time and waiting to see what happens with JAVA
and the fact that Microsoft is trying to crush them. When they get more
revenue in and UNIX seems like a money-maker they will most likely (if
they have any buisness sence) create VCL libraries for SunOS, and Irix
but since Linux is not a money making platform I realy doubt that they
will plunge a whole division into that project. So basicly it is up to
us Linux hacks to go in and update the VCL with X-Windows specific code
and create some make files that will automaticly compile the sources
with gpp. That is assuming that C++Builder outputs and links it's source
the same as traditional C++ compilers. (Hope it doesn't keep extra info
files. Guess we'll just have to hack those too). You would still have
to author on windoze. Anyone up to the challange?
--
-------------------------------------------------------
John Palmieri
Aka. Quinticent
E-Mail: JohnP@Mstarmedia.com
Quinticent@aol.com
Quinticent@worldnet.att.com
Quinticent@earthling.net
Programmer - C/C++, Pascal, Delphi, Java1.1, JavaScript, Perl,
HTML, Director, Lingo, Shockwave,
Linux, MacOS, Win95/NT
--------------------------------------------------------
------------------------------
Date: 6 Sep 1997 18:24:00 -0700
From: Robert Melson <rmelson@primenet.com>
Subject: Re: C++Builder means Future.
Message-Id: <3412022C.41C67EA6@primenet.com>
John Palmieri wrote:
>
> John Allen wrote:
>
> > Frank C. Earl wrote:
> > >
> > > On Wed, 16 Apr 1997 16:46:45 -0700, 34110s96@student.csi.cuny.edu
> > > wrote:
> > >
> > > >I just got C++Builder and I have never seen a powerful RAD tool
> > like
> > > >this one. Forget about the Visual Crap. C++Builder is the King
> > of the
> > > >Hill and not Marketing hype of Microsoft.
> > >
> > > And if only it was on Linux, we'd be in hog-heaven. Thing is, it's
> > on
> > > MS-Windows.
> > >
> > > --
> >
> > If only it was built using Star Division's StartView then it could be
> > on
> > all
> > platforms!
> >
> > --
> > --
> > ----------------------------------------------------------------------------
> >
> > Disclaimer: IBM are not responsible for anything I say or do in a
> > public
> > fora.
> > -----
> > -------------------------------------------------------------------------
>
> It will be on IBM's AS/400 which is a UNIX derivitive. I think
> BORLAND is biding it's time and waiting to see what happens with JAVA
> and the fact that Microsoft is trying to crush them. When they get more
> revenue in and UNIX seems like a money-maker they will most likely (if
> they have any buisness sence) create VCL libraries for SunOS, and Irix
> but since Linux is not a money making platform I realy doubt that they
> will plunge a whole division into that project. So basicly it is up to
> us Linux hacks to go in and update the VCL with X-Windows specific code
> and create some make files that will automaticly compile the sources
> with gpp. That is assuming that C++Builder outputs and links it's source
> the same as traditional C++ compilers. (Hope it doesn't keep extra info
> files. Guess we'll just have to hack those too). You would still have
> to author on windoze. Anyone up to the challange?
>
> --
> -------------------------------------------------------
> John Palmieri
> Aka. Quinticent
> E-Mail: JohnP@Mstarmedia.com
> Quinticent@aol.com
> Quinticent@worldnet.att.com
> Quinticent@earthling.net
>
> Programmer - C/C++, Pascal, Delphi, Java1.1, JavaScript, Perl,
> HTML, Director, Lingo, Shockwave,
> Linux, MacOS, Win95/NT
> --------------------------------------------------------
--
Last time I looked, AS/400 was an RPG derivative and OS/400 - the
operating system - was a strictly proprietary os bearing a closer
resemblance to MVS and the other mainframe oses than to anything like
UNIX.
This isn't meant to be the start of a flame war.
----------------------------------------------------------------------------
Bob Melson The right to be heard does not include
Rio Grande Microsolutions the right to be taken seriously
El Paso, TX rmelson@primenet.com Hubert Humphrey
----------------------------------------------------------------------------
------------------------------
Date: Sat, 06 Sep 1997 20:56:35 +0300
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: Can I specify fonts?
Message-Id: <34119953.4F77@icl.fi>
Gina Anderson wrote:
>
> Newbie here...I am just starting with CGI and Perl, but I have a
> question I have not been able to find in any book I got, or anywhere on
> the web for that matter.
>
> I have a guestbook that I am currently trying to customize. I use the
> font Arial or Helvetica in all my web pages using the font face tag in
> the HTML, and the guestbook cgi outputs regular times new roman, or
> default font for the platform.
>
> Is it possible to specify a certain font output to create? I know,
> picky, picky! :)
>
> If this is possible, how and where would I put this in the CGI?
Perl doesn't know or care about fonts, but since you are
writing a CGI script, just output whatver HTML tags make
the browser switch to a different font:
print '<FONT FACE="Arial, Helvetica">';
print 'Other stuff';
print '</FONT>';
Seel also this about CGI.pm:
http://www-genome.wi.mit.edu/ftp/pub/software/WWW/cgi_docs.htm
Use it.
regards,
...petri.backstrom@icl.fi
ICL Data Oy
Finland
------------------------------
Date: Fri, 05 Sep 1997 11:26:47 -0600
From: Douglas Munn <dmunn@novell.com>
Subject: Re: Can I specify fonts?
Message-Id: <341040D7.68E4@novell.com>
Andrew Starr wrote:
>
> In article <340ED6DD.FE6486E6@one.net>, Gina Anderson <ginakra@one.net> wrote:
>
> > I have a guestbook that I am currently trying to customize. I use the
> > font Arial or Helvetica in all my web pages using the font face tag in
> > the HTML, and the guestbook cgi outputs regular times new roman, or
> > default font for the platform.
> >
> > Is it possible to specify a certain font output to create? I know,
> > picky, picky! :)
>
> Yes. To the same extent you can specify an HTML tag in raw HTML, you can in
> your perl script as well. I don't know how to specify fonts in HTML, but
> I'll use font size as a related example.
>
> HTML:
> <FONT SIZE = + 2>Hello!</FONT>
>
> Perl:
> print "<FONT SIZE = + 2>Hello!</FONT>\n";
>
> Sometimes you have to watch out for those characters which perl treats
> specially, and put a \ before it so that Perl treats it literally instead
> of interpreting it the way Perl normally would.
>
> Good luck!
>
> -Andrew
>
> --
> Andrew Starr e-mail via http://www.amherst.edu/~atstarr
NO PROBLEM.
I write quite a few HTML tools Perl. A favorite Perl "structure" that I
use is:
print fileout <<endofdata
<font face="arial, helvetica" size="2">
This is a grand life.
</font>
endofdata
The "endofdata" becomes the container for for the HTML text. That way I
don't have to worry about having to include \" in the code. Another
advantage is that newlines are included when the code is printed out.
doug
------------------------------
Date: Sat, 06 Sep 1997 18:26:47 -0500
From: Jerry <jfitz@oaktree.net>
Subject: flock() time
Message-Id: <3411E6B6.65F90D67@oaktree.net>
How long does a second process keep attempting to access a file that has
been flocked by a previous process?
Is there a default time length, or is there a way to control this length
of time (i.e., tell the second process to try for only 10 seconds before
erroring out)?
I have looked in the docs, and this group, and the archives, but still
couldn't find the answer.
Awaiting any informative help,
Jerry
------------------------------
Date: Sat, 06 Sep 1997 21:44:44 -0400
From: Matt Weber <mweber@vt.edu>
Subject: Getting rid of ] and [ in perl
Message-Id: <3412070C.5A6@vt.edu>
How do I get rid of these two charectors in perl: []
It should be
$value=~ s/[]//g;
right???
Why is this not working?
M. Weber
--
http://www.weberworld.com
[Live Broadcasts 24 hrs a day!]
------------------------------
Date: 06 Sep 1997 22:16:13 -0400
From: Tom Fawcett <fawcett@nynexst.com.SPAMMERS-OFF-EARTH-NOW>
Subject: Re: Getting rid of ] and [ in perl
Message-Id: <8jk9gtna1e.fsf@nynexst.com.SPAMMERS-OFF-EARTH-NOW>
Matt Weber <mweber@vt.edu> writes:
> How do I get rid of these two charectors in perl: []
>
> It should be
> $value=~ s/[]//g;
> right???
Quote those square brackets: s/\[\]//g;
Else it's just another empty character class.
-Tom
------------------------------
Date: Sat, 06 Sep 1997 20:55:01 GMT
From: over@the.net (dave)
Subject: Re: How do I embed C in Perl
Message-Id: <3411c251.4699877@news.one.net>
Tom Phoenix <rootbeer@teleport.com> wrote:
>On Thu, 4 Sep 1997 duesterwald@gei-aachen.de wrote:
>
>> I need to embed C in a perl script. What do I need to do?
>>
>> Which are the most helpful tools and modules?
>
>Start with 'man perl', which will direct you to other manpages. After
>you've read the manpages on this subject, if you've still got questions,
>please ask again. Thanks!
>
I have one:
I think I'm more than confused. I got the impression that C routines
must be embedded in the perl installation, rather than being
selectively "loaded" by a script. If this is not the case, could you
point me to where there is specific info on how they are selectively
loaded?
Thanks,
Dave
|
| Please visit me at http://w3.one.net/~dlripber
|
| For reply by email, use:
| dlripber@one.net
|________
------------------------------
Date: Sat, 06 Sep 1997 21:23:37 GMT
From: $jsteele@insyte.com (John Steele)
Subject: HTML Table to Array
Message-Id: <5ushks$8sn$1@news.netrunner.net>
Does anyone know of a module that will rip apart an HTML table and return the
data in an array, etc.
John
.
------------
SPAM STOPPER
Regretably, this is now necesary so,
Remove the $ for EMAIL
Thanks
------------
------------------------------
Date: Sat, 06 Sep 1997 14:38:52 +0000
From: Fred <Fred@nospam.com>
Subject: Incredibly basic Newbie question
Message-Id: <34116AFC.761A@nospam.com>
I'm just beginning to look at perl. I bought a book which helped
(although it's a bit over my head for now), and all I'm trying to do is
run a sample perl program under Windows95. Is this possible?
Unfortunately, the book doesn't mention something this simple.
I'm starting with the most basic Hello World program:
#!/usr/local/bin/perl
#
# Program to do the obvious
#
print 'Hello world.';
and I simply want to see it do something before I move on to more
difficult tasks. My problem is that I have no idea how to run the damn
thing (under Windows95). I typed it as text with Notepad, then changed
the filetype to .prl but when I try to run it via the Start/Run
function of Windows95, it simply opens it as a text file. Do I have to
go to the MS.DOS window? What exact steps do I have to take to run it?
Can it be run on a p.c. or does it need to be uploaded first to a UNIX
system?
If it can be run from a p.c., do I need to compile it first, or is that
part of the run fuction? Do I need a program/compiler that is not part
of the general Windows95 system (and if so, which one, and how do I
install it?)
(Can someone point me to a tutorial or book which covers such elementary
basics?)
------------------------------
Date: 6 Sep 1997 22:19:07 GMT
From: shodan@shodan.erols.com (Dave Schenet)
Subject: Re: Incredibly basic Newbie question
Message-Id: <5usksr$8md@winter.news.erols.com>
I am somewhat unfamiliar with perl on a 95 box, but here goes..
Fred (Fred@nospam.com) wrote:
: (although it's a bit over my head for now), and all I'm trying to do is
: run a sample perl program under Windows95. Is this possible?
Very possible.
: I'm starting with the most basic Hello World program:
: #!/usr/local/bin/perl
[rest of valid 'Hello World' program snipped]
#! is a UNIX thing; AFAIK it will be treated as a comment in 95, and
ignored.
Probably what you could do, is give it a .pl extension, and then associate
.pl files with PERL.EXE (or whatever it is.), or run them from the command
line..
C:\> perl script.pl
HTH.
--
+----------------------------------+-----------------------------------+
|Dave Schenet - shodan@erols.com | Erols Internet Services, INC. |
|Junior UNIX Developer | Springfield, VA. |
+----------------------------------+-----------------------------------+
------------------------------
Date: 6 Sep 1997 21:56:26 GMT
From: rantapaa@math.umn.edu (Erik E. Rantapaa)
Subject: Re: LWP::Simple malloc error
Message-Id: <5usjia$l77@epx.cis.umn.edu>
>From what I can tell the problem is with the cgi script at getty.edu.
LWP %-escapes many more characters than other clients do, and I believe
the problem is that the cgi script doesn't expect the carets ('^') to
be %-escaped. If you open the url with Netscape and substitute %5E for
the carets you will get the same result.
perldoc URL explains this somewhat.
--
Erik Rantapaa
rantapaa@math.umn.edu
In article <341013DC.59624791@acf2.nyu.edu>,
Sean Redmond <redmonds@acf2.nyu.edu> wrote:
>I'm having trouble retrieving a page with LWP::Simple (source of the
>page is at the end of this message). The following lines (using Perl
>5.004_02 on Win95):
>
>use LWP::Simple;
>getprint(
>"http://www.ahip.getty.edu/cgi-bin/aka/multwais.pl?wais://192.215.101.7:210/Avery2.src/9632985%20734%20/wais/data/Avery/av.dash7^TEXT^ovid%2A^/aka/aka_form_pub.html^/aka/images/ahiplogo.gif^http://www.gii.getty.edu/"
>);
>
>Result in this output:
><HEAD><TITLE>Searching the Getty Databases</TITLE></HEAD>
><body bgcolor="#ffffff">
><A HREF=""><IMG align=left border=no
> SRC="/aka/images/new_search.gif"></A><p>
><A HREF="http://www.gii.getty.edu"><img border=no
>src="/aka/images/ahiplogo.gif"></a>
>
><p><hr><b>Keywords: </b><br><b>Database: </b><hr><p>Error on reading
>file. Malloc ran out of memory in an ANY<PRE></PRE>
>
>I haven't had this problem with other pages, just ones on this site. Is
>it a problem with LWP, Windows95, or this page?
>
>
>Source of the page I'm trying to retrieve:
><HEAD><TITLE>Searching the Getty Databases</TITLE></HEAD>
><body bgcolor="#ffffff">
><A HREF="/aka/aka_form_pub.html"><IMG align=left border=no
> SRC="/aka/images/new_search.gif"></A><p>
><A HREF="http://www.gii.getty.edu/"><img border=no
>src="/aka/images/ahiplogo.gif"></a>
>
><p><hr><b>Keywords: ovid*</b><br><b>Database: Avery Index to
>Architectural Periodicals</b><hr><p><PRE>TITLE : Di alcuni
>temi <b>ovid</b>iani nel piano nobile del
> Palazzo Capodiferro: iconografia e significato
>AUTHOR(S) : Ciofetta, Simona
> | Vicini, Maria Lucrezia
>ILLUS. : ill., photos.
>LANGUAGE : Italian
>JOURNAL : Bollettino d'arte: 1991 Nov.-Dec., v.76, n.70,
> p.105-119
>ISSN : 0391-9854.
>NOTE(S) : Includes bibliographical references.
>SUBJECT(S) : Iconography--Renaissance
> | Mythology--Symbolic aspects
> | Mural painting and decoration--Renaissance--Italy--
> Rome--Palazzo Capodiferro
>AVERY CALL : N4 B61
>ID : RLINNYCA93-V4697
></PRE>
>
>--
>Sean Redmond
>New York University
>redmonds@acf2.nyu.edu
>Homepage: http://www.nyu.edu/classes/latin2/
>Recent Ovidian Bibliography (1990-):
>http://www.nyu.edu/classes/latin2/ovidbib.html
--
Erik E. Rantapaa -- rantapaa@math.umn.edu
------------------------------
Date: 6 Sep 1997 17:38:42 -0400
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: oraperl on perl 5?
Message-Id: <5usih2$60n$1@tholian.cse.psu.edu>
In article <mward-ya023580000509970651580001@SanFrancisco01.news.Internex.Net>,
Michael Ward <mward@veelos.com> wrote:
>Has anyone been able to use oraperl with perl 5? I'm getting errors caused
>by the lack of .o files that don't exist in this version.
Quite a bit of knowledge and vast amounts of noise are archived at Dejanews
http://www.dejanews.com/. Try query for "oraperl" against the old archive.
John
groenvel@cse.psu.edu
------------------------------
Date: Sat, 06 Sep 1997 21:39:08 GMT
From: spam-yourself@127.0.0.1 (Ha_Ha_X)
Subject: Re: Pattern matching problem with \n
Message-Id: <3411c7ad.2236436@128.122.253.83>
>On Sun, 31 Aug 1997, Ha_Ha_X wrote:
>
>> I'm writing a script that takes a series of strings, scans them for
>> '\n', '\t', and '\\\\' (two backslashes), and replaces each of them
>> with physical newlines, tab characters, and backslashes respectively.
>> In other words, I'm trying to read strings in and process C-style
>> escape sequences in those strings.
On Sun, 31 Aug 1997 15:48:28 -0700, Tom Phoenix wrote:
>No, those won't work. You don't have the right characters there, and (more
>importantly) you want to do the transformation in parallel. (Imagine doing
>this transformation on the sequence backslash-backslash-n and you'll see
>what I mean.)
>
> {
> my %map;
> BEGIN {
> %map = (
> n => "\n",
> t => "\t",
> '\\'=> "\\",
> ) }
> $somestring =~ s#\\([nt\\])#$map{$1}#g;
> }
This is a lot better than what I had, but unfortunately it still
doesn't process an arbitrary number of backslashes correctly. Four
backslashes should become two, five backslashes should become three
(unless followed by n or t), etc. This solution is good enough for
now, but I'm still looking for a true general solution.
At this point I'm thinking of using chop() or some other standard
library function to get each character into an array so I can just
process it the C way. If anyone can dissuade me with a
pattern-matching solution I'd be eternally grateful.
~k.lee (e-mail address in my .sig, not in the headers!)
h a - h a - x_/ \_/ \_/ \_ Webfoot, New Ink:
/ \_/ \_/ \_ http://www.nyu.edu/pubs/new.ink
kql6708@is.nyu.edu \_/ \_/ \_ Visit the Radiohead Mailing List FAQ:
http://members.aol.com/hahax/ \_ http://members.aol.com/hahax/rhfaq/
------------------------------
Date: 6 Sep 97 08:30:14 GMT
From: berryb@bbs.ug.eds.com (BDMA (B.D.M.A.))
Subject: PERL COMMAND Equivalent to Unix COMM
Message-Id: <1997Sep6.083014@bbs.ug.eds.com>
Is there a PERL command that is like the Unix Shell "comm" command. comm
selects duplicate or unique lines between two sorted files. If there is a PERL
equivalence, please mail it to: bberry@barney.mdhc.mdc.com
Thank you,
Brett Berry
------------------------------
Date: Sun, 7 Sep 1997 11:46:36 LOCAL
From: Bruce@winzurf.co.nz (Bruce Spedding)
Subject: Perl Expert/Knowledge based system?
Message-Id: <Bruce.646.00251AA9@winzurf.co.nz>
Anyone know of one available?
tia
Bruce
------------------------------
Date: Sat, 06 Sep 1997 21:18:41 +0300
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: Perl's support on Win NT
Message-Id: <34119E81.3032@icl.fi>
Scott McMahan wrote:
>
> Larry Nguyen (Larry_P_Nguyen@qmail2.sp.trw.com) wrote:
> : I'm in the process of selecting a computer language/tool to write CGI
> : programs. Could some one please let me know what are the best choices
> : now? How is Perl supported on the Win NT platform? How do I get/purchase
> : the software?
>
> www.perl.hip.com
>
> While Perl is available, Perl + CGI + NT is a total loss and will
> frustrate you to no end. There's no documentation on it that
> I've ever seen, and it works poorly.
>
> Scott
Forget www.perl.hip.com; it was replaced by
http://www.activeware.com, which is now
http://www.activestate.com, but there's
also an NT port of "core" Perl, which
you can get to via http://www.perl.com/CPAN/,
for example.
Perl + CGI + NT doesn't frustrate me at all;
it works just fine and dandy for those CGI
apps I've done.
If you need help setting up Perl to work
with many of the popular web servers for
Windows NT, then take a look at:
http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html
regards,
...petri.backstrom@icl.fi
ICL Data Oy
Finland
regards,
...petri.backstrom@icl.fi
ICL Data Oy
Finland
------------------------------
Date: Sun, 07 Sep 1997 02:57:50 GMT
From: mick@lowdown.com (Mick Ghazey)
Subject: Re: Perl5.004.01 debugger doesn't work
Message-Id: <341213ad.27890671@news.lowdown.com>
On Sat, 06 Sep 1997 02:25:01 GMT, mick@lowdown.com (Mick Ghazey)
wrote:
>The perl debugger doesn't work on my system. It seg-faults every time
>you try to debug anything. The problem started when I upgraded to
>per5.004.01 It doesn't matter what script you debug. The script can be
>a simple one-liner consisting of "#!/usr/bin/perl". I've tried plenty
>of scripts.
>
>I've been working on this problem all week. Please help if you can.
>
>Thanks.
>
>Mick
I think I found the answer. At least everything I've tried so far
works. It seems a new directory was created by the rpm file. The new
one is /usr/bin/perl5/site_perl/i586-linux. The old one is
/usr/bin/perl5/site_perl/i386-linux. The loadable object modules (*.o)
were split between the two directories. The search path was only
specifying the new directory.
Mick
------------------------------
Date: 7 Sep 1997 02:20:43 GMT
From: Ed Young <youngej@magpage.com>
To: Joe Mosby <steve@mosby1.force9.net>
Subject: Re: script.pl to script.bat?
Message-Id: <5ut31r$8tm$0@204.179.92.132>
Joe Mosby wrote:
>
> Hi there,
> I have the program pl2bat that turns .pl files into .bat files,
> supposedly. If anyone could tell me the procress that I have to go
> through I would be very grateful. Thanks
>
> Joe
Yes, on an MSDOS command line, in the directory in which your .pl file
exists, type:
pl2bat yourfile.pl
A file by the name of 'yourfile.bat' will be created. As long it is in
your path you will be able to run it like any other .bat file.
Have fun...
------------------------------
Date: 6 Sep 1997 17:32:12 -0400
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: What's the difference b/w Oraperl versions?
Message-Id: <5usi4s$5vs$1@tholian.cse.psu.edu>
In article <340EDE18.9B77EEBE@dtai.com>, Rich Yumul <chewie@dtai.com> wrote:
>What's the difference between them?
In general, the best way to find out is to read the file Changes in
the latest version.
I run perl5.004_3, DBI-0.89, DBD-Oracle-0.46 in production.
Learn more about DBI/DBD's at your local library or at the defacto dbperl
website http://www.hermetica.com/technologia/DBI/
>I'd appreciate it if whoever knows to email me the answer.
I only send replies by email when the original poster promises to post
a summary. Help save the world and follow good netiquete.
John
groenvel@cse.psu.edu
------------------------------
Date: 06 Sep 1997 18:20:39 -0400
From: Tom Fawcett <fawcett@nynexst.com.spam-me-not>
Subject: Re: What's wrong with my 'if' statement?
Message-Id: <8jhgbyhyo8.fsf@nynexst.com.spam-me-not>
Rick Garland <raggmopp@ix.netcom.com> writes:
> The script I'm trying to complete is below;
Your script seems to have more problems than just its if statement.
>
> print ("Please enter the user login to disable:\n");
> $disablelogin = <STDIN>
> $disablelogin =~ s/^\s+|\s+$//g;
>
> @login = <PW>:
> @line = grep(/^disablelogin/, @login);
I think you mean $disablelogin here?
> $retval = @line;
Eh? You want $retval to be the size of @line?
> open (PW) || die "Can't open $PW: $!\n";
> open (NPW, ">NPW") || die "Can't create $NPW: $!\n";
>
> while (<PW>) {
> if ($retval == /^1/) {
I think you meant ($retval =~ /^1/)
but I can't figure out enough of the rest of your script.
------------------------------
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 988
*************************************