[16938] in Perl-Users-Digest
Perl-Users Digest, Issue: 4350 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 17 18:05:27 2000
Date: Sun, 17 Sep 2000 15:05:10 -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: <969228310-v9-i4350@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 17 Sep 2000 Volume: 9 Number: 4350
Today's topics:
Re: Annoying quotation marks! <timewarp@shentel.net>
Re: Annoying quotation marks! <tigz@ntlworld.com>
Re: binmode(): How is OS related with "\n"? (Abigail)
Call a Perlscript within a Javascript <whofer@access.ch>
Call a Perlscript within a Javascript <whofer@access.ch>
Call a Perlscript within a Javascript <whofer@access.ch>
Can not read arrays from <STDIN> (YzzuS1)
cgi script for downloading (Seth Sticco)
Re: Changing the meaning of "\n" (Abigail)
Re: Changing the meaning of "\n" (Abigail)
Re: Copying Files <scott@datona.com>
Re: Formatting a MAC address... <billy@nospamforme.com>
Re: Formatting a MAC address... (Abigail)
Re: Getting started w/ Perl (JoeCoolCols)
Re: help with HTML::Parser please ptomsic@my-deja.com
Re: Parse::RecDescent: Problem with a Grammar (Abigail)
Re: Perl Debugger (Abigail)
Re: Possible to generate html frames from perl ??? <srmalloy@home.com>
Printing to a printer without "|lp" <kj0@mailcity.com>
Re: Problem with STDIN (newbie question) (YzzuS1)
Re: Recipe For Sorting LoL andre_sanchez@my-deja.com
Re: Regular Expression for matching with email addresse (Abigail)
Re: Req.: The perfect Perl Editor? (Homer Simpson)
RunJava script from MS Explorer problem <yantarian@hotmail.com>
Re: Shortest code for Fibonacci? <rcook@pcug.org.au>
shtml on-the-fly <rs016182@pro.via-rs.com.br>
Re: Which book/site should I use? I really can't choose <gellyfish@gellyfish.com>
Re: which the best scripting language? <juex@my-deja.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 17 Sep 2000 14:33:49 -0400
From: Albert Dewey <timewarp@shentel.net>
Subject: Re: Annoying quotation marks!
Message-Id: <39C50E8D.94975D3B@shentel.net>
Tigz wrote:
> In my chat room i have just setup at (http://www.tiger.ltpage.net) when a
> message has been submited it adds quotation marks round the message like so:
> Tigz:"what u was doing to the cgi"
>
> Could somebody please tell me how to remove them, and also tell me how to
> change the font and size.
>
> Thanks,
> Mick
>
> This is the output for the new message file:
>
> open (NEW, ">$filepath$formdata{'room'}$filext");
> print NEW '<HTML><HEAD><META HTTP-EQUIV="Refresh" CONTENT="4"></HEAD><BODY
> BGCOLOR="#FFFFFF">';
> print NEW "\n";
> if ($iecompatible) {
> print NEW "\<BR\>\<B\>$formdata{'username'}\</B\>";
> print NEW "<b\>:</b\>\"";
> print NEW "$formdata{'message'}";
> print NEW "\"\n";
> for ($i = 1; $i < 30; $i++)
> {
> print NEW "$lines[$i]";}}
> print NEW "\n";
> close(NEW);
Get rid of the quotes found in this line as such -
print NEW $lines[$i];}}
------------------------------
Date: Sun, 17 Sep 2000 19:38:46 +0100
From: "Tigz" <tigz@ntlworld.com>
Subject: Re: Annoying quotation marks!
Message-Id: <dd8x5.5576$6T1.80148@news2-win.server.ntlworld.com>
Thanks evryone I have sorted the fonts out now :)
But i require to change the "Send!" and "logoff" buttons, in to text link,
how could i do this?
here is the code:
print "\<CENTER\>\<TABLE CELLSPACING=0 CELLPADDING=0\>\n\<TR\>\n\<TD\>\n";
print "\<nobr\>\<FORM ACTION=\"$ENV{'SCRIPT_NAME'}\"
METHOD=\"POST\"\><b\>Message\:\n\</b\><input name=username type=hidden
value=\"$formdata{'username'}\"\>\n";
print "\<input name=room type=hidden value=\"$formdata{'room'}\"\>\n";
print "\<input type=text name=message size=35\>\n";
print "\<input type=submit value=\"Send!\"\>";
print "\</form\>\</nobr\>\n\</TD\>\n\<TD\>\n";
print "\<nobr\>\<FORM ACTION=\"$ENV{'SCRIPT_NAME'}\"
METHOD=\"POST\"\>\<input name=username type=hidden
value=\"$formdata{'username'}\"\>\n";
print "\<input name=room type=hidden value=\"$formdata{'room'}\"\>\n";
print "\<input name=logoff type=hidden value=1>\n";
print "\<input type=hidden name=message value=\"Has\ just\ left the
chatroom\!\"\>\n";
print "\<input type=submit value=\"Logoff\"\>";
print "\</form\>\</nobr\>\n\</TD\>\n\</TR\>\n\</TABLE\>\</CENTER\>\n";
Thanks
Mick :)
------------------------------
Date: 17 Sep 2000 19:09:22 GMT
From: abigail@foad.org (Abigail)
Subject: Re: binmode(): How is OS related with "\n"?
Message-Id: <slrn8sa5ku.h8o.abigail@alexandra.foad.org>
Bart Lateur (bart.lateur@skynet.be) wrote on MMDLXXIV September MCMXCIII
in <URL:news:1e59sso0nni15d36jhtm03bjgi4sc9jbc5@4ax.com>:
## Tim Hammerquist wrote:
##
## >> No, you forget about the side effect on PC.
## >
## >How am I wrong in this? I said "*nix won't care one way or another."
## >Since when did PC (which I interpreted as DOS/Windoze) come under *nix?
##
## If you don't care about anything but *nix, you might just as well forget
## about binmode(). It helps in writing cross-platform code, in particular:
## code also targetted to PC. AFAIK binmode() is a noop on every other
## platform. (I don't know about VMS.)
PC is a type of platform that is perfectly able to run OSses that don't
need binmode().
You mean: "code also targetted to Redmondware".
Abigail
--
perl -we '$_ = q ;4a75737420616e6f74686572205065726c204861636b65720as;;
for (s;s;s;s;s;s;s;s;s;s;s;s)
{s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'
------------------------------
Date: Sun, 17 Sep 2000 20:37:24 +0100
From: "Werner Hofer" <whofer@access.ch>
Subject: Call a Perlscript within a Javascript
Message-Id: <8q32rj$g35$1@pacifica.access.ch>
Hello
i would like to call a Perlscript within a Javascipt-Function. How is this
possible ( with Server Site Include ? ) ?
Here is an example, witch i would like to realize
Test.html:
-------------
<html>
<head>
<script language="Javascript">
function abc() {
call Test.pl // Aufruf des Perlcripts !!!!
}
</script>
</head>
<body onUload="abc()">
hello world...
</body>
</html>
Thank a lot for your help in advance
Werner
------------------------------
Date: Sun, 17 Sep 2000 20:37:50 +0100
From: "Werner Hofer" <whofer@access.ch>
Subject: Call a Perlscript within a Javascript
Message-Id: <8q32sd$g3k$1@pacifica.access.ch>
Hello
i would like to call a Perlscript within a Javascipt-Function. How is this
possible ( with Server Site Include ? ) ?
Here is an example, witch i would like to realize
Test.html:
-------------
<html>
<head>
<script language="Javascript">
function abc() {
call Test.pl // Aufruf des Perlcripts !!!!
}
</script>
</head>
<body onUload="abc()">
hello world...
</body>
</html>
Thank a lot for your help in advance
Werner
------------------------------
Date: Sun, 17 Sep 2000 22:27:46 +0100
From: "Werner Hofer" <whofer@access.ch>
Subject: Call a Perlscript within a Javascript
Message-Id: <8q39ah$kng$1@pacifica.access.ch>
Hello
i would like to call a Perlscript within a Javascipt-Function. How is this
possible ( with Server Site Include ? ) ?
Here is an example, witch i would like to realize
Test.html:
-------------
<html>
<head>
<script language="Javascript">
function abc() {
call Test.pl // Aufruf des Perlcripts !!!!
}
</script>
</head>
<body onUload="abc()">
hello world...
</body>
</html>
Thank a lot for your help in advance
Werner
------------------------------
Date: 17 Sep 2000 21:30:40 GMT
From: yzzus1@aol.com (YzzuS1)
Subject: Can not read arrays from <STDIN>
Message-Id: <20000917173040.29221.00000011@ng-fp1.aol.com>
Hello,
I am very new to Perl and programming. I am using Windows 95 and Perl
5.22. When I try to read and array from <STDIN> by using control-D or control-Z
I dump the program. Is there another control character in Windows to just state
end of file? Also, how dow you clear the screen? In basic the command is clr.
Thank You,
bill
------------------------------
Date: Sun, 17 Sep 2000 21:45:57 GMT
From: sethn@bigfoot.com (Seth Sticco)
Subject: cgi script for downloading
Message-Id: <8FB2BE451sethn@204.186.201.11>
I want to make a cgi script using perl that will track downloads. I know
mostly how I am going to do this. I'm going to refer to the perl script in
the link to download the file. I want to know what the best way of having
the script send the file is. I could have it redirect to the file, or I
can have the script send the file itself. Which is the better idea? Also,
what is the best way of doing each? I hope this is easy to understand. If
any of this is hard to understand, I'm willing to answer any questions.
- Seth Sticco
------------------------------
Date: 17 Sep 2000 19:50:02 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Changing the meaning of "\n"
Message-Id: <slrn8sa816.h8o.abigail@alexandra.foad.org>
Michael Carman (mjcarman@home.com) wrote on MMDLXXIV September MCMXCIII
in <URL:news:39C4F289.E41A1F18@home.com>:
,, Here's an idle question that's been running through my mind. Is there a
,, way to change the meaning of "\n" for the output a script creates?
,,
,, Here's the situation: I have a script which generates some files. Perl
,, automagically interprets "\n" based on the platform it's on, so that I
,, get *nix format files on *nix, and DOS format on Win*. That's fine, but
,, I'd like to be able to control the output file format from either
,, platform -- create *nix files from Win*, or vice versa.
,,
,, The simplest method is obviously to just create the files and then
,, postprocess them as needed to convert the format, but that's too
,, easy. :)
,,
,, What I'd like to do is redefine "\n" such that
,,
,, print "foo\n";
,,
,, print <<"EOT";
,, multi-line
,, text goes
,, here
,, EOT
,,
,, will both work. Does anyone know of a way to do this?
Method 1:
BEGIN {
use overload;
overload::constant q => sub {local $_ = shift; s/\n/\012/g; $_};
}
... your program goes here ...
Method 2:
my $pid = open my $fh => "|-";
die "Cannot fork: $!\n" unless defined $pid;
if ($pid) {
while (<>) {
s/\n/\012/g;
print;
}
exit;
}
... your program goes here ...
The latter method only works if you print to STDOUT, and not to handles.
The former method only works for hardcoded \n's (and line breaks in strings);
it doesn't work for any \n's you read in.
Abigail
--
:;$:=~s:
-:;another Perl Hacker
:;chop
$:;$:=~y
:;::d;print+Just.
$:;
------------------------------
Date: 17 Sep 2000 19:52:21 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Changing the meaning of "\n"
Message-Id: <slrn8sa85h.h8o.abigail@alexandra.foad.org>
Clinton Pierce (clintp@geeksalad.org) wrote on MMDLXXIV September
MCMXCIII in <URL:news:dZ6x5.50749$QW4.585527@news1.rdc1.mi.home.com>:
== [Posted and mailed]
==
== In article <39C4F289.E41A1F18@home.com>,
== Michael Carman <mjcarman@home.com> writes:
== > Here's the situation: I have a script which generates some files. Perl
== > automagically interprets "\n" based on the platform it's on, so that I
== > get *nix format files on *nix, and DOS format on Win*. That's fine, but
== > I'd like to be able to control the output file format from either
== > platform -- create *nix files from Win*, or vice versa.
== >
== > What I'd like to do is redefine "\n" such that
==
== Piece o cake. \n is a logical end-of-line character. It gets translated
== into whatever your OS normally uses. Just redefine $\. perldoc perlvar
== for more information on that.
Huh? $\ is initially undefined. Does that mean that as long as I don't
set $\, print "\n"; doesn't print anything? I don't think so.
There is *NO* relation between $\ and "\n". None at all.
Abigail
--
perl -wle'print"Êõóô áîïôèåò Ðåòì Èáãëåò"^"\x80"x24'
# A pair of doves flying
# north. A goldfish swims in
# the river. Two wolves.
------------------------------
Date: Sun, 17 Sep 2000 12:00:36 -0700
From: "Datona Communications" <scott@datona.com>
Subject: Re: Copying Files
Message-Id: <ky8x5.86662$47.963273@news.bc.tac.net>
"Indy Singh" <indy@remove_this_indigostar.com> wrote in message
news:O%Pw5.12396$m7.5795486@news3.rdc1.on.home.com...
> Patrick Connolly <patrickjos@hotmail.com> wrote in message
> news:39C2DBBF.A7D3A993@hotmail.com...
> >
> > I'm trying to develop a perlscript to copy files (on windows nt) from
> > one directory to another. The simple requirements are:
> > 1. The timestamp of the file must NOT be modified.
> > 2. There must be no "noise" output to the screen.
> > 3. There should be a way to verify that the copy was successful.
> >
> > The problem:
> > 1. I've tried the copy() function from File::Copy module. On windows
> > NT, it modifies the timestamp to current time.
> > 2. I've tried using system("copy sourcefile destfile") but it prints
> > out noise to the screen for every file it copies.
> >
> > Any suggestions ?
> >
> > Patrick
> >
> >
>
>
>
> Use stat to get the time of of the source file, and use utime to set the
> time of the dest file after copying. See example below.
>
>
> sub copy_file_ex
> {
> my ($src, $dest) = @_;
> # copy file src -> dest preserve source file times and dest
permissions
> local ($/);
> open (IN, $src) || die "Can't open $src $!\n";
> my $srctime = (stat($src))[9];
> my $srcmode = (stat($src))[2];
>
> my $destmode;
> binmode IN;
> $/ = undef;
> my $data = <IN>;
> close IN;
> if (-e $dest) {
> $destmode = (stat($dest))[2];
> chmod(0666, $dest);
> } else {
> # use dest file mode if avail, else use source file's mode
> $destmode = $srcmode;
> }
> open (OUT, ">$dest") || die "Can't create $dest $!\n";
> binmode OUT;
> print OUT $data;
> close OUT;
> utime $srctime, $srctime, $dest;
> chmod $destmode, $dest;
> }
>
>
> --
> Indy Singh
> IndigoSTAR Software -- www.indigostar.com
Will this script work for Unix? I am actually looking for a script which
will copy ALL files in a directory named after the date (09172000) to
another directory under crontab once a night.
------------------------------
Date: Sun, 17 Sep 2000 19:14:09 +0100
From: "Billy" <billy@nospamforme.com>
Subject: Re: Formatting a MAC address...
Message-Id: <bR7x5.4052$ap5.71801@news6-win.server.ntlworld.com>
In article <x7g0mygasb.fsf@home.sysarch.com>, "Uri Guttman"
<uri@sysarch.com> wrote:
>
> here is one way:
>
> s/\b(\w)\b/0$1/g
>
> uri
>
That's the kind of thing. One of these days I'll get the hang of regex...
Thanks.
Billy.
--
I'm ANN LANDERS!! I can SHOPLIFT!!
------------------------------
Date: 17 Sep 2000 18:56:17 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Formatting a MAC address...
Message-Id: <slrn8sa4sd.h8o.abigail@alexandra.foad.org>
Billy (billy@nospamforme.com) wrote on MMDLXXIV September MCMXCIII in
<URL:news:qv7x5.5471$6T1.77862@news2-win.server.ntlworld.com>:
:} I've been mucking around trying to format a list of MAC
:} addresses like :
:}
:} 0:d0:96:3c:73:58
:} 8:0:4e:c:1:f7
:}
:} Into :
:}
:} 00:d0:96:3c:73:58
:} 08:00:4e:0c:01:f7
:}
:} I've been trying to do an elegant, single regex to do it, but I keep ending u
:} with a rather messy mix of two or three, or an increadibly complex expression
:} Any pointers?
join q {:} => map {sprintf "%02x" => hex} split m {:} => $string;
Abigail
--
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
${qq$\x5F$} = q 97265646f9 and s g..g;
qq e\x63\x68\x72\x20\x30\x78$&eggee;
{eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'
------------------------------
Date: 17 Sep 2000 21:24:46 GMT
From: joecoolcols@aol.com (JoeCoolCols)
Subject: Re: Getting started w/ Perl
Message-Id: <20000917172446.15978.00000416@ng-fw1.aol.com>
I am fairly new to Perl I got started by using Perl on My PC with an emulator
that ran in Windows "MkSnt" or something like that. Unfortunately it got lost
somewhere when i was transfering things from my old pc to my new one.
Does anyone know whether or where you can get one of these emulators now?
I need one so I can work on and test my CGI project before sening it to the web
site. Please Help Me !
------------------------------
Date: Sun, 17 Sep 2000 18:11:13 GMT
From: ptomsic@my-deja.com
Subject: Re: help with HTML::Parser please
Message-Id: <8q31fm$19p$1@nnrp1.deja.com>
> > On Sat, 16 Sep 2000 ptomsic@my-deja.com wrote:
>
> > > The tags are consistent in the wording "Start content here"
and "end
> > > content here" but there is no consistency to the number of
hyphens or
> > > spaces, so it could be
>
> > > <!---- START content here ----------->
> >
> > I hope you're aware that such a syntax would violate both the
official
> > SGML rules and the simplified HTML rules for comment syntax?
>
> it sounds to me like the poster has to deal with stuff that he
> did not produce. he would surely simply the problem (and his
> life) if he could affect the content generation.
Yes, it's something that I didn't produce, and although it's a
violation that you've pointed out, the content will be returned in a
valid format. Those flags (for the START/END) are merely there to find
content in pages prior to their inclusion in something else
(a personalization engine)
Thanks all for the comments and assistance, much appreciation.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 17 Sep 2000 19:38:30 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Parse::RecDescent: Problem with a Grammar
Message-Id: <slrn8sa7bi.h8o.abigail@alexandra.foad.org>
Stephen Collyer (stephen@twocats.dont-spam.demon.co.uk) wrote on MMDLXXIV
September MCMXCIII in <URL:news:969199113.10661.0.nnrp-07.9e98901a@news.demon.co.uk>:
==
== And here's the code that's giving me problems.
Are you sure that is the code? Because it doesn't look compilable to me.
== ===================================================
==
== my $func_grammar = q{
==
== Function: <rulevar: local @Args>
==
== Function: Identifier ArgList
==
==
== return { FuncName => $item[1],
== ArgNames => [ @Args ] };
== }
This brace matches the brace of the q { above. This is the end of
the string. The rest is garbage and should have perl complain loudly.
== ArgList: '(' Arg(?) (Sep Arg)(s?) ')'
==
== Arg: Quote
==
== push @Args, $item[1];
== }
Unmatched }
== | Function
== | Identifier
==
== push @Args, $item[1];
== }
Unmatched }
Please post some code that at least compiles.
Abigail
--
perl -le 's[$,][join$,,(split$,,($!=85))[(q[0006143730380126152532042307].
q[41342211132019313505])=~m[..]g]]e and y[yIbp][HJkP] and print'
------------------------------
Date: 17 Sep 2000 18:51:14 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Perl Debugger
Message-Id: <slrn8sa4iv.h8o.abigail@alexandra.foad.org>
Doron Nisenbaum (doronn@galileo.co.il) wrote on MMDLXXIV September
MCMXCIII in <URL:news:39C4CDE9.634B11E@galileo.co.il>:
()
() What tool i can use to debug my perl scripts?
ed
() Simple,free,frendly?
()
() Is there a way to use Xemacs?
Have you tried reading the xemacs manual?
() (I use SunOS , UltraSPARC-IIi-Engine )
Then I guess you have a system administrator.
Abigail
--
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-
# Two woodpeckers flying
# over a pool. A pair of
# kingfishers fly away.
------------------------------
Date: Sun, 17 Sep 2000 19:47:59 GMT
From: Sean Malloy <srmalloy@home.com>
Subject: Re: Possible to generate html frames from perl ???
Message-Id: <jv6assc0lemc4hvnn3j8lff463evuchukc@4ax.com>
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: 17 Sep 2000 16:37:55 -0400
From: kj0 <kj0@mailcity.com>
Subject: Printing to a printer without "|lp"
Message-Id: <8q3a33$8jk$1@panix3.panix.com>
I've written a CGI script for in-house use that, among other things,
prints barcode labels via a networked barcode printer. I can get the
printing to work if I do something like:
open BARCODE_PRINTER, "|/usr/bin/lp -d zebra" or PFFff_f_t(__LINE__);
print BARCODE_PRINTER $gobbledeyGook;
close BARCODE_PRINTER;
But the above will crash my script if I turn on taint checking. I
understand the problem has to do with the implicit fork done by the
open command.
Therefore, I would like to print directly to the printer without
forking a new process. How can I do this?
Thanks,
KJ
------------------------------
Date: 17 Sep 2000 21:38:39 GMT
From: yzzus1@aol.com (YzzuS1)
Subject: Re: Problem with STDIN (newbie question)
Message-Id: <20000917173839.29221.00000012@ng-fp1.aol.com>
Try:
chomp($name_ = <STDIN>);
print "Hello $name_!\n"
------------------------------
Date: Sun, 17 Sep 2000 18:05:58 GMT
From: andre_sanchez@my-deja.com
Subject: Re: Recipe For Sorting LoL
Message-Id: <8q315t$ns$1@nnrp1.deja.com>
In article <slrn8s85pm.ntr.mgjv@martien.heliotrope.home>,
mgjv@tradingpost.com.au wrote:
> Sort by first key first, then by second:
>
> sub sortsub { $a->[0] cmp $b->[0] || $a->[1] cmp $b->[1] }
>
I would like to sort by successive keys, in a fashion similiar to the
one you describe, but for the more general case where the number of
elements in the lists are not known in advance and that may vary for
each
succesive list.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 17 Sep 2000 19:29:17 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Regular Expression for matching with email addresses
Message-Id: <slrn8sa6q9.h8o.abigail@alexandra.foad.org>
Bart Lateur (bart.lateur@skynet.be) wrote on MMDLXXIV September MCMXCIII
in <URL:news:ek59ss058igiulmv2l1amqkvkncgk26420@4ax.com>:
** Albert Dewey wrote:
**
** >Try this - works for me -
** >
** >if ($Email =~ /[\w\-]+\@[\w\-]+\.[\w\-]+/)
** > {
** > Do stuff
** > }
**
** So you both fail to match my e-mail address (dot in the local part), and
** addresses of people living in the UK or Australia (domain names are like
** "domain.co.uk").
You didn't try, did you?
foreach (qw /bart.lateur@skynet.be someone@domain.co.uk/) {
print "Matches $_\n" if /[\w\-]+\@[\w\-]+\.[\w\-]+/
}
__END__
Matches bart.lateur@skynet.be
Matches someone@domain.co.uk
Hint: the regex matches if there's a "@" character, proceeded by a
letter, digit, underscore or dash, and followed by a group of
letters, digits, underscores and dashes, followed by a dot, followed
by a letter, digit, underscore or dash. There are no anchors.
** The FAQ says it is impossible to match every possible email address with
** a regex. That is a bit exaggerated. It is impossble, if you allow
** comments in the email address, which are meaningmess anyway. Comments
** may be nested, which implies a recursive definition.
I'm not so sure whether it's impossible. If (??{}) would work correctly,
that is without coredumps, one should be able to match RFC 822 addresses
with a Perl regex. It would be quite a beast though.
** If you do online email address checks, it is not unreasonable to reject
** any address that contains a comment (canonical address: the minimum that
** you need to extract from an address), or at least, nested comments.
But it *is* unreasonable not to allow whitespace between tokens.
** They're only e-mail address obfuscation, anyway. If, however, you want
** to extract email addresses from documents over which you have no control
** whatsoever, you do have to properly parse them.
**
** For a validator, check out RFC::RFC822:Address on CPAN
** (<http://search.cpan.org>). That package also requires
** Parse::RecDescent, also on CPAN. Neither needs compilation, manual
** installation is simple (copy the .pm files to their appropriate
** location).
**
** If you'd like to tackle email address validation using a regex, check
** out the mailbox (addr_spec) grammar in the RFC::RFC822:Address module.
**
** A disadvantage is that it only *checks* an e-mail address, it does not
** extract the canonical address. Another module, Mail::Address part of the
** MailTools package (also on CPAN), does not only check an address, but
** you can extract the canonical addresses from them as well.
Mail::Address doesn't get all cases right.
Abigail
--
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))
------------------------------
Date: 17 Sep 2000 19:05:38 GMT
From: homer.simpson@springfield.nul (Homer Simpson)
Subject: Re: Req.: The perfect Perl Editor?
Message-Id: <8q34m2$jr4$0@216.39.130.207>
In article <ss8l267kh3t37@corp.supernews.com>, cberry@cinenet.net (Craig Berry) wrote:
>Randy (randy_734@my-deja.com) wrote:
>: I'm rather surprised that no one has mentioned PFE, the Programmer's
>: File Editor. It is completely free for personal use. Incredibly
>: configurable, has user configurable context sensitive help, MRU list,
>: macro recording and macro library mgmgt, auto indentation, custom key
>: mappings (in case you want to make it work like vi, hehe), multiple
I have PFE but use GVIM because I found it easier than trying to make PFE work
'like' vi.
Any idea where one could get a vi .key file for PFE?
my @a=qw(10 21 19 20 0 1 14 15 20 8 5 18 0 16 5 18 12 0 8 1 3 11 5 18);
my @b=split(//," abcdefghiJklmnoPqrstuvwxyz");
foreach $a(@a){print $b[$a];};print ",\n";
------------------------------
Date: Sun, 17 Sep 2000 13:46:40 -0500
From: "yantar" <yantarian@hotmail.com>
Subject: RunJava script from MS Explorer problem
Message-Id: <0j8x5.537$9z5.93413@news-east.usenetserver.com>
Certainly someone else has seen this problem ...
There is a neat script that lets you run Java files by double
clicking the file from the Explorer window.
My problem is that MS DOS shortens all file names and appends needlessly.
Dos/Explorer doctors my files with an appended ~#, so that
any file like PEG.CLASS gets passed to the script as PEG~1.CLA.
The CLA gets stripped anyway, its the filename that's important.
The Java command line argument goes to 'java PEG~1' and not 'java PEG'.
Thus it fails because it can't find the right class.
Does anyone know
how to fix it so the filenname gets passed without appending
of the '~1' to each file name in DOS/Explorer
------------------------------
Date: Mon, 18 Sep 2000 08:39:18 +1000
From: Owen Cook <rcook@pcug.org.au>
Subject: Re: Shortest code for Fibonacci?
Message-Id: <4mhass06g96tr0bgb7ghg1fsfpkhcq7cfl@4ax.com>
On 16 Sep 2000 16:21:05 GMT, abigail@foad.org (Abigail) wrote:
>Abigail
>--
>CHECK {print "another "} # A tiger prowls beside
>INIT {print "Perl " } # a river. A flying
>BEGIN {print "Just " } # mosquito. Eshun.
>END {print "Hacker\n"}
Few of these lately, what are we supposed to do with them? or are they
just a different series of SIGs
Owen
------------------------------
Date: Sun, 17 Sep 2000 18:42:59 -0300
From: "Fernando" <rs016182@pro.via-rs.com.br>
Subject: shtml on-the-fly
Message-Id: <8q3e40$2q6d$1@phi.procergs.com.br>
I need to generate a shtml document from a cgi. For example, if I do like
this:
#!/usr/bin/perl -w
print "Content-type: text/html\n\n";
print <<END;
<html>
<head><title>File1</title></head>
<body bgcolor=white>
<!--#exec cgi="cgi-bin/inc.cgi" -->
</body>
</html>
END
The include will not execute. What should I do here? I thought in change the
MIME type to something that points to shtml, but I don't know which one is
it.
------------------------------
Date: 17 Sep 2000 22:10:55 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Which book/site should I use? I really can't choose.
Message-Id: <8q3c0v$faf$1@orpheus.gellyfish.com>
In comp.lang.perl.misc Anders Lund <anders@wall.alweb.dk> wrote:
> Lemsgaard wrote:
<snip>
Why exactly did you set the follow ups to a non-existent newsgroup ?
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Sun, 17 Sep 2000 11:19:31 -0700
From: "Jürgen Exner" <juex@my-deja.com>
Subject: Re: which the best scripting language?
Message-Id: <39c50b2f@news.microsoft.com>
"Lucisferre" <lucisferre@email.com> wrote in message
news:39c4847e.0@news.cbn.net.id...
> You think which is the best scripting language? Perl or TCL? What is
your
> best scripting language?
For which purpose?
What is the better car, a Porsche or a truck? A Porsche is a great car for
picking up a woman but terrible for hauling gravel for my driveway.
jue
------------------------------
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 4350
**************************************