[16454] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3866 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 1 03:05:32 2000

Date: Tue, 1 Aug 2000 00:05:17 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <965113516-v9-i3866@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 1 Aug 2000     Volume: 9 Number: 3866

Today's topics:
    Re: Data Editing <Tyler@noSpam.com>
    Re: DBI:: UPDATE format (Perl DBI O'Reilly fails to exp (Logan Shaw)
    Re: DBI:: UPDATE format (Perl DBI O'Reilly fails to exp <glodalec@yahoo.com>
    Re: Delete records in 2 weeks time (Keith Calvert Ivey)
    Re: Difference between a .cgi file and a .pl file? (brian d foy)
    Re: Difference between a .cgi file and a .pl file? (brian d foy)
        downloading a file from a remote machine <whitetigercat@home.com>
    Re: downloading a file from a remote machine <thalion@wonderd.com>
    Re: downloading a file from a remote machine <whitetigercat@home.com>
    Re: forking and child processes (Clinton A. Pierce)
    Re: How to print the thousands comma for financial numb (Philip 'Yes, that's my address' Newton)
    Re: How to recognize triplicates (Keith Calvert Ivey)
    Re: How to recognize triplicates (Keith Calvert Ivey)
    Re: How to recognize triplicates (Abigail)
    Re: LWP https 302 Moved Temporarily (brian d foy)
    Re: Memory leak in perl code <peiagee@hotmail.com>
        Net::XWhois.2.67 Is anyone using it? any ideas on a pro <robert@chalmers.com.au>
    Re: Perl jobs? (brian d foy)
    Re: Please unconfuse me.... if (<>)... rocoto@my-deja.com
    Re: Please unconfuse me.... if (<>)... (Keith Calvert Ivey)
    Re: Programmer - PERL - JAVA - JS - HTML - DreavWeaver (David H. Adler)
        Q: Problem using DBI <mckyung@hananet.net>
        qmail, good? bad? wheres the online tutorials? drdementor@my-deja.com
    Re: qmail, good? bad? wheres the online tutorials? (NP)
        readdir in order by date <templar318@earthlink.net>
    Re: readdir in order by date (Mark-Jason Dominus)
    Re: readdir in order by date (Rafael Garcia-Suarez)
    Re: readdir in order by date (Logan Shaw)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 31 Jul 2000 20:16:52 -0700
From: Tyler Larson <Tyler@noSpam.com>
Subject: Re: Data Editing
Message-Id: <39864124.7A5B4FB6@noSpam.com>

>
> >Got questions?  Get answers over the phone at Keen.com.
> But I know what the answer is, its 42!

Easily one of the best books ever written.



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

Date: 31 Jul 2000 20:18:18 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: DBI:: UPDATE format (Perl DBI O'Reilly fails to explain properly)
Message-Id: <8m58gq$8u9$1@provolone.cs.utexas.edu>

In article <e9Lb4WAKUgh5EwUH@worsdall.demon.co.uk>,
Mark Worsdall  <linux@worsdall.demon.co.uk> wrote:
>Hi,
>
>is this wrong:-
>
>
>$sth = $dbh->prepare("UPDATE counter FROM wizSearches WHERE ID =
>$chkfound");
>
>$sth->execute();
>
>
>err, uhm, where do things go?
>
>
>wizSearches is the name of the MySQL table
>
>The record to update is ID (the value of $chkfound)
>
>This record contains a table field called counter
>
>$searchCounter contains the value to stick in the field counter.
>
>
>a) I can't get the syntax right
>b) where do I stick the new value $searchCounter

Ultimately, you want to run some SQL that looks like this:

	update wizSearch set counter=12345 where ID=67890

There are two ways to do this in perl.  One is to build SQL that
contains the actual numbers, and the other way is to use placeholders.

The first way would look like this:

	$sth = $dbh->prepare ("update wizSearch set counter=" .
		$dbh->quote ($searchCounter) . " where ID=" .
		$dbh->quote ($chkfound) );
	$sth->execute;

The second way would look like this:

	$sth = $dbh->prepare ("update wizSearch set counter=? where ID=?")
		or die "blah blah blah";
	$sth->execute ($searchCounter, $chkfound);

Personally, I find the second method much cleaner.

  - Logan


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

Date: Tue, 01 Aug 2000 06:50:52 +0200
From: Mouse <glodalec@yahoo.com>
Subject: Re: DBI:: UPDATE format (Perl DBI O'Reilly fails to explain properly)
Message-Id: <3986572C.242@yahoo.com>

Mark Worsdall wrote:
> 
> Hi,
> 
> is this wrong:-
> 
> $sth = $dbh->prepare("UPDATE counter FROM wizSearches WHERE ID =
> $chkfound");
> 
> $sth->execute();
> 
> err, uhm, where do things go?
> 
> wizSearches is the name of the MySQL table
> 
> The record to update is ID (the value of $chkfound)
> 
> This record contains a table field called counter
> 
> $searchCounter contains the value to stick in the field counter.
> 
> a) I can't get the syntax right
> b) where do I stick the new value $searchCounter
> 
> I have Perl DBI, but strangely it only tells you how to do updates from
> the command line?
> 
> --
> He came from Econet - Oh no, I've run out of underpants :(
> Home:- jaydee@wizdom.org.uk       http://www.wizdom.org.uk
> Shadow:- webmaster@shadow.org.uk  http://www.shadow.org.uk
> Work:- netman@hinwick.demon.co.uk http://www.hinwick.demon.co.uk
> Web site Monitoring:-             http://www.shadow.org.uk/SiteSight/
Which Page ?


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

Date: Tue, 01 Aug 2000 02:25:23 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Delete records in 2 weeks time
Message-Id: <398b3368.8966169@news.newsguy.com>

Taurean <jaurangNOjaSPAM@crosswinds.net.invalid> wrote:

>$deletedate = $ref + $threedays;
>
>The new record looks like this:
>
>{HTML tags}Reference: 9xxxxxxxx{line break}{HTML tags}
>{Comment tag with deletedate}
>
>Then I can extract $deletedate from the comment tag and
>delete the record if time() > $deletedate.
>
>How do I go about doing this? TIA.

What's the advantage of having the comment?  All it contains is
the result of a calculation you can do just as well later.

And what is the problem with the solutions various people
(including me) have already offered?  What have you tried?

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: Tue, 01 Aug 2000 01:49:36 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Difference between a .cgi file and a .pl file?
Message-Id: <brian-ya02408000R0108000149360001@news.panix.com>

In article <m1wvi2wcne.fsf@halfdome.holdit.com>, merlyn@stonehenge.com (Randal L. Schwartz) posted:

> >>>>> "Andy" == Andy Bridges <abridges@eurobell.co.uk> writes:
> 
> Andy> the difference is that some servers will only allow a perl
> Andy> script to be executed as a .cgi file extension.
> 
> Andy> you will normally find that this happens on older style
> Andy> webservers , most of the newer webservers ( apache ) accept both
> Andy> .pl and .cgi file extensions.
> 
> But even that's still wrong.  I don't think I've ever written a CGI
> program, in Perl or otherwise, that had to have a required extension.

not even for the C----- class?  that server recognizes scripts by
extension :)

> Only in recent versions of Apache have you also been able to add CGI
> recognized "anywhere" using an extension,

recent? how time flies... you've been doing this longer than you
think Randal.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>


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

Date: Tue, 01 Aug 2000 01:54:23 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Difference between a .cgi file and a .pl file?
Message-Id: <brian-ya02408000R0108000154230001@news.panix.com>

In article <m1zomyuu3o.fsf@halfdome.holdit.com>, merlyn@stonehenge.com (Randal L. Schwartz) posted:

> >>>>> "Alan" == Alan J Flavell <flavell@mail.cern.ch> writes:


> Alan> The server can be given a list of file names to try for the default
> Alan> document: index.html, index.cgi, index.shtm, Welcome.htm

> Yup.  That's OK.  But it's scary when I end up seeing a URL in my
> location bar of "foo.pl" or "index.py" or "whatever.tcl" though.
> Gives away more than it needs to give.

some of those are scary no matter how you configure the server :)

however, a server admin with too much time on their hands might
map all of those extensions to something else.  not that i've 
ever used mod_rewrite to do such a thing.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>


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

Date: Tue, 01 Aug 2000 04:33:35 GMT
From: "whitetigercat" <whitetigercat@home.com>
Subject: downloading a file from a remote machine
Message-Id: <zqsh5.16632$Cm.570422@news1.gvcl1.bc.home.com>

Hi.
I want to receive a html document from another machine (like my browser does)
and save this file in my own cgi directory for parsing. This apparently isn't as simple
as opening the file, reading its lines into an array, and saving them to a file.
Any help appreciated,
Shane




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

Date: Mon, 31 Jul 2000 21:39:38 -0700
From: "HappyHippo" <thalion@wonderd.com>
Subject: Re: downloading a file from a remote machine
Message-Id: <8m5k80$hek$1@slb6.atl.mindspring.net>


Check out LWP::Simple
at cpan.org

I've got a script that does similar to that and uses this.


"whitetigercat" <whitetigercat@home.com> wrote in message
news:zqsh5.16632$Cm.570422@news1.gvcl1.bc.home.com...
> Hi.
> I want to receive a html document from another machine (like my browser
does)
> and save this file in my own cgi directory for parsing. This apparently
isn't as simple
> as opening the file, reading its lines into an array, and saving them to a
file.
> Any help appreciated,
> Shane
>
>




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

Date: Tue, 01 Aug 2000 06:28:45 GMT
From: "whitetigercat" <whitetigercat@home.com>
Subject: Re: downloading a file from a remote machine
Message-Id: <x6uh5.16649$Cm.573836@news1.gvcl1.bc.home.com>

Thanks HappyHippo for the info. It looks like what I need is indeed in there.
Only problem is that I haven't a clue how to use it. And I don't know if my
host has this module installed. I've written a lot of PERL code and never used
an external module before (ok, I probably did, but they were simple ones like
CGI::Carp qw(fatalsToBrowser); Can you or anyone give me a snippet of
code showing the actual downloading of a file from the web?
Thanks so far,
Shane

 .
HappyHippo <thalion@wonderd.com> wrote in message news:8m5k80$hek$1@slb6.atl.mindspring.net...
>
> Check out LWP::Simple
> at cpan.org
>
> I've got a script that does similar to that and uses this.
>
>
> "whitetigercat" <whitetigercat@home.com> wrote in message
> news:zqsh5.16632$Cm.570422@news1.gvcl1.bc.home.com...
> > Hi.
> > I want to receive a html document from another machine (like my browser
> does)
> > and save this file in my own cgi directory for parsing. This apparently
> isn't as simple
> > as opening the file, reading its lines into an array, and saving them to a
> file.
> > Any help appreciated,
> > Shane
> >
> >
>
>




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

Date: Tue, 01 Aug 2000 01:05:36 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: forking and child processes
Message-Id: <Anph5.55578$fR2.538635@news1.rdc1.mi.home.com>

[Posted and mailed]

In article <3985e1d9.45041866@news.ntlworld.com>,
	matt@NOSPAMcipherdesign.com (matt venn) writes:
> 1) how do i make sure that if my parent process is killed, it takes
> its children with it? would i assign a relevant handler to SIG{} to
> kill the children?
> 
> ive read the man pages on kill, and it doesnt seem to kill any child
> processes, so in the normal case do the children just get handed over
> to init?

No, in the normal case the children go on living.  If the children are in 
a stopped (SIGTSTP) situation, all of the children are sent a SIGHUP and 
SIGCONT when the process leader dies (presumably, the process that
created them).  Otherwise the children are not notified of the death and
are silently inherited by init.

[This behaviour is SYSVish.  I'm not sure if the Bezerkeley people do 
things this way.  Frankly, I don't care.  :)]

However, you can tell that you've been inherited because getppid() will
now return 1 instead of your deceased parent's PID.

> 2) i have noticed that if my parent is sleeping, and a child dies
> (assuming i have set up a 'reaper' sub); the sleep is interrupted, and
> when normal execution resumes, the sleep is not finished. how could i
> overcome this? is this actually not a problem in reality because its
> unlikely for the parent to need to sleep for a specific amount of
> time?

Well almost.  If sleep() is interrupted it should return the number of 
seconds actually slept.  Therefore:

	if ( sleep($duration) < $duration) {
		print "I was probably interrupted...";
	}

-- 
    Clinton A. Pierce              Teach Yourself Perl in 24 Hours! 
  clintp@geeksalad.org         for details see http://www.geeksalad.org
"If you rush a Miracle Man, 
	you get rotten Miracles." --Miracle Max, The Princess Bride


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

Date: Tue, 01 Aug 2000 05:35:13 GMT
From: nospam.newton@gmx.li (Philip 'Yes, that's my address' Newton)
Subject: Re: How to print the thousands comma for financial numbers ( $ 12,8292.75)
Message-Id: <39865bc5.897175@news.nikoma.de>

[alt.perl, de.comp.lang.perl.cgi removed]

On Tue, 01 Aug 2000 00:24:51 GMT, Bart Lateur <bart.lateur@skynet.be>
wrote:

> 
> >> Louis Banens (louis.banens@xs4all.nl) wrote:
> >> : I cannot find out how to print the thousands comma for financial numbers
> >( $ 12,8292.75).
> 
> That's a weird convention.

Looks Japanese to me -- they group their "thousands" by fours, not
threes (since they don't go thousand - million - milliard/billion but
man - oku - chou, i.e. 10^4 - 10^8 - 10^12).

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
If you're not part of the solution, you're part of the precipitate.


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

Date: Tue, 01 Aug 2000 02:14:45 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: How to recognize triplicates
Message-Id: <398a2f49.7910554@news.newsguy.com>

Tina Mueller <tina@streetmail.com> wrote:
>Tim Conrow <tim@ipac.caltech.edu> wrote:

>> This not-very-succinct code will find only triples, *not*
>> quadruples, quintuples, etc.
>
>> $a="baaab 111111 222 bbbb ccc 123444321 xzzz";
>> while($a=~m/(\d|\w)(?=\1\1)/g) { 
>>   print "match: $1$1$1" 
>>       if (pos($a)==1            || substr($a,pos($a)-2,1) ne $1) && 
>>          (pos($a)==length($a)-1 || substr($a,pos($a)+2,1) ne $1);
>> }
>
>> There must be a better way ... ?
>
>/(\w)\1{2,}/

That will match "111" and "bbb" in Tim's example string.
How about this?

    while (/((\w)\2+)/g) {
        print "match: $1\n" if length $1 == 3;
    }

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: Tue, 01 Aug 2000 03:42:49 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: How to recognize triplicates
Message-Id: <398d4532.13520855@news.newsguy.com>

I wrote:

>How about this?
>
>    while (/((\w)\2+)/g) {
>        print "match: $1\n" if length $1 == 3;
>    }

Anyone for golf?  Given a string in $_, print all triples of
word characters, excluding quadruples and higher, separated by
newlines.  I've got this:

    $\=$/;/^...$/&&print for/((\w)\2+)/g

and a same-length version for Abigail:

    $\=$/;map/^...$/&&print,/((\w)\2+)/g

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: 01 Aug 2000 00:33:41 EDT
From: abigail@foad.org (Abigail)
Subject: Re: How to recognize triplicates
Message-Id: <slrn8ockon.vcg.abigail@alexandra.foad.org>

Tim Conrow (tim@ipac.caltech.edu) wrote on MMDXXVI September MCMXCIII in
<URL:news:39860637.BFE67588@ipac.caltech.edu>:
$$ stillanewbie@db-networks.com wrote:
$$ > 
$$ > How to recognize 3 times the same character or the same number?
$$ > 
$$ > ie: 000 or 111 or AAA or ZZZ
$$ > 
$$ > I have tried but:  m/\D{3,}/ will match any 3 numbers in a row, not
$$ > identical numbers
$$ 
$$ As others have said, '/(\d|\w)\1\1/' will find your triples, but watch
$$ out for cases like '111111', i.e. two elided triples. Do you want that
$$ to be two triples, or do you want it excluded as a sextuple? This
$$ not-very-succinct code will find only triples, *not* quadruples,
$$ quintuples, etc.

The \d is redundant, the set of \d's is a subset of the \w's. It's not
quite clear what the OP wants, letters, numbers, spaces, punctuation
symbols, are all characters, but the OP means something that's distinct
from numbers. Perhaps he means letters or digits, in which case we
should use [^\W_]; but if underscores are allowed, we can use \w.

$$ $a="baaab 111111 222 bbbb ccc 123444321 xzzz";
$$ while($a=~m/(\d|\w)(?=\1\1)/g) { 
$$   print "match: $1$1$1" 
$$       if (pos($a)==1            || substr($a,pos($a)-2,1) ne $1) && 
$$          (pos($a)==length($a)-1 || substr($a,pos($a)+2,1) ne $1);
$$ }
$$ 
$$ There must be a better way ... ?


Well, you can do that in a single regex:

    /(?:^|(.)(?!\1))([^\W_])\2{2}(?!\2)/s;

Replace [^\W_] with \w if three underscores is fine too.


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


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

Date: Tue, 01 Aug 2000 01:58:30 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: LWP https 302 Moved Temporarily
Message-Id: <brian-ya02408000R0108000158300001@news.panix.com>

In article <8m4hiq$9ve$1@nnrp1.deja.com>, bkodl@my-deja.com posted:

> Hi, I am having trouble downloading HTTPS files via LWP. I've read the
> LWP FAQ and installed Crypt-SSLeay. However, the following script still
> results in error "302 Moved Temporarily". I'm using perl 5.005_03 with
> libwww 5.48 on WinNT 4 Workstation, Service Pack 3. Here is the script:

> my $URL = 'https://www.nodeworks.com/';  # does not work

what about other https addresses?

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>


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

Date: Tue, 01 Aug 2000 02:23:26 GMT
From: Greg Roberts <peiagee@hotmail.com>
Subject: Re: Memory leak in perl code
Message-Id: <8m5car$u6c$1@nnrp1.deja.com>

In article <3985F5EA.4CDC9EC1@ipac.caltech.edu>,
  Tim Conrow <tim@ipac.caltech.edu> wrote:

> Find out which statement(s) is(are) causing the leak. Is it the chdir?
> Comment it out and run on the current dir all the time and see. Is it
> the 'ls -l'? Comment it out and replace it with a static list. Etc.
>
> Or instead you could replace it with code that draws on the File::Find
> module, or use code that bypasses chdir and `ls -l`, like this (very
> untested):
>
> # Assuming the directory names are given on the command line ...
> for my $dir (@ARGV) {
>   opendir(DIR,"$dir") or die "can't open '$dir'; $!";
>   my @files = map { "$dir/$_" } readdir(DIR); # '/' is OS dependant
>   closedir(DIR) or die "can't read(close) '$dir'; $!";
>   for my $file (@files) {
>     # Do stuff on files. E.g. ...
>     next if -d $file || -l _; # Files only, not sub-dir.s or symlinks
>     my @fileinfo = stat(_); # See 'perldoc -f stat'
>     my $size     = -s _;
>     # ... etc.
>   }
> }

Hi Tim. Thanks very much for your reply. I've applied the above
opendir/readir/closedir code to my script and now there's no more memory
leaks. Looks like the chdir + ls was causing me grief. I put a chdir
outside the while(1) loop, then do the open/read/closedir inside the
loop, which works well. Watching the process with top, the memory size
doesn't change, unlike the previous version, which would grow every
couple of seconds!

Again, thanks very much.


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


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

Date: Tue, 1 Aug 2000 16:55:53 +1000
From: "Robert Chalmers" <robert@chalmers.com.au>
Subject: Net::XWhois.2.67 Is anyone using it? any ideas on a problem?
Message-Id: <Wruh5.73$S%.9038@nsw.nnrp.telstra.net>

I have a problem in that normally it works fine, but there are some domains
that it gets stuck on, and they all seem to have the same name server.

A whois or even 'creation_time', both from the 'examples' directory of the
package, simply go into a mad loop trying to lookup this domain, and as a
result, never return or time out..

GOPOLL.NET

There are any number of others, just using this as an example. A standard
"whois" on the server does return correct info, but the whois from
Net::XWhois never returns.

This is the example from the Net::XWhois package, couldn't be simpler, and
works for all it seems, EXCEPT for this one set of nameservers... or so it
seems

 ..............................................
#!/usr/bin/perl -I../
use Getopt::Std ;
use Net::XWhois;

getopts('neh:', \%opts);
my $whois = new Net::XWhois Domain => shift,
                            Server => $opts{h};

if ( $opts{e} ) { my @emails = $whois->contact_emails; $" = ", "; print
"Contact
s: @emails\n";  exit }
if ( $opts{n} ) { my @emails = $whois->nameservers; $" = ", "; print
"Nameserver
s: @emails\n";  exit }
print $whois->response;
 ..........................................................

This is the response from the standard system "whois", and shows the
response.

   Domain Name: GOPOLL.NET
   Registrar: XIN NET CORP.
   Whois Server: whois.paycenter.com.cn
   Referral URL: www.paycenter.com.cn
   Name Server: NS1.PAYCENTER.COM.CN
   Name Server: NS2.PAYCENTER.COM.CN
   Updated Date: 28-jul-2000

Any ideas anyone?
thanks
Bob




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

Date: Tue, 01 Aug 2000 02:02:35 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Perl jobs?
Message-Id: <brian-ya02408000R0108000202350001@news.panix.com>

In article <3985CCD9.91FEA1A@informix.com>, Mark Morgan <lemming@informix.com> posted:

> > "peter" <peterp100@hotmail.com> wrote in message
> > news:kre4os899d2g278fl1i22bfeoj59ipmg0h@4ax.com...

> > > I'm teaching myself perl and I'm taking a Java class this fall. But,
> > > I'm thinking about dropping the Java class and concentrating on Perl.
> > > Are there any jobs out there for perl programmers?  When I look in the

absolutely.  i have lots of openings.  so do a lot of other companies.
however, you should be able to do something, not just write Perl.

> > > paper everything says "Java and C ++" ???

those are different niches.

> I agree with Ben.  The more languages you know, the better off you'll
> be. 

do whatever makes you happy.  some people like systems programming.
some people like high level programming. some people like kicking
back on the beach.  try a lot of things and see what you like. :)

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>


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

Date: Tue, 01 Aug 2000 01:33:31 GMT
From: rocoto@my-deja.com
Subject: Re: Please unconfuse me.... if (<>)...
Message-Id: <8m59db$s4h$1@nnrp1.deja.com>

In article <aeeykl85.fsf@macforce.sumus.dk>,
  Jakob Schmidt <sumus@aut.dk> wrote:
>From perlop on <>:

I spent a lot of time trying to find that little nugget before I
posted here...

Thanks so much to all who replied - I do appreciate it.
I think I still have a lot learn about perl.... :)

Thanks again!
--
David



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


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

Date: Tue, 01 Aug 2000 00:58:35 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Please unconfuse me.... if (<>)...
Message-Id: <3989206c.4105256@news.newsguy.com>

Tina Mueller <tina@streetmail.com> wrote:

>while (<>) {}
>is like doing
>while ($_ = <>) {}
>(the same with for)

Actually, it's like doing

 while (defined($_ = <>)) {}

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: 1 Aug 2000 02:21:05 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: Programmer - PERL - JAVA - JS - HTML - DreavWeaver
Message-Id: <slrn8ocd0h.1tr.dha@panix2.panix.com>

On Sat, 29 Jul 2000 18:14:39 +0100, Dave Cross <dave@dave.org.uk> wrote:
>On Sat, 29 Jul 2000 17:04:40 GMT,
>TeleComMuter@WeBProgrammersInternational.net wrote:
>
>[a job advert]
>
>use dha::Job::Posting::Rant qw(:standard);

To be fair, C<grep /Randal/, @dha::Job::posting::Rant::ISA> returns
true... :-)

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
perl is a language, and as such, is about as Y2K compliant as
Serbo-Croat.	- David Cantrell in comp.lang.perl.misc


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

Date: Tue, 1 Aug 2000 14:01:38 +0900
From: "Á¶°æÇö" <mckyung@hananet.net>
Subject: Q: Problem using DBI
Message-Id: <SSsh5.3$M94.326@news.hananet.net>

Hi...

 I'm using Windows2000 professional and trying to make a board using perl
and ODBC. i downloaded DBI and DBD-ODBC modules and installed them.

 after i used a code to test it..

 test-odbc.pl
==============
#!/perl

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

end ;
=============

error message is
=============
Can't load 'E:/Perl/site/lib/auto/DBI/DBI.dll' for module DBI:
load_file:ÁöÁ¤µÈ ¸ðµâÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù at E:/Perl/lib/DynaLoader.pm line
200.
 at E:/Perl/site/lib/DBI.pm line 158
BEGIN failed--compilation aborted at E:/Perl/site/lib/DBI.pm line 158.
Compilation failed in require at E:\Inetpub\cgis\test-odbc.pl line 6.
BEGIN failed--compilation aborted at E:\Inetpub\cgis\test-odbc.pl line 6.
============
i really need to make this board in hurry...

bye.. :-)




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

Date: Tue, 01 Aug 2000 02:15:25 GMT
From: drdementor@my-deja.com
Subject: qmail, good? bad? wheres the online tutorials?
Message-Id: <8m5brq$u26$1@nnrp1.deja.com>

I was considering using webspace at a particular place and they said
they use qmail.

I have orielly books and they have info on sending and recieving mail.

does perl have such comand built in?

such lines of code from the oriely book include
use Mail::POP3Client;

the chapter is called the mail and mine modules


is this built intop perl?

i want to write my own short efficient script for handling emails
i have trouble understanding other peoples code especially when there
is zero documentation on the net.

sure i found the qmail home page but thats like zero help.

theres a book to be published on amazon.com but its not going ot be
ready for a week, and thats only one book.

people talk like qmail is the best thing since sliced bread but then
why no books?

are mime modules built into perl?

if so i have code in this bookthat looks visual basic easy, im going to
test some home made scripts.

can i send mail without special ad on moduals and stuff thats likely
not to be on the system already?

im using unix server, cant perl just talk to unix directly or
something...

im new tp perl and trying to make a sophistocated autoresponder,,, the
coding will be easy i just need to geet down the fundamental routines
for opening an sending email form pop accounts..

Jim



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


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

Date: Tue, 01 Aug 2000 02:46:35 GMT
From: nvp@spamnothanks.speakeasy.org (NP)
Subject: Re: qmail, good? bad? wheres the online tutorials?
Message-Id: <fSqh5.403074$MB.6329005@news6.giganews.com>

01 Aug 2000 02:15:25 GMT, drdementor@my-deja.com <drdementor@my-deja.com> wrote:
: I was considering using webspace at a particular place and they said
: they use qmail.

qmail is the MTA.

: does perl have such comand built in?

No.  I think that you're confusing an MTA / MUA with Perl's core
functionality.  Certainly one can write a MUA in Perl which is
implemented with core functions but you won't find a qmail() or mail()
in Perl.  :-)

: the chapter is called the mail and mine modules

Oh dear.  My poor, poor antiquated book.  :-)

: is this built intop perl?

Nope.  You have to download the module or modules from CPAN and build
them.  If you're using some variant of Unix, use the CPAN module to
help you out.  If you're using Perl for Win32 then use PPM.

: i have trouble understanding other peoples code especially when there
: is zero documentation on the net.

Aieee!  This must be a troll!

: are mime modules built into perl?

No.

: can i send mail without special ad on moduals and stuff thats likely
: not to be on the system already?

Yes.

-- 
Nate II


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

Date: Tue, 01 Aug 2000 05:15:24 GMT
From: David Tsai <templar318@earthlink.net>
Subject: readdir in order by date
Message-Id: <39865CB7.F8CDE4A9@earthlink.net>


Does anyone know how to read files from a directory in order by the date
they were created?  I know you can read the directory first and then use
the stat function and sort it that way.  But I want it to automatically
read in the files in order by the date beacuse I don't want to use an
array....

while($file = readdir(MYDIR)) {
    # Stuff
}

So I won't to use a scalar to read in one file at a time and have it in
order by the date.  I think you can some how do this with grep?
Thanks..

--

Best Regards,
David Tsai




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

Date: Tue, 01 Aug 2000 05:41:39 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: readdir in order by date
Message-Id: <39866313.1147$2df@news.op.net>

In article <39865CB7.F8CDE4A9@earthlink.net>,
David Tsai  <templar318@earthlink.net> wrote:
>Does anyone know how to read files from a directory in order by the date
>they were created?

No can do.  You get them in the order that the operating system gives
them to you.

>But I want it to automatically read in the files in order by the date
>beacuse I don't want to use an array....

You can sort them without the array:

        sort {-C $a <=> $C $b} (readdir DIR)

but I don't know what you think that will win you.



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

Date: Tue, 01 Aug 2000 06:06:43 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: readdir in order by date
Message-Id: <slrn8ocqh6.rvr.rgarciasuarez@rafael.kazibao.net>

Mark-Jason Dominus wrote in comp.lang.perl.misc:
>In article <39865CB7.F8CDE4A9@earthlink.net>,
>David Tsai  <templar318@earthlink.net> wrote:
>>Does anyone know how to read files from a directory in order by the date
>>they were created?
>
>No can do.  You get them in the order that the operating system gives
>them to you.
>
>>But I want it to automatically read in the files in order by the date
>>beacuse I don't want to use an array....
>
>You can sort them without the array:
>
>        sort {-C $a <=> $C $b} (readdir DIR)
>
>but I don't know what you think that will win you.

A little warning here : -C will not get the correct result if you
don't prepend the directory to the file name:

  opendir DIR,$dir or die "Can't read dir $dir: $!\n";
  for my $file (sort { -C "$dir/$a" <=> -C "$dir/$b" } readdir DIR) {
      # ...
  }

-- 
Rafael Garcia-Suarez


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

Date: 1 Aug 2000 01:37:11 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: readdir in order by date
Message-Id: <8m5r6n$9sv$1@provolone.cs.utexas.edu>

In article <39865CB7.F8CDE4A9@earthlink.net>,
David Tsai  <templar318@earthlink.net> wrote:
>Does anyone know how to read files from a directory in order by the date
>they were created?  I know you can read the directory first and then use
>the stat function and sort it that way.

On what platform?  On Unix, the filesystem keeps no record of file
creation time.  There are only these times:

	ctime -- the time the i-node was last changed
	atime -- the time the file was last accessed (read)
	mtime -- the time the file was last modified (written)

So, unless there is a platform that gives you access to this
information, there isn't a way to do it.  There certainly isn't a
portable way to do it no matter what.

  - Logan


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

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


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