[13324] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 734 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 7 19:07:27 1999

Date: Tue, 7 Sep 1999 16:05:17 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 7 Sep 1999     Volume: 9 Number: 734

Today's topics:
    Re: 11/1 date problem - timelocal / localtime (Abigail)
    Re: Case insensitive SQL query mrbog@my-deja.com
    Re: Counting duplicate list elements in Perl (Abigail)
    Re: Counting duplicate list elements in Perl (Abigail)
        Help with game level tool (Jeff Ross)
    Re: How do i append the beginning of a HTML file? monotone@my-deja.com
        integer mistery glaessel6281@my-deja.com
        make this a one-liner? <bmetcalf@nortelnetworks.com>
    Re: moving perl binary?? <bmetcalf@nortelnetworks.com>
    Re: Perl5 sendmail (Abigail)
    Re: Perl5 sendmail (Abigail)
        Programmer's Editor <jussij@zeusedit.com>
    Re: Question (Abigail)
    Re: Question (Abigail)
    Re: Sendmail fading away? (was  Re: Perl5 sendmail) (Abigail)
    Re: Simple question about if statement (Abigail)
    Re: URL->Text->URL (Larry Rosler)
    Re: using code written in C (anyone know about stemming (Ilya Zakharevich)
    Re: Where a subroutine gets called from? (Abigail)
    Re: writing string with some '%' to a file (Abigail)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: 2 Sep 1999 18:01:20 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: 11/1 date problem - timelocal / localtime
Message-Id: <slrn7su0jd.au2.abigail@alexandra.delanet.com>

Linda Santoso (lsantoso@baynetworks.com) wrote on MMCXCI September
MCMXCIII in <URL:news:37CC4B63.30DE44CB@baynetworks.com>:
__ 
__ Can someone help me debug the following script? I converted 11/1/1999 to
__ scalar using timelocal and tried to get it back using localtime, but it
__ keeps returning 10/31/1999.  Same happens with any date after
__ 11/1/1999.  It decrements the date by one when I tried to convert it
__ back using localtime.  Am I missing something?


Well, the program below doesn't quite compile. After fixing Timelocal
to Time::Local, and start to $start, it all works as expected to me,
returning the first of November. Now, why you have the assignment to
$end there, I have no idea.


Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 07 Sep 1999 22:33:20 GMT
From: mrbog@my-deja.com
Subject: Re: Case insensitive SQL query
Message-Id: <7r43rg$91l$1@nnrp1.deja.com>



Hello, genius, guess what, there are other people to answer the
questions besides you. The more people in the group, the more people to
answer questions. I can and have answere the questions of others, for
example.

Besides that, how fucking stupid are you to think that of 2400 new
messages, they will all be questions? You're a programmer and I need to
explain that to you?  It's more lik 10% at most.  Note I said new
messages not new threads.

God what an idiot


In article <7r395a$f89@junior.apk.net>,
  catfood@apk.net (Mark W. Schumann) wrote:
> In article <7qpc3d$ne$1@nnrp1.deja.com>,  <mrbog@my-deja.com> wrote:
> >Yes, and my feeling is that it sould be about 10% because my god how
> >goddamn painful is it for you for someone to ask something outside of
> >your so tightly drawn lines.
>
> Here's why:
>
> $ trn
> 2417 unread messages in comp.lang.perl.misc--read now [y/n]?
>
> This after being gone a day or two.  Do you have any idea how much
> stuff this is to read... to help OTHER people?  The more the regulars
> get sucked into answer non-Perl questions,
> _to_which_better_resources_exist_elsewhere_, the less time they have
> to help people with Perl.
>
> The people who answer questions here do it because they want to help
> others learn how to use Perl.  You're making it harder for them to do
> that.  Is that so difficult to understand?
>
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 2 Sep 1999 16:51:23 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Counting duplicate list elements in Perl
Message-Id: <slrn7stsg9.au2.abigail@alexandra.delanet.com>

Matthew David Zimmerman (mdz4c@node5.unix.Virginia.EDU) wrote on MMCXCII
September MCMXCIII in <URL:news:7qk8bd$et8$1@murdoch.acc.Virginia.EDU>:
~~ Uri Guttman  <uri@sysarch.com> wrote:
~~ >
~~ >a little perl golf here
~~ >
~~ [snip]
~~ >
~~ >or as a one liner:
~~ >
~~ >perl -lne '$c{$_}++;END{print "$_,$c{$_}" for sort keys %c}'
~~ 
~~  perl -lne '$c{$_}++}{print "$_,$c{$_}" for sort keys %c'

    perl -lne '$c{$_}++}{print"$_,$c{$_}"for sort keys%c'



Abigail
-- 
               split // => '"';
${"@_"} = "/"; split // => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_)  {print "$_ $_{$_} "}};
%{"@_"} = %_ = (Just => another => Perl => Hacker); &{%{%_}};


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 2 Sep 1999 16:53:41 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Counting duplicate list elements in Perl
Message-Id: <slrn7stski.au2.abigail@alexandra.delanet.com>

Ala Qumsieh (aqumsieh@matrox.com) wrote on MMCXCIII September MCMXCIII in
<URL:news:x3ylnapwaxe.fsf@tigre.matrox.com>:
[] 
[] "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net> writes:
[] 
[] > Uri Guttman wrote:
[] > > 
[] > > a little perl golf here
[] > > 
[] > > perl -lne '$c{$_}++; END{print "$_,$c{$_}" for sort keys %c}'
[] > 
[] >   perl -lne '$c{$_}++;END{print"$_,$c{$_}"for sort keys%c}'
[] > 
[] > Four fewer strokes! (And no closing -n loop with }, either!) Do I get a
[] > prize? (Tested, too!)
[] 
[] Is this considered valid Perl Golf:
[] 
[] 	% alias p perl -nle
[] 	% p '$c{$_}++;END{print"$_,$c{$_}"for sort keys%c}'
[] 
[] Eight (yes 8!!!) fewer strokes. That's VERY close to a hole in one!


Well, if you go that way:

    $ alias p perl -nle '$c{$_}++;END{print"$_,$c{$_}"for sort keys%c}'
    $ p


Abigail
-- 
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
                                      print } sub __PACKAGE__ { &
                                      print (     __PACKAGE__)} &
                                                  __PACKAGE__
                                            (                )


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 07 Sep 1999 22:54:04 GMT
From: ross@eidetic.com (Jeff Ross)
Subject: Help with game level tool
Message-Id: <6B81952AF2FE0C4D.2575BEF842CB7A36.2D211023EE61ADF9@lp.airnews.net>

can someone take a shot at this script for me? 
(cut and paste into text editor for proper formatting)

=====================================

#This is the start, gathering info for the files to work with.

print "What Level? ";
chomp ($LEVELNAME = <STDIN>);
	open(HOGFILE, "z:\\hogs\\$LEVELNAME\\wldemd.h") or die "Can't
open file $LEVELNAME, check name and try again.\n\n";
	open(LEVDATA, "z:\\vss\\temp\\$LEVELNAME\_actmap.txt") or die
"Levdata not found.\n\n";

=====================================

I want to take some values from these files and do some math.

=====================================

wldemd.h looks like this, minus the quotes:
(cut and paste the data to make your own local file)

"
#define HOG_WLDEMD_ID 936144231

// Number of blocks    : 2
#define NUM_WLDEMD_BLOCKS	2

typedef enum _eHOG_WLDEMD_BlockIndexes
{
 /* Offset:      0   Filesize:16188 bytes */   	HOG_WLDEMD_B07_EMD,
 /* Offset:  16384   Filesize:19488 bytes */   	HOG_WLDEMD_B08_EMD
}
eHOG_WLDEMD_BlockIndexes;
"

I want to nuke the file until I get these variables:

B07 = 20 formerly (Filesize:16188 bytes */   	HOG_WLDEMD_B07_EMD)
B08 = 20 formerly (Filesize:19488 bytes */   	HOG_WLDEMD_B08_EMD)

(of course the twos are the Filesize values as K, rounded up to the
nearest 10)

In a typical file there will be many more lines, separated by commas, 
and the final line will have no comma.

	
=====================================

Then I want to open the *_actmap.txt looks like this, again minus the
quotes: (cut and paste the data to make your own local file)

"
/**
 ** MOSCOW3.MAP:	Sector Activation Map for the moscow3
 **
 ** june 03, 1999
 **
 ** The Terrain EMD is required for compilation.
 **
 **/





/**-----------------**
 ** ACTIVATION DATA **
 **-----------------**/
[REPLSEC1:CHAR(2)] EOL, EOL
[REPLSEC2:CHAR(2)] EOL, EOL
[REPLSEC3:CHAR(2)] EOL, EOL
[REPLSEC4:CHAR(2)] EOL, EOL
[REPLSEC5:CHAR(2)] EOL, EOL
[REPLSEC6:CHAR(2)] EOL, EOL

[INSIDESEC:CHAR(16)] EOL

[MAP_SIZE:LONG]                 NUM_WLDEMD_BLOCKS

[GABE_START_SECTOR:LONG]	HOG_WLDEMD_B07_EMD


[HOG_WLDEMD_B07_EMD:CHAR(LEN)] HOG_WLDEMD_B07_EMD, HOG_WLDEMD_B08_EMD,
EOL

[HOG_WLDEMD_B08_EMD:CHAR(LEN)] HOG_WLDEMD_B07_EMD, HOG_WLDEMD_B08_EMD,
EOL
"

Most of this file is junk to me.  I want to strip it so 
[HOG_WLDEMD_B07_EMD:CHAR(LEN)] = becomes a new variable which 
is different than the B07 created by the wldemd.h file above.

I want this new B07 variable to be the sum of all its variables 
(listed on same line).  Since B07 and B08 are each 20K, so B07 
would equal 40K.

There doesn't seem to be too much data to work with here, but some 
files I want to parse have over 99 sectors of data.

=====================================

Once all the information has been gathered and computed I want to 
print it to a report text file, and open that new file in a 
separate text window sort of like this:

"
Terrain Cache for $LEVELNAME:

B07 = 40K
B08 = 40K
 ...and so on.
"

=====================================


I have many more tools to construct following a similar logic.  So
this should help me as a learning experience.  Thanks in advance.

If you have any questions please drop me a line.

-Jeff Ross
ross@eidetic.com
  


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

Date: Tue, 07 Sep 1999 22:08:04 GMT
From: monotone@my-deja.com
Subject: Re: How do i append the beginning of a HTML file?
Message-Id: <7r42bt$81t$1@nnrp1.deja.com>


> You can't. The data currently in the file must move to a different
> location on the disc. Therefore, all you can do is read in the whole
> file, write your new stuff, and rewrite the old stuff at the end of
> that, or something with the same effect (e.g. write the new stuff to a
> new file, append the old file to it, and replace the old file with the
> new one.
>
> Anyway, if your file can be really big, say, a lot larger than 50k,
this
> will be slow, and a completely different rethinking of the problem
might
> be in order.
>
> 	Bart.

How about this one (and it just stuck me so I don't know if I could make
it work) write your text file backwards, then when you appand to the end
you'll really be appanding to the front.  Then when you import it into
your html file, do it backwards as well.

Tone


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 07 Sep 1999 22:02:18 GMT
From: glaessel6281@my-deja.com
Subject: integer mistery
Message-Id: <7r4211$7n0$1@nnrp1.deja.com>

Hello


writing a simple Cgi/Perl script (using cgilib.pl)
i encounterd a
Integer Problem:
I hava a Form to send the perl script a amount of
Money (eg 18.10).

what I did is to mult by 100 to get rid of the
digits.


&ReadParse  # this is to get the Data (in
cgilib.pl)

-----------------------
$p = $in{'p'};

print "$p<BR>";
$p=$p*100;
print "$p<BR>";

$t=1810-$p;
print "$t<BR>";

if($p == int($p)){
	print "is eqaul<BR>";
}else{
	print "not equal<BR>";
}
------------------------

when running: I get this for example:


18.10
1810
-2.27373675443232e-13
is not equal


The Line: -2.27373675443232e-13   should be 0
and 1810==int(1810) should be true

or not?

I think i really need help

greetings Michael



Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 07 Sep 1999 16:00:12 -0700
From: Brandon Metcalf <bmetcalf@nortelnetworks.com>
Subject: make this a one-liner?
Message-Id: <37D598FC.C37F7A59@nortelnetworks.com>

Can anyone come up with a short one-liner that can be passed to perl -e
that will do the same thing as the code below?  This may not even be the
most efficient way to accomplish what I need.  I'm calling this script
from a ksh script, but I would rather not have to rely on the extra
script.

This code basically parses the output of a recursive make and looks for
/Error code.*ignored/ in between the 'building all in ...' and the
'Leaving ...' output.

Thanks,
Brandon

open(LOG, "< $log") || die "Could not open $log: $!\n";
while (<LOG>)
{
   if (/building all in (.*)$/)
   {
      $dir = $1;
      $start++;
   }
   if ($start)
   {
      $line .= $_;
      if (/Leaving directory "(.*$dir.*)"$/)
      {
         $dir2 = $1;
         print "$dir2\n" if ($line =~ /Error code.*ignored/);
         $line = '';
         $start = 0;
      }
   }
}
close(LOG);






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

Date: Tue, 07 Sep 1999 15:51:05 -0700
From: Brandon Metcalf <bmetcalf@nortelnetworks.com>
Subject: Re: moving perl binary??
Message-Id: <37D596D8.F72DA972@nortelnetworks.com>

> I've built Perl in my home directory, and would like to
> get the sys admins to install it under /usr/local.
>
> It seems a straight copy of bin/* and lib/* will not work,
> as I see my home directory in
>
> strings perl | grep home/dir
>
> What will need to be done to accomplish this the move?
> Is there some info out on the net that discusses this?

When you run the configure script, you need to specify where you are
going to install the package.

Brandon



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

Date: 2 Sep 1999 16:57:31 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl5 sendmail
Message-Id: <slrn7stsro.au2.abigail@alexandra.delanet.com>

John Casey (jcasey@workingventures.ca) wrote on MMCXCII September
MCMXCIII in <URL:news:37cd819c.604095283@wv-proxy>:
|| Hello all;
|| 
|| I am kinda new to PERL. I am trying to e-mail a form...sounds simple

We know. Otherwise, you would have called the language by its
correct name: Perl.

|| enough, but all the documentation I find refers to UNIX
|| "\usr\lib\sendmail".

No, it doesn't as there isn't such an odd thing as "Sribsendmail",
which is the same as "\usr\lib\sendmail".

||                      I have PERL 5.004 installed, but can't find
|| anything similar to sendmail in bin or lib.


Well, that has nothing to do with Perl. Ask your system administrator
if on the machine you are running your programs a sendmail or sendmail
compatible MTA is installed. If yes, as him where. If not, find an
other machine to run on, or give your admin a reason to install sendmail.
Like a case of beer.



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


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 2 Sep 1999 16:59:57 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl5 sendmail
Message-Id: <slrn7stt0a.au2.abigail@alexandra.delanet.com>

Kenneth Graves (kag@kag.citysource.com) wrote on MMCXCII September
MCMXCIII in <URL:news:slrn7sr7kb.15b.kag@kag.citysource.com>:
?? In article <37cd928b.608430136@wv-proxy>, John Casey wrote:
?? >I use OMNICRON HTTPd as my web server and have configured it for PERL
?? >5.004 just because I can use it on any machine 95/98/NT. I only have
?? >98 at home. I have NT at work and have IIS3.0 loaded on it. I will
?? >eventually be sending this site to another server which could be UNIX,
?? >NT or what ever other server my client decides to go with. Isn't there
?? >a comparable perl module for PERL5 that compares to SENDMAIL, or am I
?? >over simplifying it.
?? 
?? Net::SMTP or Mail::Mailer, depending on taste.

None of those are sendmail replacements, not by a long shot. Or are
they taking care of retrying delivery upon failure, and notifying
the original sender if the message could not be delivered after a few
days?



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


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Wed, 08 Sep 1999 08:28:31 +1000
From: Jussi Jumppanen <jussij@zeusedit.com>
Subject: Programmer's Editor
Message-Id: <37D5918F.1F27@zeusedit.com>

Zeus for Windows Version 3.00 Now Released
------------------------------------------

The Zeus for Windows programmer's editor has been totally 
re-developed and the results of this full re-write are now
ready for use. The  Programmer's is designed to run on the
Windows 95, Windows 98 or NT platforms.

So what is new:
    
    1) New syntax highlighting engine should now support almost
          any language.

    2) Comes with pre-configured syntax highlighting for:

        C/C++, Java, Perl, HTML, Python, Pascal

    3) New plugable scripting modules allows you to write Zeus
          macro scripts using the Python, LUA or Small C macro
          languages.

    4) New configuration model now makes it even easier for you
          to configure Zeus to do just what you want.

    5) Enhanced compiler, project and tool support.

    6) Improved keyboard mapping.

You can download the shareware version from:

  http://www.zeusedit.com/z300/download.htm

For some screen shots of Zeus in action goto:

  http://www.zeusedit.com/z300/look.htm

For more details visit the Zeus web page:

  http://www.zeusedit.com

Jussi Jumppanen
Author of: Zeus for Windows, Win32 (Brief, WordStar, Emacs) Text Editor
"The C/C++, Java, HTML, Pascal, Cobol, Fortran programmers text editor" 
http://www.zeusedit.com


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

Date: 2 Sep 1999 17:37:54 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Question
Message-Id: <slrn7stv7g.au2.abigail@alexandra.delanet.com>

Jimtaylor5 (jimtaylor5@aol.com) wrote on MMCXCII September MCMXCIII in
<URL:news:19990901155345.14123.00001718@ng-ft1.aol.com>:
:: 
::    chop($new_line) if $new_line =~ /\n$/;
:: 
::  Would this do the same as chomp and be less dangerous in certain
:: circumstances? or is there a problem with this also? Thanks!


What is "less dangerous"? If you are afraid that $/ isn't equal
to "\n", yet you always want to remove a trailing newline if there
is one, the above solution is preferable over chomp. Similar if
you are in paragraph mode and you want to remove at most one newline.
Of course, in both cases, I would prefer:

    $new_line =~ s/\n$//;


However, the chop() as given above might remove something that isn't
equal to $/. So, it might be "more dangerous" than chomp. It all depends
what you want to do.



Abigail
-- 
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
                                      print } sub __PACKAGE__ { &
                                      print (     __PACKAGE__)} &
                                                  __PACKAGE__
                                            (                )


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 2 Sep 1999 17:39:02 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Question
Message-Id: <slrn7stv9j.au2.abigail@alexandra.delanet.com>

Uri Guttman (uri@sysarch.com) wrote on MMCXCIII September MCMXCIII in
<URL:news:x7k8q9u7cu.fsf@home.sysarch.com>:
\\ >>>>> "MV" == Martien Verbruggen <mgjv@comdyn.com.au> writes:
\\ 
\\   MV> In article <19990901232831.23624.00002565@ng-fx1.aol.com>,
\\   MV> 	twarren10@aol.com (Twarren10) writes:
\\   >>> chop($new_line) if $new_line =~ /\n$/;
\\ 
\\   MV> Which makes chomp a lot better in many ways than chop can be,
\\   MV> especially if $/ contains more than one character.
\\ 
\\ plus chomp is a lot faster as it stays in the perl core instead of
\\ executing the silly regex and chop in perl as shown above. why on earth
\\ would someone write a chomp in terms of chop?


Well, the only reason I can think of that is is *not* the same as chomp....



Abigail
-- 
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
         % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
         BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 2 Sep 1999 17:03:15 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Sendmail fading away? (was  Re: Perl5 sendmail)
Message-Id: <slrn7stt6g.au2.abigail@alexandra.delanet.com>

Kenneth Graves (kag@kag.citysource.com) wrote on MMCXCIII September
MCMXCIII in <URL:news:slrn7sthdb.jj.kag@kag.citysource.com>:
|| In article <eBwz3.48$K4.5894@news.shore.net>, Scratchie wrote:
|| >Is Sendmail becoming less common than it used to be? What's replacing it?
|| 
|| Postfix, exim, qmail, probably others I'm forgetting.
|| Sendmail is still more common that those three combined, but it
|| isn't as ubiquitous as when I started programming.

But qmail is sendmail compatible. I run qmail, but none of the programs
that talk to an MTA know that. They just call /usr/lib/sendmail, and don't
care that that's a symbolic link into /opt/qmail.

|| Some of the above put in a symlink to fake the presence of sendmail,
|| so that old scripts assuming it would be there still work.

I would suggest that new programs still use that symlink, so if you
ever want to switch to a different MTA, none of your scripts will break,
as long as you update the link from /usr/lib/sendmail.

|| I prefer to use Net::SMTP in my own scripts, but even that assumes
|| there is an SMTP server available.

I tend to pipe things into /usr/bin/mailx.



Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 2 Sep 1999 17:46:05 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Simple question about if statement
Message-Id: <slrn7stvmr.au2.abigail@alexandra.delanet.com>

Jeff Stampes (stampes@xilinx.com) wrote on MMCXCI September MCMXCIII in
<URL:news:7qh4e0$9r1@courier.xilinx.com>:
--
-- if ($code == 10 || 20 || 30 ) {}

That doesn't do what you think it does.



Abigail
-- 
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
         % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
         BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 7 Sep 1999 15:31:58 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: URL->Text->URL
Message-Id: <MPG.123f3235692a9e0f989f22@nntp.hpl.hp.com>

In article <7r404h$3po$1@nclient11-gui.server.virgin.net> on Tue, 7 Sep 
1999 22:28:01 +0100, Terry King <terryking@hot-shot.com> says...
> We've all seen URL to text routines but I haven't seen one that converts
> special characters back into hex so that the cgi program can call itself.
> Can anyone post the few lines of code needed or point me in the right
> direction ?

Yes, there's code in a module to do this, but why bother remembering the 
name or the calling sequence?

    s/([" #%&+<=>"])/sprintf '%%%.2X' => ord $1/eg;

You may choose to add other characters to the character class (for 
example \x00-\x17 \x7F-\xFF).

Note to the picky:  I put the double-quote in the character class twice 
because the Perl syntax colorer in my version of vi (gvim) gets it wrong 
otherwise.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 7 Sep 1999 22:46:10 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: using code written in C (anyone know about stemming?)
Message-Id: <7r44ji$tc$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to The Glauber 
<theglauber@my-deja.com>],
who wrote in article <7r36lf$hmt$1@nnrp1.deja.com>:
> If Stem returns 0 on success and 1 on failure, you could do:
> 
> bool_t
> stem( word )
>     char * word
>     CODE:
>         RETVAL = (Stem(word) == 0);
>     OUTPUT:
>         RETVAL
>         word

I would try to avoid CODE and PPCODE statements if possible, in the
hope that xs2c converter would be able to exercise some optimizations
I would not think of.  Thus I would use

 #define neg_stem(w)	(!stem(w))

 PACKAGE = ... MODULE = ... PREFIX = neg_

 bool
 neg_stem(word)
     char * word
 OUTPUT
     word
     RETVAL

[Note also bool vs bool_t.  bool is a very efficient output type.]

Ilya


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

Date: 2 Sep 1999 17:47:10 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Where a subroutine gets called from?
Message-Id: <slrn7stvos.au2.abigail@alexandra.delanet.com>

Denis Kotseba (kdl@softhome.net) wrote on MMCXCI September MCMXCIII in
<URL:news:7qikvp$fv9$1@usenet.kreonet.re.kr>:
** 
** How can I find out which subrotine (a or b) called c without passing an
** extra parameter?


caller()



Abigail
-- 
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
                                      print } sub __PACKAGE__ { &
                                      print (     __PACKAGE__)} &
                                                  __PACKAGE__
                                            (                )


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 2 Sep 1999 17:49:17 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: writing string with some '%' to a file
Message-Id: <slrn7stvsr.au2.abigail@alexandra.delanet.com>

Jason Speers (jspeers@open.uoguelph.ca) wrote on MMCXCII September
MCMXCIII in <URL:news:37CD8B09.B739447A@open.uoguelph.ca>:
|| Hi,
|| 
|| When I write a string containing any number of % characters in it to a
|| file, I get unexpected results in the file.  i.e. %%%% becomes %%  or
|| 234%567 becomes 2340.0000000567  ... and sometimes this will not occur??

Really? How do you use this % char then? 

|| Is there something about the percent sign within a string that I do not
|| know about?

Not in general, no. But perhaps you are doing something (and I've a fair
idea what that might be) that you are not telling us?

I don't want to play a guessing game. Post a code fragment.



Abigail
-- 
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
         % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
         BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 734
*************************************


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