[6746] in Perl-Users-Digest
Perl-Users Digest, Issue: 371 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 25 13:17:23 1997
Date: Fri, 25 Apr 97 10: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 Fri, 25 Apr 1997 Volume: 8 Number: 371
Today's topics:
$1 var question <brandon@physics.utexas.edu>
Re: $1 var question <tchrist@mox.perl.com>
*** problem calling zmodem from perl in unix? (Jeff Baker)
ANNOUNCE: f90split (Barry W. Brown)
Re: CGI scripts <rootbeer@teleport.com>
Re: Day of the week (Chipmunk)
Re: DB_File and complex structures (Neil Bowers)
Re: Get Chars up to first | without splitting (Chipmunk)
Re: Get Chars up to first | without splitting (Andrew M. Langmead)
Re: Is there a YACC module? <eryq@enteract.com>
Re: Lisp is neither (was Re: Ousterhout and Tcl lost th <fbonnet@irisa.fr>
Re: list assignment won't untaint? <rootbeer@teleport.com>
Re: Need a round(EXPR, INT) subroutine <rootbeer@teleport.com>
Re: Notice to antispammers <usenet-tag@qz.little-neck.ny.us>
Re: order of 'keys' and 'values' <jstern@world.northgrum.com>
Re: please help - cgi database access script / program (Bob Wilkinson)
Problem with Script <camerondejong@geocities.com>
Question: nested comment '('...')' removal? <yingchen@fir.fbc.com>
Re: raw input <minaret@sprynet.com>
Re: Run UNIX commands <...petri.backstrom@icl.fi>
Re: Sorting an array of arrays (David Alan Black)
Re: Trouble with Emacs auto formatter (Dave Thomas)
Re: User autentication in Windows NT using Perl - I nee <...petri.backstrom@icl.fi>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 25 Apr 1997 10:53:12 -0500
From: "Brandon W. Metcalf" <brandon@physics.utexas.edu>
Subject: $1 var question
Message-Id: <3360D368.41C6@physics.utexas.edu>
Here's the code:
foreach $fs (@list) {
print "Dumping Filesystem $fs to $tape ...\n";
$out = `/usr/local/bin/gtar --totals -l --preserve -cf $tape $fs
2>&1`;
$out =~ /Total bytes written: (\d+)/;
$fstotal = $1;
$total += $fstotal;
print "$fstotal bytes written to tape for $fs .... Tape Total =
$total \
n";
}
Question:
Sometimes $1 is assigned a new value from the match on the $out line
each time through the loop and sometimes $1 retains the value from the
match assigned on the first pass through the loop. What should be
happening? Is there a rule that comes in to play that says whether or
not to reset $1 or does $1,$2,... only apply to the last regexp?
Thanks.
Brandon Metcalf
UNIX Systems Administrator
Department of Physics - UT Austin
brandon@physics.utexas.edu
------------------------------
Date: 25 Apr 1997 16:38:47 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: $1 var question
Message-Id: <5jqmmn$16n$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
"Brandon W. Metcalf" <brandon@physics.utexas.edu> writes:
:Sometimes $1 is assigned a new value from the match on the $out line
:each time through the loop and sometimes $1 retains the value from the
:match assigned on the first pass through the loop. What should be
:happening? Is there a rule that comes in to play that says whether or
:not to reset $1 or does $1,$2,... only apply to the last regexp?
It's only reset on a successful match:
The scope of $<digit> (and $`, $&, and $') extends to the end of the
enclosing BLOCK or eval string, or to the next successful pattern
match, whichever comes first. [perlre, v5.003_97, but it's been there
for a long time].
That just shows that it's important to test whether something worked
or not. Otherwise it's like looking at errno without knowing the success
or failure status of a system call.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
Nobody wanted a 3/4" drill bit, all they ever wanted was a 3/4" hole.
--Mike O'Dell
------------------------------
Date: 24 Apr 1997 19:14:02 GMT
From: admin@bznet.com (Jeff Baker)
Subject: *** problem calling zmodem from perl in unix?
Message-Id: <5jobdq$1q6@vger.bznet.com>
Hello, thanks for reading.
Having trouble invoking sz and rz on my unix system from within perl.
I'd recently converted this script from a Kornshell application and have
had little trouble until this command.
$x = `sz jeff.txt 2>>/var/edi/log/szstatus.txt >/dev/tty`;
Have any of you had this problem?
Thanks in advance for any help.
Jeff
------------------------------
Date: 25 Apr 1997 16:31:16 GMT
From: bwb@odin.mdacc.tmc.edu (Barry W. Brown)
Subject: ANNOUNCE: f90split
Message-Id: <5jqm8k$tmd$1@oac2.hsc.uth.tmc.edu>
ANNOUNCE f90split
f90split is a Fortran 90 version of fsplit. It reads a file
containing multiple Fortran 90 program units and writes each unit to a
separate file whose name is the same as the name of the program unit
followed by a suffix (default .f90). It should work with Fortran 77
files. However, it you don't place blanks between keyowrds (of which
Fortran officially has none) forget it. A construct such as
DOUBLEPRECISIONFUNCTIONMYFUN(X)
will blow f90split out of the water.
f90split is written in Perl. Perl is a high level language with
implementations available (free) for most popular types of computer.
To obtain Perl, set your web browser to
http://www.perl.com/perl
f90split is being made available under the same conditions as Perl itself.
To obtain f90split use anonymous ftp to
odin.mdacc.tmc.edu.
f90split is in file
./pub/misc/f90split.1.1.tar.gz
We will put pointers in our web site sometime later.
f90split was written by John Venier. Comments, corrections, etc. to
venier@odin.mdacc.tmc.edu
(Just as we prepared to announce f90split, we realized that BLOCK DATA
program units are not handled. If anyone uses this obsolescent feature,
please let us know. We will add it if there is sufficient demand.)
Those interested in reposting this code (which is encouraged) might look
at the site in a few weeks. If changes are made in response to user
comments a differently numbered version will be posted.
Barry W. Brown
Department of Biomathematics,
Box 237
University of Texas M. D.
Anderson Cancer Center
1515 Holcombe Blvd
Houston, TX 77030
bwb@odin.mdacc.tmc.edu
internet address is (143.111.62.32)
------------------------------
Date: Fri, 25 Apr 1997 08:38:35 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Paula Chase <paula@irnoise.com>
Subject: Re: CGI scripts
Message-Id: <Pine.GSO.3.96.970425083803.26685J-100000@kelly.teleport.com>
On Thu, 24 Apr 1997, Paula Chase wrote:
> We use best.com in California, and they let us use whatever CGI's we
> want.
I sure hope that they run them under your own user id, at least. :-)
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 25 Apr 1997 14:01:59 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: Day of the week
Message-Id: <5jqdgn$av3$5@dartvax.dartmouth.edu>
In article <33603315.88338587@news.sol.co.uk>
markguz@sol.co.uk (Mark Guz) writes:
> I have a text file with a field in there which shows the month and
> date(MAR1 or APR2)
>
> I need to convert this to the day of the week that it was
That kinda depends on what year it was, doesn't it?
Chipmunk
------------------------------
Date: Fri, 25 Apr 1997 16:22:53 GMT
From: neilb@cre.canon.co.uk (Neil Bowers)
Subject: Re: DB_File and complex structures
Message-Id: <E97C65.A0C@cre.canon.co.uk>
In comp.lang.perl.modules Ben Smith <ben@ronin.com> wrote:
: I want to use the tie "DB_File" facilities to write complex structures
: to disk (hash of hashes and lists). The docs (Programming Perl) seem to
: indicate that the only DB structures that come with the distribution are
: scalar, list, and hash. Is this the case? Do I need to unravel the
: complex structure into a simple hash before writing and then rebuild
: the structure after?
Take a look at the MLDBM module which is available from CPAN:
http://perl.org/CPAN/modules/by-module/MLDBM/
This lets you have arbitrary perl data structures as the values of
the hash which can be tied to DB_File, GDBM_File, etc.
Neil
--
C is quirky, flawed, and an enormous success. -- Dennis M. Ritchie
------------------------------
Date: 25 Apr 1997 13:56:57 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: Get Chars up to first | without splitting
Message-Id: <5jqd79$av3$4@dartvax.dartmouth.edu>
In article <335F2EF8.7A61@unl.ac.uk>
Alastair Aitken <a.aitken@unl.ac.uk> writes:
> ($first) = split /\|/, $line;
If you're only keeping the first piece
split /\|/, $line, 2;
should be a little more efficient.
------------------------------
Date: Fri, 25 Apr 1997 16:33:37 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Get Chars up to first | without splitting
Message-Id: <E97Co1.Hon@world.std.com>
Ronald.J.Kimball@dartmouth.edu (Chipmunk) writes:
>In article <335F2EF8.7A61@unl.ac.uk>
>Alastair Aitken <a.aitken@unl.ac.uk> writes:
>> ($first) = split /\|/, $line;
>If you're only keeping the first piece
>split /\|/, $line, 2;
>should be a little more efficient.
According to "Mastering Regular Expressions" p. 260 (and from other
sources I have seen but can't track down right now.) perl does this
optimization automatically.
If split is being assigned to a list of n scalars, it adds an implicit
limit of n+1.
If you split into an array, or some other form of unlimited list
context (function call, for loop, etc.) a limit will still be useful.
--
Andrew Langmead
------------------------------
Date: Fri, 25 Apr 1997 11:33:32 -0500
From: Eryq <eryq@enteract.com>
To: Bernie Cosell <bernie@rev.net>
Subject: Re: Is there a YACC module?
Message-Id: <3360DCDC.6385972E@enteract.com>
Bernie Cosell wrote:
>
> I have a program I'd like to convert from Unix C->Perl. The guts of the
> program are a big YACC grammar --- has anyone managed to make a module
> that'll accept a YACC grammar and do the right thing with it? [I can
> envision how such a thing would work, creating a suite of subroutines which
> it would then 'eval' to get them all defined, so that the actual run-time
> parsing shouldn't be that awful... the problem is that I don't really know
> enough about how YACC does its thing [and sets up that huge state
> transition table, etc] so I'm stuck unless someone cleverer than I has
> already done it...
I believe Berkeley YACC (byacc) produces Perl output, although I found
the speed less than optimal when I used it a couple of years ago.
For simple grammars, I generally code my own lexer and shift-reduce parser,
but then I'm a masochist. ;-)
HTH,
--
___ _ _ _ _ ___ _ Eryq (eryq@enteract.com)
/ _ \| '_| | | |/ _ ' / Hughes STX, NASA/Goddard Space Flight Cntr.
| __/| | | |_| | |_| | http://www.enteract.com/~eryq
\___||_| \__, |\__, |___/\ Visit STREETWISE, Chicago's newspaper by/
|___/ |______/ of the homeless: http://www.streetwise.org
------------------------------
Date: Fri, 25 Apr 1997 17:15:19 +0200
From: Frederic BONNET <fbonnet@irisa.fr>
Subject: Re: Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
Message-Id: <3360CA87.6F1B@irisa.fr>
Following the example of Samuel L. Bayer (sam@linus.mitre.org), I've
removed comp.lang.tcl from the Xpost list. I think most people there
don't care about the Erik Naggum vs. M. Prasad shootout.
TIA.
See you, Fred
------------------------------
Date: Fri, 25 Apr 1997 08:34:01 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: "John F. Whitehead" <jfw@wral-tv.wral-tv.com>
Subject: Re: list assignment won't untaint?
Message-Id: <Pine.GSO.3.96.970425083328.26685I-100000@kelly.teleport.com>
On 23 Apr 1997, John F. Whitehead wrote:
> Apparently although the following works to untaint a variable in 5.003:
>
> $tainted =~ /^(safe_match)$/;
> $untainted = $1;
>
> the following does not:
>
> ($untainted) = ($tainted =~ /^(safe_match)$/);
>
> i.e., $untainted is actually still considered tainted in the second example.
Fixed in the upcoming 5.004. Thanks!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Fri, 25 Apr 1997 08:32:38 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Frederic Desjarlais <fdesjarl@chat.carleton.ca>
Subject: Re: Need a round(EXPR, INT) subroutine
Message-Id: <Pine.GSO.3.96.970425083144.26685H-100000@kelly.teleport.com>
On Wed, 23 Apr 1997, Frederic Desjarlais wrote:
> How would you code a Perl4 (or 5) round function that takes a
> 'double' or 'float' as a parameter to be rounded and the number of
> decimal places to round it to.
> i.e. round(EXPR, INT) or round($double_number, 3)
I'd probably use sprintf, which should make it pretty simple. Hope this
helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 25 Apr 1997 15:16:08 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: Notice to antispammers
Message-Id: <5jqhro$9cg$1@news.netusa.net>
Tom Christiansen <tchrist@mox.perl.com> wrote:
: I am creating a web page that contains the real addresses of everyone
: who posts a bogus address in their mail message. I'm tired of getting
: postings I can't reply to, and I don't see why we should suffer just
: because you can't keep the spammers off your back.
I agree than in 95% of all cases non-replyably addresses are rude. Good
luck convincing everyone of that.
Matt Kruse <mkruse@shamu.netexpress.net> followed up:
>But really, people have the right to try to
>block email-grabbing bots if they want to. It might be futile, but I'm
>seeing a LOT of people doing it these days (I've thought about it).
People have the right to not post to usenet. People have the right to
not have an email address. People have the right to forward all email
to /dev/null. Rights have nothing to do with this. Unless you are
posting "trade secrets" of $cientology or something, it is rude to
post to Usenet without a return address. If you put your real address
in a human readible form, I -- for one -- won't complain too much,
but the total lack of it or having it rot-13ed or otherwise obfuscated
is asking to be shuned by all, IMNSHO.
There is a persistent return to this subject in news.software.readers.
The general argument is that RFC1036 requires the "Sender: " header
to be valid if the user has substituted their own "From: " header. If
you adhere to this, spambots win and real users lose.
There is a third alternative, which I heartily endorse: special usenet
mailboxes with extra strong spam filtering. Go ahead, reply to this
post to the address I used. It will work. Don't think about sending me
new email at this address however. For my work-in-progress FAQ on this
see: <URL:http://www.netusa.net/~eli/faqs/addressing.html>.
Elijah
------
it also has some fun addresses you can try your address REs on :^)
------------------------------
Date: Fri, 25 Apr 1997 14:27:51 GMT
From: Jim Stern <jstern@world.northgrum.com>
Subject: Re: order of 'keys' and 'values'
Message-Id: <3360BF67.24AF@world.northgrum.com>
Paul W. Box wrote:
> [Clear, concise explanation elided. Thank you! Such are all too
rare.]
> I then associate an array to the canonical list, and tag which items are
> seen in the local list
>
> @temparray{@canonical_list} = ' o' x @canonical_list;
Before answering your main question, a comment on the line above:
' o' x @canonical_list # Creates a scalar consisting of
# repeated copies of ' o'
(' o') x @canonical_list # Creates an array
I think you meant the latter. But it doesn't matter, because you
assign all elements of %temparray below anyway. I.e., the above
line is wrong but redundant.
> foreach $place (@canonical_list){
> $temparray{$place} = $tag{$place} == 1? ' 1': ' 0';
> }
Above is where %temparray gets reassigned.
Now to the meat:
> I would then like to write the resulting string of ones and zeros as a
> string that would line up in columns underneath a list of the items on
> the canonical list (make a table where the local lists are the rows, and
> showing 1 in the column that appears under the item on the canonical
> list in which they occur).
>
> When I try to retrieve this array by keys(temparray) or
> values(temparray), they do not come out in the same order in which they
> were entered in the @canonical_list. In the man page for perl, it says
> that keys() and values() return the items in a "seemingly random" way.
> Apparantly that means 'not the order in which they were entered', as
> well as 'not sorted'.
>
> Two questions:
>
> 1- how do keys() and values() determine the order in which they output
> elements?
Short answer: You don't want to know. :-) Longer: Perl implements
associative arrays as "hashes." A hash files elements for rapid
retrieval by converting each key into a hash index. The conversion
is not order-preserving. Indeed, the relationship between key and
resulting index is not at all obvious to the eye. For details, read
about hashing in any good data structures textbook. "man perlguts"
for the hash function used.
>
> 2- is there any way to have have the items of an array returned in the
> order in which they were entered?
You're close to the answer already. Store an array of keys and
loop through the array. I.e., use
for (@canonical_list) { # NOT "for (keys %temparray)"
my $key = $_;
my $value = $temparray{$_};
# ...
}
A variation on this appears in the perlfunc man page's "sort" entry.
The FAQ gives some alternate solutions. See under 'Data: Hashes".
--
Jim Stern -- Views here are my own, not Northrop Grumman's. (El
Segundo, CA)
------------------------------
Date: Fri, 25 Apr 1997 17:28:41 +0100
From: b.wilkinson@pindar.co.uk (Bob Wilkinson)
Subject: Re: please help - cgi database access script / program for web page
Message-Id: <b.wilkinson-2504971728410001@ip57-york.pindar.co.uk>
In article <aiahjIAIHHYzEwli@alchemedia.co.uk>, "Richard G. Coleman"
<richard@see.my.sig> wrote:
> I wonder if anyone can help me.
>
> I am looking to create a web page that accesses a database (can be in
> Access, Paradox, DBase or any other major pc format - even delimited
> text if it must be) and displays information from it. The page should
> contain a form with a radio button to detect which field (eg title,
> subject, area) to search, and a textbox for the query string. No write
> function will be included, as it is going to be a directory for people
> to view from.
>
> Can anoyne tell me the correct way to proceed. The server will probably
> (more than likely) be linux or unix. Do I _have_ to purchase a database
> access program for the server, or is it possible to write a script to do
> this.
>
> I would be most grateful for any response.
>
>
> --
> Richard G. Coleman | richard@alchemedia.co.uk
> Alchemedia Interactive Ltd | http://www.alchem.demon.co.uk/
> -------------------------------------------------------------
> "Reality is an illusion caused by a lack of alcohol"
Perhaps asking in the appropriate newsgroup would help.
comp.infosystems.www.authoring.cgi would probably be more appropriate for this
question.
You say "The server will probably (more than likely) be linux or unix." I
thought that Linux was a variant of Unix?
Bob
--
I have become death, destroyer of the worlds.
------------------------------
Date: Fri, 25 Apr 1997 12:16:41 -0400
From: camerond <camerondejong@geocities.com>
Subject: Problem with Script
Message-Id: <3360D8E9.7BAB@geocities.com>
Hi all
I run Web Site 1.1 on a Windows 95 computer. I was given a perl script
(had extension .pl) and put it in my win-cgi directory and attempted to
run it, but it wouldn't execute. Someone told me that I would have to
interpret it or something with perl. I no nothing about this language,
so I am very lost. The script is a chatroom script and it comes with
two html files to use. I have no idea how to do anything, I am sorry
this isn't very specific, but I don't know how else to ask or beg for
help, Thank you
Cameron DeJong
------------------------------
Date: Fri, 25 Apr 1997 10:23:12 -0400
From: Ying Chen <yingchen@fir.fbc.com>
Subject: Question: nested comment '('...')' removal?
Message-Id: <3360BE50.41C67EA6@fir.fbc.com>
Hi all..
I was wondering about balancing parenthesis..
(I read the Faq - and looked at the pull_quotes script
very much confused... and thought maybe I don't need
something as elaborate..)
The question is.. if you know all parenthesis are matched and
if you don't have to care about the contents within the
parenthesis (because the contents are comment in this
case) - but because comment can be nested and escaped... like:
(junk (\(comment\) to junk (is junk ))) important (again junk)
is it still possible to write a regexp to just remove the comments?
or do I still have to work my way thru the string??
(see perl script)... tho.. I don't think this script
is particularly efficient enough tho..
Any comments on this would be really appreciated -
Thanks in advance!
Ying
(oh yeah.. I am still using Perl 4 ^_^;)
# -----------
local ($str) = "(junk1(nested \\(junk)) Something\\)Important(junk3)";
local (@stack, @str) = ();
local (@useful_str, $is_junk) = ();
while ($str =~ m/(\\.)|(.)/g) {
push (@str,$&);
}
$is_junk = 0;
@useful_str = ();
foreach (@str) {
next if (/^\\/ && $is_junk);
next if (/[^()]/ && $is_junk);
if (/^\(/) {
push (@stack, '(');
$is_junk = 1;
next;
}
if (/^\)/) {
pop (@stack);
if ($#stack eq -1) { $is_junk = 0;}
next;
}
push (@useful_str, $_);
}
print join ('', @useful_str),"\n";
------------------------------
Date: 25 Apr 1997 15:53:27 GMT
From: "Geoff Mottram" <minaret@sprynet.com>
Subject: Re: raw input
Message-Id: <01bc50b9$8214bbe0$3f81aec7@cactus>
> I have a Problem i want to write an more intelligent chat and want to
> use perl is there a way to get data before or without a newline "amen" ?
> don't say RTFM to me, I DID !!!
You need to make an IOCTL call to put the terminal in "raw" or "rare" input
mode. Check your UNIX doc's for information on how to do this. The is a
Perl IOCTL module you can use to make the actual calls. Don't forget to
undo your changes when the program exits.
--
Geoff Mottram
minaret@sprynet.com
------------------------------
Date: Fri, 25 Apr 1997 15:10:04 +0200
From: Petri Backstrom <...petri.backstrom@icl.fi>
Subject: Re: Run UNIX commands
Message-Id: <3360AD2C.59A9@icl.fi>
William Krige wrote:
>
> I was wondering if it is possible to run a command with a perl script,
> just like you would normally do with UNIX.
> e.g last root
> tail -f /usr/adm/syslog/syslog.log | grep "Thu 18"
>
> How would you run a commands like the ones above in perl, if it can be
> done.
Consult the Perl documentation. Start by looking up 'system' and
'exec' and 'backtick' in perlfunc.
However, as to your particular example, commands such as
tail -f
and others that loop forever (unless interrupted) could be
somewhat problematic to handle (but you can run the command
all right).
regards,
...petri.backstrom@icl.fi
ICL Data Oy
Finland
------------------------------
Date: 25 Apr 1997 15:58:38 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: Sorting an array of arrays
Message-Id: <5jqkbe$4vc@pirate.shu.edu>
Hello -
niksun@lconn.net (Niksun) writes:
>I've created a link page in HTML with a table of contents and
>sections, etc... I can sort the table of contents easily, but I'm
>having trouble sorting the links in each of the sections. Here's what
>some of my HTML looks like:
[ etc. ]
OK, this isn't meant as a position statement about not
using temporary variables. I just happened to go down this
path in looking at your problem, and I ended up learning
a lot about, and exponentially increasing my feel for,
the ST (or whatever bastardization of it I have brought
into being).
Besides, I think I'm in the running for this week's
time-drain award :-)
(Tom C., don't look :-)
#!/usr/local/bin/perl -w
print join "\n",
map { $_->[0], @{$_->[2]}, "$_->[1]\n" }
map { [shift @$_, pop @$_,
[map { @$_[0] }
sort { $a->[1] cmp $b->[1] }
map { $_ =~ /(blah.)/; [$_, $1] } @$_]] }
map { [split /\n/, $_->[1]] }
sort { $a->[0] cmp $b->[0] }
map { $_ =~ /(Section\w+)/; [$1, $_] }
split /\n\n+/, join '', <DATA>;
# Deliberately putting sections and links out of order:
__DATA__
<!--begin: SectionX-->
<A HREF="http://blah2">link2</A><BR>
<A HREF="http://blah1">link1</A><BR>
<!--end: SectionX-->
<!--begin: SectionZ-->
<A HREF="http://blah6">link6</A><BR>
<A HREF="http://blah5">link5</A><BR>
<!--end: SectionZ-->
<!--begin: SectionY-->
<A HREF="http://blah3">link3</A><BR>
<A HREF="http://blah4">link4</A><BR>
<!--end: SectionY-->
Output:
<!--begin: SectionX-->
<A HREF="http://blah1">link1</A><BR>
<A HREF="http://blah2">link2</A><BR>
<!--end: SectionX-->
<!--begin: SectionY-->
<A HREF="http://blah3">link3</A><BR>
<A HREF="http://blah4">link4</A><BR>
<!--end: SectionY-->
<!--begin: SectionZ-->
<A HREF="http://blah5">link5</A><BR>
<A HREF="http://blah6">link6</A><BR>
<!--end: SectionZ-->
David Black
dblack@icarus.shu.edu
------------------------------
Date: 25 Apr 1997 16:54:35 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Trouble with Emacs auto formatter
Message-Id: <slrn5m1oe7.dc8.dave@fast.thomases.com>
On Fri, 25 Apr 1997 20:48:46 +1000, Chris Phillips wrote:
> $ra = ${$filedata{RA}}[$imatch]; # Emacs autoformatter does
> $dec = ${$filedata{DEC}}[$imatch]; # Not like these two lines
Have you tried putting a space between the $ and the {?
$dec = $ {$filedata{DEC}}[$imatch];
The latest CPerl mode does this automatically.
Regards
Dave
--
_________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Fri, 25 Apr 1997 14:43:41 +0200
From: Petri Backstrom <...petri.backstrom@icl.fi>
Subject: Re: User autentication in Windows NT using Perl - I need Help
Message-Id: <3360A6FC.77B0@icl.fi>
mandre@ism.com.br wrote:
>
> I need to know how I can check username and password from a Perl script
> in a Windows NT 4.0.
>
> Where the users file is located ? How can I check the password ?
>
> Thanks.
>
> mandre@ism.com.br
> www.matec.com.br
See the Win32::NetAdmin module in CPAN for what can and cannot
be done with that piece of software (reflect back to the
Microsoft Win32 API documentation for what is possible in
the first place using documented interfaces).
The Windows NT user database is stored in the
.\system32\config
directory under the drive/directory where Windows NT was
installed. For details see Windows NT documentation, or
consult a Windows NT related newsgroup.
If this is about a CGI script written in Perl, then consult
the documentation of the web server you use (if it is Microsoft
IIS, then the user database for the web server is the same
as the Windows NT UAS, User Accounts Subsystem). In any case,
with CGI, the validated username is passed to you in
$ENV{REMOTE_USER}.
regards,
...petri.backstrom@icl.fi
ICL Data Oy
Finland
------------------------------
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 371
*************************************