[13455] in Perl-Users-Digest
Perl-Users Digest, Issue: 865 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 21 12:07:31 1999
Date: Tue, 21 Sep 1999 09:05:12 -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: <937929912-v9-i865@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 21 Sep 1999 Volume: 9 Number: 865
Today's topics:
Re: Accessing SCSI-Devices from Perl? (Kragen Sitaker)
Re: Accessing SCSI-Devices from Perl? <dan@tuatha.sidhe.org>
Re: Attachment with sendmail in cgi-script (Kragen Sitaker)
Re: Case insensitive SQL query <gellyfish@gellyfish.com>
Re: Changing Passwords from CGI Script with Perl? (Kragen Sitaker)
Re: Combining variables - newbie andy_muscat@my-deja.com
Re: deja.com alters posts (Walter Pienciak)
Re: Fork / Pipe Problem (Kragen Sitaker)
Re: Fork / Pipe Problem <fhusmann@gmt.nl>
Re: intermittent probs with www.perl.com <fhusmann@gmt.nl>
LinkSwitcher with dodgy bits <nmorison@ozemail.com.au>
Re: mkdir bug under Sinix 5.43 (RM600)? (Kragen Sitaker)
mkdir(). What am I doing wrong? <daniel@vesma.co.uk>
Re: mkdir(). What am I doing wrong? (Kragen Sitaker)
Re: mkdir(). What am I doing wrong? (Sean McAfee)
Re: mkdir(). What am I doing wrong? <daniel@vesma.co.uk>
Re: mkdir(). What am I doing wrong? (Kragen Sitaker)
OmniPerl: We're cheaper than OmniMark <jeffp@crusoe.net>
Re: OmniPerl: We're cheaper than OmniMark (Steve Linberg)
Re: OmniPerl: We're cheaper than OmniMark <rasmusr@online.no>
Output buffering/flusing problem in PERL-CGI <yann@yann.screaming.net>
Re: perl related question now! <ysroh@chat.carleton.ca>
Re: Porting Perl script to Win32 perl <nghthawk@nospamhal-pc.org>
Recommendation for introductory classroom textbook? <roger@coelacanth.com>
Redirect STDERR <henkel@us.ibm.com>
Re: Saving a list of filenames from directory into an a (Larry Rosler)
Re: Saving a list of filenames from directory into an a (Kragen Sitaker)
Re: String Splitting <rhomberg@ife.ee.ethz.ch>
Re: String Splitting andy_muscat@my-deja.com
Re: Which are the best books for learning Perl for use <news@*NO-SPAM*adelphi-group.co.uk>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 21 Sep 1999 14:50:45 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Accessing SCSI-Devices from Perl?
Message-Id: <9XMF3.52$QJ.3584@typ11.nn.bcandid.com>
In article <stephan.budach-2109991517200001@budach-stephan.intern.knsk-bbdo.de>,
Stephan Budach <stephan.budach@knsk-bbdo.de> wrote:
>i know, it sounds a bit weird, but has anyone successfully accessed a
>SCSI-Device from within Perl? I guess, this is going to be a hard one for
>me.
All my files at work are stored on SCSI devices, and Perl accesses the
files with no problem.
On Unix, Perl can do arbitrary system calls; it can do anything a C
program can do, including accessing raw SCSI devices. I don't know
about Win32 or VMS.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 20 1999
49 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 21 Sep 1999 15:10:43 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Accessing SCSI-Devices from Perl?
Message-Id: <TdNF3.23928$xg5.2546@news.rdc1.ct.home.com>
Kragen Sitaker <kragen@dnaco.net> wrote:
> In article <stephan.budach-2109991517200001@budach-stephan.intern.knsk-bbdo.de>,
> Stephan Budach <stephan.budach@knsk-bbdo.de> wrote:
>>i know, it sounds a bit weird, but has anyone successfully accessed a
>>SCSI-Device from within Perl? I guess, this is going to be a hard one for
>>me.
> All my files at work are stored on SCSI devices, and Perl accesses the
> files with no problem.
> On Unix, Perl can do arbitrary system calls; it can do anything a C
> program can do, including accessing raw SCSI devices. I don't know
> about Win32 or VMS.
You need XS code to access system calls on VMS, but it's not particularly
tough to write. Same for Win32, though I have no idea how easy or
difficult it is.
Dan
------------------------------
Date: Tue, 21 Sep 1999 14:55:41 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Attachment with sendmail in cgi-script
Message-Id: <N%MF3.66$QJ.145@typ11.nn.bcandid.com>
In article <7s7qpl$su8@fstgal00.tu-graz.ac.at>,
Walter Winter <wiwa@sbox.tu-graz.ac.at> wrote:
>Does anyone know how to attach a file within this script
>Thank´s
Use the MIME:: modules. Or read the MIME RFCs and roll your own. The
former is recommended.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 20 1999
49 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: 21 Sep 1999 16:53:22 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Case insensitive SQL query
Message-Id: <37e7a9f2_2@newsread3.dircon.co.uk>
mrbog@my-deja.com wrote:
> No, the goal isn't to solve people's perl problems, it's to solve their
> problems! If one of "the regulars" has the answer to a question that is
> tangentially related to perl, as mine was, then it does just as much
> good for him to answer it as anyone.
>
Cant you get this into your stupid brain - your question was not even
tangentially related to Perl it was about SQL and nothing else - I cant
see how much of problem it would be for you to just accept this and
shut up.
> Remember, there are people asking perl questions on non-perl newsgroups
> as well, so the argument that "oh there are sooo many questions" is
> completely ridiculous.
>
Sorry I dont understand the pertinence of that point - but dont bother
explaining I'm not interested.
/J\
--
"Tony Blair is reported to be detained indefinitely under plans unveiled
by the Home Secretary" - Corrupt Teletext Page
------------------------------
Date: Tue, 21 Sep 1999 14:25:01 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Changing Passwords from CGI Script with Perl?
Message-Id: <1zMF3.19$QJ.1062@typ11.nn.bcandid.com>
In article <7s7da7$17a4@news.rhrz.uni-bonn.de>,
Konstantin Wiesel <uzs8n8@uni-bonn.de> wrote:
>Correct, i would have to change the uid. Are Perl scripts
>executed with the owners rights if the suid bit is set?
euid, yes.
>My CGI script ist executed with uid "wwwrun".
>I would like to know if i can change the uid within Perl.
No. In Unix you can change your uid only if you're running as root, or
by executing a setuid program.
>With my CGI Script i am reading the old and new passwords from
>a html form and now would like to first validate the
>form and then change the passwords.
>
>I could do this by calling the passwd programm, but
>i dont see how to pass the input stream to it correctly.
I told you. Use Expect.pm. It's on CPAN.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 20 1999
49 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 21 Sep 1999 15:00:37 GMT
From: andy_muscat@my-deja.com
Subject: Re: Combining variables - newbie
Message-Id: <7s86id$eie$1@nnrp1.deja.com>
> I have two variables, $var1 and $var2 which I'd like to combine into a
> single variable $var3 with a space in between. How should I do this?
>
$var3 = $var1." ".$var2;
# :o)
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 21 Sep 1999 14:40:05 GMT
From: walter@io.frii.com (Walter Pienciak)
Subject: Re: deja.com alters posts
Message-Id: <9NMF3.88$HHm.170560512@news.frii.net>
If you look at the links near the the bottom of a displayed article
on deja.com, there's one named "View original Usenet format".
That said, when I click on the Deja-munged links in their default
view, I "always" get a 404 Internal Server Error message from
deja.com. Not too helpful.
Walter
------------------------------
Date: Tue, 21 Sep 1999 14:52:49 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Fork / Pipe Problem
Message-Id: <5ZMF3.59$QJ.3826@typ11.nn.bcandid.com>
In article <37E7877A.F7E1B099@IHATESPAM.gmt.nl>,
Frank Husmann <fhusmann@gmt.nl> wrote:
>I use the following code but I think something is wrong in the frame
>work. Can anyone help me?
You're opening CHILD repeatedly. Each time you open CHILD, the
previous CHILD will be closed.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 20 1999
49 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 21 Sep 1999 17:14:42 +0200
From: Frank Husmann <fhusmann@gmt.nl>
Subject: Re: Fork / Pipe Problem
Message-Id: <37E7A0E2.94719EBF@gmt.nl>
Ok, so now I do it like this but still how can I stop reading from the
childs? This won't work:
#!/usr/bin/perl -w
use Socket;
use IO::Handle;
CHILD->autoflush(1);
PARENT->autoflush(1);
socketpair(CHILD, PARENT, AF_UNIX, SOCK_STREAM, PF_UNSPEC)
or die "socketpair: $!";
sub startChild($)
{
$pid=fork();
if ($pid) {
# this is the parent process that only initiates all childs
return $pid;
} else {
# this is the child process which will search the site for me
die "cannot fork: $!" unless defined $pid;
print PARENT "Child $i Pid $$ is sending thing 1\n";
print PARENT "Child $i Pid $$ is sending thing 2\n";
exit;
}
}
for ($i=0;$i<=1;$i++)
{
# MAIN
$child=startChild $i;
print ($i." ".$child."\n");
$pidChild[$i] = $child;
}
while ($line = <CHILD>) {
# Read from the children but it never stops
print "Parent Pid $$ just read this: '$line'\n";
}
------------------------------
Date: Tue, 21 Sep 1999 16:35:01 +0200
From: Frank Husmann <fhusmann@gmt.nl>
Subject: Re: intermittent probs with www.perl.com
Message-Id: <37E79795.7E42B668@NOSPAM.gmt.nl>
Mark Hamlin wrote:
>
> Has anyone notices intermittent problems with these sites? Is the problem
> local?
No. I have also experienced the same problems for some days now.
>
> http://www.perl.com - 208.201.239.50
> http://language.perl.com/ - 208.201.239.50
>
> http://www.w3j.com/ - 208.201.239.44 (I'm told this was discontinued
> and may have been shut down.
>
> + does anyone know if & where the ppt project is mirrored?
>
> Mark Hamlin
------------------------------
Date: Wed, 22 Sep 1999 01:01:21 +1000
From: "Neale Morison" <nmorison@ozemail.com.au>
Subject: LinkSwitcher with dodgy bits
Message-Id: <L9NF3.18950$1E2.142703@ozemail.com.au>
Hi all. I'm trying to create a package that takes the relative links in an
HTML file and edits them so they're correct when the file is moved to a new
location. The rest of the file is supposed to pass through totally
unchanged.
I'm trying to be profoundly orthodox, in line with the sentiment in this
newsgroup that encourages the use of modules. Thanks to Randal L Schwartz
for the parser from his linkchecker module which I cannibalized.
I have been impure and done a bit of regexing where I could see no other
way. I've commented those bits as dodgy. Can anyone suggest a parser
purification process?
use strict;
#-------------------------------
# LinkSwitcher package
#
# This is intended to parse an HTML file and return
# in htmltext the same file, with links changed so
# that they are now relative to a new base URI.
#
#-------------------------------
BEGIN {
package LinkSwitcher;
use HTML::Parser;
use URI;
use vars qw(@ISA);
@ISA = qw(HTML::Parser);
my $htmltext="";
my $oldbase="";
my $newbase="";
## link structure
## $self->{Links} = {
## ------------------
## "url" => { origtext}, ...
## };
sub start { # called by parse
my $self = shift;
my ($tag, $attr, $attrseq, $origtext) = @_;
my $link;
$link = $attr->{href} if $tag eq "a";
$link = $attr->{src} if $tag eq "img";
$link = $attr->{src} if $tag eq "frame";
if (defined $link) {
$self->{Links}{$link}{'origtext'}=$origtext;
if ($link =~ m{^http://} or $link =~ m{^/} ) { # dodgy - but URI doesn't
do what I expect when link starts with /
$htmltext .= $origtext;
} else { # assume it's a relative link
my $uri = URI->new_abs($link, $oldbase);
my $uri_rel = $uri->rel($newbase);
my $newlink = $uri_rel->as_string;
(my $stag = $origtext) =~ s#$link#$newlink#; # this is dodgy - how can I
reconstruct the tag with a changed link?
$htmltext .= $stag;
}
} else {
$htmltext .= $origtext;
}
}
sub text {
my $self=shift;
$htmltext .= shift;
}
sub comment {
my $self=shift;
$htmltext .= shift;
}
sub declaration {
my $self=shift;
my $decl=shift;
$htmltext .= '<!'.$decl.'>';
}
sub get_links { # $instance->get_links()
my $self = shift;
$self->{Links};
}
sub get_htmltext {
$htmltext;
}
sub set_bases($$) {
my $self=shift;
($oldbase,$newbase)= @_;
}
} # end of LinkSwitcher package
#-----------------------------
my $file = "linktest.html";
my $oldbase="http://lev1/lev2/br1lev3/br1lev4/br1lev5/file.htm"; # original
file in which relative links were found
my $newbase="http://lev1/lev2/br2lev3/br2lev4/file.htm"; # new file in which
links are to be placed
my $filetext = do {
local ($/, *FH);
open FH, "< $file" or die "test Link Switcher - Unable to open file
\"$file\" - ERROR: $!";
<FH>;
};
my $p = LinkSwitcher->new;
$p->set_bases($oldbase,$newbase);
$p->parse($filetext);
$p->parse(undef); # signal the end of parse
print $p->get_htmltext;
__END__
sample file linktest.html
<a href="../fred">
<a href="george">
<a href = "../../../br2lev3/reg">
<a name="clive" href="../../clive/percy/finglenagle">
<a
name="bill"
href="http://bill.fred.com/colin">
<a href="/alf.boris.craig/dilbert">
This is some stuff that is not a link
<HR>
and so is this<P>
<a
href="./ralph/../../fred/george/../././../mary/">
<img
src="./ted/../bill/../././alice/">
<frame src="./clint/../myrtle/../././sylvester/">
not a link
<HR>
--
Neale Morison
Wordface
Tel: 02 9555 8971 Fax: 02 9818 4257
Mobile: 0417 661 427
E-mail: mailto:nmorison@ozemail.com
Web: http://www.wordface.com.au
------------------------------
Date: Tue, 21 Sep 1999 14:13:21 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: mkdir bug under Sinix 5.43 (RM600)?
Message-Id: <5oMF3.25028$N77.1966279@typ11.nn.bcandid.com>
In article <HDTnN1oKLsmBrV12mkIU4ebp4YRB@4ax.com>,
Tobias Rudolph <rudolpht@lsv-wuerttemberg.de> wrote:
>I wonder why the mkdir command from perl doesn´t do what it should.
umask?
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 20 1999
49 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 21 Sep 1999 15:40:58 +0100
From: "Daniel Vesma" <daniel@vesma.co.uk>
Subject: mkdir(). What am I doing wrong?
Message-Id: <7s855a$3gr$1@gxsn.com>
Hi Guys,
I am trying to get a script to create an empty directory with wide-open
CHMOD settings.
I am using this...
use CGI qw(param);
print "Content-type: text/html\n\n";
$foo = param("foo");
$makeDIR = "/my/path/is/here/" . $foo;
mkdir($makeDIR, 777);
print "YAY";
It creates the directory, but when I try to go to them in ie5, I get the
error...
Forbidden
You don't have permission to access /****/****/ on this server.
The ****s just represent the name of the directory.
Any ideas? Please? Aww, come on. Please? I love you! Please?
Daniel Vesma
http://www.thewebtree.com
http://www.thewebtree.com/daniel-vesma
------------------------------
Date: Tue, 21 Sep 1999 14:54:42 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: mkdir(). What am I doing wrong?
Message-Id: <S_MF3.65$QJ.4016@typ11.nn.bcandid.com>
In article <7s855a$3gr$1@gxsn.com>, Daniel Vesma <daniel@vesma.co.uk> wrote:
>Any ideas? Please? Aww, come on. Please? I love you! Please?
umask?
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 20 1999
49 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 21 Sep 1999 15:03:26 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: mkdir(). What am I doing wrong?
Message-Id: <27NF3.486$V7.61291@news.itd.umich.edu>
In article <7s855a$3gr$1@gxsn.com>, Daniel Vesma <daniel@vesma.co.uk> wrote:
>I am trying to get a script to create an empty directory with wide-open
>CHMOD settings.
>mkdir($makeDIR, 777);
I thought you said you were creating the directory with wide-open settings!
This is only owner=write, group=execute, and other=execute permissions.
And what's that extra 512 for? Permission bits don't go that high.
--
Sean McAfee mcafee@umich.edu
print eval eval eval eval eval eval eval eval eval eval eval eval eval eval
q!q@q#q$q%q^q&q*q-q=q+q|q~q:q? Just Another Perl Hacker ?:~|+=-*&^%$#@!
------------------------------
Date: Tue, 21 Sep 1999 16:30:51 +0100
From: "Daniel Vesma" <daniel@vesma.co.uk>
Subject: Re: mkdir(). What am I doing wrong?
Message-Id: <7s882s$si7$1@gxsn.com>
> I thought you said you were creating the directory with wide-open
settings!
> This is only owner=write, group=execute, and other=execute permissions.
> And what's that extra 512 for? Permission bits don't go that high.
Whistle Whistle. I think I'm showing my CHMOD ignorance.
The chart at http://www.go-nexus-go.com/chmodchart.html says that 777 is
wide-open
So what should I be using?
Thanks guys,
Daniel Vesma
http://www.thewebtree.com
http://www.thewebtree.com/daniel-vesma
------------------------------
Date: Tue, 21 Sep 1999 15:59:47 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: mkdir(). What am I doing wrong?
Message-Id: <TXNF3.126$QJ.10316@typ11.nn.bcandid.com>
In article <7s882s$si7$1@gxsn.com>, Daniel Vesma <daniel@vesma.co.uk> wrote:
>The chart at http://www.go-nexus-go.com/chmodchart.html says that 777 is
>wide-open
>
>So what should I be using?
0777
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 20 1999
49 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 21 Sep 1999 11:11:39 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: OmniPerl: We're cheaper than OmniMark
Message-Id: <Pine.GSO.4.10.9909211037410.12299-100000@crusoe.crusoe.net>
OmniPerl 0.02 is free. You can use it at work, at home, at school,
anywhere you please.
Use OmniPerl instead of OmniMark.
You'll work faster, more effectivelt, and most important, you will know
what your program does a month from now!
(sorry, no IDE ;) )
In case you don't know what OmniMark is, go to their web site
(http://www.omnimark.com/) for more details. In a nutshell, it's a
language for folks who can't stand to see non-alphanumeric characters.
And that's just the beginning of an ugliness I can't stand.
So if you want to get the same satisfaction, use OmniPerl.
OmniPerl's learning curve is amazing shallow: all you need to know is
Perl! Here's a sample OmniPerl file:
shebang slash usr slash bin slash perl space dash doubleyoo newline
newline
if space openparen dollar caret ECKS closeparen openbrace newline
tab print space doublequote The space executable space is space
dollar caret ECKS backslash en doublequote semicolon newline
closebrace newline
It's THAT easy.
OmniPerl allows you to read from an input file or enter your program on
standard input. It also allows you to save your program to a file, or run
it as soon as it's done being parsed.
OmniPerl's conversion table (it converts 'dollar' to the cryptic '$'
symbol, an 'shebang' to the funny-looking '#!' couplet) can be added to
via the custom.conv file, so you can refer to the '#' sign as 'hash' if
you want.
It's THAT easy.
Why, look at OmniPerl's regular expression expertise!
ess slash percent percent openparen openbracket caret percent
closebracket plus closeparen percent percent slash dollar TABLE
openbrace dollar one closebrace slash gee semicolon
This generates the oh-so-cryptic:
s/%%([^%]+)%%/$TABLE{$1}/g;
Who can stand all that line noise?
And! If you feel more comfortable with spelling out your variable names,
instead of using OmniPerl's dynamic translation of unknown keywords to
plaintext, you can! Just look:
print space doublequote EYE space aye em space en oh tee space aye space
see ar oh oh kay bang doublequote semicolon
It's an amazing new language. Perl is free. OmniMark may be cheaper than
Perl, but OmniPerl is cheaper than OmniMark.
Do the math. We think OmniPerl is the answer to all your questions.
You can download OmniPerl 1.00 by visiting this site:
aitch tee tee pee colon slash slash doubleyoo doubleyoo doubleyoo dot
pee oh bee oh ecks dot see oh em slash tilde jay aye pee aitch why
slash OH em ne eye PEE ee ar ell slash
For those of you stone-age Perl programmers, that URL is:
http://www.pobox.com/~japhy/OmniPerl/
Start programming smarter. Start programming faster. Start programming
in OmniPerl. Be the first on your block! In your town! On the planet!
(While I *have* created the OmniPerl lexer, this entire thing is just a
spoof. I really think you should look at OmniMark if you're having a
rotten day. It will make you feel so much better about yourself.)
--
jeff pinyan japhy@pobox.com
perl stuff japhy+perl@pobox.com
CPAN ID: PINYAN http://www.perl.com/CPAN/authors/id/P/PI/PINYAN
------------------------------
Date: Tue, 21 Sep 1999 11:33:05 -0400
From: slinberg@crocker.com (Steve Linberg)
Subject: Re: OmniPerl: We're cheaper than OmniMark
Message-Id: <slinberg-2109991133050001@bsg-ma1a-40.ix.netcom.com>
In article <Pine.GSO.4.10.9909211037410.12299-100000@crusoe.crusoe.net>,
japhy@pobox.com wrote:
> shebang slash usr slash bin slash perl space dash doubleyoo newline
> newline
> if space openparen dollar caret ECKS closeparen openbrace newline
> tab print space doublequote The space executable space is space
> dollar caret ECKS backslash en doublequote semicolon newline
> closebrace newline
LOL! Yes, what WERE Larry & Co. thinking?! :)
------------------------------
Date: Tue, 21 Sep 1999 17:40:15 +0100
From: "Rasmus Rimestad" <rasmusr@online.no>
Subject: Re: OmniPerl: We're cheaper than OmniMark
Message-Id: <FHNF3.1545$1s6.21161@news1.online.no>
You're not serious about this are you?
Jeff Pinyan wrote in message ...
>OmniPerl 0.02 is free. You can use it at work, at home, at school,
>anywhere you please.
>
>Use OmniPerl instead of OmniMark.
>
>You'll work faster, more effectivelt, and most important, you will know
>what your program does a month from now!
>
>(sorry, no IDE ;) )
>
>
>In case you don't know what OmniMark is, go to their web site
>(http://www.omnimark.com/) for more details. In a nutshell, it's a
>language for folks who can't stand to see non-alphanumeric characters.
>And that's just the beginning of an ugliness I can't stand.
>
>So if you want to get the same satisfaction, use OmniPerl.
>
>OmniPerl's learning curve is amazing shallow: all you need to know is
>Perl! Here's a sample OmniPerl file:
>
> shebang slash usr slash bin slash perl space dash doubleyoo newline
> newline
> if space openparen dollar caret ECKS closeparen openbrace newline
> tab print space doublequote The space executable space is space
> dollar caret ECKS backslash en doublequote semicolon newline
> closebrace newline
>
>It's THAT easy.
>
>OmniPerl allows you to read from an input file or enter your program on
>standard input. It also allows you to save your program to a file, or run
>it as soon as it's done being parsed.
>
>OmniPerl's conversion table (it converts 'dollar' to the cryptic '$'
>symbol, an 'shebang' to the funny-looking '#!' couplet) can be added to
>via the custom.conv file, so you can refer to the '#' sign as 'hash' if
>you want.
>
>It's THAT easy.
>
>Why, look at OmniPerl's regular expression expertise!
>
> ess slash percent percent openparen openbracket caret percent
> closebracket plus closeparen percent percent slash dollar TABLE
> openbrace dollar one closebrace slash gee semicolon
>
>This generates the oh-so-cryptic:
>
> s/%%([^%]+)%%/$TABLE{$1}/g;
>
>Who can stand all that line noise?
>
>And! If you feel more comfortable with spelling out your variable names,
>instead of using OmniPerl's dynamic translation of unknown keywords to
>plaintext, you can! Just look:
>
> print space doublequote EYE space aye em space en oh tee space aye space
> see ar oh oh kay bang doublequote semicolon
>
>It's an amazing new language. Perl is free. OmniMark may be cheaper than
>Perl, but OmniPerl is cheaper than OmniMark.
>
>Do the math. We think OmniPerl is the answer to all your questions.
>
>You can download OmniPerl 1.00 by visiting this site:
>
> aitch tee tee pee colon slash slash doubleyoo doubleyoo doubleyoo dot
> pee oh bee oh ecks dot see oh em slash tilde jay aye pee aitch why
> slash OH em ne eye PEE ee ar ell slash
>
>For those of you stone-age Perl programmers, that URL is:
>
> http://www.pobox.com/~japhy/OmniPerl/
>
>Start programming smarter. Start programming faster. Start programming
>in OmniPerl. Be the first on your block! In your town! On the planet!
>
>
>(While I *have* created the OmniPerl lexer, this entire thing is just a
>spoof. I really think you should look at OmniMark if you're having a
>rotten day. It will make you feel so much better about yourself.)
>
>--
>jeff pinyan japhy@pobox.com
>perl stuff japhy+perl@pobox.com
>CPAN ID: PINYAN http://www.perl.com/CPAN/authors/id/P/PI/PINYAN
>
------------------------------
Date: Tue, 21 Sep 1999 23:47:18 +0800
From: "Yann S Taddei" <yann@yann.screaming.net>
Subject: Output buffering/flusing problem in PERL-CGI
Message-Id: <7s89k0$jme$1@epos.tesco.net>
Hello all !
I'm involved in a perl-cgi project that takes user input from an HTML form,
does a lot of complex processing and prints the output to STDOUT (the user's
browser).
Although partial output is generated almost as soon as the script it invoked
(and more gets generated throughout the script), it all seems to be getting
buffered and actually sent out only at the termination of the script.
I've tried out various things to set autoflush on STDOUT but none of them
seem to be working. I've tried the following without success :
1. $| =1;
2. select(STDOUT); $|=1;
3. use FileHandle; STDOUT->autoflush(1);
4. autoflush STDOUT 1;
5. $OUTPUT_AUTOFLUSH =1;
I would like the output to be actually sent to the user statement by
statement.
Any help would be highly appreciated.
Thanks in advance.
Ash Alex
ash_alex@hotmail.com
------------------------------
Date: 21 Sep 1999 15:21:39 GMT
From: Young-Soo Roh <ysroh@chat.carleton.ca>
Subject: Re: perl related question now!
Message-Id: <37E7A3AF.E1A6E2DF@chat.carleton.ca>
David Cassell wrote:
> Young-Soo Roh wrote:
> > This is newsgroup for perl.
>
> Yes. It is *not* for things which have as much relation to
> Perl as they do to Java.
>
Well, sorry. I didn't know that. That's why I asked
>
> > I posted this message because I was wondering something can be done by perl cgi script.
>
> Not quite. You asked a question that was more appropriate
> for several other newsgroups, and were told so. Quite abruptly.
>
I only posted message on this newsgroup.
>
> > Anyway, thank you to the person above for being nice.
> > But, One thing, you don't have right to say "go away".
>
> Why doesn't the unattributed person [who we all know]
> have such a right, if you have a right to ask anything
> you feel like, whether it is appropriate for this newsgroup
> or not? Are you saying you have a right to free speech but
> no one else does?
I didn't say that.
> Your post irritated someone a great deal,
Hmm.. Sorry about that.
I was just pissed because of "Go away".
He could just say it is unappropriate message.
He didn't have to use such a sentence.
> and that someone let you know. Now you're doing *exactly*
> the same thing. That post irritated you a great deal,
> so you are letting that someone know. What is the difference?
>
> > I hope you don't talk to people like that even if you don't see them.
> > Loser.
>
> I hope you don't talk to people like that even if you don't
> see them. And I hope you learn what is appropriate to ask
> in newsgroups and what is not. Note that I am not going
> to continue by calling you a 'loser' also, as _ad_hominem_
> arguments and name-calling are not appropriate here.
>
> BTW, you posted Jeopardy-style, putting your words ahead of
> the previous post. That's bad style in Usenet. You're
> supposed to post in sequence, so that a logical thread can
> be maintained. And you failed to attribute anyone except
> yourself, which is also bad Usenet style. For more details,
> you can read the intro materials in news.announce.newusers
> or news.newsusers.questions .
>
> And for CGI questions with no Perl programming content,
> please ask in a CGI/HTML/web newsgroup in future.
>
Thanks for the tips.
>
> David
> --
> David Cassell, OAO cassell@mail.cor.epa.gov
> Senior computing specialist
> mathematical statistician
------------------------------
Date: Tue, 21 Sep 1999 09:53:08 -0500
From: None <nghthawk@nospamhal-pc.org>
To: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Porting Perl script to Win32 perl
Message-Id: <37E79BD4.2E40E63A@hal-pc.org>
Bob Walton wrote:
>
> Cheryl, if you really mean it when you say (below) that you are
> looking for "UL COMPACT", then you need to either put in
> "UL COMPACT" above (not "ul compact"), or add the "i" switch to
> the pattern match so it won't care about case. And, I assume,
> you want to exclude the "UL COMPACT" line from the output, but
> include the "/UL" line, per your logic?
>
Thanks for writing.
No...the all caps was for emphasis. But I did go back and check as
I didn't think of case. But, no, it is written just as in the script.
I don't really care that "/UL" is in there but, I would otherwise have
to
make it go to the previous tag which is a </LI> and of which there
are a few so it would probably stop after the first one.
I tried this on some other pages with lists as well and couldn't get
it to work, but I may recheck the tag case on those pages.
--Cheryl
------------------------------
Date: Tue, 21 Sep 1999 14:35:02 GMT
From: Roger Williams <roger@coelacanth.com>
Subject: Recommendation for introductory classroom textbook?
Message-Id: <m3lna0z621.fsf@grouper.coelacanth.com>
I have been asked to teach a one-semester introductory Perl class at
one of the local universities, and I have the freedom to select the
text(s).
Since this is an evening ("continuing education") class, I expect
students' interest in Perl to be split between system administration
tasks and writing CGI scripts.
My own inclination is to use the Llama book, augmented with random
handouts and assignments, but I'm interested in other recommendations,
especially from those who have taught Perl in a classroom setting.
--
Roger Williams finger me for my PGP public key
Coelacanth Engineering Inc consulting & turnkey product development
Middleborough, Massachusetts wireless * datacomm * DSP * ATE
tel +1 508 947-5585 * fax +1 508 861-0278 * http://www.coelacanth.com/
------------------------------
Date: Tue, 21 Sep 1999 10:14:57 -0500
From: "Dean A. Henkel" <henkel@us.ibm.com>
Subject: Redirect STDERR
Message-Id: <37E7A0F0.BBE48AAD@us.ibm.com>
Hello,
Very new to Perl programming.
What I'd like to do is redrect std error. When this line is executed:
my $files = `ls /u/r/c/t/*/"$fileName"*;
if $filename does not exist, I get an error message printed from
STDERR. I'd like to capture that so the user does not see it. In my
application it's really not an error. Can't seem to find any examples.
Thanks if you can assist.
Dean
------------------------------
Date: Tue, 21 Sep 1999 07:35:46 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Saving a list of filenames from directory into an array.
Message-Id: <MPG.12513793eae75317989fac@nntp.hpl.hp.com>
In article <37e75003.1287605318@frettir.simnet.is> on Tue, 21 Sep 1999
09:30:57 GMT, Helgi Briem <helgi@NOSPAMdecode.is> says...
> On Mon, 20 Sep 1999 15:34:53 -0400, George
> <dgscapin@castaway.cc.uwf.edu> wrote:
>
> >I am trying to find a way to save a list of jpeg and gif filenames from
> >a given directory into an array. I just need a simple way to do this.
> >Thank you in advance for the help. I have tried some suggestions from
> >the gurus through reading similar problems but haven't had any luck, so
> >I need an answer to my specific problem.
> >
> >george@thescapins.com
>
> opendir DIR, "somedir/somesubdir";
> @dirlist = readdir (DIR);
> closedir DIR;
You forgot a few things in this response:
1. You forgot to check the opendir for failure.
2. You forgot to read the question in regard to exactly which of the
contents of the directory were desired.
3. You forgot to read the correct solution posted by Kragen Sitaker
some thirteen hours ahead of yours (according to my newsfeed).
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 21 Sep 1999 14:57:38 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Saving a list of filenames from directory into an array.
Message-Id: <C1NF3.69$QJ.2561@typ11.nn.bcandid.com>
In article <MPG.12513793eae75317989fac@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
>3. You forgot to read the correct solution posted by Kragen Sitaker
>some thirteen hours ahead of yours (according to my newsfeed).
Actually, my solution only finds files *named* *.gif or *.jpeg. (It
doesn't even find *.jpg or *.GIF files.) I like Abigail's solution
better, although I think it could be improved to fork and exec less.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 20 1999
49 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 21 Sep 1999 16:40:16 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: String Splitting
Message-Id: <37E798D0.F1400D2@ife.ee.ethz.ch>
Ollie Cook wrote:
>
> I am trying to write a perl script which will analyse
> my /var/log/maillog file, so that I can discover how much traffic each
> domain's email is using.
>
> A sample line would be (all on one line):
>
> Sep 21 14:53:19 s108 sendmail[18811]: OAA18811:
> from=<user@etoncollege.org.uk>, size=1895, class=0, pri=31895,
> nrcpts=1,
> msgid=<A76C57705916D211B3400020480E101789C8D9@nts5.school.etoncollege.or
> g.uk>, proto=ESMTP, relay=nts5.school.etoncollege.org.uk
> [195.195.166.146]
>
> I am having trouble splitting the string up (I don't know where to
> start!!). I've read chapter 7, regular expressions, in Learning Perl by
> O'Reilly, but I couldn't see how to use it. [isbn: 1-56592-284-0]
>
> I would like to be able to ascertain the 'from' field and the 'size'
> field. That's to say I would like to store 'user@etoncollege.org.uk' in
> one variable, and '1895' in another variable, for the example above.
>
> Would someone be kind enough to point me in the right direction?
perldoc perlre
$_ = what you wrote above;
my %fields;
$fields{$1} = $2 while /\s(.*?)=(.*?),/g;
use Data::Dumper;
print Dumper(\%fields);
- Alex
------------------------------
Date: Tue, 21 Sep 1999 14:43:03 GMT
From: andy_muscat@my-deja.com
Subject: Re: String Splitting
Message-Id: <7s85hk$dm1$1@nnrp1.deja.com>
In article <7s82gj$ba4$1@nnrp1.deja.com>,
o.cook@etoncollege.org.uk wrote:
> Sep 21 14:53:19 s108 sendmail[18811]: OAA18811:
> from=<user@etoncollege.org.uk>, size=1895, class=0, pri=31895,
> nrcpts=1,
>
msgid=<A76C57705916D211B3400020480E101789C8D9@nts5.school.etoncollege.or
> g.uk>, proto=ESMTP, relay=nts5.school.etoncollege.org.uk
> [195.195.166.146]
> I would like to be able to ascertain the 'from' field and the 'size'
> field. That's to say I would like to store 'user@etoncollege.org.uk'
in
> one variable, and '1895' in another variable, for the example above.
>
get the line into a variable like
$line = "Sep 21 14:53:19 s108 sendmail[18811]: OAA18811:
from=<user@etoncollege.org.uk>, size=1895, class=0, pri=31895, nrcpts=1,
msgid=<A76C57705916D211B3400020480E101789C8D9@nts5.school.etoncollege.or
g.uk>, proto=ESMTP, relay=nts5.school.etoncollege.org.uk
[195.195.166.146]";
# then get user and size
$line =~/from=<([^>]+)>,\s*size=(\d+),/;
$user = $1;
$size = $2;
# ok :o)
Andy
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 21 Sep 1999 15:32:42 +0100
From: "Paul McKnight" <news@*NO-SPAM*adelphi-group.co.uk>
Subject: Re: Which are the best books for learning Perl for use in a Web environment?
Message-Id: <37e79877_1@newsread3.dircon.co.uk>
Hi Cameron,
Many thanks for replying.
I am looking at both UNIX and Windows usage.
Is there much difference?
Is the Official Guide To CGI.pm a general programming/reference guide, I
looked at Amazon.com and it was referring to Libraries and alike?
TIA,
Paul.
Email address fixed - let the deluge of spam begin!
Cameron Dorey wrote in message <37E789B6.DB0D81AC@mail.uca.edu>...
>Paul wrote:
>>
>> Hi,
>>
>> I wish to learn Perl for use in a Web environment. The following books
>> seem to come recommended by many people are they relevant for Web
>> programming?
>>
>> Learning Perl, Programming Perl, Perl Cookbook
>
>Your headers imply that you use Windows, so I would suggest the
>following in this order:
>
>Learning Perl on Win32 Systems (an adaptation of Learning Perl)
>
>The Official Guide to CGI.pm
>
>Perl Cookbook
>
>-> Important! Don't start one until you have finished (or almost
>finished) the previous one. <-
>
>And, if you are going to go heavily into web stuff, you might want to
>look into:
>
>Web Design in a Nutshell
>
>Information Architecture for the World Wide Web
>
>All of the aforementioned books are published by O'Reilly, except "The
>Official Guide..." which is published by Wiley. You might note a subtle
>pattern here. Not to say that there aren't other good books out there,
>but always look in one of these two places:
>
>1. Books published by O'Reilly.
>
>2. Books authored by (or recommended by) a frequent poster on the
>c.l.p.* newsgroups or one of the ActiveState mailing lists - NB: I mean
>a frequent (and correct) *answerer* of questions, not an asker. You will
>get to know of whom I speak quickly reading these newsgroups.
>
>> TIA
>
>YW. Fix that mailing address, and you would have gotten this advice
>sooner.
>
>> Paul.
>
>
>Cameron
>
>--
>Cameron Dorey
>Associate Professor of Chemistry
>University of Central Arkansas
>Phone: 501-450-5938
>camerond@mail.uca.edu
------------------------------
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 865
*************************************