[10250] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3843 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 28 15:07:32 1998

Date: Mon, 28 Sep 98 12:00:25 -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           Mon, 28 Sep 1998     Volume: 8 Number: 3843

Today's topics:
    Re: A CGI question about Linux + Apache droby@copyright.com
    Re: an observation on why python will fail <jdporter@min.net>
    Re: an observation on why python will fail <zenin@bawdycaste.org>
    Re: an observation on why python will fail <hyoon@bigfoot.com>
    Re: Best Editor for Perl (under WinNT4) - Syntax Colori <jdubois@keane.com>
        Cookies & perl <luc.petit2@wanadoo.fr>
        format help <jamdiaz@klaskycsupo.com>
        how do I get array slice of multidim. array???? <smaring@gte-es.com>
    Re: how do I get array slice of multidim. array???? (Larry Rosler)
    Re: how to code: iterate through x statements but stop  <jdporter@min.net>
        How to obtain my server IP number ?? dragnovich@my-dejanews.com
    Re: How to obtain my server IP number ?? <95ncp@eng.cam.ac.uk>
    Re: How to read contents of all *.TXT files in director <uri@camel.fastserv.com>
        Input Separator Matching <shenge@ece.ucdavis.edu>
    Re: Input Separator Matching (Matt Knecht)
    Re: just to show you how screwed up the server is... (brian d foy)
        MIME::Lite, changing bounce path (Matt Arnold)
        Perl bug?  Pack command <markem@flash.net>
    Re: Perl bug?  Pack command (Clinton Pierce)
        Perl-CGI & metasend <bench@surfshop.net.ph>
    Re: Problem with Text::ParseWords Solved <jhd@saltmine.radix.net>
        question concerning gethostbyaddr (remove)
    Re: reducing a variable <uri@camel.fastserv.com>
    Re: script: scriptMangle! <danboo@negia.net>
        sqerl question <klingela@nt.com>
        Where can I find a member() function? (Brian Kendig)
    Re: Where can I find a member() function? (Michael Fuhr)
        Win32::Registry <alex@digi-q.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Mon, 28 Sep 1998 17:51:10 GMT
From: droby@copyright.com
Subject: Re: A CGI question about Linux + Apache
Message-Id: <6uoiaf$pen$1@nnrp1.dejanews.com>

In article <6uo2o5$k76$1@earth.superlink.net>,
  dblack@saturn.superlink.net (David A. Black) wrote:
>
> I think you set the record for the most agressively un-clpm-ish
> subject line in history.  I've seen more relevant ones with the
> words "Torri Spelling" in them.
>

But no! It could get much worse.
A CGI question about Linux + Apache using JavScript to set a cookie on IE4.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Mon, 28 Sep 1998 13:30:04 -0400
From: John Porter <jdporter@min.net>
Subject: Re: an observation on why python will fail
Message-Id: <360FC79C.3760ACC4@min.net>

Lloyd Wood wrote:
> 
> It always comes down to the most visible leading advocate and exemplar:
> tcl:    John Ousterhout
> perl:   Larry Wall
> python: George Reese

A. I don't believe George Reese is Python's "most visible leading
advocate and exemplar".

B. Larry Wall, though certainly the very visible embodiment of 
Perl's heart and soul, is not Perl's leading advocate and exemplar,
IMHO.  I think Tom Christiansen deserves that distinction.

-- 
John "Many Jars" Porter


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

Date: 28 Sep 98 18:29:57 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: an observation on why python will fail
Message-Id: <907007617.755277@thrush.omix.com>

James Logajan <JamesL@Lugoj.Com> wrote:
: Lloyd Wood wrote:
: > It always comes down to the most visible leading advocate and exemplar:
: > tcl:    John Ousterhout
: > perl:   T^HLarry Wall
: > python: George Reese
:
: George who?

	You're lucky. :-)

: P.S. Don't what you're talking about, but I suspect you must be trolling.

	Yep.

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Mon, 28 Sep 1998 14:06:34 -0400
From: Hoon Yoon <hyoon@bigfoot.com>
Subject: Re: an observation on why python will fail
Message-Id: <360FD02A.C82820F0@bigfoot.com>

from yet another former Perl programmer (who hates maintaining his or
anyone else's Perl),

Flame bait...

I am sure Perl community would love a message.
Re: an observation on why Perl will fail -> 
	because it's not MS product
	Larry is not charismatic as Bill G.
	finger cramp due to typing in all those curly braces
	eye and mental strain due to illegiable program
, which I say no way <-
	It's still easy to cut up files in Perl than VB
	if you are sed & awk hack, it's a natural transition (I was)
	you still have to maintain all that programs written by someone else
	it's packaged in all Unix operating system known to me
	it's free!
	Bill G and MS is not the loveliest pair one will meet
	CS people are into cramp and strain

BTW: Just because Python & Perl is free, does not mean everything else
connecting to it should be free. Too often, the management does likes
paid product. If we had either Visual Python or Visual Perl, either one
would have been super hit; however, neither would be compatiable with
anything except windows.
Can we chop off this kind of header? 
Enough said,

Hoon,


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

Date: Mon, 28 Sep 1998 13:39:46 -0400
From: Joseph DuBois <jdubois@keane.com>
Subject: Re: Best Editor for Perl (under WinNT4) - Syntax Coloring ?
Message-Id: <360FC9E2.DC371CB6@keane.com>



Alec Stewart wrote:

> Hi,
>
> Can anyone recommend a decent Editor for Perl (5) ?
> - Ideally something with Syntax Coloring
> (like KEDIT seems to do for other languages...)
>
> I am running under WinNT 4 (SP3).

I am currently using Dana. It handles code higlighting as
well as box cutting and pasting which is good for tables/arrays/etc.
It allows you to add your own keywords as well.

-------------------------------------------------------
Joseph DuBois            (Internet/Intranet Specialist)
mailto:jdubois@keane.com  (Work)  http://www.keane.com/




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

Date: Mon, 28 Sep 1998 19:15:21 +0200
From: "Philippe PETIT" <luc.petit2@wanadoo.fr>
Subject: Cookies & perl
Message-Id: <6uoflg$13i$1@platane.wanadoo.fr>

How can I testing if navigator accept a cookies with perl

thank in avance

regard,

Bien ` vous
Philippe
Luc PETIT inginieur Conseil
Developer's Paradise
http://www.devparadise.com/




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

Date: Mon, 28 Sep 1998 10:50:55 -0700
From: Jaime Diaz <jamdiaz@klaskycsupo.com>
Subject: format help
Message-Id: <360FCC7E.7E0E@klaskycsupo.com>

I am trying to get info on formatting using perl.


for example in unix if i want reformat the output of the df -k
command


open (test, "/etc/tester");  ##tester is df output

while (<test>) {

      ($one,$two,$three) = split(' ');
   write >out;

}
format STDOUT =
@<<<<  @<<<<<<<< @<<<<<<<<
$one,$two,$three

I want to create column headers in the format ..for example


Total Megabytes
----------------

any ideas..

Jamie Diaz


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

Date: Mon, 28 Sep 1998 17:57:48 +0000
From: Steve Maring <smaring@gte-es.com>
Subject: how do I get array slice of multidim. array????
Message-Id: <6uoiva$7e6$1@news-1.news.gte.net>

I have a two dimensional array from which I wish to delete a row.

In the one dimensional case I can say:
@array[$i..($sizeofarray-1)] = @array[($i+1)..($sizeofarray-1)];

and $array[$i] will be deleted with subsequent entries shifted up.

Given $array[$i][$j] and a desire to delete a given $i, the same
approach
does not work.

Any ideas would be greatly appriciated.


-Steve Maring
Tampa, FL



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

Date: Mon, 28 Sep 1998 11:31:40 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: how do I get array slice of multidim. array????
Message-Id: <MPG.107975e3d55193e79897c6@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <6uoiva$7e6$1@news-1.news.gte.net> on Mon, 28 Sep 1998 
17:57:48 +0000, Steve Maring <smaring@gte-es.com> says...
> I have a two dimensional array from which I wish to delete a row.
> 
> In the one dimensional case I can say:
> @array[$i..($sizeofarray-1)] = @array[($i+1)..($sizeofarray-1)];
> 
> and $array[$i] will be deleted with subsequent entries shifted up.

This should be done using 'splice':

  splice @array, $i, 1;

(and in your code, you should use $#array instead of using another 
variable to keep track of the size).

> Given $array[$i][$j] and a desire to delete a given $i, the same
> approach does not work.

Why not?  Each element of the array is an array reference, so deleting 
one of the array references will delete the entire row.

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


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

Date: Mon, 28 Sep 1998 13:10:12 -0400
From: John Porter <jdporter@min.net>
Subject: Re: how to code: iterate through x statements but stop if condition is true
Message-Id: <360FC2F4.16EFFE2C@min.net>

Randal Schwartz wrote:
> 
> try_one() or try_two() or try_three() or nothing_worked();

That's the way I'd do it; but I can't pass by the opportunity
to suggest the Functional (FP) approach, namely, disjoin:

  sub disjoin {
    my @funcs = @_;
    sub {
      my @args = @_;
      for my $f ( @funcs ) {
        $f->( @args ) and return 1; # short circuit
      }
      return undef;
    }
  }

disjoin() creates and returns a closure which acts as a
replacement for all the functions passed to disjoin().
When the closure is called, each of the functions is called
in order until one returns non-false.

The closure should be called with the arguments that all
the functions would take -- so they  must all be expecting
the same arguments.  (If this seems like a problem, try
reworking them all to take a hash of named values; then
they can pick the ones they need from the hash.)

So, if you would say:

     one( 'alpha' => 7 ) 
  or two( 'alpha' => 7, 'beta' => 29 )
  or three( 'beta' => 29, 'gamma' => 137 )
  or crapout();

You can say instead:

  &{ disjoin(
     \&one,
     \&two,
     \&three,
     \&crapout
  ) }(
     'alpha' => 7,
     'beta'  => 29,
     'gamma' => 137,
  );

-- 
John "Many Jars" Porter


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

Date: Mon, 28 Sep 1998 17:00:53 GMT
From: dragnovich@my-dejanews.com
Subject: How to obtain my server IP number ??
Message-Id: <6uofc3$m2r$1@nnrp1.dejanews.com>

Hello folks heres a good question! (I think)

I want to my perl program, obtain the IP numer from the machine that it is
ruuning, but how can I do this ???? Ie

I want that test.pl return the follow response:

Hello you are on 10.10.99.168 ip number
and test.pl script is on 1.1.1.1 ip number

I know how to obtain the IP of the machine that is reading my perl script (via
WWW) and here is the code...

$remoteip = $ENV{'REMOTE_ADDR'};
$localip = ?????????;
print "Hello you are on $remoteip ip number\n";
print "and test.pl script is on $localip ip number\n";

But how can I obtain the SERVER IP NUMBER ???? Is this possible! ??? and a
better one, is that possible on ALL PERL PORTS (unix,windows,mac etc..??)

Ok folks I hope you can help! (ASP)

P.D. I know my server IP number ! but I whant that the program can obtain the
server number by it self!   =-)

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Mon, 28 Sep 1998 18:56:40 +0100
From: Nigel Parker <95ncp@eng.cam.ac.uk>
Subject: Re: How to obtain my server IP number ??
Message-Id: <Pine.HPP.3.96L.980928184652.12023C-100000@club.eng.cam.ac.uk>

On Mon, 28 Sep 1998 dragnovich@my-dejanews.com wrote:

: Hello folks heres a good question! (I think)
: 
: I want to my perl program, obtain the IP numer from the machine that it is
: ruuning, but how can I do this ???? Ie
: 
: I want that test.pl return the follow response:
: 
: Hello you are on 10.10.99.168 ip number
: and test.pl script is on 1.1.1.1 ip number
: 
: I know how to obtain the IP of the machine that is reading my perl script (via
: WWW) and here is the code...
: 
: $remoteip = $ENV{'REMOTE_ADDR'};
: $localip = ?????????;
: print "Hello you are on $remoteip ip number\n";
: print "and test.pl script is on $localip ip number\n";
: 
: But how can I obtain the SERVER IP NUMBER ???? Is this possible! ??? and a

$ENV{'SERVER_NAME'} will return the IP address or host name.  If you need
the IP address rather than the name you could do something like:

if ($ENV{'SERVER_NAME'} =~ /[a-z]+/gi) {
   $serverip = &dns_get_ip($ENV{'SERVER_NAME');
}

Not sure how to do the dns lookup, I'm afraid!

Cheers.


Nigel
-- 
Girton College, Cambridge, England, CB3 0JG.             Tel: 0411 384803

http://welcome.to/nigels                             nigel.parker@iee.org



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

Date: 28 Sep 1998 12:58:28 -0400
From: Uri Guttman <uri@camel.fastserv.com>
Subject: Re: How to read contents of all *.TXT files in directory into one file?
Message-Id: <sar90j4w4wb.fsf@camel.fastserv.com>

>>>>> "MB" == Matthew Bafford <dragons@scescape.net> writes:

  MB> In article <x790j4utpb.fsf@sysarch.com> on 28 Sep 1998 11:45:36 -
  MB> 0400, Uri Guttman (uri@sysarch.com) pounded in the following 
  MB> text:

  MB> => i rarely see or use -w with -e. it doesn't make much sense! i
  MB> think even => randal and tom c. would agree with that. but i am
  MB> open to flaming => responses and counterexamples of where the
  MB> combo would be needed.

  MB> Hmm, when you are testing something before you post? :)

  MB> Larry Rosler caught me with that one. :(

i usually write small scripts with -w for testing. one liners i just
edit in the shell until i get them right.

uri

-- 
Uri Guttman                  Fast Engines --  The Leader in Fast CGI Technology
uri@fastengines.com                                  http://www.fastengines.com


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

Date: 28 Sep 1998 17:48:53 GMT
From: Eric Sheng <shenge@ece.ucdavis.edu>
Subject: Input Separator Matching
Message-Id: <6uoi65$6su$1@mark.ucdavis.edu>

Hi all,

	I have a question on the input separator $/.  Instead of trying to
matching the word "ERROR:", I want to match only if it is at the begining
of line: /^ERROR:/.  But I don't know how to set the $/ variable to
indicate match only "ERROR:" that start at the begining of line.

	Any ideas anyone?

--Eric


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

Date: Mon, 28 Sep 1998 18:04:45 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: Input Separator Matching
Message-Id: <1dQP1.952$7Q6.6388038@news2.voicenet.com>

Eric Sheng <shenge@ece.ucdavis.edu> wrote:
>	I have a question on the input separator $/.  Instead of trying to
>matching the word "ERROR:", I want to match only if it is at the begining
>of line: /^ERROR:/.  But I don't know how to set the $/ variable to
>indicate match only "ERROR:" that start at the begining of line.

Just tell it to match "\nERROR:".  This will fail if ERROR begins the
data you're looking at, though.  You'd have to implement something
special to catch that.

#!/usr/local/bin/perl

$/ = "\nERROR:";

while (<DATA>) {
        print "[[$_]]\n\n";
}

__END__
ERROR:

$/ doesn't match this ERROR:, or the first one.

ERROR:

And another chunk
of stuff.  Don't find this ERROR:

ERROR:
More stuff
ERROR:

-- 
Matt Knecht - <hex@voicenet.com>


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

Date: Mon, 28 Sep 1998 13:57:29 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: just to show you how screwed up the server is...
Message-Id: <comdog-ya02408000R2809981357290001@news.panix.com>
Keywords: from just another new york perl hacker

In article <356c5b2d.0@newsprime.tidalwave.net>, "caustic" <caustic@causticinteractive.nospam.com> posted:

>i tried out a sample script before using the headlines code:
>
>#!/usr/bin/perl
>   print ("hello world!\n");
>
>and i received an 'internal server error'.

>very bizarre.

not if you had read the documentation for writing CGI scripts or
server side includes.

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>


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

Date: Mon, 28 Sep 1998 13:31:16 -0500
From: marnold@novia.net (Matt Arnold)
Subject: MIME::Lite, changing bounce path
Message-Id: <marnold-2809981331160001@news.uswmedia.com>

I've been using the wonderful product MIME::Lite to send messages.  But I
can't figure out how to use MIME::Lite to specify where an
incorrectly-addressed message should bounce to.  I have been able to do
this with sendmail, but I can't figure out how to do it with MIME::Lite.

I thought that perhaps this isn't something that MIME::Lite attempts to
address, but the MIME::Lite docs specifically identify "Return-Path" as
one of the fields I can modify.  So here's what I'm trying.

my $msg = new MIME::Lite
  Return-Path =>'good_address@domain.com',
  To          =>'User <good_address@domain.com>',
  Cc          =>'bad_address@domain.com',
  Data        =>'foo'
$msg->send;

Mail is properly delivered to the good address.  But when the mail can't
be delivered to the bad address, the undeliverable mail doesn't bouce
where I want it to.  Even though I told MIME::Lite about the return path,
I can't find the "Return-Path" header anywhere in the message created by
MIME::Lite.   Hmmm.

I still have one idea which I haven't tried.  It seems MIME::Lite will let
me specify my own sendmail command line.  Perhaps I could slip in the
needed command line arguments this way.  Even if this would work, I'm
still wondering if there's a better way.

Anyone have any ideas for me?  I've searched DejaNews for an answer, but
have come up empty.

Thanks,
Matt


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

Date: Mon, 28 Sep 1998 12:41:05 -0500
From: "Mark Manning/Muniz Eng." <markem@flash.net>
Subject: Perl bug?  Pack command
Message-Id: <360FCA31.59E2@flash.net>

I posted this to the MacPerl list but I thought I'd post it here also
(and probably send in a bug report).  Just in case someone has an answer
about this.  :-)

I made this test program.  It goes like this:

#!/usr/bin/perl

	@array = ();
	$array[++$#array][0] = "This ";
	$array[$#array][1] = "is ";
	$array[$#array][2] = "a ";
	$array[$#array][3] = "test.";
	$array[++$#array][0] = "This ";
	$array[$#array][1] = "is ";
	$array[$#array][2] = "a ";
	$array[$#array][3] = "test.";
	$array[++$#array][0] = "This ";
	$array[$#array][1] = "is ";
	$array[$#array][2] = "a ";
	$array[$#array][3] = "test.";
	$array[++$#array][0] = "This ";
	$array[$#array][1] = "is ";
	$array[$#array][2] = "a ";
	$array[$#array][3] = "test.";
	$array[++$#array][0] = "This ";
	$array[$#array][1] = "is ";
	$array[$#array][2] = "a ";
	$array[$#array][3] = "test.";
	$array[++$#array][0] = "This ";
	$array[$#array][1] = "is ";
	$array[$#array][2] = "a ";
	$array[$#array][3] = "test.";
	$array[++$#array][0] = "This ";
	$array[$#array][1] = "is ";
	$array[$#array][2] = "a ";
	$array[$#array][3] = "test.";
	$array[++$#array][0] = "This ";
	$array[$#array][1] = "is ";
	$array[$#array][2] = "a ";
	$array[$#array][3] = "test.";

	print pack( "AAAA", @array ), "\n";
	print pack( "AAAA", $array[0] ), "\n";
	print pack( "AAAA", $array[0][0] ), "\n";
	exit( 0 );

What is returned is:

First print statement: AAAA
Second print statement: A
Third print statement: T

First, remember that "AAAA" means to return four strings space filled. 
(Which is different from "CCCC" which would mean to return four
characters.)

What I expected to get back was "This is a test." repeated in one long
string for the first PACK statement.  In the second one I expected to
get back just one repititon of the "This is a test.".  In the last I
expected to just get the word "This " back.

What the results mean to me is that the PACK command doesn't know how to
reference into the list of arrays properly.

Using the latest version of Perl found on CPAN.


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

Date: 28 Sep 1998 18:34:59 GMT
From: cpierce1@cp500.fsic.ford.com (Clinton Pierce)
To: "Mark Manning/Muniz Eng." <markem@flash.net>
Subject: Re: Perl bug?  Pack command
Message-Id: <6uoksj$b2l1@eccws1.dearborn.ford.com>

In article <360FCA31.59E2@flash.net>,
	"Mark Manning/Muniz Eng." <markem@flash.net> writes:
>I posted this to the MacPerl list but I thought I'd post it here also
>(and probably send in a bug report).  Just in case someone has an answer
>about this.  :-)
>
>I made this test program.  It goes like this:
> [bulk deleted]
>
>	print pack( "AAAA", @array ), "\n";

This is nonsense in this context.

>	print pack( "AAAA", $array[0] ), "\n";

And so is this.

>	print pack( "AAAA", $array[0][0] ), "\n";

This does something interesting, but probably not what you had in 
mind.

At this point, you have an array of arrays.  @array returns the references
to each of the array elements (which happen to be arrays).

>	print pack( "AAAA", @array ), "\n";

Makes no sense.  Something useful might be:

	print pack( "AAAA", @{$array[0]}), "\n";

Yeilds "Tiat".  Or even more useful:

	print pack( "A*A*A*A*", @{$array[0]}), "\n";

Yeilds "This is a test".  If you want to give pack an array, you have
to give it an _array_.  Not a reference to one.  (Which is a scalar...
I guess...it's not what you want anyway).

>First, remember that "AAAA" means to return four strings space filled. 
>(Which is different from "CCCC" which would mean to return four
>characters.)

Ahh...but you didn't finish reading...or read carefully enough...

>What I expected to get back was "This is a test." repeated in one long
>string for the first PACK statement.  In the second one I expected to
>get back just one repititon of the "This is a test.".  In the last I
>expected to just get the word "This " back.
>
>What the results mean to me is that the PACK command doesn't know how to
>reference into the list of arrays properly.

They mean something completely different to me.  :-)

--excerpt----
Blue Camel, Chapter 3: pack()

 ..the length on an "a" [and presumably an "A"] field applies to only
one string:

	$out=pack "a4", "abcd", "x", "y", "z";   # "abcd"

To get around that limitation, use multiple specifiers:


	$out=pack "aaaa", "abcd", "x", "y", "z";   # "axyz"
	$out=pack "a" x 4, "abcd", "x", "y", "z";   # "axyz"

--end excerpt----

Good luck!

-- 
+------------------------------------------------------------------------+
|  Clinton A. Pierce    |   "If you rush a Miracle Man,   | http://www.  |
|  cpierce1@ford.com    |     you get rotten miracles"    | dcicorp.com/ |
| fubar@ameritech.net   |--Miracle Max, The Princess Bride| ~clintp      |
+------------------------------------------------------------------------+
GCSd-s+:+a-C++UALIS++++P+++L++E---t++X+b+++DI++++G++e+>++h----r+++y+++>y*



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

Date: Tue, 29 Sep 1998 00:31:31 +0800
From: "Benjamin" <bench@surfshop.net.ph>
Subject: Perl-CGI & metasend
Message-Id: <6uoe5b$jsg$1@tempo.news.iphil.net>

Has anyone tried using metasend with Perl-CGI?
I wonder why it's not working with CGI, althought it works well
if it's used in a Perl script. Here isthe line where it is invoked in the
CGI:

system("$METASEND -b -s $subject -F $from -t $to -f $file1 -e $encoding -m
TEXT/PLAIN >/home/bench/debug.mime");

The content of debug.mime is:

Invalid content-type specified

What could be reason?





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

Date: 28 Sep 1998 18:12:24 GMT
From: Joseph Davidson <jhd@saltmine.radix.net>
Subject: Re: Problem with Text::ParseWords Solved
Message-Id: <6uoji8$ev1$1@news1.Radix.Net>


Problem solved

Fred Richards <gadget@bc.sympatico.ca> noted that I failed to distinguish
between forward / and backslashes \ in my   s|/|:|g; code.  It should have
been s|\\|:|g;

Joseph Davidson <jhd@saltmine.radix.net> wrote:


: Using 5.003 and Text::ParseWords I am having this problem.

: I use Parsewords to be able to tokenize a string around quotes.  This
: enable me to read Eudora address books for www.interguru.com/mailconv.htm,
: my addressbook conversion service.

: The code fails with the following input.

: alias "Judy\John Xxxxx" jhxxxxxB@slxx.net 

: with the following message

: Unmatched quote at (eval 1) line 31  

: If I delete the slash it works.

: I have attempted to trap the problem by deleting the slash, but it doesn't
: work

: Here is the relevant code, and the output

: -----------------------  CODE -------------
: 	print "JHD2   $_ \n";
: 	s/\'//g;
:         s|/|:|g;
:         $a = tr/"/"/;
:         #@@@@
:         print "JHD3   A= $a $_ \n";
:         if (tr/"/"/%2 !=0) # to prevent unterminated quotes
:                 # (which should not exist, but ocasionaly do)
:                 # from terminating the script with a 500
:                 # server error. The garbled line will remain
:                 # garbled.
:                 {
:                 print "JHD1   $_ \n";
:                 s/ / "/;
:                 }              
: ----------------------- END Code ---------------------------
: -----------------------------  BEGIN output -----------
: JHD2   alias "Judy\John Xxxxx" jhxxxxx@slxx.net

: JHD3   A= 2 alias "Judy\John Xxxxx" jhxxxxx@slxx.net

: Unmatched quote at (eval 1) line 31                                            

: ------ END output ----------------------------------------
: note that my attempt to get rid of the slash and replace it with a colon
: does not work

: Thanks

: Joe Davidson 
: ----------------------------------------------------------------------
: Joseph Davidson Ph.D.
: InterGuru -- Internet Engineering
: Perl/CGI, E-mail address list conversion service
: 1501 Dublin Drive, Silver Spring, Md. 20902
: voice 301 593 4152 ; fax 301 593 2541
: jdavidson@interguru.com, http://www.interguru.com
: ----------------------------------------------------------------------

-- 
----------------------------------------------------------------------
Joseph Davidson Ph.D.
InterGuru -- Internet Engineering
Perl/CGI, E-mail address list conversion service
1501 Dublin Drive, Silver Spring, Md. 20902
voice 301 593 4152 ; fax 301 593 2541
jdavidson@interguru.com, http://www.interguru.com
----------------------------------------------------------------------


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

Date: Mon, 28 Sep 1998 11:46:42 +0000
From: jasonW <"westi"@(remove)leland.stanford.edu>
Subject: question concerning gethostbyaddr
Message-Id: <6uold4$e9m$1@nntp.Stanford.EDU>

Is there a way I can have my script check an I.P address for the host
name (like using nslookup). The gethostbyaddr functions seems like it
should do the trick, but I don't understand the format it requires,
especially ADRTYPE. If anyone could clarify things for me I would really
appreciate it.


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

Date: 28 Sep 1998 13:05:11 -0400
From: Uri Guttman <uri@camel.fastserv.com>
Subject: Re: reducing a variable
Message-Id: <sar7lyow4l4.fsf@camel.fastserv.com>

>>>>> "KB" == Kevin Bartz <kevinbartz@geocities.com> writes:

  KB> $newvar=3Dunpack("a8",$oldvar);

  KB> The one line solution!

but the 100 line followup with 2 copies of the original post!

try editing the original post and not posting mime or html to this
group.

<snip of redundant text and html and mime headers>

uri

-- 
Uri Guttman                  Fast Engines --  The Leader in Fast CGI Technology
uri@fastengines.com                                  http://www.fastengines.com


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

Date: Mon, 28 Sep 1998 13:14:04 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: script: scriptMangle!
Message-Id: <360FC3DC.D18E3830@negia.net>

Elaine -HappyFunBall- Ashton wrote:
> 
> Russell Schulz wrote in message
> <19980927.134531.4H0.rnr.w164w@locutus.ofB.ORG>...
> >> To make Perl 'unreadable' is almost blasphemy.
> 
> >I thought it was the point of the Obfuscated Perl Contest.
> 
> To obfuscate is different than to obscure. Perhaps a dictionary will help?
[SNIP]

hmm, lets see. open up websters, find obfuscate. ahh here we are:

  obfuscate 2. to make *obscure* or unclear

yep, the dictionary helps. they can indeed be used synonymously. :)

cheers,

-- 
Dan Boorstein   home: danboo@negia.net  work: danboo@y-dna.com

 "THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."
                         - Cosmic AC


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

Date: Mon, 28 Sep 1998 13:11:00 -0400
From: "Adrian G. Klingel" <klingela@nt.com>
Subject: sqerl question
Message-Id: <360FC324.CA96B891@nt.com>

Perl people,

I'm new to perl, and I'm supporting this program that runs from sqerl,
which is supposed to access a bunch of perl libraries.  Unfortunately,
it can't find the libraries unless everything, libraries and sqerl
executable included, is located in $HOME.  It's running in another
environment, but I can't see any environment variables telling it where
to find the libraries.  I've put it in the PATH to no avail.  I can't
find a damn thing on sqerl on the web.  Doesn't even pop up on any
search engines, except to appear on a couple of people's resumes.  I've
tried to RTFM, I've got the camel book and the Waite Group Press Perl 5
book, can't find anything.  Please help me.

Adrian


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

Date: 28 Sep 1998 11:34:32 -0700
From: fox-at-enchanter-net@SPAM.BLOCK (Brian Kendig)
Subject: Where can I find a member() function?
Message-Id: <6uokro$oqj$1@shell11.ba.best.com>

I want a subroutine which takes a scalar and a list as input, and
returns true if a copy of the scalar exists in the list.

This seems so basic and fundamental that I'm surprised not to find it
mentioned in the camel book, but I can't even find any modules on CPAN
which implement it!  Are Perl hackers not supposed to think of lists
this way?

I would write a member() function myself, except I'm having trouble
figuring out how to pass an array by reference rather than by value.

-- 
 ____    |\/|                  Brian Kendig   
 \  /\   / ..__.       fox at enchanter net     You are in a maze of twisty
  \/  \__\   _/    http://www.enchanter.net/    little passages, all alike.
   \__   __  \_       Be insatiably curious.  
      \____\___\            Ask "why" a lot.  


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

Date: Mon, 28 Sep 1998 18:49:05 GMT
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: Where can I find a member() function?
Message-Id: <6uolmg$jk0@flatland.dimensional.com>

fox-at-enchanter-net@SPAM.BLOCK (Brian Kendig) writes:

> I want a subroutine which takes a scalar and a list as input, and
> returns true if a copy of the scalar exists in the list.
>
> This seems so basic and fundamental that I'm surprised not to find it
> mentioned in the camel book, but I can't even find any modules on CPAN
> which implement it!  Are Perl hackers not supposed to think of lists
> this way?
>
> I would write a member() function myself, except I'm having trouble
> figuring out how to pass an array by reference rather than by value.

What are you trying to do that Perl's builtin "grep" doesn't handle?
Or have I just become troll bait?

-- 
Michael Fuhr
http://www.fuhr.net/~mfuhr/


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

Date: Mon, 28 Sep 1998 10:53:40 -0700
From: Alex Guberman <alex@digi-q.com>
Subject: Win32::Registry
Message-Id: <360FCD24.6E25@digi-q.com>

Hi,

I'm trying to get the list of running applications from WinNT/95. 
Here's the script that I have, but it seems to list all the software
that I have and some other stuff:

use Win32::Registry;
my $Register = "";
my ($hkey, @key_list, $key);

$HKEY_LOCAL_MACHINE->Open($Register,$hkey)|| die $!;
$hkey->GetKeys(\@key_list);
foreach $key (@key_list) 
        {
        print "$key\n\n"; 
        }
$hkey->Close();

Please help,

Alex


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

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


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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