[18489] in Perl-Users-Digest
Perl-Users Digest, Issue: 657 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Apr 9 06:06:19 2001
Date: Mon, 9 Apr 2001 03:05:16 -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: <986810715-v10-i657@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 9 Apr 2001 Volume: 10 Number: 657
Today's topics:
Re: [OT] Re: password encryption <alun.moon@unn.ac.uk>
Blocking pipe. <cernava@itexas.net>
Re: Catch ctrl-C before it kills perl process? <msw99@u.washington.edu>
Re: complaint about moderation of this group (---Pete---)
Re: complaint about moderation of this group <uri@sysarch.com>
Re: Copying Directories <philip.shean@uwe.ac.uk>
Criticism (searching a syslog) <joeybach@127.0.0.1>
Re: Criticism (searching a syslog) <bart.lateur@skynet.be>
Re: dir problem (Gwyn Judd)
Re: dir problem <wayne.keenan@ntlworld.com>
Re: Formatting HTML using Perl <wingetr@wingetsolutions.com>
How to use Net::Telnet if the login without password <jackkon@pchome.com.tw>
Re: How to use Net::Telnet if the login without passwor (Rafael Garcia-Suarez)
Including Perl code in documents <cave@pertus.com.pl>
Re: Including Perl code in documents <wayne.keenan@ntlworld.com>
Re: newbie help - replace <P> tags only if within <DIR> <bart.lateur@skynet.be>
Re: newbie help - replace <P> tags only if within <DIR> <krahnj@acm.org>
Re: problem with making dirs! <gtoomey@usa.net>
Re: Provo Perl Mongers Meeting <wingetr@wingetsolutions.com>
Re: Return code for % operator <bart.lateur@skynet.be>
Re: Return code for % operator (Abigail)
Re: So what do YOU use Perl for? <bart.lateur@skynet.be>
Re: So what do YOU use Perl for? <ocschwar@mit.edu>
tr question <buggerma@de.ibm.com>
Re: tr question <wuerz@yahoo.com>
Using Perl's Expect like from Comm.pl (LS)
Re: Want Lisp-like state machine impl. <cadet@alum.mit.edu>
Re: Want Lisp-like state machine impl. <tony_curtis32@yahoo.com>
Re: Want Lisp-like state machine impl. (Logan Shaw)
Re: Why Perl? (Harri Haataja)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 09 Apr 2001 10:13:04 +0100
From: Alun Moon <alun.moon@unn.ac.uk>
Subject: Re: [OT] Re: password encryption
Message-Id: <ur8z2h1wf.fsf@unn.ac.uk>
merlyn@stonehenge.com (Randal L. Schwartz) writes:
[description of mail reader snipped]
> mail reader posts-and-mails by adding "this mail was also posted" in
> the first few lines of the message body on the mail only. (In other
> words, my news/mail reader can beat up your big brother's news and
> mail readers combined. :)
What is this powerful tool for Mail/News?
At the moment I'm in emacs/gnus for newsgroups and Outlook (not my choice)
for mail!!
Alun
------------------------------
Date: Mon, 9 Apr 2001 00:54:48 -0500
From: "Itexas" <cernava@itexas.net>
Subject: Blocking pipe.
Message-Id: <9arir902bsh@enews1.newsguy.com>
Hi,
I've search and searched the groups and came up with lots of the same
pages, but nothing seems to work.
I'm making a pipe and trying to talk to the main from the forked child, but
it blocks. I've tryed using IO::Select, but even when I write to the pipe
can_read never comes true or returns an array of the ready to read pipes.
Here is an example of a program I saw some one posted. I think it should
work, but it just does not work. I'm using ActiveState perl on windows. I
have not tryed it on my linux box, maybe I should.
use strict;
use IO::Select;
use IO::File;
$| = 1;
my $sel = new IO::Select;
pipe(my $reader,my $writer) or die "Cannot pipe: $!";
my $kid = fork();
if ($kid)
{
close ($writer);
$sel->add($reader);
}
else
{
close ($reader);
$writer->autoflush(1);
while(1)
{
print $writer "I am $$\n";
sleep rand(10); #pause for somthing from 10 sec and down.
}
exit;
}
while(1)
{
foreach my $client ($sel->can_read)
{
my $data = <$client>;
print "Got $data";
}
}
Hope some one can help.
Richard.
------------------------------
Date: Sun, 08 Apr 2001 22:34:08 -0700
From: Matthew Weaver <msw99@u.washington.edu>
Subject: Re: Catch ctrl-C before it kills perl process?
Message-Id: <3AD149D0.AED1E52@u.washington.edu>
That's what I needed -- thanks!
Jonathan Stowe wrote:
>
> Matthew Weaver <msw99@u.washington.edu> wrote:
> > My script runs a bunch of executables, but some of the executables may
> > get stuck in an infinite loop. Is there a way to catch ctrl-C (to
> > stop the loop) before it stops my whole script?
> >
>
> Read about %SIG in the perlvar manpage.
>
> Essentially it comes down to :
>
> $SIG{INT} = sub { print "Ooof - copped Ctrl-C" };
>
> /J\
> --
> Jonathan Stowe |
> <http://www.gellyfish.com> | This space for rent
> |
------------------------------
Date: Mon, 09 Apr 2001 07:23:53 GMT
From: bogus@erol.com (---Pete---)
Subject: Re: complaint about moderation of this group
Message-Id: <3ad15714.514132413@news.earthlink.net>
On Sun, 8 Apr 2001 22:46:51 -0400, tadmc@augustmail.com (Tad
McClellan) wrote:
>No, it isn't that. It is just the extremely large number of folks
>who happen to choose to use Perl for their CGI programs.
>There are 10's of thousands of them out there. It only takes a few
>dozen to begin putting stress on the Perl newsgroup.
>>This is the root of CGI off-topic problem.
>That (too many people with not enough training to even sort out
>"what is what") is the root of the CGI problem.
>I don't see "this problem" ever going away.
--------
Right, and since it's internet and not a private or exclusive
association, the right thing to do is to accept and help
everyone of all levels of expertise -- allowing novices
to help novices and expert to help experts.
The thing I like to discourage is the elitist or snobish attitude
often found in the types of newsgroups (or anywhere in life)
where people gather with various levels of knowledge,
experience, money or whatever that divides people into
sub-groups. However, if anyone from any level within the
group has blatant disrespect for the rules and knowingly
practices poor net-etiquette then they should be delt with
accordingly.
> http://www.augustmail.com/~tadmc/clpmisc_guide/
>No comments on its contents accepted at this time!
>Wait until the autopost happens (hopefully within a week or two)
>then followup to that if you have anything to say.
-------
Ok, I just read through it. I'll coment at the appropriate
time.
---pete---
------------------------------
Date: Mon, 09 Apr 2001 08:09:30 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: complaint about moderation of this group
Message-Id: <x7snjipk93.fsf@home.sysarch.com>
>>>>> "-" == ---Pete--- <bogus@erol.com> writes:
-> Right, and since it's internet and not a private or exclusive
-> association, the right thing to do is to accept and help
-> everyone of all levels of expertise -- allowing novices
-> to help novices and expert to help experts.
then hang out in alt.perl. we don't appreciate novices helping novices
here as they tend to give and propogate wrong answers. novices do better
lurking or asking questions. when they feel they have enough perl to
help out others then they can start to answer questions they feel they
can properly answer. and they have to be capable of handling corrections
from others. all of the regulars have made mistakes and trust others to
be nitpicking them. that is how it works here. if you can't tolerate any
critiques of your posts, then don't post here.
-> The thing I like to discourage is the elitist or snobish attitude
-> often found in the types of newsgroups (or anywhere in life) where
-> people gather with various levels of knowledge, experience, money
-> or whatever that divides people into sub-groups. However, if anyone
-> from any level within the group has blatant disrespect for the
-> rules and knowingly practices poor net-etiquette then they should
-> be delt with accordingly.
we have no restrictions on who can participate here. we do have certain
rules on how they can. there is a big difference. i have seen many
newbies here over the years stick around, learn more perl, start to
answer questions and become regulars. it is the hit and run newbie
attacks and whines that get annoying.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Learn Advanced Object Oriented Perl from Damian Conway - Boston, July 10-11
Class and Registration info: http://www.sysarch.com/perl/OOP_class.html
------------------------------
Date: Mon, 9 Apr 2001 07:40:51 GMT
From: Phil Shean <philip.shean@uwe.ac.uk>
Subject: Re: Copying Directories
Message-Id: <3AD166E7.C4EDDA3A@uwe.ac.uk>
> No it won't, try (on cmd/command prompt):
>
> Please start using normal slashes (the ones going forward :) in all your
> paths.
That's not strictly true. I made an error on my example though.
On an NT System, you need to use double back slashes. Well, at least with IIS 5
and active perl 5.6!
Cheer for all your help!
Phil
------------------------------
Date: Mon, 09 Apr 2001 06:10:08 GMT
From: "John Doe" <joeybach@127.0.0.1>
Subject: Criticism (searching a syslog)
Message-Id: <4ncA6.5075$nD5.1283069@typhoon.tampabay.rr.com>
This is my first real script. I am new to programing in general and just
starting with perl. I do not know anyone else locally who is into perl
who can add input suggest other methods or who can just tell me it sucks.
(Especially with the knowledge of people in this group.) So any criticism
is welcomed.
This script reads a flat syslog file from a start date to
end date with keyword searches that are selected from the user. The format of the file is as follows
Aug 21 19:45:48 node.e-xpedient.com 681: Aug 21 19:44:02: %LINK-3-UPDOWN: Interface FastEthernet2, changed state to up
Aug 22 07:33:30 node.e-xpedient.com 682: Aug 22 07:31:44: %LINK-3-UPDOWN: Interface FastEthernet2, changed state to up
Aug 22 09:32:23 node.e-xpedient.com 683: Aug 22 09:30:38: %LINK-3-UPDOWN: Interface FastEthernet2, changed state
to up
the current dates are at the bottom.
My script is:
#!/usr/bin/perl
use CGI qw/-debug :standard/;
print header;
our $tnMon = param(endMon); our $tnDay = param(endDay); our $tnYear = param(endYear); # Test ending dates
our $tsMon = param(startMon); our $tsDay = param(startDay); our $tsYear = param(startYear); # Test starting dates
our @words = split' ',param(startSearch); #search string; our $loop = 0;
our @found;
#########This Subroutine checks the date
sub dateCheck(){
%Months =(
"Jan"=>1,
"Feb"=>2,
"Mar"=>3,
"Apr"=>4,
"May"=>5,
"Jun"=>6,
"Jul"=>7,
"Aug"=>8,
"Sep"=>9,
"Oct"=>10,
"Nov"=>11,
"Dec"=>12
);
####### validate the dates
####
###
###ENDING DATE
if ($tnMon eq "Apr" || $tnMon eq "Jun" || $tnMon eq "Sep" || $tnMon eq "Nov"){
if ($tnDay > 30){
print "There are only 30 Days in $tnMon . <BR>\n";
$loop = 1;
return;
}
}
if ($tnMon eq "Feb"){
if ($tnDay > 28){
print "There are only 28 days in $tnMon . <br>\n";
$loop = 1;
return;
}
}
#########
###
### STARTING DATE
if ($tsMon eq "Apr" || $tsMon eq "Jun" || $tsMon eq "Sep" || $tsMon eq "Nov"){
if ($tsDay > 30){
print "There are only 30 Days in $tsMon . <BR>\n";
$loop = 1;
return;
}
}
my $test1 = (($Months{$tsMon})*31)+$tsDay + (($tsYear - 2000) * 403);
my $test2 = (($Months{$tnMon})*31)+$tnDay + (($tnYear - 2000) * 403);
if ($test1 < 269 || $test2 < 269){
print " There are no records before Aug 21 2000. <BR>\b";
$loop = 1;
return;
}
if ($test1 > $test2){
print "The starting date must be before the ending date. \n";
print end_html;
$loop = 1}
else {$loop = 0}
}
##############This subroutine transforms the sting to search all variables
sub strSearch(){
###This formats the days to match the syntax of the syslog.
if ($tsDay <= 9){
$start = join(" ",$tsMon,$tsDay);
}
else{
$start = join(" ",$tsMon,$tsDay);
}
if ($tnDay <= 9){
$end = join(" ",$tnMon,$tnDay);
}
else{
$end = join(" ",$tnMon,$tnDay);
}
print "start $start end $end @words <br>\n";
print " TNMON:$tnMon TNDAY:$tnDay TSMON:$tsMon TSDAY:$tsDay WORDS:@words LOOP:$loop <BR>\n";
## Read the syslog
open (SYSLOG, "<cisco.log");
@found = ('');
while(<SYSLOG>){
if (m/^$start.*/i../^$end.*/i){push @found, $_ }
}
LINE:foreach my $matched(@found){
foreach my $word(@words){
next LINE unless ($matched =~ /\Q$word/i)
}
print "$matched <BR> \n";
}
}
dateCheck();
if ($loop < 1){&strSearch()};
------------------------------
Date: Mon, 09 Apr 2001 07:35:01 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Criticism (searching a syslog)
Message-Id: <i4o2dtc4pg0s9o1t3b0cknt4260dbp7fn8@4ax.com>
John Doe wrote:
>use CGI qw/-debug :standard/;
>
>print header;
>our $tnMon = param(endMon); our $tnDay = param(endDay); our $tnYear = param(endYear); # Test ending dates
>our $tsMon = param(startMon); our $tsDay = param(startDay); our $tsYear = param(startYear); # Test starting dates
Can't you combine the param call to return multiple values at once?
Apparently not. One of the reasons I really don't like CGI.pm.
>our @words = split' ',param(startSearch); #search string; our $loop = 0;
>our @found;
>
>#########This Subroutine checks the date
>sub dateCheck(){
>
>%Months =(
Oops. You should have made this a local variable to the sub. This is a
general critiscism, you seem to be using global variables for
everything. A dangerous practise. ALL variables in a sub should be
localized, always, unless there's a specific need for them to have a
wider scope.
You could also have put it outside the sub, in an enclosing block around
the variable declaration and the sub itself, but initialization should
then always happen before the first sub call. That is rather messy, I'm
afraid. So: never mind.
> "Jan"=>1,
> "Feb"=>2,
> "Mar"=>3,
> "Apr"=>4,
> "May"=>5,
> "Jun"=>6,
> "Jul"=>7,
> "Aug"=>8,
> "Sep"=>9,
> "Oct"=>10,
> "Nov"=>11,
> "Dec"=>12
> );
>
>####### validate the dates
>####
>###
>###ENDING DATE
>
>if ($tnMon eq "Apr" || $tnMon eq "Jun" || $tnMon eq "Sep" || $tnMon eq "Nov"){
> if ($tnDay > 30){
> print "There are only 30 Days in $tnMon . <BR>\n";
> $loop = 1;
> return;
> }
> }
Are you assuming that the user will never enter a number above 31?
That's an unsafe assumption.
You also seem to assume that the user's enetered month name is always
valid. Perhaps you've used a dropdown in your HTML form, and then maybe
you may just assume this.
I'd check anyway.
The %month hash is an excellent tool for this check.
>if ($tnMon eq "Feb"){
> if ($tnDay > 28){
> print "There are only 28 days in $tnMon . <br>\n";
> $loop = 1;
> return;
> }
> }
No leap years?
>
>#########
>###
>### STARTING DATE
>
>if ($tsMon eq "Apr" || $tsMon eq "Jun" || $tsMon eq "Sep" || $tsMon eq "Nov"){
> if ($tsDay > 30){
> print "There are only 30 Days in $tsMon . <BR>\n";
> $loop = 1;
> return;
> }
> }
Same code again? Then put it in a sub.
And no check for february?
>my $test1 = (($Months{$tsMon})*31)+$tsDay + (($tsYear - 2000) * 403);
>my $test2 = (($Months{$tnMon})*31)+$tnDay + (($tnYear - 2000) * 403);
That is very artisanal code. A huge chance for buggy code.
Tell yo what I would do: after some minimal checking for valid months
and after seeing the other parameters are indeed numbers, I'd use the
(standard, always present) Time::Local module to change the "date" into
a seconds-since-the-epoch, and then back again, and see if you get the
same date. If you do, your date is valid. Use either the gmtime+timegm
combo, or localtime+timelocal.
I'll skip a few things...
>## Read the syslog
>open (SYSLOG, "<cisco.log");
>@found = ('');
>while(<SYSLOG>){
> if (m/^$start.*/i../^$end.*/i){push @found, $_ }
> }
Since this is a CGI script, I'd use the /o modifier. And drop the ".*"
at the end of the regexes, they're useless.
But the whole concept is vulnerable. If for some starting date there are
no log entries, think of an extremely quiet day, or a day where your
server was down, then your script will return nothing. If if there are
no log entries for the end date, everything until the end of the log
file will be returned.
And your end check isn't right either. It will accept the first log
entry for the end date, but none of the remainder.
HTH,
Bart.
------------------------------
Date: Mon, 09 Apr 2001 04:30:04 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: dir problem
Message-Id: <slrn9d2emb.m5t.tjla@thislove.dyndns.org>
I was shocked! How could wayne.keenan <wayne.keenan@ntlworld.com>
say such a terrible thing:
>
>Gwyn Judd wrote:
>
>> I was shocked! How could J.A.W <nlp0421@gz.cngb.com>
>> say such a terrible thing:
>>
>> >to ignore the subdirs, but is there an efficient way to do this?
>>
>> You want the '-d' file-test operator.
>>
>
>-f
That only gets the files. He wanted to ignore the directories. !-d != -f
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
"She served it as Earl Grey. I could swear it's Darjeeling."
-- Picard in ST:TNG "All Good Things"
------------------------------
Date: Mon, 09 Apr 2001 08:43:47 +0100
From: "wayne.keenan" <wayne.keenan@ntlworld.com>
Subject: Re: dir problem
Message-Id: <3AD16833.AC054F9A@ntlworld.com>
Gwyn Judd wrote:
> >> You want the '-d' file-test operator.
> >>
> >
> >-f
>
> That only gets the files. He wanted to ignore the directories. !-d != -f
>
I'm sure he also said 'only the files' , oh well.
------------------------------
Date: Mon, 09 Apr 2001 01:08:40 -0600
From: "Roger W. Winget" <wingetr@wingetsolutions.com>
Subject: Re: Formatting HTML using Perl
Message-Id: <3AD15FF8.A7FE407C@wingetsolutions.com>
Aloha!
The problem at hand is to take an html document, trim everything
but the tags, and print it out as an outline, much like the W3
validator.
Another person stated that most elements have both an opening and
closing tag. The notable exceptions are <hr>, <img>, and <br>.
<p> SHOULD have a closing tag, but is not required.
In my solution, I assume that the whole HTML document is stored
in $html. $html may or may not include CRs or LFs.
my $nonos = "BR HR IMG";
$html=~s/\s+/ /mg; #trim excess white space.
$html=~s/<!--.*?-->//g; #get rid of comments. Note the ?
$html=~s/<\s/</g; #get rid of extra space
$html=~s/\s>/>/g; #ditto
@tags = $html=~/(<[^>]+>)/g; # extract the HTML tags in order
my $spaces = 0;
my $spacer = "\t";
my @stack = ();
foreach $tag (@tags) {
$tag=~s/$<(\/?\w+/<\U$1\E/; # make tag uppercase
my $t1 = $1;
$t1~s/\///;
if ($tag=~/^//) { # end tag
my $last = pop @stack;
unless ($t1=~/^\/$last/i) {
#invalid HTML or missing </p>
print $spacer x $spaces, "</$t1>\n";
push @stack, $last;
}
--$spaces;
print $spacer x $spaces, "$tag\n";
} else {
print $spacer x $spaces, "$tag\n";
unless ($nonos=~/\W$t1\W/i) {
++$spaces;
push @stack, $t1;
}
}
}
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: Mon, 9 Apr 2001 15:26:54 +0800
From: "jackkon" <jackkon@pchome.com.tw>
Subject: How to use Net::Telnet if the login without password
Message-Id: <9arohf$mek@netnews.hinet.net>
hi.....
I will use the Net::Telnet to login the linux system.
But the account don't have password.
How can I do?
I try the code below, but it seems don't work.
$user='myname';
$passwd='';
$t->login($user, $passwd);
------------------------------
Date: 9 Apr 2001 09:21:47 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: How to use Net::Telnet if the login without password
Message-Id: <slrn9d2vq8.4us.rgarciasuarez@rafael.kazibao.net>
jackkon wrote in comp.lang.perl.misc:
> hi.....
> I will use the Net::Telnet to login the linux system.
> But the account don't have password.
If the account is disabled, or if it doesn't have a shell, you can't
login, whatever method you use. Use an account that allows logins.
--
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: Mon, 09 Apr 2001 07:42:47 +0200
From: Mirek Rewak <cave@pertus.com.pl>
Subject: Including Perl code in documents
Message-Id: <mui2dtg2mmlki48rg46t3gkppjrv493n5m@4ax.com>
Hi
I'm looking for a solutions that help me include Perl programs in my
documents. I would write in tex + fine packages to colorize
("boldize") syntax and numbering lines but unfortunately I have to
write in M$ Word. So maybe there're any macros that'd help me?
Thanks.
Pozdrowienia
Mirek Rewak
cave@pertus.com.pl
------------------------------
Date: Mon, 09 Apr 2001 08:41:41 +0100
From: "wayne.keenan" <wayne.keenan@ntlworld.com>
Subject: Re: Including Perl code in documents
Message-Id: <3AD167B5.ACA2373B@ntlworld.com>
http://www.palfrader.org/code2html/
&paste
Mirek Rewak wrote:
> Hi
> I'm looking for a solutions that help me include Perl programs in my
> documents. I would write in tex + fine packages to colorize
> ("boldize") syntax and numbering lines but unfortunately I have to
> write in M$ Word. So maybe there're any macros that'd help me?
> Thanks.
>
> Pozdrowienia
> Mirek Rewak
> cave@pertus.com.pl
------------------------------
Date: Mon, 09 Apr 2001 07:46:03 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: newbie help - replace <P> tags only if within <DIR> tags
Message-Id: <lop2dtcouvobrikq828gri2lg9lqei038a@4ax.com>
Logan Shaw wrote:
>I don't think you need a Ph.D. to parse HTML. I believe it's
>just a simple context-free language.
It's not. It's far too free-form for that: optional end tags are the
most striking example. In fact, in such situations, just using
HTML::Parser is not good enough. If HTML::TreeBuilder wasn't such a
memory hog, it might have been a better solution.
There's some interesting and appropriate text in the docs for
HTML::TreeBuilder, under the header "HTML AND ITS DISCONTENTS".
OTOH, XML is very strict, and for that you can indeed use a more
artisanal approach, if you must.
--
Bart.
------------------------------
Date: Mon, 09 Apr 2001 09:39:20 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: newbie help - replace <P> tags only if within <DIR> tags
Message-Id: <3AD18341.567E16B8@acm.org>
Bart Lateur wrote:
>
> OTOH, XML is very strict, and for that you can indeed use a more
> artisanal approach, if you must.
^^^^^^^^^
This is the second time you used this word today. Is it on your
word-of-the-day calendar? ;-)
John
--
use Perl;
program
fulfillment
------------------------------
Date: Mon, 9 Apr 2001 15:55:17 +1000
From: "Gregory Toomey" <gtoomey@usa.net>
Subject: Re: problem with making dirs!
Message-Id: <0YbA6.12077$45.69749@newsfeeds.bigpond.com>
I did the same - signed up with an ISP to find they only offered Win NT on
their "commercial" servers. They only think you could do was to FTP to the
site.
Now I have an ISP that offers Linux, Telnet, Apache and associated goodies
at half the cost. Transferring domains is easy ...
gtoomey
---------------
"Bert" <webmaster@netdating.nl> wrote in message
news:3ad04790$0$21298@reader5...
> Well, that's because i didn't knew it would matter that much.. I've always
> used Linux, and since a week i've got an own domain, with hosting, and
it's
> Win ME.. I regret it already but we'll see... I'll give Bill a last change
> to prove me Windows could be kinda nice.. :)
>
>
------------------------------
Date: Mon, 09 Apr 2001 02:52:12 -0600
From: "Roger W. Winget" <wingetr@wingetsolutions.com>
Subject: Re: Provo Perl Mongers Meeting
Message-Id: <3AD1783C.621FF8C9@acm.org>
brian d foy wrote:
>
> In article <slrn9c72ks.3ga.dha@panix2.panix.com>, dha@panix2.panix.com
> (David H. Adler) wrote:
>
> > On Thu, 29 Mar 2001 09:29:21 +0100, Paul Boardman <peb@bms.umist.ac.uk> wrote:
> > >Alan Young wrote:
> > >>
> > >> If this is OT I'm sure y'all'll let me know.
> > >>
> > >> We are having a meeting of the Provo Perl Mongers tonight at the Orem
> > >> Public Library at 7pm for anyone who is interested.
> > >
> > >I'd say it was pretty off topic. esp since many readers of this
> > >newsgroup don't come from the same country as you!
> >
> > I think it's on topic... you may disagree with the breadth of its
> > distribution, though... :-)
>
> i personally like to see that Perl user groups are alive and well ;)
If not here, where would we find local Perl user groups?
PS. Add me to any emailing list about the Provo / Orem Utah group(s).
Roger Winget
>
> --
> brian d foy <comdog@panix.com>
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: Mon, 09 Apr 2001 07:08:31 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Return code for % operator
Message-Id: <0ln2dtoq94s3rko0bvmtfushlq1hsl6jtm@4ax.com>
hue micheal wrote:
>My first thought, the following were correct:
>if (100%4) { print "100 is dividible by 4" }
>if (!(101%4)) { print "101 is not divisible by 4" }
It's not correct.
What would be the most useful result for %, just a flag whether a number
is divisible, or a numerical value how far off the result of the
division is off from a perfect integer division (commnly known as "the
remainder")? The latter, I would think. You can also use this to test
divisibility, by checking if it's off by zero. But using this as a flag
is just a side effect. Some languages would even complain about this,
for which a boolean and a number are NOT interchangable. Perl is a lot
freeer in this regard, but it comes with more responsibility for you,
the programmer.
So the best change to your code to make it work, would IMO be:
if (100%4==0) { print "100 is dividible by 4\n" }
if (!(101%4==0)) { print "101 is not divisible by 4\n" }
--
Bart.
------------------------------
Date: Mon, 9 Apr 2001 08:14:38 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Return code for % operator
Message-Id: <slrn9d2rre.96g.abigail@tsathoggua.rlyeh.net>
hue micheal (huem@MailAndNews.com) wrote on MMDCCLXXVIII September
MCMXCIII in <URL:news:3B0CF845@MailAndNews.com>:
"" My first thought, the following were correct:
"" if (100%4) { print "100 is dividible by 4" }
"" if (!(101%4)) { print "101 is not divisible by 4" }
""
"" results: Nothing is printed !!!
""
"" So the actual return code were:
"" (100%4) returns faulse
"" (101%4) returns true
No. % is not a boolean operator. % returns the remainder of (integer)
division by its operands. So, if the right operand is a divisor of the
left, % returns 0. It's just unfortunate that Perl, like C, doesn't
have booleans, and overloads other things to have a true/false value.
A source of a lot of grief, only made worse by people using boolean
operations on the result of non-boolean functions.
Don't apply `!' on the outcome of %, it makes little to no sense.
What you want is:
if (100 % 4 == 0) {print "100 is divisible by 4"}
if (101 % 4 != 0) {print "101 is not divisible by 4"}
"" So I have to change my codes to:
"" if (!(100%4)) { print "100 is dividible by 4" }
"" if (101%4) { print "101 is not divisible by 4" }
That's confusing. % is not a boolean operator.
Abigail
--
use lib sub {($\) = split /\./ => pop; print $"};
eval "use Just" || eval "use another" || eval "use Perl" || eval "use Hacker";
------------------------------
Date: Mon, 09 Apr 2001 06:56:15 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: So what do YOU use Perl for?
Message-Id: <q9n2dt8lgh4uhig0cd345kl1c0ll948e06@4ax.com>
Tad McClellan wrote:
>Randal L. Schwartz <merlyn@stonehenge.com> wrote:
>
>>print "Just another Perl hacker,"
>
>
>Dude! You forgot to output the Content-type header first.
print "Content-type: text/japh\n\n";
print "Just another Perl hacker,\n";
--
Bart.
------------------------------
Date: 09 Apr 2001 05:37:31 -0400
From: Omri Schwarz <ocschwar@mit.edu>
Subject: Re: So what do YOU use Perl for?
Message-Id: <octg0fi5s84.fsf@mint-square.mit.edu>
Szilvia Oszko <soszko@gmu.edu> writes:
> One recurring theme in this newsgroup seems to be that Perl!=CGI and
> that while Perl is often used to write CGI scripts, it can also be used
> to do a lot of other things. I'd be curious to see what non-CGI stuff
> you do with Perl.
Generating static HTML out of my templates.
Administrative tasks of all sorts when I'm
sysadminning.
It slices.. It dices..
--
Omri Schwarz ---
Timeless wisdom of biomedical engineering:
"Noise is principally due to the presence of the
patient." -- R.F. Farr
------------------------------
Date: Mon, 9 Apr 2001 10:40:35 +0200
From: "Sven Buggermann" <buggerma@de.ibm.com>
Subject: tr question
Message-Id: <9arsd0$s02$1@news.btv.ibm.com>
Hi ,
i want to cut of whitespaces at the end of a string
eg
"sdgsf sdfr ewef.............."
.... = whitespaces
i want to have
"sdgsf sdfr ewef"
can someone tell me how to do do that ?
thx in advance
Sven
------------------------------
Date: Mon, 09 Apr 2001 10:40:46 +0200
From: Mona Wuerz <wuerz@yahoo.com>
Subject: Re: tr question
Message-Id: <090420011040466632%wuerz@yahoo.com>
<buggerma@de.ibm.com> wrote:
> i want to cut of whitespaces at the end of a string
>
> can someone tell me how to do do that ?
Yes. The Perl FAQ can tell you how to do that.
perlfaq4
"How do I strip blank space from the beginning/end of a string?"
-mona
------------------------------
Date: Mon, 09 Apr 2001 09:45:16 GMT
From: learners@bigfoot.com (LS)
Subject: Using Perl's Expect like from Comm.pl
Message-Id: <3ad183cd.2896288@news.acay.com.au>
Hi :
I downloaded a from, www.perl.com, a utility called Comm.pl . Inside
it it has a Perl subroutine that allows someone to do telnet, ftp,
etc.., and also uses the know expect calls .
If anyone has downloaded this Comm.pl, and tried the telnet
example, can they please reply on how they got it to work
I tried it, but for some reason in the "expect"
subroutine call, once the PID was created, it did out for some
reason.
I will post the exact ouptut that I got, if someone has downloaded
this module, and tried it.
Look forward for a reply.
Regds
LS
------------------------------
Date: Mon, 09 Apr 2001 04:24:59 GMT
From: David Bakhash <cadet@alum.mit.edu>
Subject: Re: Want Lisp-like state machine impl.
Message-Id: <m3y9tbuwzb.fsf@alum.mit.edu>
>>>>> "ron" == Ron Savage <ron@savage.net.au> writes:
ron> If you want Lisp, write in Lisp. If you want Perl, write in
ron> Perl.
ron> Writing Lisp using Perl syntax is childish (to be
ron> polite). [Extended comment elided.]
People who misread a very simple question asking how to elegantly
implement something whose flavor is similar to a solution implemented
in another language are not childish. I don't know whether I should
be thanking you for the link, or just loathing you for your arrogance.
To put it plainly, you suck. I'd rather have no solution than one
which comes with such a deprecating tone.
If you're lucky enough to read this post, I sincerely hope you
actually consider it, and consider it without stubbornness rather than
dismissing it. I have a strange feeling that in a few words, I have
you pinned as being the loser you are, so much as to take an innocent
question and use it as an excuse to belittle someone. But I trust
much more that you will dismiss it, and go on being the arrogant loser
you are.
Now let me answer _your_ question of why the people around you can't
stand you. It's because you piddle with posts from people who want to
learn, and use your supposed knowledge to reduce them, and exalt
yourself. Let me bring you back to reality. Computers and languages
are imperfect tools designed to allow people to express their ideas,
and solve problems. If you continue to make yourself appear smart by
making others look stupid, or "childish", then you will only be more
disliked.
Anyway, I'm glad that you're not representative of the people on this
newsgroup.
As for your DFA::Command module. It's a sad excuse for what I was
looking for. When I'm done coding, or searching, I'll post again, and
you can see not only what I was looking for, but how short-sighted
you are, and you might reconsider your exaggerated sense of
self-importance.
dave
------------------------------
Date: 08 Apr 2001 23:42:01 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Want Lisp-like state machine impl.
Message-Id: <87bsq6ofae.fsf@limey.hpcc.uh.edu>
>> On Thu, 05 Apr 2001 19:21:04 GMT,
>> David Bakhash <cadet@alum.mit.edu> said:
> Hi, I'm writing because I'm implementing something in
> Perl now, and I'd *really* like it to look Lispy.
> I'm not too sure that Perl isn't capable, but it's
> certainly not as straight-forward as if done in Common
> Lisp.
A quick check at http://search.cpan.org/ with suitable
search keywords found some lispy modules and something to
make perl haskelly.
I've never used these modules, nor do I know if they do
*directly* the CL stuff you want to do, but they might be
a good point of departure.
However perl is of course capable of implementing the same
state machine. There's probably a better perl idiom than
making it lispy (I guess you know that from your article).
It's late and my brain is slowly shutting down, so I'll
proffer closures as one possible way to maybe do this in a
sort-of-lisp-like fashion (I may be wrong).
perldoc -q closure
brain# init 0
hth
t
--
Just reach into these holes. I use a carrot.
------------------------------
Date: 9 Apr 2001 01:58:57 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Want Lisp-like state machine impl.
Message-Id: <9armjh$ed4$1@charity.cs.utexas.edu>
In article <m3g0fn8vpr.fsf@alum.mit.edu>,
David Bakhash <cadet@alum.mit.edu> wrote:
>I'm writing because I'm implementing something in Perl now, and I'd
>*really* like it to look Lispy.
:
:
>I'm writing a program for a system which, if it had it's own
>custom-made language, would look like the following. I'll try to
>provide some background.
>
>A "state" is a uniquely named entity (i.e. a name is provided,
>e.g. `Q1'). It contains a list of required fields (parameters) that
>must all be provided in order to enter this state, and potentially
>some optional types of these fields. Each state must list all of the
>states it might possibly seek, as well as exception states it can
>throw into (which are also just states, like any other).
:
:
>This is really beautiful. I wish I could do this in Perl the way I
>can in CL. In CL, I'd make the macro so smart that it'd do all the
>right things such that it would do error-checking and validation at
>compile-time.
I'd just like to point out that, while Lisp may be the lingua franca at
MIT, it isn't in comp.lang.perl.misc. There may be several people
hanging around in this group that could help you find an elegant
solution but who don't happen to know Lisp well enough to understand
your post. I expect you're excluding many of the people who might be
able to give you a good answer.
I know I myself have written a state machine simulator in Perl, yet I
don't even really understand your problem, largely because you've used
what looks like some very idiomatic Lisp that I don't understand.
So basically, what I'm saying is, could you state what you want in
plain English? I don't know what you mean when you say a required
field. Where do these fields come from? User input? Some static data
structure? Also, I don't know what you mean when you say "seek a
state". Presumably it has something to do with what can trigger a
transition from one state to another, but I don't know what.
You get the idea.
- Logan
--
my your his her our their _its_
I'm you're he's she's we're they're _it's_
------------------------------
Date: Mon, 09 Apr 2001 09:44:36 GMT
From: harri@tolppa.kotisivupalvelu.fi (Harri Haataja)
Subject: Re: Why Perl?
Message-Id: <slrn9d30ug.552.harri@tolppa.kotisivupalvelu.fi>
Gregory Toomey wrote:
>And how many useful one line Java programs are there?
Object-oriented oneliners. Now there's a concept.
--
If it walks like SPAM and quacks like SPAM, it is very likely SPAM.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.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 V10 Issue 657
**************************************