[7397] in Perl-Users-Digest
Perl-Users Digest, Issue: 1022 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 13 23:17:23 1997
Date: Sat, 13 Sep 97 20:00:24 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 13 Sep 1997 Volume: 8 Number: 1022
Today's topics:
Re: 5.004 and suidperl patch? <rootbeer@teleport.com>
Re: A simpler perl question. <tou@tou.com>
Re: Calling a Perl Script... <tou@tou.com>
Re: Comparing dates?? <ajohnson@gpu.srv.ualberta.ca>
Re: divide by zero problem in reports. <dfetter@shell4.ba.best.com>
formatting number to 6 figures <dwaters@delphi.co.uk>
Re: formatting number to 6 figures <fawcett@SPAMLESS.nynexst.com>
Re: formatting number to 6 figures (Tad McClellan)
Re: formatting number to 6 figures <ajohnson@gpu.srv.ualberta.ca>
Re: Free Perl CGI Scripts, password protection michael.nilsson@maze.se
Re: Help with perl!! Please!! <rootbeer@teleport.com>
Re: How can I tell which modules are installed ? lvirden@cas.org
Re: How to check if a file exits! <petri.backstrom@icl.fi>
Re: How to make this program faster? <doug@tc.net>
Method call bug <manowar@sauropod.engin.umich.edu>
Re: NT 4.0 <petri.backstrom@icl.fi>
Re: PERL 5 for Alpha OpenVMS <petri.backstrom@icl.fi>
RegExp basics <j.curzon-price@ic.ac.uk>
Re: RegExp basics (Tad McClellan)
Re: saving reg expressions (Eric Arnold)
Re: Slogans (Was Re: perl and XEmacs) <vladimir@cs.ualberta.ca>
Re: Slogans (Was Re: perl and XEmacs) <hniksic@srce.hr>
Software Programs to help with CGI scripting <ginakra@one.net>
Re: Software Programs to help with CGI scripting <rootbeer@teleport.com>
Re: Strip spaces in filenames (Floyd Pierce)
unshift function (Rick B Teh)
Re: Why don't my <<HERE documents work? <justinb@crow.cray.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 13 Sep 1997 16:06:52 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Pat Trainor <ptrainor@aura.title14.com>
Subject: Re: 5.004 and suidperl patch?
Message-Id: <Pine.GSO.3.96.970913160206.21918I-100000@julie.teleport.com>
On Fri, 12 Sep 1997, Pat Trainor wrote:
> Does 5.004* have the suidperl security patch already installed
> in the distribution version?
Yes. All security problems discovered in previous versions should be fixed
in this version.
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sat, 13 Sep 1997 18:46:45 -0700
From: Joel Shellman <tou@tou.com>
To: OrdwayNet Webmaster <ordway@iwshost.net>
Subject: Re: A simpler perl question.
Message-Id: <341B4205.8FF8A4FC@tou.com>
OrdwayNet Webmaster wrote:
>
> I have a question that I need answered-
>
> I have a directory full of files. Lets say that I want to add something to
> each one of those files. How would I do it?
>
> I think it would be something like this, but it isn't enough-
>
> foreach $file
>
> print "bla bla"\n";
>
> How do I make $file mean every file in the dir. Thanks for any help!
> Email me at ordway@iwshost.net or post it on this newsgroup.
Here's a code snippet that does that:
unless ( opendir( fileDir, "$basedir/$input{'username'}" ) ) {
print "Unable to open directory.";
goto End;
}
@fileList = readdir( fileDir );
foreach $fileName ( @fileList ) {
...
}
closedir( fileDir );
Regards,
Joel Shellman
--
TaoTree Research and Development
Web Development/Design, Virtual Servers, hosting, Perl/CGI programming
http://www.tou.com/rd/
Revolutionary new clicks-based Banner Exchange Guarantees you traffic
http://www.tou.com/ite/
------------------------------
Date: Sat, 13 Sep 1997 18:03:33 -0700
From: Joel Shellman <tou@tou.com>
Subject: Re: Calling a Perl Script...
Message-Id: <341B37E5.EC7FCA7F@tou.com>
Guy Doucet wrote:
>
> (1) I want to know how to call a Perl script from an HTML/JavaScript
> document, other than the <form method="post"... or "get"... What I'm
> getting at is I'd like to know if a JavaScript can call the Perl script
> directly.
You can do it from an image tag--just have the
<img src=http://www.yourdomain.com/cgi-bin/yourscript.cgi height=0
width=0>
Would that do for you?
If you really want to use JavaScript--you could do this in the same way
for Netscape JavaScript by loading image object or something like that.
Joel Shellman
--
TaoTree Research and Development
Web Development/Design, Virtual Servers, hosting, Perl/CGI programming
http://www.tou.com/rd/
Revolutionary new clicks-based Banner Exchange Guarantees you traffic
http://www.tou.com/ite/
------------------------------
Date: Sat, 13 Sep 1997 14:47:46 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Comparing dates??
Message-Id: <341AEDE2.115C2413@gpu.srv.ualberta.ca>
Raymond K. Bush wrote:
!
[snip]
! ( i think people take the system administrator chainsaw
! analogy off the deep end ...why use a chainsaw when scissors
! will do ...people and their bloody modules!)
!
! from the command line:
!
! perl -e '$bd = "09101981";
! require "ctime.pl";
! $d=ctime(time);
! ($j,$j,$j,$j,$j,$t)=split / /,$d,6;
! $y=$t-substr($bd,4);
! print "$y\n";
! '
! 16
!
! I hope this helps.
[danger:ajohnson:~]$ perl -e 'require "ctime.pl";print ctime(time);'
Sat Sep 13 14:09:57 1997
^^^ ^^^ ^^ ^^^^^^^^ ^^^^
even after fixing your example to actually put the year into $t on my
machine---it would only help if you didn't care that not all
people born in 1979 are 18 years old yet.
why 'hack' around with scissors (and risk cutting yourself)
when you can use a tool designed for the task at hand??
#!/usr/bin/perl -w
use Date::Manip;
$bday="12311979"; # birthday in mmddyyyy format
$bday=~s/^(\d\d)(\d\d)(\d\d\d\d)$/$1-$2-$3/;
$bdate=&ParseDate($bday);
$today=&ParseDate("today");
&DateCalc($bdate,$today,undef,1)=~/([+-]\d+)/;
print "$1:over 18\n" if $1>=18;
print "$1:under 18\n" if $1<18;
__END__
regards
andrew
------------------------------
Date: 13 Sep 1997 18:57:51 GMT
From: David Fetter <dfetter@shell4.ba.best.com>
Subject: Re: divide by zero problem in reports.
Message-Id: <5vennf$m31$1@nntp1.ba.best.com>
Kvan <kvan@diku.dk> wrote:
> $percent = 0;
> $percent = (($used/$avail) * 100) unless ($avail == 0);
> A bit shorter than your suggestion. I think there may be a better way
> involving some logical operations, but I'll leave those (if they exist) to
> someone else.
You could use something like
sub accprint {sprintf '%.'.$ACCURACY."f",shift(@_) }
$percent = $avail?accprint(100*$used/$avail):accprint(0);
which formats $percent to show $ACCURACY places to the right of
the decimal, but doesn't check $avail for numericity, and
might be annoying to read later ;)
HTH,
Dave.
--
David Fetter 888 O'Farrell Street Apt E1205
shackle@ren.glaci.com San Francisco, CA 94109-7089 USA
http://www.glaci.com/~shackle +1 415 567 2690 (voice)
for(split/ /,"tsuJ rehtona lreP rekcah"){print $_=reverse(split)." ";}
The plural form of "anecdote" is "data."
------------------------------
Date: Sat, 13 Sep 1997 20:15:12 +0100
From: David Waters <dwaters@delphi.co.uk>
Subject: formatting number to 6 figures
Message-Id: <341AE63F.1E1E11EC@delphi.co.uk>
Hi all,
I want to format a number so that it
has leading zeros and is always padded
to 6 figures.
e.g.
1 becomes 000001
567 becomes 000567
and 123456 is 123456
How do I do this?
Thanx alot
David
------------------------------
Date: 13 Sep 1997 16:46:03 -0400
From: Tom Fawcett <fawcett@SPAMLESS.nynexst.com>
Subject: Re: formatting number to 6 figures
Message-Id: <8jpvqd9c38.fsf@SPAMLESS.nynexst.com>
David Waters <dwaters@delphi.co.uk> writes:
> I want to format a number so that it has leading zeros and is always
> padded to 6 figures.
printf("%06d", 17);
------------------------------
Date: Sat, 13 Sep 1997 15:41:11 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: formatting number to 6 figures
Message-Id: <7ptev5.pd2.ln@localhost>
David Waters (dwaters@delphi.co.uk) wrote:
: I want to format a number so that it
: has leading zeros and is always padded
: to 6 figures.
: How do I do this?
printf("%06d", $number);
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 13 Sep 1997 18:19:51 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: formatting number to 6 figures
Message-Id: <341B1F97.2878E422@gpu.srv.ualberta.ca>
David Waters wrote:
>
> Hi all,
>
> I want to format a number so that it
> has leading zeros and is always padded
> to 6 figures.
check the perlfunc manpage for the printf() and sprintf()
functions (try 'perldoc -f sprintf').
ie:
$num=123;
printf("%06d",$num);
will print:
000123
regards
andrew
------------------------------
Date: Sat, 13 Sep 1997 15:51:59 -0600
From: michael.nilsson@maze.se
Subject: Re: Free Perl CGI Scripts, password protection
Message-Id: <874183271.29086@dejanews.com>
In article <comdog-ya02408000R1209972014170001@news.panix.com>,
comdog@computerdog.com (brian d foy) wrote:
>
> In article <874104574.6967@dejanews.com>, michael.nilsson@maze.se wrote:
>
> >New free perl script protect.pl http://www.maze.se/freeware/
>
> thanks for sharing with the world! :)
>
> i took a look at your source - give me telnet and i can defeat it.
> checking HTTP_REFERER is not security. you'll also run into
> problems with proxies by trying to block IP numbers.
>
> you might want to look at the various server products to see
> which ones don't implement these sorts of protection features
> already.
>
> good luck :)
>
> --
> brian d foy <comdog@computerdog.com>
Hello Brian!
It's always nice to get some feedback.
I totally agree with you checking HTTP_REFERER is not security, what I
try to do by checking HTTP_REFERER is allow forms to be located only on
servers which are in this field.
If you take a closer look at my source you will find out that checking
the log in name and password provides the protection and when you log in
correctly an HTML file is printed to your browser.
The protected HTML file should have the file access permissions set to
only allow the owner to read it.
I am aware of the potentially problem if some one that uses a proxy does
a failed log ins and block out the proxy address.
This will not be a problem unless you have different users or just one
valid user within the same proxy.
You wrote
>give me telnet and I can defeat it
I am really interested to now how, I've tried to hack this in all the
ways I can think of like using telnet and try to access the script or the
other files in this package.
My conclusion is that the only way to access the files is to log in as
the owner of the files.
Maybe I've missed something important here, if so please let me now.
The reason that I wrote this little script is that I tried to protect a
directory by setting up a .htacces and a .htpasswd file it, took me
about 3 minutes to log in to another UNIX account by telnet and read this
files.
Next step is to run a Unix password checker/cracker on the .htpasswd
file, isn't this to easy ?
So when I finished protect.pl I thought that it might be some people out
there with the same problem like being hosted on a UNIX with
Apache/1.2b10 :)
Michael Nilsson
michael.nilsson@maze.se
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Sat, 13 Sep 1997 15:56:58 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Kaveh Pahlevan <kpahlevan@hotmail.com>
Subject: Re: Help with perl!! Please!!
Message-Id: <Pine.GSO.3.96.970913155613.21918G-100000@julie.teleport.com>
On 12 Sep 1997, Kaveh Pahlevan wrote:
> How would I go about adding a number to a variable everytime someone
> fills out the form.
$var++
If you want to keep that value in a file, I think you could use the
methods in Randal's fourth Web Techniques column, which explains how to
use flock() to avoid problems when multiple processes need to modify one
file. Hope this helps!
http://www.stonehenge.com/merlyn/WebTechniques/
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 14 Sep 1997 01:41:24 GMT
From: lvirden@cas.org
Subject: Re: How can I tell which modules are installed ?
Message-Id: <5vffc4$7vd$1@srv38s4u.cas.org>
According to Jerry Pank <its.spelt.out.in.the.sig@file.OK>:
:Is there an easy way to find exactly which module are already installed?
:
What about going into
perl -MCPAN -e shell
and looking around?
--
Larry W. Virden INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.
------------------------------
Date: Sat, 13 Sep 1997 21:31:53 +0300
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: How to check if a file exits!
Message-Id: <341ADC19.655@icl.fi>
Michael Genovese wrote:
>
> This is problably a fairly simple question, but I can't
> seem to find a "nice" way to do it in perl ...
>
> how do I check to see if a file EXISTS ?
>
> I don't need to read it, but I do need to know if it exists.
Yes, the question is simple, and the answer is
also documented...
If you search for "file exists" in the free online
Perl documentation that comes with every proper
Perl distribution kit, you can't miss the line
that reads
-e File exists.
in perlfunc.
Use it, e.g., as follows:
print "file texists" if -e $filename;
Much "nicer" than that it can't be.
Read perlfunc for details. Read the rest of
the docs too. Read also the FAQ (Frequently
Asked Questions) list, which you can access
through, e.g.,
http://www.perl.com
Reading those will save you the embarrassment of
asking questions already answered in the docs.
Consider also getting to know services such
as
http://www.dejanews.com
http://altavista.digital.com
They're also helpful tools for finding answers
that someone has already typed up and posted
on the net on a web page or a newsgroup.
regards,
...petri.backstrom@icl.fi
ICL Data Oy
Finland
------------------------------
Date: 13 Sep 1997 21:47:40 -0400
From: Douglas McNaught <doug@tc.net>
To: mpettit@geocities.com (Mark K. Pettit)
Subject: Re: How to make this program faster?
Message-Id: <m2iuw4ll8j.fsf@ono.tc.net>
[mailed and posted]
mpettit@geocities.com (Mark K. Pettit) writes:
> foreach (keys %VisitorFeatures) {
> if ($url =~ /$_/) {
> return $VisitorFeatures{$_};
> }
> }
>
Stuff like this is going to slow things down--you're compiling a
regexp for *every* key in these hashes, for *every* line of the file.
This is just kicking your butt. There are some tricks you can use to
avoid recompiling regexes--see the last part of
http://www.perl.com/CPAN-local/doc/FMTEYEWTK/regexps.html
for details (it's ugly!)
-Doug
--
sub g{my$i=index$t,$_[0];($i%5,int$i/5)}sub h{substr$t,5*$_[1]+$_[0],1}sub n{(
$_[0]+4)%5}$t='encryptabdfghjklmoqsuvwxz';$c='fxmdwbcmagnyubnyquohyhny';while(
$c=~s/(.)(.)//){($w,$x)=g$1;($y,$z)=g$2;$w==$y&&($p.=h($w,n$x).h($y,n$z))or$x==
$z&&($p.=h(n$w,$x).h(n$y,$z))or($p.=h($y,$x).h($w,$z))}$p=~y/x/ /;print$p,"\n";
------------------------------
Date: 13 Sep 1997 19:51:05 -0400
From: Krisztian Flautner <manowar@sauropod.engin.umich.edu>
Subject: Method call bug
Message-Id: <f3yafhgdb86.fsf@sauropod.engin.umich.edu>
Below is a small program I tried:
package test;
sub new {
my $class = shift;
my $self = {};
bless $self, $class;
return $self;
}
package test;
sub print {
my $self = shift;
print "hehehe\n";
}
package main;
$a = new test;
print $a, "\n";
$a->print();
%ttt = ();
$ttt{$a} = 1;
foreach $key (keys %ttt) {
print $key, "\n";
$key->print();
I got the following output using perl5.003 and perl5.004 on
Solaris and HP-UX machines:
test=HASH(0x227c50)
hehehe
test=HASH(0x227c50)
Can't call method "print" in empty package "test=HASH(0x227c50)"
at ./ttt line 42.
I do no understand why this code would produce an error. Does the
key somehow forget what class it belongs to?
Is this a bug in perl5 or am I doing something wrong?
Thanks, -- Kris
------------------------------
Date: Sat, 13 Sep 1997 21:35:18 +0300
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: NT 4.0
Message-Id: <341ADCE6.146A@icl.fi>
webadmin wrote:
>
> Is there perl for NT 4.0 on the web somewhere.
But of course. Start with
http://www.perl.com
for the "core" Perl which is at V5.004 + fixes.
Or
http://www.activestate.com
for a version known as "Perl for Win32".
regards,
...petri.backstrom@icl.fi
ICL Data Oy
Finland
------------------------------
Date: Sat, 13 Sep 1997 21:51:32 +0300
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: PERL 5 for Alpha OpenVMS
Message-Id: <341AE0B4.44CD@icl.fi>
Daniel Mills wrote:
>
> Does anyone know where I can get a reliable port for this OS?
Perhaps from your nearest CPAN (Comprehensive Perl Archive
Network) site. The README file in the ./ports/vms directory
says:
"Starting from the Perl 5.004 the Perl source code
distributions can be compiled out of the box in VMS."
You can get the latest sources from, e.g.,
http://www.perl.com/CPAN/src/latest.tar.gz
I can't vouch for the accuracy of the above statement
as I've never tried 5.004 on any version of VMS. I also
don't know if you need DEC C/C++ (VAX or Alpha) to build
it, or if works with the older VAX C (on a VAX, not Alpha ;-)
or if, e.g., GNU C would suffice.
regards,
...petri.backstrom@icl.fi
ICL Data Oy
Finland
------------------------------
Date: Sat, 13 Sep 1997 20:48:57 +0100
From: Tony Curzon Price <j.curzon-price@ic.ac.uk>
Subject: RegExp basics
Message-Id: <341AEE29.644845A2@ic.ac.uk>
Hello,
I think I'm missing something pretty basic about regexp's - can't really
see how they're working (and I've trawled the faq's & manpages ...). Is
there a kind soul out there who'll explain:
I have a great big file that looks like:
D,13-06-1997,HBD,YW02 PRICE3 ,-300,
D,13-06-1997,HBD,YW02 PRICE5 ,770,
etc, repeated many times over
I want to strip out just the number at the end, into 2 different files
depending on hte name just before the "PRICEN" string.
Things I've tried:
($tt, $price) = split(/,\d+,/,$line);
($line was 1 line of the above file)
I would have thought that /,\d+,/ would find a comma separated number.
But $tt ends up being the same as line, and $price being empty. The only
way I got it more or less to work was by saying "match at least 30
characters, then take any number of digits. The price was then OK, but
the text variable was empty.
Then I thought - the problem is coming from the dates, so if I could
exclude them, getting the prices and the text would be easy (I don't
care about the dates).
I tried things like:
($a,$d) = split(/,\d+-\d+-\d,/,$line)
to get a variable ($d) I could use to exclude with ... and again just
can't see why ,\d+-\d+-\d, isn't trapping comma, digits, minus, digits
minus, comma ...
Is there something _fundamental I'm getting wrong?
Thanks
Tony
--
Tony Curzon Price Imperial College
http://is.eunet.ch/Customers/curzon/index.html
(During GMT office hours, or so):
http://epgphd.et.ic.ac.uk/www/
------------------------------
Date: Sat, 13 Sep 1997 15:49:50 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: RegExp basics
Message-Id: <e9uev5.8f2.ln@localhost>
Tony Curzon Price (j.curzon-price@ic.ac.uk) wrote:
: Hello,
: I think I'm missing something pretty basic about regexp's - can't really
: see how they're working (and I've trawled the faq's & manpages ...). Is
: there a kind soul out there who'll explain:
I'll try.
: I have a great big file that looks like:
: D,13-06-1997,HBD,YW02 PRICE3 ,-300,
: D,13-06-1997,HBD,YW02 PRICE5 ,770,
: etc, repeated many times over
: I want to strip out just the number at the end, into 2 different files
: depending on hte name just before the "PRICEN" string.
: Things I've tried:
: ($tt, $price) = split(/,\d+,/,$line);
: ($line was 1 line of the above file)
: I would have thought that /,\d+,/ would find a comma separated number.
It might. It will then discard it, because the number is part of the
split string ;-) (the split string gets discarded, unless you tell
it not to)
It will not find any matches on the first line (there are no commas
with only digits between them).
It will match only the final field on the second line, so you will
get only the part before that.
: But $tt ends up being the same as line, and $price being empty. The only
: way I got it more or less to work was by saying "match at least 30
: characters, then take any number of digits. The price was then OK, but
: the text variable was empty.
I'd help if I could figure what you want $tt and $price to be set to...
: Then I thought - the problem is coming from the dates, so if I could
Nope.
: Is there something _fundamental I'm getting wrong?
Yes. What matches the pattern is taken as a delimiter, and not included
in the return values.
@fields = split /\s*,\s*/, $line; # split on commas
then have a look at @fields[0..4]
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: 13 Sep 97 04:54:14 GMT
From: eric.arnold@sun.com (Eric Arnold)
Subject: Re: saving reg expressions
Message-Id: <ERIC.97Sep13045414@m-e-ir1.sun.com>
How about:
if ($case) {
if ($reg) {
$expr = q{ $match =~ /$field/; };
}
else {
$expr = q{ $match =~ /\Q$field\E/; };
}
}
else ...
foreach $field (@fields) {
eval $expr;
}
(It won't be as fast, but you might not notice it.)
-Eric
In article <3416db9b.83500410@news.supernews.com>
alex@gossamer-threads.com writes:
>This will probably sound a bit confusing, but I'll try and explain my
>question as best as possible:
>
>What I have is a search routine that can have several different
>options (match case, match whole word, use reg expression, or a
>combination of those). This same options are used throughout the
>search and I'm not sure if it's possible to save those options?
>
>The way my routine is running now, I have something like:
>
>foreach $field (@fields) {
>
> if ($case) {
> if ($reg) {
> $match =~ /$field/;
> }
> else {
> $match =~ /\Q$field\E/;
> }
> }
> else ...
>
>You get the idea. (In the full source, I do look for bad reg
>expressions etc., but the idea is the same). Now instead of going
>through this series of if statements (which is 3 levels deep on the
>full routine), to find out which options to use, is it possible to
>save those options somehow so I can just do:
>
>foreach $field (@fields) {
> $match =~ something here.. not sure what
>}
>
>If anyone has any ideas, how I could structure this, I'd really
>appreciate it!
>
>Thanks,
>
>Alex
------------------------------
Date: 13 Sep 1997 19:06:57 -0600
From: Vladimir Alexiev <vladimir@cs.ualberta.ca>
Subject: Re: Slogans (Was Re: perl and XEmacs)
Message-Id: <omyb50snym.fsf@tees.cs.ualberta.ca>
In article <kigk9gpq84a.fsf@jagor.srce.hr> Hrvoje Niksic <hniksic@srce.hr> writes:
> pudge@pobox.com (Chris Nandor) writes:
> > # If you have become part of
> > # the Perl thing by months of pain learning the most evil syntax,
open(FOO,"foo") or die $OS_ERROR;
What's so evil about this? I find that perl gives me much more natural ways to
express myself than most languages. Sure you can write ugly syntax. But well,
like, don't.
> > # Perl is, to say the least, difficult to debug if you don't know the
> > # complexities and intricacies of the language.
Not if the program doesn't use them.
> > # But what saves Perl (or *can* save it) is that it can be well-written.
Absolutely.
> > # Also, since it's interpreted and high-level, lots of ugly stuff is done
> > # internally.
Perl is powerful. Lisp, *the* list language, is less powerful for handling
lists. IT doesn't have inline list concatenation (backquote helps here a bit),
splicing, ...
> > If you replace "Perl" with "English," the above sentences still make
> > perfect sense.
> Or with "Intercal."
Yeah, but intercal is not powerful and has random limitations. Perl doesn't.
------------------------------
Date: 14 Sep 1997 03:54:09 +0200
From: Hrvoje Niksic <hniksic@srce.hr>
Subject: Re: Slogans (Was Re: perl and XEmacs)
Message-Id: <kig90x064ou.fsf@jagor.srce.hr>
Vladimir Alexiev <vladimir@cs.ualberta.ca> writes:
> open(FOO,"foo") or die $OS_ERROR;
> What's so evil about this?
Perl is OK when you write it and you parse it. It is a little-bit
less OK when you parse someone else's code, because the "intuitive"
bits tend to byte you then.
Note that I didn't write any of the things you quoted, except the
Intercal reference. And it was a joke.
> > > If you replace "Perl" with "English," the above sentences still make
> > > perfect sense.
> > Or with "Intercal."
> Yeah, but intercal is not powerful and has random limitations. Perl doesn't.
--
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Then... his face does a complete change of expression. It goes from
a "Vengeance is mine" expression, to a "What the fuck" blank look.
------------------------------
Date: Sat, 13 Sep 1997 15:05:45 -0400
From: Gina Anderson <ginakra@one.net>
Subject: Software Programs to help with CGI scripting
Message-Id: <341AE409.42AA330F@one.net>
Hi all,
In risk of getting flamed for being lazy, I was wondering if there are
any software programs capable of outputing cgi scripts. Say I wanted to
make a form, I would input values and stuff through information dialog
boxes, and out spits the cgi?
I am new in Perl, and I need a couple fo simple scripts fast. I have
checked out Polyform, but it seems like I have to have a server on my
machine to use it. All I have is Personal Web Server that came with
Microsoft Frontpage 97.
Any ideas?
Thanks
Gina
--
_\/_ | _\/_
/o\\ \ / //o\
| .-'-. |
_|_______ -- / \ -- ______|__
jgs `~^~^~^~^~^~^~^~^~^~^~^~`
Gina Anderson ginakra@one.net
http://members.aol.com/ginakra
Need a web page?
Contact Me For Affordable Rates!
------------------------------
Date: Sat, 13 Sep 1997 16:00:57 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Gina Anderson <ginakra@one.net>
Subject: Re: Software Programs to help with CGI scripting
Message-Id: <Pine.GSO.3.96.970913155747.21918H-100000@julie.teleport.com>
On Sat, 13 Sep 1997, Gina Anderson wrote:
> In risk of getting flamed for being lazy,
Laziness is a virtue; haven't you read the perl(1) manpage? :-)
> I was wondering if there are any software programs capable of outputing
> cgi scripts. Say I wanted to make a form, I would input values and
> stuff through information dialog boxes, and out spits the cgi?
Maybe you want something like the popular mailmerge. There are plenty of
such scripts around, and you can probably find one through Yahoo.
http://www.yahoo.com
> All I have is Personal Web Server that came with Microsoft Frontpage 97.
There are plenty of free webservers; check the FAQs for a server newsgroup
or Yahoo and you'll probably find more than you need. Good luck!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sun, 14 Sep 1997 00:35:18 GMT
From: floydp@_REMOVE_xnet.com (Floyd Pierce)
Subject: Re: Strip spaces in filenames
Message-Id: <341b30b6.104215068@nntp.ix.netcom.com>
David Roberts <dtrobert@ladc.lockheed.com> wrote:
>Kuntal Daftary wrote:
>is this command good for say replacing a .txt with a .bak on a files in
>a specific directory. i tried :
>
Here's one way without perl
for i in `find . -name '*.txt' -print`
> do
> x=`echo $i|sed 's/\.txt$/\.bak/'`
> mv $i $x
> done
Bit more typing but it works.
--
Floyd Pierce floydp at xnet.com
floydp at ix.netcom.com
------------------------------
Date: 14 Sep 1997 01:20:24 GMT
From: boonteh@acsu.buffalo.edu (Rick B Teh)
Subject: unshift function
Message-Id: <5vfe4o$bh0$1@prometheus.acsu.buffalo.edu>
Can someone please show me an example of using the unshift function?
I have just lost my camel book. ANy help will be appreciated.
Thanks.
-Rick
------------------------------
Date: 13 Sep 1997 18:02:32 -0500
From: Justin Banks <justinb@crow.cray.com>
Subject: Re: Why don't my <<HERE documents work?
Message-Id: <o8nbu1wom0n.fsf@crow.cray.com>
Faust -
I would download the latest and greatest version of perl, and install the
whole thing in ~/. If your sysadmin won't give you the tools you need to
do your work, he/she isn't much of a sysadmin anyway.
-justinb
--
Justin Banks \ If you spam me, I promise to go upstream from you until I
Silicon Graphics \ find someone that cares. Then, I'll think about charging
Eagan, Minnesota \ you for my time. Do it at your own risk
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 1022
**************************************