[8280] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1897 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Feb 14 07:07:22 1998

Date: Sat, 14 Feb 98 04:00:24 -0800
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, 14 Feb 1998     Volume: 8 Number: 1897

Today's topics:
    Re: Appending information to a referring html document (Daniel Koch)
    Re: auto responder script (Benji Spencer)
    Re: Binary Search Trees (Bart Lateur)
    Re: Counter problem - resets (Abigail)
    Re: Decryptable crypt? <root@hemma.se>
    Re: EXAMPLES: Simple I/O operations (Kuma)
    Re: formating a text file (hard returns)? (Martin Vorlaender)
    Re: garbage collection in perl (Bart Lateur)
    Re: Is this correct? File Locking <rra@stanford.edu>
    Re: Killfile Triage (Bart Lateur)
    Re: Learning Perl <friedman@uci.edu>
    Re: Location: returns empty document? <bala@bnoc.net>
    Re: Location: returns empty document? (Martin Vorlaender)
        New perl programmer requesting comments <baughj@rpi.edu>
    Re: on reading FAQs and gurus answering questions <tchrist@mox.perl.com>
    Re: Quickie: regexp for valid e-mail addresses (Abigail)
    Re: Reg Exp  How Do I... (Jeeves)
    Re: Reg Exp  How Do I... (Bart Lateur)
        Selena Sols authentification script messes up with Form (Robert Nedelcu)
    Re: Substitution in perl for newbie (Jonathan Feinberg)
    Re: Substitution in perl for newbie (Jerry)
    Re: what does "deprecate" mean? (David Oswald)
    Re: what does "deprecate" mean? (Jeeves)
    Re: what does "deprecate" mean? (Daniel Koch)
    Re: Year 2000 Compliance: Lawyers, Liars, and Perl (Bart Lateur)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sat, 14 Feb 1998 08:53:03 GMT
From: dkoch@amcity.com (Daniel Koch)
Subject: Re: Appending information to a referring html document
Message-Id: <34e55938.137534526@news.vnet.net>

On Sat, 14 Feb 1998 01:29:06 -0500, "Eric" <cravaccio@usa.net> wrote:

>Please help!?!?!?
>
>  Does somebody know what I need to write in a perl script to append some
>data to the referring HTML document that called up the script?
>If so what is the variable or syntax?
>
>Also, what is the syntax for file permissions through a script on that file
>so that way others can write to it?
>
>
>I would really appreciate any suggestions.....
>
>Eric..
>

You might try reading some CGI tutorials before posting in a perl
language group, and you might want to try a CGI group
(comp.infosystems.www.authoring.cgi).

Since your description of what you're trying to do isn't very clear,
all I can do is suggest a couple of things to look up:

    $ENV{'HTTP_REFERER'}

    chmod()

Dan Koch <dkoch@amcity.com>



------------------------------

Date: Sat, 14 Feb 1998 11:52:06 GMT
From: spunge@ripco.com (Benji Spencer)
Subject: Re: auto responder script
Message-Id: <34e584dd.115419862@news.enteract.com>

>I recommend *against* using the autoresponder example in procmailex for
>the following reasons:
>
> (a) formail's reply code is broken.  It should follow RFC 822 and look
>     solely at Reply-To and then From to determine what address to
>     respond to.  It doesn't.  It applies a bunch of heuristics to look
>     for "right-looking" addresses and can potentially reply to Sender
>     (which is *totally* wrong).
>
> (b) The given example is nowhere *close* to sufficient to prevent mail
>     looping.  X-Loop headers are sufficient to keep you from responding
>     to yourself, but they're not sufficient to prevent more complex
>     loops.
[snip]

>This is not to say that procmail can't be used.  It might be a good tool.
>This is just to say that the example given in the man pages is dangerously
>inadequate.

ok, then do you have any other suggestions besides procmail then? Or
other ways of using procmail to do this? I don't mean for you to do
the homework for me, just wondering as I am planning on working on
this today

Thanks for your input :)

Benji

(:------------------------Benji Spencer----------------------------:)
     spunge@enteract.com	  http://www.enteract.com/~spunge
     spunge@ripco.com 		  http://www.ripco.com/~spunge   
     ben@anduin.eldar.org	  http://anduin.eldar.org/~ben   
  PGP public key can be retrieved by fingering ben@anduin.eldar.org


------------------------------

Date: Sat, 14 Feb 1998 10:45:47 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Binary Search Trees
Message-Id: <34eb649b.4057199@news.tornado.be>

Tom Christiansen <tchrist@mox.perl.com> wrote:

>In comp.lang.perl.misc, olm@mail1.csun.edu writes:
>:Is there any way to implement Binary Search Trees or AVL Trees in Perl.
>
>Sure.  Why do you want to?  You prefer the logarhytmic time of trees
>to the constant of hashes for some nonobvious reason?

I can only think of two reasons:

 * You want to be able to inspect closest matches (especially for
numerical data)

 * The data is to big to fit in a memory. The intermediate step would be
to keep a file seek index as the hash values, but eventually the keys
alone might be too much to fit in memory.

Is there some solution that I'm missing? Probably.

	Bart.


------------------------------

Date: 14 Feb 1998 07:24:43 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Counter problem - resets
Message-Id: <6c3grr$pcn$2@client3.news.psi.net>

Stephen P. Clouse (stephenc@granddesign.com) wrote on 1625 September 1993
in <URL: news:34e45b95.14629233@news2.kc.net>:
++ 
++ I wrote this little Counter.pm module to handle counters like this for me. 
++ (Yes, I know CPAN lists a module called File::CounterFile that does this, but
++ I DARE you to find it.)  There's pod documentation at the end, although the
++ module is pretty straightforward.

perl -wMCPAN -eshell
and then 'install File::CounterFile'.

It's in:
http://www.cs.ruu.nl/pub/PERL/CPAN/authors/id/GAAS/libwww-perl-5.20.tar.gz




Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'


------------------------------

Date: Sat, 14 Feb 1998 09:24:38 +0100
From: root <root@hemma.se>
Subject: Re: Decryptable crypt?
Message-Id: <34E554C6.346011A1@hemma.se>

Russ Allbery wrote:
> 
> Michael R Harper <mikihasa@worldnet.att.net> writes:
> 
> > The Unix man page says that crypt is a one-way street.  I am looking for
> > an encryption command for which there is an inverse operation
> > (decrypt?).  The Camel book suggested the possibility of using a PGP
> > module.
> 
> > I was only able to find one post to this group that mentioned PGP.  Can
> > someone steer this newbie in the right direction?  I currently only need
> > the ability to encrypt and decrypt data, so I guess I do not need
> > anything fancy.
> 
> Good news:  PGP would probably do what you want.
> 
Yes it will!
I wrote C wrappers around PGP which I then called from perl.
This allows me to encrypt and decrypt files from perl via a 
system() call.
Works fine for me!

                                /Henrik


------------------------------

Date: Sat, 14 Feb 1998 07:25:00 GMT
From: tgy@chocobo.org (Kuma)
Subject: Re: EXAMPLES: Simple I/O operations
Message-Id: <34e54296.11959005@news.oz.net>

On 12 Feb 1998 00:07:51 GMT, Tom Christiansen <tchrist@mox.perl.com>
wrote:

>The following set of examples has been used by me and my trainers in
>some of our Perl training courses.
>
>Many will find their way into the Perl Cookbook that should be out
>late this spring, so are necessarily copyrighted by me unless otherwise
>attributed.  I post them here as a help, and a teaser. :-)
>
>--tom
>
>+----------------------------------------------+
>| TASK:  Print the last 50 lines (expensively) |
>+----------------------------------------------+
>
>    perl -e '@lines = <>; print @lines[$#lines .. $#lines-50]' file1 file2 file3 ....

perl -e '@lines = <>; print @lines[$#lines-49 .. $#lines]' file1 ...

Do I get book royalties? :)


--
Kuma


------------------------------

Date: Sat, 14 Feb 1998 07:11:26 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: formating a text file (hard returns)?
Message-Id: <34e5358e.524144494f47414741@radiogaga.harz.de>

John Davidson Highfill (davidson@unity.ncsu.edu) wrote:
: I have been trying to make up a perl script
: (I am VERY new to perl, and programing in general)(If it makes a diff
: i am using linux slackware) that would atuomatically format a text file 
: so that is is say 70 char long bout would not cut off words (rather hard 
: return and put them on the next line).

Have a look into CPAN, the Comprehensive Perl Archive Network, at
http://www.perl.com/CPAN/ . In the modules section, you'll find
Text::Wrap.

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


------------------------------

Date: Sat, 14 Feb 1998 10:45:59 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: garbage collection in perl
Message-Id: <34ed676a.4776278@news.tornado.be>

Chris Schoenfeld <chris@ixlabs.com> wrote:

>> >Also, Perl never returns any
>> >memory to the OS (it keeps it in a pool for reuse instead),

>> Is this a perl thing or an OS thing?

>Wow that has to be a Perl thing, but I never realized that. That kinda
>sucks. Is this the way Java works as well?

Hah! You think this sucks!

Do you know how memory managment works on a Mac? (Let's give the Unix
elitists something to snear about ;-) You have to PRE-ALLOCATE an amount
of memory to an app, before it starts. This memory pool will better have
to be enough, because that's all the memory you app can ever get. Once
this memory is souped up, most applications simply crash.

But on the whole, it's probably the fastes approach.

HTH,
Bart.


------------------------------

Date: 13 Feb 1998 22:59:41 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Is this correct? File Locking
Message-Id: <m3d8gqvfhe.fsf@windlord.Stanford.EDU>

Chris <rebel@wantree.com.au> writes:
> Tom Christiansen wrote:

>> You have no idea how ugly that paragraph miswrapped. :-(

> Well turn off your line wrapper!

Tom wasn't the one who linewrapped it.  It was that way in the original
message.

> In other words, I believe that it should be up to the operating system*
> to flush any buffers before releasing a lock. thats the logical and
> safest thing to do.

This is not, however, what the operating system does.  And it's unlikely
that we're going to be able to change every existing version of Unix, so
people will have to work around it by not unlocking files unless they know
*exactly* how buffering is working.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


------------------------------

Date: Sat, 14 Feb 1998 10:45:55 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Killfile Triage
Message-Id: <34ec65dc.4378236@news.tornado.be>

Richard Caley <spt@cstr.ed.ac.uk> wrote:

>So, people who put requests not to be spammed in their headers should
>be killed but people like me who have applied some spamproofing should
>not. I'm not clear on the logic here.

Because you shovel the trouble of dealing with spam, into the shoes of
those people trying to send you an e-mail reply. Having to manually edit
e-mail addresses, bouncing mail, you know.

The only fully acceptable solution would be to make spamming a legal
offense, no matter what country it's sent from. But this will never
happen. Can you imagine tackling a spammer who sends spam from, say,
Iraq?

	Bart.


------------------------------

Date: 14 Feb 1998 07:21:15 GMT
From: "Eric D. Friedman" <friedman@uci.edu>
Subject: Re: Learning Perl
Message-Id: <6c3glb$h9d@news.service.uci.edu>

[mailed,posted]

In article <34e51e24.83532638@news.cnnw.net>,
James L. Taylor <cowboy@cnnw.net> wrote:
<On 13 Feb 1998 08:26:42 GMT, "Eric D. Friedman" <friedman@uci.edu>
<wrote:

<>You should always write open() this way:
<>
<>open WORDLIST, "<wordlist" || die "Can't open wordlist: $!";
<>
<>(note the change of the filename: you're opening your program source
<>and not the datafile)
<
<Ok I made the change to:  open WORDSLIST, "<wordslist.pl" || die
<"Can't open wordlist: $!";

Note that you missed my note.  Was it unclear or are you just in 
a hurry?

-edf

-- 
Eric D. Friedman
friedman@uci.edu


------------------------------

Date: Fri, 13 Feb 1998 22:14:56 -0500
From: "Bala S. Chidambaram" <bala@bnoc.net>
Subject: Re: Location: returns empty document?
Message-Id: <34e50bac.0@news.bnoc.net>


Martien Verbruggen wrote in message <6c0mvp$co8$2@comdyn.comdyn.com.au>...
>[comp.lang.perl is long dead. Please inform your news admin that that
>group should be removed.]
>
>In article <34E3C371.D27D62FF@no.spam.wxs.nl>,
> "P. Schmitz" <schmitzp@no.spam.wxs.nl> writes:
>> Does anyone have any idea why the following perl script:
>>
>> print "Location: www.yahoo.com\n\n";


Try
print "Location: http://www.yahoo.com\n\n";
Hope this works.
Bala






------------------------------

Date: Sat, 14 Feb 1998 07:21:23 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Location: returns empty document?
Message-Id: <34e537e3.524144494f47414741@radiogaga.harz.de>

P. Schmitz (schmitzp@no.spam.wxs.nl) wrote:
: I just discovered that if I change the perl script to this:

: print "HTTP/1.0 302 Object moved\r\nLocation: http://www.yahoo.com\r\n\r\n";

: it does work! That is, my browser executes the redirect instead of
: complaining that the 'Document contains no data'.

: Now I guess my question is: why is this necessary in a perl script, and not
: in a C script? The web server is an NT 4.0 Server box with IIS 3.0 and perl
: 5.

I have no idea why the C CGI program works. IIS3 expects all CGI scripts
to be NPH ("Non-Parsed-Headers") scripts, i.e. it relies on the script
to supply HTTP headers. CGI.pm is aware of that. Are you?

So, the best thing to do is probably

use CGI;

print redirect('http://www.yahoo.com/');

which automagically does The Right Thing(TM).

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


------------------------------

Date: Sat, 14 Feb 1998 03:14:27 -0500
From: "Justin Baugh" <baughj@rpi.edu>
Subject: New perl programmer requesting comments
Message-Id: <6c3jor$ftm@newsfeeds.rpi.edu>

Hello everyone,

   I am new at Perl programming, and I have just finished my first script -
a small CGI utility to print out some information to stdout, in this case,
the web browser.

Basically, the script calculates the uptime of the current machine, and
displays it, along with the system name, the current system time, and the
users logged in (Before you start in with the security gripes, read the
comments in the file).

What I am asking for is some help with cleaning up the code; ways that I
have made a kludge out of the language, stuff like that.  I've been
programming in C++ for quite a while and it took me time to get used to the
constructs of the language, so what I would like is if you happen to be
reading this, please send me any comments (negative or positive) that you
can think of.

Thanks,

Justin Baugh

What follows is the perl script.

#!/usr/bin/perl
# **************************************************************
# * System Status v.1b     by Justin D. Baugh (baughj@rpi.edu)
# *
# * WARNING: This may be wildly inefficient and use crazy Perl
# * commands since it's my first script written in Perl - so
# * give a guy a break.  Of course, you are welcome to yell
# * "Hey, you shoulda done this or that" or even "You smoke
# * way too much crack"  to the email above.
# * Please don't give me any yack about security, you wouldn't
# * run this if you were that concerned about said security. My
# * machine is a gathering place for lots of people, and I
# * wanted to have an easy way to see who's online and at the
# * same time, teach myself some Perl.  Having written this,
# * I think Perl is the shit.  It rules.  So nuff said, got
# * comments, please e-mail me at the above address.
# **************************************************************
#
# DESCRIPTION:
#               This script will fool around with w -h and some other stuff
#               to eventually give you a nice, table-ized (gasp!) view of
who
#               is using your system, how long it's been up, etc.
#
# PLATFORMS:    Linux/Un*x.
#
# DISCLAIMER:
#                 Like I said, this is my first Perl script, use with care.
#
# OTHER STUFF:
#               You can do what you like with this code, but if
#               you incorporate it or use it as a base for another
#               Perl script, please mention my name somewhere.
#
# LOFTY GOALS:
#               I plan on developing some Linux management tools that
#               will allow you to check out what's going on with your
#               box remotely (i.e. how much disk space there is, if
#               lp0 is in flames, whether or not the hard drive has
#               ripped itself out of the case...the usual stuff).
#               They will all have a nice HTML interface and support
#               password authentication (either the real user/pass or
#               a "group" type pass (i.e user monitor pass afsdfdsa).
#
# NEXT VERSION:
#                Will include a lot more customization, including all the
#               table arguments and other cool stuff.  Next version will
#               also use the finger command instead of w.

# some customizable variables, pretty self explanatory,
# bg_color is the background color, tx_color is the text color,
# please note these values are the normal hex color values.
# next version will be "way" customizable

$bg_color="#000000";
$tx_color="#FFFFFF";

# put the results of w into a scalar
# also snag uptime statistics and current system time & date
# we will grab the raw values from proc and yes, God willing, do integer
division
# we also snag the system name here

$who = `w -h`;
$uptime = `cat /proc/uptime`;
$systime = `date`;
$sysname = `uname -n`;

# Parse the who return by breaking it up according to newlines;
# this will return one line for every user.

@who1 = split(/\n/,$who);
$num_users = length(@who1)+1;

# okay, now do the proctime

@uptime = split(/ /,$uptime);
$days = int $uptime[0]/86400;
$uptime[0]=$uptime[0]-(int $days*86400);
$hours = int $uptime[0]/3600;
$uptime[0]=$uptime[0]-(int $hours*3600);
$mins = int $uptime[0]/60;
$uptime[0]=$uptime[0]-(int $mins*60);
$secs = int $uptime[0];

# Dump it out to the browser; I used the <<'marker' convention for ease of
design and
# modifications


print "Content-type: text/html\n\n";

# begin actual HTML code (prior to table)

print <<beforeTable
<html>
<head>
<title>$sysname System Status</title>
</head>
<body bgcolor=$bg_color text=$tx_color>
<center><font size=+2><b>Current System Status</font></b></center><br><br>
System Name: <b>$sysname</b><br><br>
Current System Time: <b>$systime</b><br><br>
System has been up for: <b>$days days, $hours hours, $mins minutes, and
$secs second(s)</b><br><br>
Users currently connected: <b>$num_users users</b><br><br>

<br><br><br><br>
<center><i>Users Currently Logged In</i></center><br>
<table cellpadding=1 cellspacing=3 width=100% border=0 align=\"middle\">

<tr><b>
    <th>Login</th>
    <th>Terminal</th>
    <th>Logged in since</th>
    <th>Idle for</th></b></b></b></b>
</tr>
beforeTable
;

# calculate the # of elements in @who1, the + 1 needs to be there, otherwise
this skips
# the last user.  I have a fishy feeling this is related to my limited
knowledge of Perl.
# If anyone could help out on this one, i would appreciate it...also is
there an easier
# way to do this? foreach didn't work at all, maybe I was doing it wrong.
# i also included the \n for nicer-looking source.  (otherwise it gets
jammed up on one
# line)

$i=0;
if (@who1[0]) {
for ($i; $i<=length(@who)+1; $i++) {
   print "<tr>";
   print "<th>";
   print substr(@who1[$i],0,8);
   print "</th>";
   print "\n";
   print "<th>";
   print substr(@who1[$i],9,5);
   print "</th>";
   print "\n";
   print "<th>";
   print substr(@who1[$i],34,6);
   print "</th>";
   print "\n";
   print "<th>";
   print substr(@who1[$i],41,7);
   print "</th>";
   print "</tr>";
   print "\n";
}
print "</table>";
}
else {
print "No users are logged in at the moment."
}
print "</body></html>";






------------------------------

Date: 14 Feb 1998 07:33:34 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: on reading FAQs and gurus answering questions
Message-Id: <6c3hce$7i7$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Randal Schwartz <merlyn@stonehenge.com> writes:
:You can't retrofit clpm as
:moderated very easily.  

It was done for ciwac.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
There's some side effect based on the fact that SIGCHLD isn't sent by
anyone, but is fabricated by the kernel when a child dies.  It's a huge
kludge.  But then, it _is_ SysV. --Chip Salzenberg, aka <chs@nando.net>


------------------------------

Date: 14 Feb 1998 07:53:25 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Quickie: regexp for valid e-mail addresses
Message-Id: <6c3ihl$pcn$3@client3.news.psi.net>

Dennis Whitney (dennis@ironlight.com) wrote on 1627 September 1993 in
<URL: news:34E4874F.62B98C21@ironlight.com>:
++ Hello Bart,
++     I had this same problem a while back and the only real thing you can do
++ is a check is make sure that the address is in at leat the right format.
++ After that, it's all up to sendmail (or what ever you use).
++     The check I currently use looks something like:
++ if (($email =~ /\w+@[\w\.]+(com|gov|net|edu|mil|us|org|int)$/)&&
++  ($email !~ /(!#$%^&*\(\))+/)) {
++         ... Your code here ...
++ }
++ 
++ the first expression checks for valid formating and the 7 TLDs (+ int),
++ while the second looks for chars that sendmail cannot (or will not) deal
++ with.


Interesting, you consider mail from Germany, Sweden, Japan, The United
Kingdom, and over a hundred other countries invalid?

Furthermore, you need to upgrade your sendmail. It seems to reject
at least 8 characters that are valid in RFC 822 style addressing.




Abigail
-- 
perl -wle 'print "Prime" if (0 x shift) !~ m 0^\0?$|^(\0\0+?)\1+$0'


------------------------------

Date: 14 Feb 1998 07:41:58 GMT
From: darlenem@flash.net (Jeeves)
Subject: Re: Reg Exp  How Do I...
Message-Id: <slrn6eak0n.507.darlenem@jeeves.flash.net>

On 14 Feb 1998 06:07:21 GMT, djcyr@NOSPAM.connix.com wrote:
>This seems like a really simple problem:
>
>How do I remove all commas from a text file, EXCEPT
>those commas where there is a space immediately after the comma?
>
>Any help would be appreciated.
>TIA

Try 's/(?!\s)//xg;' . I'm assuming the whole text file is in $_.

-- 
---------------------------------------------------------------------
     J |  Copyright (c) 1997 Jeeves Industries Limited.
     J |  All rights reserved. Void where prohibited.
     J |  Some restrictions may apply. Limit 1 per customer.
 J   J |  Offer not valid in conjunction with any other offer.
  JJJ  |  Some sold separately. Not intended for children under 3.
---------------------------------------------------------------------
>From .cshrc:
alias rm 'rm -rf \!*'
alias hose kill -9 '`ps -augxww | grep \!* | awk \'{print $2}\'`'
alias kill 'kill -9 \!* ; kill -9 \!* ; kill -9 \!*'
alias renice 'echo Renice\?  You must mean kill -9.; kill -9 \!*'
=====================================================================


------------------------------

Date: Sat, 14 Feb 1998 10:46:03 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Reg Exp  How Do I...
Message-Id: <34ee6f16.6740066@news.tornado.be>

djcyr@NOSPAM.connix.com wrote:

>How do I remove all commas from a text file, EXCEPT
>those commas where there is a space immediately after the comma?

	s/(, )|,/$1/g;

The left side possible match will be tested first.

HTH,
Bart.


------------------------------

Date: Sat, 14 Feb 1998 11:35:43 GMT
From: nedelcu@algonet.se (Robert Nedelcu)
Subject: Selena Sols authentification script messes up with Forms? Why?
Message-Id: <34e58175.5871795@news.algonet.se>

Hi, 

Need a maintenance script (basically upload, download, edit) for
editing pages with a browser and without FTP. I've found a good one,
called Editpage (5.02), however it uses forms to pass information from
a script into another, and somehow I can't use the
server_authentification script auth.pl from Selena Sols page. Is there
anyone who can give me a good clue? 

I've tried all the ACTION=auth.pl?file=test.pl$session= etc...but It
don't work. As soon as I post information from a script I end up on
the main entry page asking me for logon. Nothing gets processed even
after loggin on.

What should I do? Please, give me a hint!


------------------------------

Date: Sat, 14 Feb 1998 02:07:36 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Substitution in perl for newbie
Message-Id: <MPG.f4f0cc3a02582ef9896c6@news.concentric.net>

[This followup was posted to comp.lang.perl.misc and a copy was sent to the 
cited author.]

nospam@nospam.com said...
> I've tried a more than a few different methods, but still can't get
> it.  Must be a mental block.

Please post one or two of those methods you've tried, so we can remove that 
block.  In the meantime, I'll give you a hint towards using an anchor in your 
regex.  I'll even tell you that the anchor is spelled "$" and indicates the 
end of a string.
-- 
Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


------------------------------

Date: Sat, 14 Feb 1998 07:33:24 GMT
From: nospam@nospam.com (Jerry)
Subject: Re: Substitution in perl for newbie
Message-Id: <34e54888.181183625@192.168.1.1>

$Userhome = $ENV{'REMOTE_ADDR'};

$Userhome =~ s/\205.213.42.//;



On Sat, 14 Feb 1998 02:07:36 -0500, jdf@pobox.com (Jonathan Feinberg)
wrote:

>[This followup was posted to comp.lang.perl.misc and a copy was sent to the 
>cited author.]
>
>nospam@nospam.com said...
>> I've tried a more than a few different methods, but still can't get
>> it.  Must be a mental block.
>
>Please post one or two of those methods you've tried, so we can remove that 
>block.  In the meantime, I'll give you a hint towards using an anchor in your 
>regex.  I'll even tell you that the anchor is spelled "$" and indicates the 
>end of a string.



------------------------------

Date: Sat, 14 Feb 1998 07:20:27 GMT
From: doswald@xmission.com (David Oswald)
Subject: Re: what does "deprecate" mean?
Message-Id: <34e543b5.161931810@news.xmission.com>

On 13 Feb 1998 14:32:03 -0500, kcohen@julius.ling.ohio-state.edu
(Kevin B Cohen) wrote:

>okay, i *know* what it means to "deprecate" in english, but what does
>it mean in perlish?  here are some examples of usage (hope i'm not
>violating any laws of copyright...):
>
>"This usage is vaguely deprecated, and may be removed in some future
>version of Perl."  (camel, 2nd ed., pg. 72)
>
>"Use of $* is now deprecated, and is allowed only for maintaining
>backwards compatibility with older versions of Perl."  (camel, 2nd
>ed., pg. 129)

"Depreciated" in this context begins by meaning discouraged or
disapproved of.  But it goes farther than that.  Consider the value of
a dollar.  If one is buying guns or butter at $1,000,000 / ton the
dollar isself is a depreciated form of payment where more modern forms
of payment (such as $1,000.00 bills) would be more convenient.  In
Perltalk the term 'depreciated' is often used with this connotation;
not only is the use of a depreciated form discouraged, it is also no
longer the most convenient way of doing something.  The value of a
particular method has depreciated as another higher value method has
been introduced.  To use the depreciated method is at best an
inefficient way of writing something (here, efficiency is used in the
context of the three qualities of a good programmer) and at worst a
dangerous or even soon-to-no-longer-exist method of doing something.

Dave
--                doswald@xmission.com
If you mung your return address you must read replies in
the newsgroup; I don't mung, and therefore I don't unmung.


------------------------------

Date: 14 Feb 1998 07:50:21 GMT
From: darlenem@flash.net (Jeeves)
Subject: Re: what does "deprecate" mean?
Message-Id: <slrn6eakge.507.darlenem@jeeves.flash.net>

On Sat, 14 Feb 1998 07:20:27 GMT, David Oswald <doswald@xmission.com> wrote:
>On 13 Feb 1998 14:32:03 -0500, kcohen@julius.ling.ohio-state.edu
>(Kevin B Cohen) wrote:
>
>>okay, i *know* what it means to "deprecate" in english, but what does
>>it mean in perlish?  here are some examples of usage (hope i'm not
>>violating any laws of copyright...):
>>
>>"This usage is vaguely deprecated, and may be removed in some future
>>version of Perl."  (camel, 2nd ed., pg. 72)
>>
>>"Use of $* is now deprecated, and is allowed only for maintaining
>>backwards compatibility with older versions of Perl."  (camel, 2nd
>>ed., pg. 129)

In such a context, 'deprecated' describes feature of the language
that seemed like a good idea at the time, but now there is a better (usually
means 'safer') way to do it and the old feature is only supported so that old
scripts don't break. Case in point: $#. The Camel says it was an ill-advised
attempt to emulate a feature of awk. Authors of new scripts should not use this
variable, as printf is much better, however, Perl will still recognize $# so
that your old scripts will still function properly. HTH.

-- Jeeves

-- 
---------------------------------------------------------------------
     J |  Copyright (c) 1997 Jeeves Industries Limited.
     J |  All rights reserved. Void where prohibited.
     J |  Some restrictions may apply. Limit 1 per customer.
 J   J |  Offer not valid in conjunction with any other offer.
  JJJ  |  Some sold separately. Not intended for children under 3.
---------------------------------------------------------------------
>From .cshrc:
alias rm 'rm -rf \!*'
alias hose kill -9 '`ps -augxww | grep \!* | awk \'{print $2}\'`'
alias kill 'kill -9 \!* ; kill -9 \!* ; kill -9 \!*'
alias renice 'echo Renice\?  You must mean kill -9.; kill -9 \!*'
=====================================================================


------------------------------

Date: Sat, 14 Feb 1998 08:33:28 GMT
From: dkoch@amcity.com (Daniel Koch)
Subject: Re: what does "deprecate" mean?
Message-Id: <34e55416.136220510@news.vnet.net>

On Sat, 14 Feb 1998 07:20:27 GMT, doswald@xmission.com (David Oswald)
wrote:

>On 13 Feb 1998 14:32:03 -0500, kcohen@julius.ling.ohio-state.edu
>(Kevin B Cohen) wrote:
>
>>okay, i *know* what it means to "deprecate" in english, but what does
>>it mean in perlish?  here are some examples of usage (hope i'm not
>>violating any laws of copyright...):
>>
>>"This usage is vaguely deprecated, and may be removed in some future
>>version of Perl."  (camel, 2nd ed., pg. 72)
>>
>>"Use of $* is now deprecated, and is allowed only for maintaining
>>backwards compatibility with older versions of Perl."  (camel, 2nd
>>ed., pg. 129)
>
>"Depreciated" in this context begins by meaning discouraged or
>disapproved of.  But it goes farther than that.  Consider the value of
>a dollar.  If one is buying guns or butter at $1,000,000 / ton the
>dollar isself is a depreciated form of payment where more modern forms
>of payment (such as $1,000.00 bills) would be more convenient.  In
>Perltalk the term 'depreciated' is often used with this connotation;
>not only is the use of a depreciated form discouraged, it is also no
>longer the most convenient way of doing something.  The value of a
>particular method has depreciated as another higher value method has
>been introduced.  To use the depreciated method is at best an
>inefficient way of writing something (here, efficiency is used in the
>context of the three qualities of a good programmer) and at worst a
>dangerous or even soon-to-no-longer-exist method of doing something.
>

"Depreciated" and "deprecated" are two different words.  "Deprecated"
means disapproved of, out of favor, frowned upon.  "Depreciated" means
lessened in value, usually monetary value.

"Depreciated" is not commonly used in the context of programming
languages.  "Deprecated" is computer-speak for: "Don't use it.  Your
program will break under a future version of the language. There are
better ways of doing it."

Dan Koch <dkoch@amcity.com>




------------------------------

Date: Sat, 14 Feb 1998 10:45:42 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <34e9625a.3479993@news.tornado.be>

seebs@plethora.net (Peter Seebach) wrote:

>The struct
>tm has been Y2K-ready for a long time.
>
>I dread the 34,667 bug.

Do you expect still to be alive by then? Or  do you expect your programs
still to be used? Really?

It is quite striking that solutions to time related software problems
are always temporary patches, though.

	Bart.


------------------------------

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 1897
**************************************

home help back first fref pref prev next nref lref last post