[14039] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1449 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Nov 21 09:10:13 1999

Date: Sun, 21 Nov 1999 06:06:33 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <943193192-v9-i1449@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 21 Nov 1999     Volume: 9 Number: 1449

Today's topics:
    Re: Can Perl Answer Prompts <zigouras@mail.med.upenn.edu>
    Re: Can perl load a html output from another server?? (Abigail)
        can't find db.h lib.db <bunjonwa@trek.CS.ORST.EDU>
    Re: Date Problem - Whats the deal with this? (Abigail)
    Re: Encryption Algorithm for Perl Source Code?? jut@letterbox.com
    Re: Encryption Algorithm for Perl Source Code?? (Simon Cozens)
    Re: Generating pi <jarrowwx@NOSPAM.home.com>
    Re: hashes <ron@savage.net.au>
    Re: hashes <lr@hpl.hp.com>
        Help w/ DBI (Adam Levenstein)
    Re: Help w/ DBI (Abigail)
    Re: Help With CyberCash.... <rdutt@voxel.net>
    Re: Help with understanding syntax <crdevilb@mtu.edu>
    Re: Help with understanding syntax (Abigail)
    Re: Help with understanding syntax (Abigail)
    Re: How do I take all of the email addresses out of an  (Tad McClellan)
        How to Capitalize the first letter of a word an or whol (Slim)
    Re: How to Capitalize the first letter of a word an or  (Abigail)
    Re: How to create file in other directory ? (Honey)
    Re: How to create file in other directory ? (Honey)
    Re: How to create file in other directory ? (Simon Cozens)
        Perl and Linux (Henner Graubitz)
        reading binary digits with oct (David Foster)
        RegEx: Replace new lines with <br> etc. <brackett@pobox.com>
    Re: RegEx: Replace new lines with <br> etc. <slanning@bu.edu>
    Re: RegEx: Replace new lines with <br> etc. <lr@hpl.hp.com>
    Re: Search Engine (brian d foy)
    Re: sendmail pipe <dukat@flash.net>
    Re: SQL questions and Win32::ODBC (Honey)
    Re: Time modules. <bwalton@rochester.rr.com>
    Re: What is a good book on Perl <wyzelli@yahoo.com>
    Re: alias a mailer (Martien Verbruggen)
        Best Database Engine? <jamesthurley@hotmail.com>
    Re: Best Database Engine? (Thunderdust (TomH))
    Re: Best Database Engine? <gellyfish@gellyfish.com>
    Re: Date Problem - Whats the deal with this? <gellyfish@gellyfish.com>
    Re: help need please on perl <gellyfish@gellyfish.com>
    Re: Help w/ DBI <gellyfish@gellyfish.com>
        How do I take all of the email addresses out of an emai <poohba@io.com>
    Re: How to Capitalize the first letter of a word an or  <gellyfish@gellyfish.com>
    Re: How to Capitalize the first letter of a word an or  (Slim)
    Re: How to create file in other directory ? <gellyfish@gellyfish.com>
    Re: how to send data back and forth over sockets <flavell@mail.cern.ch>
        HTML format <grossole@slu.edu>
        New dialect of perl: xperl (or reinventing perl, or per <schneiker@jump.net>
    Re: newbie : looking for a script that reads all  the f <gellyfish@gellyfish.com>
    Re: newbie : looking for a script that reads all  the f (Slim)
    Re: Perl and Linux <gellyfish@gellyfish.com>
    Re: Perl Security jampa@my-deja.com
    Re: Perl Security <gellyfish@gellyfish.com>
        Q: How to read command-line arguments.  Not in FAQ. (Phil)
    Re: Q: How to read command-line arguments.  Not in FAQ. <gellyfish@gellyfish.com>
    Re: SQL questions and Win32::ODBC <gellyfish@gellyfish.com>
        Writing data in another server jampa@my-deja.com
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sun, 21 Nov 1999 00:10:14 -0500
From: Nico Zigouras <zigouras@mail.med.upenn.edu>
To: JG <gebhardt@erinet.com>
Subject: Re: Can Perl Answer Prompts
Message-Id: <Pine.OSF.4.21.9911210009370.18074-100000@mail.med.upenn.edu>

There is a Perl module called Expect like
use Expect;
that can do all of the expect stuff.

Go to cpan.org to get it and read the docs if you do not have it.


On Sat, 20 Nov 1999, JG wrote:

> Date: Sat, 20 Nov 1999 12:14:00 -0500
> From: JG <gebhardt@erinet.com>
> Newsgroups: comp.lang.perl.misc
> Subject: Can Perl Answer Prompts
> 
> Can perl answer prompts similar to the way expect does? If so, any
> special moduals needed? An exmple available?
> 
> 
> Thanks
> 
> J Gebhardt
> 
> 



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

Date: 21 Nov 1999 01:26:11 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Can perl load a html output from another server??
Message-Id: <slrn83f7qr.m2v.abigail@alexandra.delanet.com>

Nicky (bay@serve.com) wrote on MMCCLXXIII September MCMXCIII in
<URL:news:01bf33cd$998b03c0$030101a8@genma>:
$$ Hi all.
$$ 
$$ Is it allowed to load the output from a cgi from another server
$$ so that I can process it?
$$ 
$$ eg. loading search results from multiple search engines and displaying
$$ them in my own formats.

Doubtful. Of course, you can just do it, and see what happens if one
of the search engines whose works you're reaping is going to sue you.

$$ If its possible, how do I go about it?


You hire a programmer.



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: Sat, 20 Nov 1999 22:13:46 -0800
From: Waranun Bunjongsat <bunjonwa@trek.CS.ORST.EDU>
Subject: can't find db.h lib.db
Message-Id: <Pine.GSO.4.03.9911202211580.3441-100000@trek.CS.ORST.EDU>

Hi,

	I tried to build DB_File, but I can't find db.h and lib.db. Are
they supposed to come with Perl5 ?

Thanks,

Waranun,



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

Date: 21 Nov 1999 01:05:29 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Date Problem - Whats the deal with this?
Message-Id: <slrn83f6k1.m2v.abigail@alexandra.delanet.com>

larry (larrymac@strato.net) wrote on MMCCLXXIII September MCMXCIII in
<URL:news:SzJZ3.32519$YI2.1567924@typ11.nn.bcandid.com>:
-- I'm new to perl and am trying to track down a falt on a hit statistics
-- program (called counter.pl) that is returning the wrong date.
-- Its returning 10/20/99 on 11/20/99 yet when I look at the file dates on the
-- system they are correct!

Wow, there are 20 months in 1999? 

-- here is what I have, does this look ok?

No.

I suggest you read the manpage about localtime. And when you are
at it, read sprintf as well. Or the POSIX manpage.

-- # Get the Date For Logging Purposes
-- if ($uselog == 1) {
--    ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
--    if ($sec < 10)  { $sec = "0$sec";   }
--    if ($min < 10)  { $min = "0$min";   }
--    if ($hour < 10) { $hour = "0$hour"; }
--    if ($mday < 10) { $mday = "0$mday"; }
--    if ($mon < 10)  { $monc = "0$mon";  }
--    $date = "$hour\:$min\:$sec $mon/$mday/$year";
-- }
--
-- The time and year is working ok, just the month is wrong.


Well, the year will look awfully funny in less than 50 days.



Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


  -----------== 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: Sun, 21 Nov 1999 09:45:34 GMT
From: jut@letterbox.com
Subject: Re: Encryption Algorithm for Perl Source Code??
Message-Id: <3837bea5.8544017@news.singnet.com.sg>

The mystery has been solved!

After several sleepless nights, I've finally found out how they did
it. It's through the use of this software called ShroudIt! It's really
quite a piece of work. 

The code IS obfuscated and defeats all my attempts to print the
plain-text code to a file because it's really the compiler which sort
of decodes it. However, with the aid of my trusty debugger, I managed
to view the plain-text nevertheless. :)

Thanks to all who have contributed or thought of contributing.


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

Date: 21 Nov 1999 09:47:15 GMT
From: simon@brecon.co.uk (Simon Cozens)
Subject: Re: Encryption Algorithm for Perl Source Code??
Message-Id: <slrn83fft3.qos.simon@othersideofthe.earth.li>

jut@letterbox.com (comp.lang.perl.misc):
>The code IS obfuscated and defeats all my attempts to print the
>plain-text code to a file because it's really the compiler which sort
>of decodes it. However, with the aid of my trusty debugger, I managed
>to view the plain-text nevertheless. :)

Would this be a bad time to mention B::Deparse, then?

-- 
Don't get suckered in by the comments -- they can be terribly misleading.
Debug only code.
		-- Dave Storer


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

Date: Sun, 21 Nov 1999 06:13:53 GMT
From: John Arrowwood <jarrowwx@NOSPAM.home.com>
Subject: Re: Generating pi
Message-Id: <38378DC1.EBD698ED@NOSPAM.home.com>

Mark-Jason Dominus wrote:

> In article <3836EBC1.EC8C507E@NOSPAM.home.com>,
> John Arrowwood  <jarrowwx@NOSPAM.home.com> wrote:
> >Now, does anybody know if this is the same basic method used by people when
> >they calculate PI to a million decimal places or more?  Or is there yet
> >another formula that can be used?
>
> They definitely don't use that fomula, because it converges really
> really slowly.
>
> A web search turned up a whole lot of relevant material, including
>
>         http://www.cecm.sfu.ca/organics/papers/borwein/paper/html/paper.html
>
> This is probably more useful than asking the folks in this group.

Thanks for the link!  Actually, asking in this group WAS useful, because I got
that link!  I'd searched for several hours one day and the best I could find
was where someone had calculated many digits, not HOW to calculate many
digits.   I know, that doesn't speak well of my web searching skills, does
it? :)

Thanks again!



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

Date: Sun, 21 Nov 1999 20:17:10 +1100
From: "Ron Savage" <ron@savage.net.au>
Subject: Re: hashes
Message-Id: <jROZ3.6541$MZ.52167@ozemail.com.au>

Use $hash{lc($username)} = $loginTime;

--
Cheers
Ron & Pen Savage
ron@savage.net.au    pen@savage.net.au
http://savage.net.au/index.html
Frank Hale <frankhale@trespass.net> wrote in message
news:38098454.9254FB38@trespass.net...
> Okay I got a hash which stores usernames with there login times. Problem
> is I don't want a duplicate key in the hash. For instance say user
> "john" logs in at 13:22 and then logs in again at 13:45, I don't want
> him in the hash 2 times. How can I test for this and
> only enter him in the list once?
>
> --
> From:  Frank Hale
> Email: frankhale@yahoo.com
> ICQ:   7205161




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

Date: Sun, 21 Nov 1999 01:46:59 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: hashes
Message-Id: <MPG.12a15f63b0c2bb1b98a244@nntp.hpl.hp.com>

[Rearranged to be readable.  WHEN will people learn?]

In article <jROZ3.6541$MZ.52167@ozemail.com.au> on Sun, 21 Nov 1999 
20:17:10 +1100, Ron Savage <ron@savage.net.au> says...
> Frank Hale <frankhale@trespass.net> wrote in message
> news:38098454.9254FB38@trespass.net...
> > Okay I got a hash which stores usernames with there login times. Problem
> > is I don't want a duplicate key in the hash. For instance say user
> > "john" logs in at 13:22 and then logs in again at 13:45, I don't want
> > him in the hash 2 times. How can I test for this and
> > only enter him in the list once?

> Use $hash{lc($username)} = $loginTime;

That records the last login time for that username.  If you want the 
first login time, use the 'or-cache':

$hash{lc($username)} ||= $loginTime;

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


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

Date: Sun, 21 Nov 1999 06:37:36 GMT
From: che@worker.com (Adam Levenstein)
Subject: Help w/ DBI
Message-Id: <3837931e.294422215@news.psu.edu>

Does anybody here know the DBI module well?

I'm trying to connect to a MySQL server, but my script doesn't work
and I don't know why. It doesn't give me an error, but doesn't add the
form info to the DB either.

Could someone take a look and let me know what's wrong? I'd appreciate
it.

Thanks,

Adam

P.S. $user, $password, and $host are defined, but I took them out of
this code for security reasons.



#!/usr/bin/perl

use DBI;

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

@pairs = split(/&/, $buffer);		
foreach $pair (@pairs) {
	($name, $value) = split(/=/, $pair);		# decode pairs
	$value =~ tr/+/ /;				# trans all
'+' to ' '
	$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
	$FORM{$name} = $value;
}

$loc = $FORM{'location'};
$roomies = $FORM{'no_roomies'};
$ownroom = $FORM{'ownroom'};
$rent = $FORM{'rent'};
$deposit = $FORM{'deposit'};
$utilities = $FORM{'utilities'};
$parking = $FORM{'parking'};
$pets = $FORM{'pets'};
$name = $FORM{'name'};
$email = $FORM{'email'};
$phone = $FORM{'phone'};
$description = $FORM{'description'};

$driver = "mysql";
$db = 'entries';

$dbh = DBI->connect("DBI:mysql:database=$db;host=$host", $user,
$password, {RaiseError => 1});

$dbh->do("INSERT INTO sublets VALUES ('$loc, $roomies, $ownroom),
$rent, $deposit, $utilities, $parking, $pets, $name, $email, $phone,
$description')", undef, $dbh->quote("number"), $dbh->quote("name"));

print "Content-type: text/html\n\n";
print "$FORM{'location'}";

$dbh->disconnect;


------------------------------------------------------
"You must be in love with the devil.  You probably 
sold your soul to him to learn how to play the banjo.
May God help you!"

              - "Bishop" Norman Boyd


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

Date: 21 Nov 1999 01:29:25 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Help w/ DBI
Message-Id: <slrn83f80u.m2v.abigail@alexandra.delanet.com>

Adam Levenstein (che@worker.com) wrote on MMCCLXXIII September MCMXCIII
in <URL:news:3837931e.294422215@news.psu.edu>:
() 
() Could someone take a look and let me know what's wrong? I'd appreciate
() it.
() 
() 
() #!/usr/bin/perl

There's no -w.
There's no -T.
There's no use strict;
There's no use CGI;



No need to continue.



Abigail
-- 
perl -e 'for (s??4a75737420616e6f74686572205065726c204861636b65720as?;??;??) 
             {s?(..)s\??qq \?print chr 0x$1 and q ss\??excess}'


  -----------== 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: Sat, 20 Nov 1999 22:57:28 +0800
From: Raj Dutt <rdutt@voxel.net>
Subject: Re: Help With CyberCash....
Message-Id: <3836B6D8.BC30CC93@voxel.net>

> extensively with CyberCash about this and they indicate it is not
> their policy to help with stuff like this. I have modified the script

This has absolutely nothing to do with Cybercash. And I don't see what it has to
do with perl either.

Cybercash merely returns the status of the credit card transaction. What you do
with that status is up to you.

They are 100% correct in saying that it isn't their problem.

Regards,
-- 
+-----------------------------------------------------+
| Raj Dutt			raj@voxel.net         |
| CTO, Network Administrator	518.330.7597          |
| Voxel Dot Net, Inc		http://www.voxel.net  |
+-----------------------------------------------------+


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

Date: 21 Nov 1999 08:20:10 GMT
From: Colin R. DeVilbiss <crdevilb@mtu.edu>
Subject: Re: Help with understanding syntax
Message-Id: <8189vq$oka$1@campus3.mtu.edu>

Abigail <abigail@delanet.com> wrote:
> Brett W. McCoy (bmccoy@news.lan2wan.com) wrote on MMCCLXX September
> MCMXCIII in <URL:news:slrn8372ji.5rb.bmccoy@dragosani.lan2wan.com>:
> $$ Also sprach marius_13@my-deja.com <marius_13@my-deja.com>:
> $$ 
> $$ >how would the following c statement be written in perl:
> $$ >
> $$ >switch(foo)
> $$ >{
> $$ >  case 1:
> $$ >          printf ("case 1\n");
> $$ >          break;
> $$ >  case 2:
> $$ >          printf ("case 2\n");
> $$ >          break;
> $$ >  default:
> $$ >          print ("no match\n");
> $$ >          break;
> $$ >
> $$ >}

> This one is probably closer to the C syntax, except you have to
> calculate wether it jumps to the default or not:

>     goto 1 <= $foo && $foo <= 2 ? "case_$foo" : "default"; {
>         case_1:  printf "case 1\n";
>                  last;
>         case_2:  printf "case 2\n";
>                  last;
>         default: printf "no match\n";
>                  last;
>     }


> The advantage over the "for" and the "if/else" solutions are that
> if you have 47 cases, it doesn't have to try them all before defaulting
> to default. (Assuming you can easily calculate the correct label).

why not:
    (
        {
            1 => sub { printf "case 1\n" },
            2 => sub { printf "case 2\n" },
        }->{$foo} ||
        sub { printf "no match\n" }
    )->();

this should have the same constant-time performance as you describe
above, but without the goto--any comments?

-- 
Colin DeVilbiss
crdevilb@mtu.edu


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

Date: 21 Nov 1999 04:37:40 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Help with understanding syntax
Message-Id: <slrn83fj1i.m2v.abigail@alexandra.delanet.com>

Colin R. DeVilbiss (crdevilb@mtu.edu) wrote on MMCCLXXIII September
MCMXCIII in <URL:news:8189vq$oka$1@campus3.mtu.edu>:
;; Abigail <abigail@delanet.com> wrote:
;; 
;; > This one is probably closer to the C syntax,
;; 
;; why not:
;;     (
;;         {
;;             1 => sub { printf "case 1\n" },
;;             2 => sub { printf "case 2\n" },
;;         }->{$foo} ||
;;         sub { printf "no match\n" }
;;     )->();
;; 
;; this should have the same constant-time performance as you describe
;; above, but without the goto--any comments?


I haven't programmed much the last years in C. But in the time I was
still using C, there wasn't anyway to make piece of C code that looks
like your suggestion.

I guess C9X changed the language a lot then.



Abigail
-- 
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))


  -----------== 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: 21 Nov 1999 04:49:48 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Help with understanding syntax
Message-Id: <slrn83fjo1.m2v.abigail@alexandra.delanet.com>

Colin R. DeVilbiss (crdevilb@mtu.edu) wrote on MMCCLXXIII September
MCMXCIII in <URL:news:8189vq$oka$1@campus3.mtu.edu>:
;; Abigail <abigail@delanet.com> wrote:
;; 
;; > This one is probably closer to the C syntax,
;; 
;; why not:
;;     (
;;         {
;;             1 => sub { printf "case 1\n" },
;;             2 => sub { printf "case 2\n" },
;;         }->{$foo} ||
;;         sub { printf "no match\n" }
;;     )->();
;; 
;; this should have the same constant-time performance as you describe
;; above, but without the goto--any comments?


I haven't programmed much the last years in C. But in the time I was
still using C, there wasn't anyway to make piece of C code that looks
like your suggestion.

I guess C9X changed the language a lot then.



Abigail
-- 
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))


  -----------== 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: Sat, 20 Nov 1999 17:16:47 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How do I take all of the email addresses out of an email?
Message-Id: <slrn83e7ef.5b8.tadmc@magna.metronet.com>

On Sat, 20 Nov 1999 13:24:37 -0500, Poohba <poohba@io.com> wrote:

>I am trying to get all of the email addresses out of a letter that I have
>so that I can put in my address book.


   Did you maybe forget to mention what problem it is that you
   are having?

   It is customary to include a question in your post.



   Show us the code (and sample data) you have so far, and we'll 
   help you fix it.


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sun, 21 Nov 1999 09:27:17 GMT
From: ShadeyGradey@linuxfreak.com (Slim)
Subject: How to Capitalize the first letter of a word an or whole word
Message-Id: <3837ba56.17617581@news.inet4u.com>

thanks...
-Slim-


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

Date: 21 Nov 1999 04:58:13 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: How to Capitalize the first letter of a word an or whole word
Message-Id: <slrn83fk8c.m2v.abigail@alexandra.delanet.com>

Slim (ShadeyGradey@linuxfreak.com) wrote on MMCCLXXIII September MCMXCIII
in <URL:news:3837ba56.17617581@news.inet4u.com>:
&& thanks...


You are welcome.


Abigail
-- 
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
 |perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
 |perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
 |perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;


  -----------== 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: Sun, 21 Nov 1999 05:21:40 GMT
From: honeypot@tienet.net (Honey)
Subject: Re: How to create file in other directory ?
Message-Id: <38378324.15325525@news-server>

you can give it it's physical location like

usr/www/html_docs/userid/directory

or you can ../directory if its a above or equal to the current
directory  or ./directory name if it is within the current directory

On Sun, 21 Nov 1999 12:08:38 +0800, "Henry E. P."
<hep05@jakartamail.com> wrote:

>Please help me how to create file in other directory ?
>I've to try this syntax but it doesn't work.
>
>open HTML, "> \\test\\test.html;
>
>



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

Date: Sun, 21 Nov 1999 05:23:53 GMT
From: honeypot@tienet.net (Honey)
Subject: Re: How to create file in other directory ?
Message-Id: <383783f5.15535134@news-server>

	foreach $Name (@AllNames) {
		if (-d $Name) {next}
		{ 	print  "$Name"}
		}

hope this helps


On Sun, 21 Nov 1999 12:08:38 +0800, "Henry E. P."
<hep05@jakartamail.com> wrote:

>Please help me how to create file in other directory ?
>I've to try this syntax but it doesn't work.
>
>open HTML, "> \\test\\test.html;
>
>



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

Date: 21 Nov 1999 05:38:53 GMT
From: simon@brecon.co.uk (Simon Cozens)
Subject: Re: How to create file in other directory ?
Message-Id: <slrn83f1bc.l88.simon@othersideofthe.earth.li>

Honey (comp.lang.perl.misc):
>On Sun, 21 Nov 1999 12:08:38 +0800, "Henry E. P." 
><hep05@jakartamail.com> wrote:
>>Please help me how to create file in other directory ?
>>I've to try this syntax but it doesn't work.
>>open HTML, "> \\test\\test.html;
>	foreach $Name (@AllNames) {
>		if (-d $Name) {next}
>		{ 	print  "$Name"}
>		}
>
>hope this helps

Notice how *you* didn't quote this in the sane order, but everyone
else on the newsgroup does. I can't understand how people can do this -
do they simply *not see* everyone elses' responses?

Anyway:

The attempted code Henry wrote was to write a file in another directory.

Your code, which doesn't compile, and doesn't acknowledge the existence
of unless or even if(!...), appears to print all the non-directories in
an array. Bit of a difference, no?

Henry, your code (which is missing a quote before the semicolon) looks
fine, but you DIDN'T TEST THE RETURN VALUE OF OPEN()! Sinner!
Maybe if you do that, you'll get a clearer idea of why it `doesn't
work'.

You may also save yourself a lot of pain by using forward slashes - the
Windows API deep down supports them, but that looks like UNIX so it
tries to hide this fact.

Hence, I suggest:

 open HTML, ">/test/test.html" or die "Foo, $!";

Simon

-- 
Goda's Truism:
	By the time you get to the point where you can make ends meet,
	somebody moves the ends.


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

Date: Sun, 21 Nov 1999 09:21:13 GMT
From: kissgfjg@sp.zrz.tu-berlin.de (Henner Graubitz)
Subject: Perl and Linux
Message-Id: <3837b966.3072646@news.zrz.tu-berlin.de>

Hi friends, 

first of all I know for my problem c.o.l.networking would be better,
but 

I am searching very friendly people who develop cgi scripts under
Linux (i got Suse 6.2) and are able to test their scripts under Linux
with their Apache server and a browser. 

Is it possible that these people can send me their httpd.conf,
srm.conf and access.conf as an attachement to my e-mail address 

kissqfjg@sp.zrz.tu-berlin.de

I tried to configure but I am helpless. I do not need any suggestions
"read the HOWTO's" or your scrip and your rights are wrong or
something like that. Thats what I have done and that is because I am
helpless. 

Please help me, I am out of power now and I do not know what to do
else. 

A lot of thanks to the people who send it 


Henner Graubitz / Germany 



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

Date: 21 Nov 1999 01:28:11 -0500
From: dfoster@panix.com (David Foster)
Subject: reading binary digits with oct
Message-Id: <8183dr$64b$1@panix6.panix.com>
Keywords: oct binary perldoc

For some reason, I can't get 

print oct("0b10101");  # that's a zero-b, though I tried Oh-b as well

to work for me, having tried on various installations.  It just
keeps returning "0".  Is this supposed to work?  Or am I missing
something basic in the syntax here?

Binary strings seems to be a new feature; maybe the docs got a bit ahead
of the language, or is there a problem in the configurations I've got?

-- 
-- 
 David Foster            |  I am a camera with its shutter open
 dfoster@panix.com       |  quite passive, recording not thinking
 finger for PGP key      |              -- Christopher Isherwood


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

Date: Sun, 21 Nov 1999 00:35:51 -0800
From: "Brackett" <brackett@pobox.com>
Subject: RegEx: Replace new lines with <br> etc.
Message-Id: <818b5u$mnv$1@newsfeed.smartt.com>

Apologies for such an easy question, but I can't seem to get this to =
work. I want to do some basic text to HTML -- not enough to warrant =
using txt2HTML -- so I'm trying to get a small RegEx working. Basically, =
all I want to do is replace single line feeds  with <br> and replace =
double (or more line feeds) with <p>. That's about it.

For example, on the <p> front, I've been trying various permutations on =
the following to no avail.

s/\n{2,}/<p>/g;

If I just do s/\n/<p>/g; I get <p> breaks at the beginning of every new =
line, but there is some mystery character that I'm not matching that's =
preventing me turning back-to-back /n into a <p>.

Any ideas (on both the <p> and <br> question) much appreciationed.

--=20
P.



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

Date: 21 Nov 1999 04:35:44 -0500
From: Scott Lanning <slanning@bu.edu>
Subject: Re: RegEx: Replace new lines with <br> etc.
Message-Id: <kusemdkdw5r.fsf@strange.bu.edu>

"Brackett" <brackett@pobox.com> writes:
> If I just do s/\n/<p>/g; I get <p> breaks at the beginning of every
> new line, but there is some mystery character that I'm not matching
> that's preventing me turning back-to-back /n into a <p>.

Presumably you're reading the file line-by-line like

while(<FILE>){
    s/\n{2,}/<p>/g;
}

Unless you reset the $/ variable, the while() is going to
catch only one \n per iteration. HTML files generally aren't
tremendously huge, so slurping it all into memory shouldn't
be too bad

{
    undef $/;
    my $file = <FILE>;
    $file =~ s/\n{2,}/<p>/g;
    $file =~ s/\n/<br>/g;
    ...
}

When you undefine $/, then basically there are no longer
any "record" separators.

-- 
"It showed a lady, with a fur cap on and a fur stole, sitting upright
and holding out to the spectator a huge fur muff into which the whole
of her forearm had vanished!" --From Franz Kafka's Metamorphosis


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

Date: Sun, 21 Nov 1999 01:43:32 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: RegEx: Replace new lines with <br> etc.
Message-Id: <MPG.12a15ea1a23c22be98a243@nntp.hpl.hp.com>

In article <818b5u$mnv$1@newsfeed.smartt.com> on Sun, 21 Nov 1999 
00:35:51 -0800, Brackett <brackett@pobox.com> says...
> Apologies for such an easy question, but I can't seem to get this to =
> work. I want to do some basic text to HTML -- not enough to warrant =
> using txt2HTML -- so I'm trying to get a small RegEx working. Basically, =
> all I want to do is replace single line feeds  with <br> and replace =
> double (or more line feeds) with <p>. That's about it.
> 
> For example, on the <p> front, I've been trying various permutations on =
> the following to no avail.
> 
> s/\n{2,}/<p>/g;
> 
> If I just do s/\n/<p>/g; I get <p> breaks at the beginning of every new =
> line, but there is some mystery character that I'm not matching that's =
> preventing me turning back-to-back /n into a <p>.
> 
> Any ideas (on both the <p> and <br> question) much appreciationed.

The 'mystery character' is probably carriage-return "\r".  Try

  s/(\r?\n){2,}/<p>/g;

By the way, why is your 'newsreader' X-Newsreader: Microsoft Outlook 
Express 5.00.2919.6600 putting out the 'mystery' equals-sign on every 
line that isn't the end of a paragraph?  Consider using a real 
newsreader instead of that hunk of M$ crap.

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


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

Date: Sun, 21 Nov 1999 00:39:08 -0500
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Search Engine
Message-Id: <brian-ya02408000R2111990039080001@news.panix.com>

In article <38371F6A.85A8F01A@pacbell.net>, Jaime Perez <jaimedp@pacbell.net> posted:

> For those of you that are not helping me with the program, I would
> appreciate it if you kept
> your comments to yourselves.  I am a programmer!

i'd appreciate it if you didn't call yourself a programmer.  

> This place is for professionals like me trying to
> find solutions for not so evident
> problems.

when you can solve these problems on your own, grasshopper, then
you will be a programmer.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: Sun, 21 Nov 1999 05:47:04 GMT
From: Eric Miller <dukat@flash.net>
Subject: Re: sendmail pipe
Message-Id: <3837863F.18784D14@flash.net>

lee.lindley@bigfoot.com wrote:
> 
> You should check the return on that close(MAIL) just like
> you check the return on the open().

Thank you.  I can't tell you hoq much your advice is appreciated.

Eric Miller
dukat@flash.net


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

Date: Sun, 21 Nov 1999 05:32:29 GMT
From: honeypot@tienet.net (Honey)
Subject: Re: SQL questions and Win32::ODBC
Message-Id: <38378470.15657774@news-server>

I don't know if it's why it wont work on NT or not but I had a similar
problem with 95, that did not happen on 98..  I needed to install
DCOM95 for windows 95 so that the perl would run.  maybe there is a
DCOM for NT

On Sat, 20 Nov 1999 21:31:26 GMT, "Jim Schuman" <netanator@home.com>
wrote:

>Thank you very much.
>
>I did write the program quickly. Perhaps I did not find the error when I
>looked it over.
>
>I have had no problems with similiar programs on my comp at home (Win 98).
>However, my work computer (NT Workstation) is where the problems occured.
>
>I will give it a better lookover on Monday.
>
>Thanks again!
>Jim
>
>



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

Date: Sun, 21 Nov 1999 00:09:02 -0500
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Time modules.
Message-Id: <38377E6E.EE0EB62F@rochester.rr.com>

John Iyezack wrote:
> 
> Why does none of the time modules support converting time in military
> time ?  They can go from 13:00 to 1:00 pm.  But why not 1:00 pm to
 ...

use Date::Manip;
$TZ='EST';
print UnixDate(ParseDate('today 1:30 pm'),'%R');

prints:

13:30

-- 
Bob Walton


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

Date: Sun, 21 Nov 1999 15:41:36 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: What is a good book on Perl
Message-Id: <s2MZ3.45$OK4.1994@vic.nntp.telstra.net>

Abigail <abigail@delanet.com> wrote in message
news:slrn83dsem.m2v.abigail@alexandra.delanet.com...
> Jonathan Stowe (gellyfish@gellyfish.com) wrote on MMCCLXXII September
> MCMXCIII in <URL:news:8161op$78k$1@gellyfish.btinternet.com>:
>
>    - Cormen, Leiserson and Rivest: "Introduction to Algorithms".
>    - Chapman: "Perl, the Programmers Companion".
>    - Kernighan & Pike: "The Practice of Programming".
>    - Friedl: "Mastering Regular Expressions".
>    - Knuth: "The Art of Computer Programming, Vol I, II & III".
>    - Christiansen & Torkington: "The Perl Cookbook".
>    - Conway: "Object Oriented Perl".
>    - Stevens: "Advanced Programming in the UNIX Environment".
>    - Srinivasan: "Advanced Perl Programming".
>    - Walsh: "Learning Perl/Tk".
>
>    - Schwartz & Christiansen: "Learning Perl".
>    - Orwant, Hietaniemi & MacDonald: "Mastering Algorithms with Perl".
>    - Hall with Schwarz: "Effective Perl Programming".
>    - Siever, Spainhour & Patwardhan: "Perl in a Nutshell".
>    - Wall, Schwartz, Christiansen: "Programming Perl".
>

Any comments from anyone regarding

Eric C. Herman: "Mastering Perl 5" from Sybex?

Wyzelli




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

Date: 21 Nov 1999 11:44:46 GMT
From: mgjv@localhost.localdomain (Martien Verbruggen)
Subject: Re: alias a mailer
Message-Id: <slrn83fmt1.cna.mgjv@localhost.localdomain>

On Sat, 20 Nov 1999 09:41:30 GMT,
	Fox <hry@163.net> wrote:
> On 20 Nov 1999 02:29:41 GMT, mgjv@wobbie.heliotrope.home (Martien
> Verbruggen) wrote:
> 
> >On Fri, 19 Nov 1999 22:01:49 GMT,
> >	Fox <hry@163.net> wrote:
> >> hi all:
> >> i got a problem....
> >> in my /etc/aliases
> >> i definded :
> >> 
> >> aaa:|/www/fox/test.pl
> >> 
> >> in /www.fox/test.pl i wrote:
> >
> >That's not the same thing.
> then ,how can i  do that ?

Euhmm.. Either change the location of test.pl to /www/fox/ or change the
line in your aliases file to aaa:|/www.fox/test.pl...

Did you really need to ask that?

> >-w, and use strict are considered to be good things.
> i can run it in shell ,and no errors ....
> so i don't think -W is useful.

That's a very silly attitude. All the people here that are quite
experienced Perl users believe that -w (_lowercase_) is a useful thing.
Maybe you know more than all of use put together, and maybe we are
mistaken, and maybe -w is not useful, but you'll have to explain
slightly more verbosely why not,

> >And in the case of potentially multiple access to that output file, you
> >should probably also implement locking.
> i'll do that latter ,now is in my test system,only 1 user.

fine with me. I just noticed that there was no locking, and I didn't
know if you knew it was potentially going to be necessary.

> >> sh: /www/fox/test.pl: Text file busy
> >
> >That's an error from sh, not from perl
> i know

So? What does your shell documentation have to say about that error?

> >> 554 |/www/fox/test.pl... unknown mailer error 126
> >That's an error from your MTA, not from perl
> where to change to slove this error?

Sorry.. I don't understand. slove is not english, and I can't, even
trying very hard, come up with a meaning for it, allowing for many sorts
of typos and/or misspellings. Do you mean 'get rid of'?

The above two remarks were meant to point out to you that the error
messages have noting at all to do with Perl, and that you need to
consult your shell and MTA documentation, or ask in a newsgroup that
deals with those things.

> >What happens if you execute the script, feeding it an email message on
> >stdin? Have you even tried?
> i want to process some mail infomation .

Yes? So.. get yourself a mail message, probably from your mailbox, and
execute your script, with the mail message as input, just like your MTA
hopefully would do. Not that your script does anything with the input at
the moment (which means that it's lost for prosperity), but it may tell
you something.

But above, you already mentioned 'i can run it in shell, and no errors
 ....', so there is nothing wrong with the perl. Maybe it's a
configuration issue of your MTA. Maybe it's something else on your
platform. But it's _not_ _perl_.

Martien
-- 
Martien Verbruggen                      |
Interactive Media Division              | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: Sun, 21 Nov 1999 11:33:10 -0000
From: "James Thurley" <jamesthurley@hotmail.com>
Subject: Best Database Engine?
Message-Id: <818lag$5tu$1@lux.doc.ic.ac.uk>

I was looking at the Database Engines in the CPAN archives but couldn't
descide which would be the best.
I want to have a database contaning hundreds of thousands of users and need
quick access.
Does anyone have any recomendations?

Thanks,
James.




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

Date: Sun, 21 Nov 1999 13:09:58 GMT
From: beans@bedford.net (Thunderdust (TomH))
Subject: Re: Best Database Engine?
Message-Id: <3837ee12.7001505@news.bedford.net>


There are too many unknowns to answer your question, like update
frequency, number of simultaneous searches and updates, etc. And what
do you mean by  "quick"?

Here's a page with some benchmarks using the DBI interface in Perl:

	http://www.mysql.com/info.html



On Sun, 21 Nov 1999 11:33:10 -0000, "James Thurley"
<jamesthurley@hotmail.com> wrote:

>I was looking at the Database Engines in the CPAN archives but couldn't
>descide which would be the best.
>I want to have a database contaning hundreds of thousands of users and need
>quick access.
>Does anyone have any recomendations?






Schnoodlewinks-constantly leveling up warrior
Fluffy_the_Fly-lvl.7 warrior (x2-don't ask!)
Flame-QFG5 Paladin


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

Date: 21 Nov 1999 14:08:23 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Best Database Engine?
Message-Id: <818ucn$aai$1@gellyfish.btinternet.com>

In comp.lang.perl.misc James Thurley <jamesthurley@hotmail.com> wrote:
> I was looking at the Database Engines in the CPAN archives but couldn't
> descide which would be the best.
> I want to have a database contaning hundreds of thousands of users and need
> quick access.
> Does anyone have any recomendations?

I think that you're coming at this from the wrong direction - You will have
seen the DBI drivers that are available for various database engines, If
you want recommendations about an actual database you will want to ask in
one of the comp.databases.* groups otherwise you are likely to get advice
*here* that is possibly ill-informed and any informed discussion of the
merits of various databases will be off-topic here whether or no you are
using Perl to access them as the issues are largely the same whatever
language you are using.

The quality of the DBI drivers on the other hand could be said to be a
proper topic of discussion of this group, as could the use of DBI over
any other form of database interface.

At the risk of being off-topic myself I would suggest that in choosing
a database for your needs you should create a check list of requirements
and score these in order of importance to your appication - you can then
measure these against the capabilities of the various databases.  Amongst
these requirements I might include :

   * Programming Language bindings (in the case Perl via DBI )
   
   * Transaction support

   * SQL standards level compliance

   * Stored procedure (or server run code ) support

   * Trigger and/or Constraint support

   * Database integrity features

   * Security features

   * Supported platforms (both server and client platforms)

Of course some of these may be more or less important to you - if you are
unsure about it then this is probably a sign that you are making a low-level
system design decision at the wrong time in your design process and that
you should really be thinking about what you will need to be doing with your
database rather than thinking about what database to use.

Of course the beauty of DBI is that you can start off using any database
and if that database is insufficient to the the task then you can simply
switch to a new database by changing the connect string in your programs.

Anyhow I can hear the sound of a legion of "web developers" hitting the
reply button in their browsers to recommend MySQL  ....

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 21 Nov 1999 10:46:30 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Date Problem - Whats the deal with this?
Message-Id: <818ii6$9nt$1@gellyfish.btinternet.com>

On Sat, 20 Nov 1999 22:51:31 -0500 Jeff Pinyan wrote:
> [posted & mailed]
> 
> On Nov 20, larry blah blah blah:
> 
>> Its returning 10/20/99 on 11/20/99 yet when I look at the file dates on the
>> system they are correct!
> 
> That's because you didn't bother to READ the documenation for
> localtime()... you just glanced at it.
> 
>> here is what I have, does this look ok?
> 
> Only if you want January 1, 2000 to be "00/01/100"...
> 
>>    if ($sec < 10)  { $sec = "0$sec";   }
>>    if ($min < 10)  { $min = "0$min";   }
>>    if ($hour < 10) { $hour = "0$hour"; }
>>    if ($mday < 10) { $mday = "0$mday"; }
>>    if ($mon < 10)  { $monc = "0$mon";  }
> 

Actually I very much doubt that he even *saw* the documentation, let 
alone glanced or read - unless I am very mistaken (and hey ! it has been
know to happen :) I would hazard the guess that this code was simply
cut and paste from some less than highly recommended body of code - I
think everyone probably knows what I mean ...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 21 Nov 1999 11:20:26 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: help need please on perl
Message-Id: <818khq$9pr$1@gellyfish.btinternet.com>

On Sat, 20 Nov 1999 20:55:26 -0700 Joe Burris wrote:
> Abigail wrote:  "Did you read the CGI man page?"
> 
> I am a newbie too.  I don't know which CGI main page you were referring to.
> I have been reluctant to post questions because I'm not even sure what to
> ask or how to ask it.  I am a teacher enrolled in an Educational Technology
> Masters program, not a programmer.  If you have any ideas of resources that
> might be helpful, please share.
> 

Let us pretend for the sake of simplicity that Abigail was referring to the
man page for the module CGI.pm - this is the Perl module that most 
people will recommend for performing functions with respect to CGI - this
module is now part of the Perl distribution : if you are using ActivePerl
then this documentation will be available from the Start Menu as HTML.

A resource that some people recommend for beginning Perl programmers is:

    <http://www.netcat.co.uk/rob/perl/win32perltut.html>

The CGI FAQ :

     <http://www,webthing.com/tutorials/cgifaq.html>

The CGI Specification (Not necessarily essential reading but it may give
some idea of what programs written for the CGI can and cant do):

     <http://hoohoo.ncsa.uiuc.edu/cgi>

If you have questions that are general to CGI rather than specific to Perl
then you will want to look at the newsgroup:

      comp.infosystems.www.authoring.cgi

If you have questions regarding the selection, configuration or maintainance
of a web server on a Win32 platform :

      comp.infosystems.www.servers.ms-windows


I hope that gives you some idea of the resource available.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 21 Nov 1999 12:57:16 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help w/ DBI
Message-Id: <818q7c$a16$1@gellyfish.btinternet.com>

On Sun, 21 Nov 1999 06:37:36 GMT Adam Levenstein wrote:
> Does anybody here know the DBI module well?
> 
> I'm trying to connect to a MySQL server, but my script doesn't work
> and I don't know why. It doesn't give me an error, but doesn't add the
> form info to the DB either.
> 

Abigail has covered most of the reasons why your script is not really
worth any further attention however ...

> 
> $dbh->do("INSERT INTO sublets VALUES ('$loc, $roomies, $ownroom),
> $rent, $deposit, $utilities, $parking, $pets, $name, $email, $phone,
> $description')", undef, $dbh->quote("number"), $dbh->quote("name"));
> 

The first parameter to do() does not appear to be a correct SQL statement
you appear to b trying to inserting a single value your row here - I
dont understand what those two single quotes and the unmatched ) after
$ownroom are doing - I would recommend that you check the success of
the do() and print $dbh->errstr if it fails :

  $dbh->do(...) || print $dbh->errstr;

Of course doing this sort of debugging remotely is generally bad news so
I would suggest that do this from the command line first ...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 21 Nov 1999 06:41:58 -0500
From: Poohba <poohba@io.com>
Subject: How do I take all of the email addresses out of an email? 2 of 2
Message-Id: <Pine.LNX.4.10.9911210635410.24232-100000@fnord.io.com>

#!/usr/local/bin/perl -w

$file = "email.txt";
$email = "email.dat";

open (FILE, "$file") || die "Can't open $file:   $!\n";
@words = <STDIN>;
close(FILE);

open (NEWFILE, ">$email") || die "Can't open $email:   $!\n";

foreach $word (@words) {
   ($name) = split(/\w/, $word);
   chop($name);
   if($name =~ /@/i) {
	print NEWFILE "$name/n";
   }
}
close(NEWFILE);



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

Date: 21 Nov 1999 12:29:58 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to Capitalize the first letter of a word an or whole word
Message-Id: <818ok6$a0g$1@gellyfish.btinternet.com>

[removed the pointless alt.comp.perlcgi.freelance from groups ]

On Sun, 21 Nov 1999 09:27:17 GMT Slim wrote:
Subject: How to Capitalize the first letter of a word an or whole word
> thanks...

It is customary to include a message as whilst your newsreader might
display the entire Subject line I wouldnt you are in a position to
know whether this is true of all newreaders.

read about uc() and ucfirst() in the perlfunc manpage.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 21 Nov 1999 13:54:24 GMT
From: ShadeyGradey@linuxfreak.com (Slim)
Subject: Re: How to Capitalize the first letter of a word an or whole word
Message-Id: <3837f85f.33503200@news.inet4u.com>

I finally figured out how to capitalize the whole word I used
$word = "myword";
$word =~ tr/[a-z]/[A-Z]/;
and got ...    MYWORD
now I need to learn how to change just the first letter to capital...

-Slim-


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

Date: 21 Nov 1999 11:01:05 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to create file in other directory ?
Message-Id: <818jdh$9pn$1@gellyfish.btinternet.com>

On Sun, 21 Nov 1999 05:23:53 GMT Honey wrote:
> On Sun, 21 Nov 1999 12:08:38 +0800, "Henry E. P."
> <hep05@jakartamail.com> wrote:
> 
>>Please help me how to create file in other directory ?
>>I've to try this syntax but it doesn't work.
>>
>>open HTML, "> \\test\\test.html;
>>
>>
> 
> 	foreach $Name (@AllNames) {
> 		if (-d $Name) {next}
> 		{ 	print  "$Name"}
> 		}
> 
> hope this helps
> 

This from the School of Surrealist Programming Solutions 

I am not sure what this had to do with the original question but :

   opendir(DIR,'.') || die "Cant open . - $!\n";
   @AllNames = readdir DIR;
   closedir DIR;
   foreach $Name (@AllNames)
     {
       print $Name,"\n" unless -d $Name;
     }

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 21 Nov 1999 11:50:59 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: how to send data back and forth over sockets
Message-Id: <Pine.HPP.3.95a.991121114944.15363B-100000@hpplus01.cern.ch>

On Sat, 20 Nov 1999, Matthew H. Devlin III blurted out without any
referent:

> Obviously the code that I need will be seperate from anything that relates to
> the tk portion.

Oh, obviously.  I detected a perity error, too.




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

Date: Sat, 20 Nov 1999 20:18:10 -0600
From: "Lenny grosso" <grossole@slu.edu>
Subject: HTML format
Message-Id: <817kri$368s$1@systems2.slu.edu>

How do i make my perl script send an email in html format instead of text? i
am using sendmail and perl 5.003

Thanks In Advance
Lenny Grosso




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

Date: Sun, 21 Nov 1999 06:23:12 -0600
From: "Conrad Schneiker" <schneiker@jump.net>
Subject: New dialect of perl: xperl (or reinventing perl, or perl-izing jpython)
Message-Id: <818od1$34p$1@news.jump.net>

Has anyone (in recent times) given any serious thought to what a new
dialect/species of perl ought to look like if (full) backwards compatibility
were not required?

Of course there should be one exception here: full backwards compatibility
with the perl design philosophy should be required (i.e. make different
things look different, there's more than one way to improve it, try doing
what I might mean, and so on).

For purposes of discussion, let's designate this dialect/species xperl (for
perl based on eXperience with PERL).

If one of the xperl design aims was to facilitate compilation into java byte
codes (like jpython) and to facilitate exploitation of java classes/features
(in particular GUI stuff and bean stuff) then what additional features, if
any, would be desirable? In other words, how could the aims of JPL
(java-perl lingo) be better served if backwards compatibility on one hand
and lack of a first class perl-to-java bytecode compiler on the other had
were not troublesome constraints?

I've only seen a fraction of the considerable amount of discussion and
debate about the comparative strengths and weakness of perl relative to
other languages on this newsgroup, but almost nothing about the
possibilities of reinventing an even better perl, which is something that
those involved in such discussions might be able to shed some useful light
on.




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

Date: 21 Nov 1999 12:25:13 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: newbie : looking for a script that reads all  the file names in the directory
Message-Id: <818ob9$a0d$1@gellyfish.btinternet.com>

On Sun, 21 Nov 1999 03:34:56 GMT jim and lois flaherty wrote:
> I am looking for a perl  script the reads the names of all the files in a
> directory , then I can
> make the script to build a html page
> 

I think it must be the fact that the Grundy's painting cow dies on the Archers
or that I am listening to the dissolute and bizzare life history of the
One Remaining Fat Lady on Desert Island Discs I guess - but here you go :


#!/usr/bin/perl -wT

use strict;

use CGI qw(:standard);

my $filename = param('filename');


my $directory = '/home/gellyfish';

my $me = script_name();

if ($filename)
  {
    $filename = $1 if $filename =~ m#^.+/([^/]+)$#;
    my $fullpath = "$directory/$filename";
    my $content;
    if ($filename =~ /html?$/ )
      {
        $content = 'text/html';
      }
    elsif ( -T $fullpath )
      {
        $content = 'text/plain';
      }
    else
     {
        $content = 'application/x-unknown';
     }
    if ( open(INFILE,$fullpath) )
      {
        print header(- type => $content, -filename => $filename);
        while(<INFILE>)
          {
            print $_;
          }
        close INFILE;
       }
     else
       {
         print header,start_html('Oops');
         print h1("Couldnt open the file - $!");
         print end_html;
       }
  }
else
  {
    print header,start_html("Directory of : $directory");
    
    if ( opendir(DIR,$directory ))
      {
        my @files = grep {/^[^.]/ && -f "$directory/$_"} readdir(DIR);
        closedir(DIR);
        print "<UL>\n";
        foreach (@files)
          {
            my $url_file = CGI::escape($_);
            print "<LI>\n";
            print "<A HREF='$me?filename=$url_file'>$_</A>\n";
            print "</LI>\n";
          } 
        print "</UL>\n";
        print end_html;
      }
    else
      {
        print h1("Cant open the directory - $!");
        print end_html;
      }
   }

I thinks its safe enough to use now - (I nearly forgot to put in the
check for a ../../../etc/passwd ) but dont blame me if someone gets your
password file if you dont understand what is going on here.

Please read the perlfunc manpage regarding opendir,readdir,closedir and
the CGI.pm manpage.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 21 Nov 1999 14:06:13 GMT
From: ShadeyGradey@linuxfreak.com (Slim)
Subject: Re: newbie : looking for a script that reads all  the file names in the directory
Message-Id: <3837f9d3.33875755@news.inet4u.com>

On Sun, 21 Nov 1999 03:34:56 GMT, "jim and lois flaherty"
<kf4dmb@tds.net> wrote:

>I am looking for a perl  script the reads the names of all the files in a
>directory , then I can
>make the script to build a html page
>
>
>Thanks
>
>Jim
>
>

$folder = "/usr/www/folder/";

opendir(DIR,$folder) || die $!;
@files = grep(/\./,readdir(DIR));
closedir(DIR);

foreach $files(@files) {

print "$files<br>\n";

}


there ya' go"
if you change the /\./ to /[a-zA-Z]/ in the grep part those extra dots
will be gone... or you can list just files like /(.*).(.*)/ or type of
files like /.jpg/ or /.gif/ or /.html/ etc.

-Slim-






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

Date: 21 Nov 1999 12:33:56 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl and Linux
Message-Id: <818ork$a0k$1@gellyfish.btinternet.com>

On Sun, 21 Nov 1999 09:21:13 GMT Henner Graubitz wrote:
> Hi friends, 
> 
> first of all I know for my problem c.o.l.networking would be better,
> but 
> 
> I am searching very friendly people who develop cgi scripts under
> Linux (i got Suse 6.2) and are able to test their scripts under Linux
> with their Apache server and a browser. 
> 
> Is it possible that these people can send me their httpd.conf,
> srm.conf and access.conf as an attachement to my e-mail address 
> 
> kissqfjg@sp.zrz.tu-berlin.de
> 
> I tried to configure but I am helpless. I do not need any suggestions
> "read the HOWTO's" or your scrip and your rights are wrong or
> something like that. Thats what I have done and that is because I am
> helpless. 
> 

Tough.  Ask in comp.infosystems.www.servers.unix.  I am not about to send
a configuration file from my machine to someone I dont know.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 21 Nov 1999 12:00:49 GMT
From: jampa@my-deja.com
Subject: Re: Perl Security
Message-Id: <818mth$22s$1@nnrp1.deja.com>


> >Hi all!
> >I'm concerned about i problem that all of you had
> >or will have someday... perl security.
> >After search all over the net i find myself
> >totally blind in this subject.
> >Let's to my scenario:
>
> I'm assumming you are referrring to a web thing, even though
> you didn't say (which is why I assume it is web).

 Sorry i forgot to mention that it really is a Web thing, and i'm
putting the "member files" off the web tree e.g:
public files: /usr/data/public_html/*.html
member files: /usr/data/members/*.data
It's ok?


> There is no need to store the file in the web tree, thus the
> only way for someone to access it is via a different protocol
> (ftp, or telnet, or whatever) or a via a badly written CGI or
> web server.

What would be a badly written CGI, something with "parse" holes? By now
i'm checking all content that the user send, for example when he tries
to write or read some content the script checks for somethind but "."
or "/" and so on...

So you're telling me that via http the "hacker" cannot access the
files, in a off web tree directory?

>
> Again those files can be stored outside of the web tree.

They already are!

>
> You are much better off using the security providied by whatever your
> 'site' runs on.
>
> If it is a web based thing, then reading the web server documentation
and
> setting up htaccess style security will be much easier, and much more
> secure.

I tryed to use htaccess but it has some drawbacks like Prompt Windows
and so etc, with scripts showing contents i have more "control", in
this case, specifically!

Do you have a suggestion of a newsgroup that discuss perl security, i'm
assuming they exists!

Thank you again!


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 21 Nov 1999 11:34:09 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl Security
Message-Id: <818lbh$9q2$1@gellyfish.btinternet.com>

On Sun, 21 Nov 1999 01:58:32 GMT jampa@my-deja.com wrote:
> Hi all!
> I'm concerned about i problem that all of you had
> or will have someday... perl security.

I assume that you mean 'Web Security' - Perl security features are
discussed in the perlsec manpage.

> After search all over the net i find myself
> totally blind in this subject.
> Let's to my scenario:
> A friend ask me to make a sort of member site for
> him, so i started to use my "perl skills", i use
> a textfile to keep the login and passwds (crypted
> with crypt function) the file is on a "hidden
> area" of my server, but my doubt is that possible
> that some kind of hacker can get the file? or get
> access to the members file?
> Just to clarify all the content to the members
> are generated by the script
> Let me show an example:
> Let's say that i have to files: 1.txt and 2.txt
> in a protected/hidden directory, so after the
> member give username and pass the script get the
> files and show on the screen.
> 

You will probably want to ask the appropriate comp.infosystems.www.servers.*
group to find out about how configure the server to refuse requests
for certain files or files in certain locations - alternatively you
should store the files somewhere where the web server doe not have
access to.

Either way this is not a Perl issue.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 21 Nov 1999 13:33:36 GMT
From: flick@CC860922-A.home.com (Phil)
Subject: Q: How to read command-line arguments.  Not in FAQ.
Message-Id: <818s3f$6et$1@CC860922-A.home.com>

You'd think this would be in the documentation or the FAQ, but so far
as I can tell it isn't:

"man perl" says perl is called like so:

       perl [ -sTuU ]      [ -hv ] [ -V[:configvar] ]
            [ -cw ] [ -d[:debugger] ] [ -D[number/list] ]
            [ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal] ]
            [ -Idir ] [ -m[-]module ] [ -M[-]'module...' ]
            [ -P ]      [ -S ]      [ -x[dir] ]
            [ -i[extension] ]
            [ -e 'command' ] [ -- ] [ programfile ] [ argument ]...

Question:  How do I access the command line arguments?
They're not in @_.  For instance, this program:


  #!/usr/bin/perl -w
  print @_;

run like this:

  foo.pl hi there perl

prints nothing at all.

- Phil
flick@populus.net, despite the reply-to header


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

Date: 21 Nov 1999 14:25:34 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Q: How to read command-line arguments.  Not in FAQ.
Message-Id: <818vcu$ahm$1@gellyfish.btinternet.com>

On Sun, 21 Nov 1999 13:33:36 GMT Phil wrote:
> You'd think this would be in the documentation or the FAQ, but so far
> as I can tell it isn't:
>

<snip>
 
> 
> Question:  How do I access the command line arguments?
> They're not in @_.  For instance, this program:
> 

Read about the @ARGV array in perlvar .

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 21 Nov 1999 11:26:02 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: SQL questions and Win32::ODBC
Message-Id: <818ksa$9pu$1@gellyfish.btinternet.com>

On Sun, 21 Nov 1999 05:32:29 GMT Honey wrote:
> On Sat, 20 Nov 1999 21:31:26 GMT, "Jim Schuman" <netanator@home.com>
> wrote:
> 
>>I did write the program quickly. Perhaps I did not find the error when I
>>looked it over.
>>
>>I have had no problems with similiar programs on my comp at home (Win 98).
>>However, my work computer (NT Workstation) is where the problems occured.
>>
>>I will give it a better lookover on Monday.
>>
> 
> I don't know if it's why it wont work on NT or not but I had a similar
> problem with 95, that did not happen on 98..  I needed to install
> DCOM95 for windows 95 so that the perl would run.  maybe there is a
> DCOM for NT
> 

Er yes.  But as with Win98 it is part of the OS and doesnt need to be
retrofitted as it does with Win95.

I think that the problem is more likely to be with the Security setup
on the NT machine - the user that the program is running as doesnt have
the permission to do something ot other - of course this question should
be addressed in comp.infosystems.www.servers.ms-windows .

/j\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 21 Nov 1999 12:16:27 GMT
From: jampa@my-deja.com
Subject: Writing data in another server
Message-Id: <818nqq$2ge$1@nnrp1.deja.com>

I have a file in my Web Server that must be written by the wwwusers, so
it's 777 (i use a script to write data to the file), i'm wondering if
users can only write to this file using my scripts or someone more
"evil" can use a local script or sort of to write data on my server?
Thankx!


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

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


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


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