[16952] in Perl-Users-Digest
Perl-Users Digest, Issue: 4364 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 18 18:15:50 2000
Date: Mon, 18 Sep 2000 15:15:26 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <969315326-v9-i4364@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 18 Sep 2000 Volume: 9 Number: 4364
Today's topics:
popup_menu problems <star@sonic.net>
Re: popup_menu problems <yanick@babyl.sympatico.ca>
Re: popup_menu problems <amonotod@netscape.net>
Re: Possible to generate html frames from perl ??? (Alone)
Re: Possible to generate html frames from perl ??? (Alone)
Re: Possible to generate html frames from perl ??? (Alone)
Re: Possible to generate html frames from perl ??? <NHekman@geo-slope.com>
Re: Pure perl encrypt/decryption? grymoire@my-deja.com
Re: Qualifications for new Perl programmer????? <bcaligari@my-deja.com>
Re: Qualifications for new Perl programmer????? <bcaligari@my-deja.com>
Re: Qualifications for new Perl programmer????? <bcaligari@my-deja.com>
Re: Qualifications for new Perl programmer????? (brian d foy)
Range operator with "... /^$/" ollie_spencer@my-deja.com
Re: Range operator with "... /^$/" <bcaligari@my-deja.com>
Re: Range operator with "... /^$/" <yanick@babyl.sympatico.ca>
Re: Range operator with "... /^$/" ollie_spencer@my-deja.com
Re: Range operator with "... /^$/" ollie_spencer@my-deja.com
Re: Rant: Re: An identd faking ident. <flavell@mail.cern.ch>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 18 Sep 2000 19:35:35 GMT
From: arthur <star@sonic.net>
Subject: popup_menu problems
Message-Id: <B5EA6B16.8302%star@sonic.net>
Good day,
I am trying to get a popup_menu to work
When I run the following:
#!/usr/bin/perl -w
use strict;
use CGI qw(:standard);
print header,start_html("popup"),h1("popup_menu");
if (param() {
my $pages = param("name");
print "OK the name of your game is $pages";}else{
print hr();
print start_form();
p("name the game, textfield('name'));
print p("Here are the games made all ready: " popup_memu("pop",
{'mint',"cherry",'mocha']));
print p(submit("send"), reset('clear"));
print end_form(), hr();
}
print end_html;
----------------------
I get:
# syntax error, near "print"
File 'StarMax HD:Desktop Folder:popup.cgi'; Line 8
# Global symbol "pages" requires explicit package name.
File 'StarMax HD:Desktop Folder:popup.cgi'; Line 8
# Execution of StarMax HD:Desktop Folder:popup.cgi aborted due to
compilation errors.
anyone care to share why?
Thanks and ENJOY YOURSELVES,
~ARTHUR
STAR@SONIC.NET
------------------------------
Date: Mon, 18 Sep 2000 20:44:47 GMT
From: Yanick Champoux <yanick@babyl.sympatico.ca>
Subject: Re: popup_menu problems
Message-Id: <39vx5.252916$Gh.6101091@news20.bellglobal.com>
arthur <star@sonic.net> wrote:
: Good day,
Hullo,
: I am trying to get a popup_menu to work
: When I run the following:
: #!/usr/bin/perl -w
: use strict;
: use CGI qw(:standard);
: print header,start_html("popup"),h1("popup_menu");
: if (param() {
^-------^
: my $pages = param("name");
: print "OK the name of your game is $pages";}else{
: print hr();
: print start_form();
: p("name the game, textfield('name'));
^-------------^
: print p("Here are the games made all ready: " popup_memu("pop",
: {'mint',"cherry",'mocha']));
^-------------------------^
: print p(submit("send"), reset('clear"));
^-----^
: print end_form(), hr();
: }
: print end_html;
: ----------------------
: I get:
: # syntax error, near "print"
: File 'StarMax HD:Desktop Folder:popup.cgi'; Line 8
: # Global symbol "pages" requires explicit package name.
: File 'StarMax HD:Desktop Folder:popup.cgi'; Line 8
: # Execution of StarMax HD:Desktop Folder:popup.cgi aborted due to
: compilation errors.
:
: anyone care to share why?
A program, like the Universe must be balanced. And no, I'm
not saying that for every feature there must exist an equal and
inverse bug. Close all parentheses that you open. Same
thing for quotes. And stay consistant. 'This' is nice,
"that" too, but "there' is things that can't be done...
Joy,
Yanick
--
eval" use 'that poor Yanick' ";
print map{ (sort keys %{{ map({$_=>1}split'',$@) }})[hex] }
qw/8 b 15 1 9 10 11 15 c b 13 1 12 b 13 f 1 c 9 a e b 13 0/;
------------------------------
Date: Mon, 18 Sep 2000 20:51:28 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: popup_menu problems
Message-Id: <8q5v86$cju$1@nnrp1.deja.com>
In article <B5EA6B16.8302%star@sonic.net>,
arthur <star@sonic.net> wrote:
>
>
> Good day,
>
> I am trying to get a popup_menu to work
> When I run the following:
<rewrite to my style>
#!/usr/bin/perl -w
use strict;
use CGI qw(:standard);
print header,start_html("popup"),h1("popup_menu");
if (param() {
## ^^ Either too many OP or not enough CP##
my $pages = param("name");
print "OK the name of your game is $pages";
}else{
print hr();
print start_form();
p("name the game, textfield('name'));
print p("Here are the games made all ready: "
popup_memu("pop", {'mint',"cherry",'mocha']));
## ^^ I bet you'll have a problem here also...##
print p(submit("send"), reset('clear"));
print end_form(), hr();
}
print end_html;
</rewrite>
> ----------------------
> I get:
>
> # syntax error, near "print"
> File 'StarMax HD:Desktop Folder:popup.cgi'; Line 8
> # Global symbol "pages" requires explicit package name.
> File 'StarMax HD:Desktop Folder:popup.cgi'; Line 8
> # Execution of StarMax HD:Desktop Folder:popup.cgi aborted due to
> compilation errors.
>
> anyone care to share why?
See my comment lines...
>
> Thanks and ENJOY YOURSELVES,
> ~ARTHUR
> STAR@SONIC.NET
>
>
HTH,
amonotod
--
`\|||/ amonotod@
(@@) netscape.net
ooO_(_)_Ooo________________________________
_____|_____|_____|_____|_____|_____|_____|_____|
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 18 Sep 2000 18:53:56 GMT
From: Alone@Work.com (Alone)
Subject: Re: Possible to generate html frames from perl ???
Message-Id: <39c663d4.59735680@news.reliable-net.net>
Yes, CGI
I can generate html to the browser now without creating an actual
file. I want to be able to generate html frames without creating a
file.
My server limits the number of files per user.
The only way I can determine to generate this page to a browser is to
first create the framesets as files and generate the html that calls
them, but this would creates two files...
On Sun, 17 Sep 2000 15:49:46 GMT, michael.soulier@home.com (Michael P.
Soulier) wrote:
In article <39c4cb8e.51769585@news.reliable-net.net>, Alone wrote:
>
>Is it possible to generate an html frameset without writing to a file?
Elaborate. CGI?
Mike
--
Michael P. Soulier <msoulier@storm.ca>
"...the word HACK is used as a verb to indicate a massive amount
of nerd-like effort." -Harley Hahn, A Student's Guide to UNIX
------------------------------
Date: Mon, 18 Sep 2000 18:54:20 GMT
From: Alone@Work.com (Alone)
Subject: Re: Possible to generate html frames from perl ???
Message-Id: <39c664c7.59978445@news.reliable-net.net>
I can generate html to the browser now without creating an actual
file. I want to be able to generate html frames without creating a
file.
My server limits the number of files per user.
The only way I can determine to generate this page to a browser is to
first create the framesets as files and generate the html that calls
them, but this would creates two files...
On Sun, 17 Sep 2000 17:12:29 GMT, cberry@cinenet.net (Craig Berry)
wrote:
Alone (Alone@Work.com) wrote:
: Is it possible to generate an html frameset without writing to a file?
This is a nearly meaningless question. A frameset is just another
HTML document. Any agent capable of generating HTML, from a text file
served through a web server, to a CGI application, to a Java servlet,
can
produce a frameset document. What are you actually trying to do?
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "Every force evolves a form."
| - Shriekback
------------------------------
Date: Mon, 18 Sep 2000 19:01:19 GMT
From: Alone@Work.com (Alone)
Subject: Re: Possible to generate html frames from perl ???
Message-Id: <39c665e5.60263737@news.reliable-net.net>
Okay, but correct me if I am wrong, but all your frameset pages
already exist on your server, so you are just calling them up
dynamically... but the framesets *I* need to send the server do not
previously exist, and I am trying to avoiding creating a file in order
to do it.
I can generate html to the browser now without creating an actual
file. I want to be able to generate html frames without creating a
file.
My server limits the number of files per user.
The only way I can determine to generate this page to a browser is to
first create the framesets as files and generate the html that calls
them, but this would creates two files...
On Sun, 17 Sep 2000 19:47:59 GMT, Sean Malloy <srmalloy@home.com>
wrote:
Alone@Work.com (Alone) wrote:
>Is it possible to generate an html frameset without writing to a file?
Certainly. On the website that I administer, I use a Perl script to
generate framesets so that the search engine links to properly-framed
pages (top banner, left menu, right content) based on the results of
searches that locate information in the content pages. Here's the
script (once the print statements start, any line _not_ starting with
'print' is wrapped from the previous line until you get to the
document close tag):
---------------------------------
#!/usr/local/bin/perl
$hostname = "www-nmcsd.med.navy.mil";
$len = length($ARGV[0]);
@path = split("/",$ARGV[0]);
$basename = @path[$#path];
$#path -= 1;
$root = join("/",@path);
print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<HEAD><TITLE></TITLE>\n";
print "<BASE URL=\"http://",$hostname,$root,"/\">\n";
print "<SCRIPT LANGUAGE=\"JavaScript\">\n<!--\n";
print "if (window != window.top)\n top.location.href =
location.href;\n";
print "// -->\n</SCRIPT>\n";
print "</HEAD>\n";
print "<FRAMESET ROWS=\"120,*\" BORDER=0>\n";
print "<FRAME SRC=\"/banner/banner.html\" NAME=\"Banner\"
MARGINWIDTH=\"0\" MARGINHEIGHT=\"0\" SCROLLING=\"NO\"
NORESIZE=\"NORESIZE\">\n";
print "<FRAMESET COLS=\"185,*\" BORDER=0>\n";
print "<FRAME SRC=\"",$root,"/ndx_file.html\" NAME=\"Index\"
NORESIZE=\"NORESIZE\">\n";
print "<FRAME SRC=\"",$root,"/",$basename,"\" NAME=\"Main\">\n";
print "</FRAMESET>\n";
print "</FRAMESET></HTML>\n";
exit;
-----------------------------
What this program does is to take an absolute path reference (within
the website directory tree) to a file -- which is always a content
page, going in the rightmost frame in the frameset -- and dynamically
create a frameset to load the banner and menu frames around it. So a
call to the perl script:
/cgi-bin/srch_frame.pl?/patients/hlthpromo/card_rehab.html
will return the following HTML frameset:
--------------------
<HTML>
<HEAD><TITLE></TITLE>
<BASE URL="http://www-nmcsd.med.navy.mil/patients/hlthpromo/">
<SCRIPT LANGUAGE="JavaScript">
<!--
if (window != window.top)
top.location.href = location.href;
// -->
</SCRIPT>
</HEAD>
<FRAMESET ROWS="120,*" BORDER=0>
<FRAME SRC="/banner/banner.html" NAME="Banner" MARGINWIDTH="0"
MARGINHEIGHT="0" SCROLLING="NO" NORESIZE="NORESIZE">
<FRAMESET COLS="185,*" BORDER=0>
<FRAME SRC="/patients/hlthpromo/ndx_file.html" NAME="Index"
NORESIZE="NORESIZE">
<FRAME SRC="/patients/hlthpromo/card_rehab.html" NAME="Main">
</FRAMESET>
</FRAMESET></HTML>
--------------------
Because no files are actually _served_ by the Perl script, and the
file/pathname passed to the script gets served by the webserver
itself, which can't see outside the document tree, trying to use
'/../' constructs to get at files outside the webserver's document
tree doesn't work, so it's not necessary to sanity-check the page
reference passed to the script. The BASE tag at the start of the file
ensures that all relative links in the pages loaded by the frameset
will link correctly back into the website.
--
Sean R. Malloy | American Non Sequitur
Naval Medical Center | Society
San Diego, CA 92134-5000 |
srmalloy@home.net | "We may not make sense,
srmalloy@nmcsd.med.navy.mil | but we do like pizza"
FORMAL NOTICE: unsolicited commercial email will be read
at a charge of $500 per item. Receipt of such email shall
be considered to constitute acceptance of contract, and
will be billed immediately.
------------------------------
Date: Mon, 18 Sep 2000 14:29:06 -0600
From: "Nathaniel Hekman" <NHekman@geo-slope.com>
Subject: Re: Possible to generate html frames from perl ???
Message-Id: <OXux5.44$Mw.1129@read1>
A frameset just points to other urls used to fill each frame. Make those
urls point to your cgi script, with some way for the script to know which
frame it is now generating. For example, the url to your main page could be
http://www.whatever.com/myscript.cgi. myscript.cgi generates a frameset in
html, saying that frame 1 is to be filled with myscript.cgi?frame=1, and
frame 2 with myscript.cgi?frame=2. When myscript.cgi is called with the
frame parameter set, it generates the appropriate html for that frame.
Nate
------------------------------
Date: Mon, 18 Sep 2000 21:18:30 GMT
From: grymoire@my-deja.com
Subject: Re: Pure perl encrypt/decryption?
Message-Id: <8q60qe$eni$1@nnrp1.deja.com>
In article <39c64550.0@juno.wiesbaden.netsurf.de>,
"Thomas Kratz" <Thomas.Kratz@lrp.de.nospam> wrote:
>
> What about Crypt::Blowfish_PP ? (the PP stands for Pure Perl)
That should do it! Thanks!
(It wasn't listed in the Security modules)....
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 18 Sep 2000 18:07:03 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: Re: Qualifications for new Perl programmer?????
Message-Id: <8q5ljk$bv$1@nnrp1.deja.com>
In article <9r49ss02vlnfhs618lvgdgifnr4c7b5kid@4ax.com>,
Bart Lateur <bart.lateur@skynet.be> wrote:
> brian d foy wrote:
>
> >In article <8q0tsk$q2k$1@nnrp1.deja.com>, Brendon Caligari wrote:
>
> >> It would be pretentious of oneself to call
> >> himself or practice as a programmer if his exposure has been
> >> limited to one language.
> >
> >i don't agree.
>
> Neither do I. So, in the early days when there was nothing but
Assembly
> and Fortran, there were virtually no programmers?
....please...don't cite Turing
Brendon
++++
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 18 Sep 2000 18:11:21 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: Re: Qualifications for new Perl programmer?????
Message-Id: <8q5lrk$gq$1@nnrp1.deja.com>
In article <brian-ya02408000R1609002217570001@news.panix.com>,
brian@smithrenaud.com (brian d foy) wrote:
> In article <8q0tsk$q2k$1@nnrp1.deja.com>, Brendon Caligari
<bcaligari@my-deja.com> posted:
>
> > In article <slrn8s7c9a.6uu.dha@panix6.panix.com>,
> > dha@panix.com (David H. Adler) wrote:
>
> > > On Fri, 15 Sep 2000 13:36:26 GMT, Brendon Caligari
> > > <bcaligari@my-deja.com> wrote:
>
> > > Of course, all this assumes that the student in question isn't
> > > impervious to learning in the first place...
>
> > I believe that there is a consensus that while Perl is good,
> > perl alone is not sufficient for a comprehensive education in
> > programming.
>
> you assume that everyone wants to be a programmer. some people
> just want to do their job.
>
I'm just claiming that I believe that as means to learn programming,
perl might not be amongst the best of tools.
Brendon
++++
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 18 Sep 2000 18:40:32 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: Re: Qualifications for new Perl programmer?????
Message-Id: <8q5nis$2o1$1@nnrp1.deja.com>
In article <9%_w5.18267$a5.260437@news1.rdc1.mb.home.com>,
andrew-johnson@home.com wrote:
[snip snip]
> No more so than anyone calling herself a programmer having only
just out of curiosity...why do you always use feminine in
a gender neutral context?
> exposure to any other single language. This is not a language
> specific issue -- would you accept me as a programmer if my only
> experience was with C? or Hypertalk? or Pascal? or Prograph? or
> Fortran? or Basic? or awk? or assembly? or mix? or scheme? or Python,
> or ... whatever?
>
> Is any one language sufficient for a comprehensive education in
> programming? Wouldn't a comprehensive education in programming
> involve more than just learning a single language?
I agree...different tools help one express different concepts
better....a solution to a database problem is specified more
flexibly in sql.
>
> ! At the end of the day, a programming language is a tool with which
to
> ! carry out solutions derived from certain theories and practices.
>
> And so any student must start learning such tools -- why do you view
> Perl as such a bad tool with which to begin such an education?
My Opinion: Perl is too liberal in it's way of doing things.
it's too forgiving....the syntax, the types. It makes things
seem too easy.
Brendon
++++
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 18 Sep 2000 15:44:16 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Qualifications for new Perl programmer?????
Message-Id: <brian-ya02408000R1809001544160001@news.panix.com>
In article <8q5nis$2o1$1@nnrp1.deja.com>, Brendon Caligari <bcaligari@my-deja.com> posted:
> My Opinion: Perl is too liberal in it's way of doing things.
> it's too forgiving....the syntax, the types. It makes things
> seem too easy.
yes. things should be hard so you can be a member of an elitist
group. *snicker*
but, if you don't like Perl, stop using it. the other people
who like to get work done without worrying if they will go to
computer science heaven will be having a pint while you spend
quality time with your terminal.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>
------------------------------
Date: Mon, 18 Sep 2000 18:01:06 GMT
From: ollie_spencer@my-deja.com
Subject: Range operator with "... /^$/"
Message-Id: <8q5l8i$vn6$1@nnrp1.deja.com>
Hi - I'm trying to parse a computer-generated text file that divides
its paragraphs with a blank line(actually 2 line feeds, I expect). I
try to separate what I want from the file with code like:
while(<INFILE>){
for (/LOG AN EVENT/ ... /^$/){
print OUTFILE "$_\n";
}
}
<Flame discalmer ON>
PLEASE DON"T GET PICKY OVER THIS CODE _ I'M JUST ILLUSTRATING A POINT
<Flame disclaimer OFF>
I intend to print just the paragraphs of INFILE between where is a line
containing "LOG AN EVENT" and the nest blank line. Instead, when the
code encounters "LOG AN EVENT" it starts printing and continues to the
end of the file.
If I substitute a pattern that I know to be in some of the desired
paragraphs, it behaves the way I expect- prints out the parts selected.
I have read the "Perl Cookbook" section on extracting a range of lines,
and could use it for this situation. But my questions are: why isn't
/^$/ a valid delimiter for the range operator? Has it something to do
with "greedy" searches? If so, why does it work for other patterns?
Maybe the range operator doesn't like ^ or $ in its expressions?
ollie spencer
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 18 Sep 2000 19:59:34 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: Re: Range operator with "... /^$/"
Message-Id: <8q5s6n$8pr$1@nnrp1.deja.com>
In article <8q5l8i$vn6$1@nnrp1.deja.com>,
ollie_spencer@my-deja.com wrote:
[snip snip]
> and could use it for this situation. But my questions are: why isn't
> /^$/ a valid delimiter for the range operator? Has it something to do
m/^$/ matches an empty line
a 'just read' line will probably contain a newline
Brendon
++++
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 18 Sep 2000 20:17:21 GMT
From: Yanick Champoux <yanick@babyl.sympatico.ca>
Subject: Re: Range operator with "... /^$/"
Message-Id: <lLux5.1409$z9.107954@news20.bellglobal.com>
ollie_spencer@my-deja.com wrote:
: Hi - I'm trying to parse a computer-generated text file that divides
: its paragraphs with a blank line(actually 2 line feeds, I expect). I
: try to separate what I want from the file with code like:
: while(<INFILE>){
: for (/LOG AN EVENT/ ... /^$/){
: print OUTFILE "$_\n";
: }
: }
The 'while' already iterate over your lines: the 'for' must be a
'if'.
while(<INFILE>){ print if /LOG AN EVENT/ .. /^$/; }
# or even
/LOG AN EVENT/ .. /^$/ and print while <DATA>;
(by the by, you don't have to add a "\n" to $_ since it wasn't
chomp'ed to begin with, and a ... here is the same as a .. since
a line cannot match both /LOG AN EVENT/ and /^$/)
Joy,
Yanick
--
eval" use 'that poor Yanick' ";
print map{ (sort keys %{{ map({$_=>1}split'',$@) }})[hex] }
qw/8 b 15 1 9 10 11 15 c b 13 1 12 b 13 f 1 c 9 a e b 13 0/;
------------------------------
Date: Mon, 18 Sep 2000 21:39:55 GMT
From: ollie_spencer@my-deja.com
Subject: Re: Range operator with "... /^$/"
Message-Id: <8q6238$g6i$1@nnrp1.deja.com>
In article <8q5s6n$8pr$1@nnrp1.deja.com>,
Brendon Caligari <bcaligari@my-deja.com> wrote:
> In article <8q5l8i$vn6$1@nnrp1.deja.com>,
> ollie_spencer@my-deja.com wrote:
> [snip snip]
>
> > and could use it for this situation. But my questions are: why isn't
> > /^$/ a valid delimiter for the range operator? Has it something to
do
>
> m/^$/ matches an empty line
>
> a 'just read' line will probably contain a newline
>
> Brendon
I didn't post my code correctly - I used while, not if, and I "chomp"ed
the input.
If you're still interested in the problem(I hope you are) see my reply
to Yannick Champois detailing some further thoughts and errors in my
posting - I probably should have said I am using the WinNT platform, as
well.
Thanks for the reply.
ollie spencer
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 18 Sep 2000 21:35:06 GMT
From: ollie_spencer@my-deja.com
Subject: Re: Range operator with "... /^$/"
Message-Id: <8q61q8$fsl$1@nnrp1.deja.com>
I agree. I'm covered by embarassment, since my code DOES have "if", but
in my hurry to post, I used the incorrect "while". And in my "REAL"
code, I do chomp.
If I believe the "Perl Cookbook" ( and I do), the construct
(/LOG AN EVENT/ ... /^$/) is a boolean, value initially "0", that
evaluates each line it encounters against the first expression ( i.e.,
/LOG AN EVENT/) until it encounters a line that contains that pattern,
whereupon it becomes "1". It then evaluates each subsequent line until
it finds one that matches the second pattern (i.e., /^$/), then becoming
"0".
There is even an example of using the /^$/ expression to find a blank
line in the same section of Cookbook, although not used as the argument
of "while".
The trouble I'm having is probably due to my WinNT platform and the use
of hex 0d0a as the line terminator. I printed $/ to a file and viewed it
using emacs HEXL-MODE; It's one character, "0a", not "0d0a". Maybe I
need to use /^0x0d$/(where 0x0d may not be correct - I may have to be
clever to put a "0d" between ^ and $). Or maybe I can change $/ to
hex0d0a for evaluating this file. I had hoped (and still hope)for a
magic bullet that would put this problem to bed. I wonder if chomp
changes the EOL character to "0a"?
ollie spencer
No Joy, so far.
In article <lLux5.1409$z9.107954@news20.bellglobal.com>,
yanick1@sympatico.ca wrote:
> ollie_spencer@my-deja.com wrote:
> : Hi - I'm trying to parse a computer-generated text file that divides
> : its paragraphs with a blank line(actually 2 line feeds, I expect). I
> : try to separate what I want from the file with code like:
>
> : while(<INFILE>){
> : for (/LOG AN EVENT/ ... /^$/){
> : print OUTFILE "$_\n";
> : }
> : }
>
> The 'while' already iterate over your lines: the 'for' must be a
> 'if'.
>
>I also tried using
> while(<INFILE>){ print if /LOG AN EVENT/ .. /^$/; }
>
> # or even
> /LOG AN EVENT/ .. /^$/ and print while <DATA>;
>
> (by the by, you don't have to add a "\n" to $_ since it wasn't
> chomp'ed to begin with, and a ... here is the same as a .. since
> a line cannot match both /LOG AN EVENT/ and /^$/)
>
> Joy,
> Yanick
>
> --
> eval" use 'that poor Yanick' ";
> print map{ (sort keys %{{ map({$_=>1}split'',$@) }})[hex] }
> qw/8 b 15 1 9 10 11 15 c b 13 1 12 b 13 f 1 c 9 a e b 13 0/;
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 18 Sep 2000 20:40:45 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Rant: Re: An identd faking ident.
Message-Id: <Pine.GHP.4.21.0009182034290.18461-100000@hpplus03.cern.ch>
On 18 Sep 2000 nobull@mail.com wrote:
> Servers that log ident info on requests do so in order to _help_ the
> admins of the client sites track abusive users. If your site has only
> one user at a time and you know who that is then there's no reason to
> respond to ident requests.
Crypted identd (a la "pidentd") seems a neat idea. Gives the other
party a token that gives away no useful information about the calling
system, but if the party uses that token when reporting abuse, the
sysadmin can decrypt it and thus both 1) identify the offending
userid, date and time and 2) prove that the report is a genuine one.
Of course this isn't a Perl language issue... but it seemed relevant
enough to justify a short posting. Sorry.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 V9 Issue 4364
**************************************