[14264] in Perl-Users-Digest
Perl-Users Digest, Issue: 1673 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Dec 19 21:12:18 1999
Date: Sun, 19 Dec 1999 18:12:07 -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: <945655927-v9-i1673@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 19 Dec 1999 Volume: 9 Number: 1673
Today's topics:
file existence test <gold@kr8.com>
file existence test <gold@kr8.com>
Re: file existence test <adnisbet@magma.ca>
Re: file existence test <grommel@sears.com>
Re: file existence test <jeffp@crusoe.net>
Re: file existence test john_gold@my-deja.com
Re: file existence test john_gold@my-deja.com
Re: file existence test (M.J.T. Guy)
Re: file existence test <gold@kr8.com>
fixing line breaks? <drkrause@mindspring.com>
Re: fixing line breaks? (Abigail)
Re: fixing line breaks? ahands@my-deja.com
Re: fixing line breaks? ahands@my-deja.com
Form list value <dmizesr@zoomnet.net##>
Form Problem <psousa@methodus.com>
Re: Form Problem (Abigail)
Re: Form Problem <red_orc@my-deja.com>
Re: Form Problem <cassell@mail.cor.epa.gov>
GDBM MetaHTML and PERL (MLDBM) <microstation_rangers@iname.com>
German Perl Workshop 2.0 - Call for Contributions - Cal <richter@ecos.de>
getgrent jjseif@my-deja.com
gethostbyaddr not working <isomeone@yahoo.com>
Getting a file's Datestamp <khowe@performance-net.com>
Re: Getting a file's Datestamp <khowe@performance-net.com>
Re: Getting a file's Datestamp <tony_curtis32@yahoo.com>
gmtime + hour = timezone? <ab@cd.com>
Re: gmtime + hour = timezone? (Michel Dalle)
Re: gmtime + hour = timezone? <lr@hpl.hp.com>
Re: gmtime + hour = timezone? (John Stanley)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 10 Dec 1999 20:27:21 -0000
From: "John Gold" <gold@kr8.com>
Subject: file existence test
Message-Id: <838qqj$oid$1@duke.telepac.pt>
Hi,
any help would be appreciated, I am writing a program that will generate a
data sheet from an msql database, so far so good, I need to check for the
existence of a file and if it does not exist create it, pretty straight
forward but I can't seem to get it to work, I have tried most options
without success, here is the code. Could anyone shed some light on the
issue?
sub load_value ($) {
#loads value passed from APQ.cgi - functional!
($ref_id) = @_ ;
$html_file_ad = "../www/htdocs/data/andorra".$ref_id.".html" ;
$html_web_ad = ("../data/andorra".$ref_id.".html") ;
}
sub display_html($$) {
#the problem area!
($html_file_ad, $html_web_ad) = @_ ;
if (x_fileexists($html_file__ad)) {
print "Location: $html_web_ad \n\n" ;
} else {
print "Content-type:text/html\n\n";
print "test - file simply does not exist yet" ;
}
}
sub x_fileexists($) {
# returns 1 if file with name given by $a1filena exists else 0
my($a1filena) = @_;
my $x =system ("if test -f $a1filena ;then exit 1 ;fi ;exit 0");
$x = $x eq 0 ? 0 : 1;
return $x;
}
------------------------------
Date: Fri, 10 Dec 1999 20:28:06 -0000
From: "John Gold" <gold@kr8.com>
Subject: file existence test
Message-Id: <838qru$2al$1@duke.telepac.pt>
Hi,
any help would be appreciated, I am writing a program that will generate a
data sheet from an msql database, so far so good, I need to check for the
existence of a file and if it does not exist create it, pretty straight
forward but I can't seem to get it to work, I have tried most options
without success, here is the code. Could anyone shed some light on the
issue?
sub load_value ($) {
#loads value passed from APQ.cgi - functional!
($ref_id) = @_ ;
$html_file_ad = "../www/htdocs/data/andorra".$ref_id.".html" ;
$html_web_ad = ("../data/andorra".$ref_id.".html") ;
}
sub display_html($$) {
#the problem area!
($html_file_ad, $html_web_ad) = @_ ;
if (x_fileexists($html_file__ad)) {
print "Location: $html_web_ad \n\n" ;
} else {
print "Content-type:text/html\n\n";
print "test - file simply does not exist yet" ;
}
}
sub x_fileexists($) {
# returns 1 if file with name given by $a1filena exists else 0
my($a1filena) = @_;
my $x =system ("if test -f $a1filena ;then exit 1 ;fi ;exit 0");
$x = $x eq 0 ? 0 : 1;
return $x;
}
------------------------------
Date: Wed, 15 Dec 1999 15:21:41 -0500
From: Alan Nisbet <adnisbet@magma.ca>
Subject: Re: file existence test
Message-Id: <3857F855.AA0BEC5D@magma.ca>
John,
All you needed was to add a -e existance check in the problem area code.
sub display_html
{
#the problem area!
#make these variables lexically scoped to this subroutine
my ($html_file_ad, $html_web_ad) = @_ ;
if ( -e x_fileexists($html_file__ad)) #<--- the fix
{
print "Location: $html_web_ad \n\n" ;
}
else
{
print "Content-type:text/html\n\n";
print "test - file simply does not exist yet" ;
}
# allows your values to maintain values once subroutine out of scope
#pass the values in work on them then return values to the caller
return ($html_file_ad, $html_web_ad);
}
Alan.
John Gold wrote:
> Hi,
> any help would be appreciated, I am writing a program that will generate a
> data sheet from an msql database, so far so good, I need to check for the
> existence of a file and if it does not exist create it, pretty straight
> forward but I can't seem to get it to work, I have tried most options
> without success, here is the code. Could anyone shed some light on the
> issue?
>
> sub load_value ($) {
> #loads value passed from APQ.cgi - functional!
> ($ref_id) = @_ ;
> $html_file_ad = "../www/htdocs/data/andorra".$ref_id.".html" ;
> $html_web_ad = ("../data/andorra".$ref_id.".html") ;
> }
>
> sub display_html($$) {
> #the problem area!
> ($html_file_ad, $html_web_ad) = @_ ;
> if ( x_fileexists($html_file__ad)) {
> print "Location: $html_web_ad \n\n" ;
> } else {
> print "Content-type:text/html\n\n";
> print "test - file simply does not exist yet" ;
> }
> }
>
> sub x_fileexists($) {
> # returns 1 if file with name given by $a1filena exists else 0
> my($a1filena) = @_;
> my $x =system ("if test -f $a1filena ;then exit 1 ;fi ;exit 0");
> $x = $x eq 0 ? 0 : 1;
> return $x;
> }
------------------------------
Date: Wed, 15 Dec 1999 14:50:22 -0600
From: Geoffrey Rommel <grommel@sears.com>
Subject: Re: file existence test
Message-Id: <3857FF0E.847D42EE@sears.com>
John Gold wrote:
> Hi,
> [...] I need to check for the existence of a file and if it does not exist
> create it [...]
> sub display_html($$) {
> #the problem area!
> ($html_file_ad, $html_web_ad) = @_ ;
> if (x_fileexists($html_file__ad)) {
> print "Location: $html_web_ad \n\n" ;
> } else { [....]
>
> sub x_fileexists($) {
> # returns 1 if file with name given by $a1filena exists else 0 [....]
Your approach is needlessly complex. You don't need to call the shell at all;
Perl has built-in tests that will check for whether a file exists, its size,
what kind of file it is, etc. Probably the best to use would be "-f", which
returns TRUE if the file exists and is a regular file, FALSE (undefined, I
believe) otherwise. So you can simply say:
if (-f $html_file__ad) {
print "Location: $html_web_ad \n\n" ;
} else {
print "Content-type:text/html\n\n";
print "test - file simply does not exist yet" ;
}
For more info, see the Camel book, p. 85, or the perlfunc man page.
------------------------------
Date: Wed, 15 Dec 1999 18:12:59 -0500
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: file existence test
Message-Id: <Pine.GSO.4.10.9912151811370.3722-100000@crusoe.crusoe.net>
[posted & mailed]
On Dec 10, John Gold said:
> any help would be appreciated, I am writing a program that will generate a
> data sheet from an msql database, so far so good, I need to check for the
> existence of a file and if it does not exist create it, pretty straight
> forward but I can't seem to get it to work, I have tried most options
> without success, here is the code. Could anyone shed some light on the
> issue?
Yuck. You only need to test with -e to ensure a file exists. You don't
use any lexically scoped variables at all -- only globals.
> ($html_file_ad, $html_web_ad) = @_ ;
> if (x_fileexists($html_file__ad)) {
> print "Location: $html_web_ad \n\n" ;
You have a double underscore here. Apparently, you don't use the -w
switch to perl either. Sigh.
From what resources did you learn Perl?
--
MIDN 4/C PINYAN, USNR, NROTCURPI http://www.pobox.com/~japhy/
jeff pinyan: japhy@pobox.com perl stuff: japhy+perl@pobox.com
"The Art of Perl" http://www.pobox.com/~japhy/book/
CPAN ID: PINYAN http://www.perl.com/CPAN/authors/id/P/PI/PINYAN/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
------------------------------
Date: Thu, 16 Dec 1999 00:23:55 GMT
From: john_gold@my-deja.com
Subject: Re: file existence test
Message-Id: <839bem$t57$1@nnrp1.deja.com>
In article <3857FF0E.847D42EE@sears.com>,
Geoffrey Rommel <grommel@sears.com> wrote:
>
> John Gold wrote:
>
> > Hi,
> > [...] I need to check for the existence of a file and if it does
not exist
> > create it [...]
>
> > sub display_html($$) {
> > #the problem area!
> > ($html_file_ad, $html_web_ad) = @_ ;
> > if (x_fileexists($html_file__ad)) {
> > print "Location: $html_web_ad \n\n" ;
> > } else { [....]
>
> >
> > sub x_fileexists($) {
> > # returns 1 if file with name given by $a1filena exists else 0
[....]
>
> Your approach is needlessly complex. You don't need to call the shell
at all;
> Perl has built-in tests that will check for whether a file exists,
its size,
> what kind of file it is, etc. Probably the best to use would be "-f",
which
> returns TRUE if the file exists and is a regular file, FALSE
(undefined, I
> believe) otherwise. So you can simply say:
>
> if (-f $html_file__ad) {
> print "Location: $html_web_ad \n\n" ;
> } else {
> print "Content-type:text/html\n\n";
> print "test - file simply does not exist yet" ;
> }
>
> For more info, see the Camel book, p. 85, or the perlfunc man page.
>
>
Hi Geoffrey,
this was one of the first things I tried but for some reason the result
is always 0 whether the file exists or not, this means either the -e
function can not find the file or the variable pointing to its location
is incorrect, have you any other suggestions?
thanks
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 16 Dec 1999 00:31:05 GMT
From: john_gold@my-deja.com
Subject: Re: file existence test
Message-Id: <839bs9$tan$1@nnrp1.deja.com>
In article <Pine.GSO.4.10.9912151811370.3722-100000@crusoe.crusoe.net>,
japhy@pobox.com wrote:
> [posted & mailed]
>
> On Dec 10, John Gold said:
>
> > any help would be appreciated, I am writing a program that will
generate a
> > data sheet from an msql database, so far so good, I need to check
for the
> > existence of a file and if it does not exist create it, pretty
straight
> > forward but I can't seem to get it to work, I have tried most
options
> > without success, here is the code. Could anyone shed some light on
the
> > issue?
>
> Yuck. You only need to test with -e to ensure a file exists. You
don't
> use any lexically scoped variables at all -- only globals.
>
> > ($html_file_ad, $html_web_ad) = @_ ;
> > if (x_fileexists($html_file__ad)) {
> > print "Location: $html_web_ad \n\n" ;
>
> You have a double underscore here. Apparently, you don't use the -w
> switch to perl either. Sigh.
>
> From what resources did you learn Perl?
>
> --
>
> MIDN 4/C PINYAN, USNR, NROTCURPI http://www.pobox.com/~japhy/
> jeff pinyan: japhy@pobox.com perl stuff: japhy+perl@pobox.com
> "The Art of Perl"
http://www.pobox.com/~japhy/book/
> CPAN ID: PINYAN http://www.perl.com/CPAN/authors/id/P/PI/PINYAN/
> PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
>
> Actually the double underscore is a typo and not in the code, also if
you saw the original thread you would see I do actually use the -w
switch, but if you have any constructive criticisms they would be most
appreciated, testing only with -e in this case does not work as the
returned value is always 0 ,
thanks in advance.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 16 Dec 1999 17:22:28 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: file existence test
Message-Id: <83b74k$luj$1@pegasus.csx.cam.ac.uk>
In article <839bem$t57$1@nnrp1.deja.com>, <john_gold@my-deja.com> wrote:
>this was one of the first things I tried but for some reason the result
>is always 0 whether the file exists or not, this means either the -e
>function can not find the file or the variable pointing to its location
>is incorrect, have you any other suggestions?
After -e returns false, check $! to see what the error is, then proceed
accordingly.
Some obvious guesses are
* is the current directory what you expect it to be?
* are your permissions set suitably?
Mike Guy
------------------------------
Date: Sat, 11 Dec 1999 19:50:53 -0000
From: "John Gold" <gold@kr8.com>
Subject: Re: file existence test
Message-Id: <83bd3e$kfs$1@duke.telepac.pt>
Problem solved, I used system (pwd) and this showed that directory address
was not as assumed and this info allowed me to debug successfully,
thanks for the help!
------------------------------
Date: Fri, 17 Dec 1999 15:01:56 -0500
From: Drew Krause <drkrause@mindspring.com>
Subject: fixing line breaks?
Message-Id: <385A96B4.8032A80A@mindspring.com>
Hello, I'd like to use perl to fix line breaks in a large flat file.
Basically, I know that if the first string in a line is less than 43
characters long, it belongs to the previous line.
Email replies please. Thanks for any help!
Drew Krause
------------------------------
Date: 16 Dec 1999 15:32:25 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: fixing line breaks?
Message-Id: <slrn85in29.5q3.abigail@alexandra.delanet.com>
Drew Krause (drkrause@mindspring.com) wrote on MMCCXCIX September
MCMXCIII in <URL:news:385A96B4.8032A80A@mindspring.com>:
.. Hello, I'd like to use perl to fix line breaks in a large flat file.
.. Basically, I know that if the first string in a line is less than 43
.. characters long, it belongs to the previous line.
Use a 1 line buffer.
Abigail
--
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
print } sub __PACKAGE__ { &
print ( __PACKAGE__)} &
__PACKAGE__
( )
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sun, 19 Dec 1999 21:40:24 GMT
From: ahands@my-deja.com
Subject: Re: fixing line breaks?
Message-Id: <83jjcb$o6g$1@nnrp1.deja.com>
In article <385A96B4.8032A80A@mindspring.com>,
drkrause@mindspring.com wrote:
> Hello, I'd like to use perl to fix line breaks in a large flat file.
> Basically, I know that if the first string in a line is less than 43
> characters long, it belongs to the previous line.
>
> Email replies please. Thanks for any help!
>
> Drew Krause
>
>
How about this:
$ perl -we '(my $foo = join("", <>)) =~ s@\n(.{1,42}\n)@$1@gs; print
$foo;' < infile > outfile
$
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 19 Dec 1999 22:15:47 GMT
From: ahands@my-deja.com
Subject: Re: fixing line breaks?
Message-Id: <83jleh$pka$1@nnrp1.deja.com>
In article <83jjcb$o6g$1@nnrp1.deja.com>,
ahands@my-deja.com wrote:
> In article <385A96B4.8032A80A@mindspring.com>,
> drkrause@mindspring.com wrote:
> > Hello, I'd like to use perl to fix line breaks in a large flat file.
> > Basically, I know that if the first string in a line is less than 43
> > characters long, it belongs to the previous line.
> >
> > Email replies please. Thanks for any help!
> >
> > Drew Krause
> >
> >
>
> How about this:
>
> $ perl -we '(my $foo = join("", <>)) =~ s@\n(.{1,42}\n)@$1@gs; print
> $foo;' < infile > outfile
> $
>
If there's a possibility of have two or more consecutive lines, each
less than 42,
replace the "g" with a "while" loop:
$ perl -we 'for($foo = join("", <>); $foo =~ s@\n(.{1,42}\n)@$1@s;) {};
print $foo;' < infile > outfile
$
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 19 Dec 1999 17:19:00 -0500
From: "David Mize, Sr." <dmizesr@zoomnet.net##>
Subject: Form list value
Message-Id: <s5qmftu6ee660@corp.supernews.com>
How do you retrieve a value from a drop down list on a form and assign it to
a variable?
Thanks,
DWM
--
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
[][] [][]
[][] visit us at [][]
[][] www.central-christian.com [][]
[][] [][]
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
------------------------------
Date: Sun, 12 Dec 1999 21:41:33 -0000
From: "Pedro Sousa" <psousa@methodus.com>
Subject: Form Problem
Message-Id: <38541767@readers.ip.pt>
I am using a perl script on a form. The problem is that instead of the
sending an email and redirecting to another page after the form is
submitted, a page shows up with all the form fields.
What is wrong?
Pedro
------------------------------
Date: 16 Dec 1999 19:55:20 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Form Problem
Message-Id: <slrn85j6f7.5q3.abigail@alexandra.delanet.com>
Pedro Sousa (psousa@methodus.com) wrote on MMCCXCIV September MCMXCIII in
<URL:news:38541767@readers.ip.pt>:
// I am using a perl script on a form. The problem is that instead of the
// sending an email and redirecting to another page after the form is
// submitted, a page shows up with all the form fields.
//
// What is wrong?
There's a bug on line 17.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Fri, 17 Dec 1999 13:58:33 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: Form Problem
Message-Id: <83dfi7$ntk$1@nnrp1.deja.com>
In article <slrn85j6f7.5q3.abigail@alexandra.delanet.com>,
abigail@delanet.com wrote:
> Pedro Sousa (psousa@methodus.com) wrote on MMCCXCIV September
MCMXCIII in
> <URL:news:38541767@readers.ip.pt>:
> // I am using a perl script on a form. The problem is that instead of
the
> // sending an email and redirecting to another page after the form is
> // submitted, a page shows up with all the form fields.
> //
> // What is wrong?
>
> There's a bug on line 17.
brilliant! I missed that one, but remain convinced that there is also
a problem in line 11.
>
> Abigail
> --
> perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
>
> -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==---
-------
> http://www.newsfeeds.com The Largest Usenet Servers in the
World!
> ------== Over 73,000 Newsgroups - Including Dedicated Binaries
Servers ==-----
>
--
Some drink at the fountain of knowledge...others just gargle.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 17 Dec 1999 17:17:45 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Form Problem
Message-Id: <385AE0B9.63B7629D@mail.cor.epa.gov>
Rodney Engdahl wrote:
>
> In article <slrn85j6f7.5q3.abigail@alexandra.delanet.com>,
> abigail@delanet.com wrote:
> > There's a bug on line 17.
>
> brilliant! I missed that one, but remain convinced that there is also
> a problem in line 11.
It's an old and hoary hacker joke. When given way too little info, say
"the bug is on line 17" instead of "How the bleep am I supposed to know
where
the bug is when you didn't show any code?"
Although one time the bug really *was* on line 17 when the poster came
back
with real code. Eerie...
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician
------------------------------
Date: Wed, 15 Dec 1999 21:33:27 +0000
From: Karsten <microstation_rangers@iname.com>
Subject: GDBM MetaHTML and PERL (MLDBM)
Message-Id: <38580927.8BFE2E9C@iname.com>
Sorry for breaking a thread but was wondering if any one has used PERL on GDBM
data files before and what they used?
I can open a GDBM file created by metahtml using perl and reference the main
hash, but not the hash of hashes. Tried understanding MLDBM but think that
metahtml must store the hashes differently to PERL.
Any help appreiciated. Also does anyone know of utilies for editing, dumping,
loading GDBM files to ascii?
--
Regards,
Karsten Evans
mailto:kes@whitehorse.co.uk
------------------------------
Date: Sun, 19 Dec 1999 14:02:09 +0100
From: Gerald Richter <richter@ecos.de>
Subject: German Perl Workshop 2.0 - Call for Contributions - Call for Participation
Message-Id: <385CD751.60D39522@ecos.de>
===============================================================
German Perl Workshop 2.0
===============================================================
WHAT? German Perl Workshop 2.0
WHEN? March 8-10th, 2000
WHERE? Sankt Augustin (near Bonn), FH Rhein-Sieg, Germany
MORE? http://www.gmd.de/Events/Perl-WS2000/
Building on this year's success, German-speaking perl enthusiasts
are preparing the next non-profit perl workshop in Germany. You are
cordially invited to contribute or to participate. Workshop languages
will be German, but English is also accepted. We plan to publish all
contributions
in a workshop reader.
Timetable for Contributors:
---------------------------
IMMEDIATELY:
Suggestions
UNTIL 07.01.2000:
Submission of an extended abstract for review
UNTIL 21.01.2000:
Commented information on acceptance
UNTIL 04.02.2000
Submission of camera-ready final version of talks
UNTIL 18.02.2000:
Submission of camera-ready final version of work in progess
reports
Send any ideas to perl-ws-chairs@gmd.de
Information for Participants:
-----------------------------
Participation will cost a nominal fee to cover basic costs.
You will be able to register via WWW starting in a few days.
The program committee <perl-ws-chairs@gmd.de>:
----------------------
CHRISTOFFEL, Juergen <jc@port25.com>
GRUENER, Norbert <nog@MPA-Garching.MPG.DE>
KIRSCH, Christian <ck@ix.heise.de>
KRIEGER, Jost <kriegjcb@ruhr-uni-bochum.de>
LEHMANN, Marc <pcg@opengroup.org>
REDER, Joern <joern@dimedis.de>
RICHTER, Gerald <richter@ecos.de>
SCHMIDT, Susanne <banshee@zedat.fu-berlin.de>
SIGEL, Alexander <sigel@bonn.iz-soz.de>
===============================================================
Deutscher Perl-Workshop 2.0
===============================================================
WAS? Deutscher Perl-Workshop 2.0
WANN? 8.-10. März 2000
WO? Sankt Augustin (bei Bonn), FH Rhein-Sieg
MEHR? http://www.gmd.de/Events/Perl-WS2000/
Auf dem Erfolg des diesjaehrigen Workshops aufbauend, bereiten
deutschsprachige Perl-Enthusiasten gerade den naechsten
nicht-kommerziellen Perl-Workshop in Deutschland vor. Du bist herzlich
eingeladen, inhaltlich beizutragen oder teilzunehmen. Workshop-Sprache
wird Deutsch sein, englische Beiträge sind aber auch möglich. Es ist
vorgesehen, die Beitraege in einem Workshop-Reader zu publizieren.
Zeitplan Beitraege:
-------------------
AB SOFORT:
Vorschlaege fuer Vortraege, Demos, Tutorials, Poster,
Anregungen, etc.
BIS SPAETESTENS 07.01.2000:
Einreichung eines extended Abstracts zur Begutachtung
BIS SPAETESTENS 21.01.2000:
Mitteilung der Begutachtungskommentare (Annahme/Ablehnung)
BIS SPAETESTENS 04.02.2000
Einreichung der druckreifen Endfassung von Vortraegen
BIS SPAETESTENS 18.02.2000:
Einreichung der druckreifen Endfassung von
Work-in-Progress-Berichten
Wer einen Vortrag o.ä. halten möchte sollte eine Mail an
perl-ws-chairs@gmd.de schicken.
Hinweis fuer Teilnehmer:
------------------------
Fuer die Teilnahme wird eine geringe Teilnahmegebuehr erhoben, um
die entstehenden Kosten abzudecken. Du kannst dich in den naechsten
Tagen ueber WWW anmelden.
Das Programmkomitee <perl-ws-chairs@gmd.de>:
--------------------
CHRISTOFFEL, Juergen <jc@port25.com>
GRUENER, Norbert <nog@MPA-Garching.MPG.DE>
KIRSCH, Christian <ck@ix.heise.de>
KRIEGER, Jost <kriegjcb@ruhr-uni-bochum.de>
LEHMANN, Marc <pcg@opengroup.org>
REDER, Joern <joern@dimedis.de>
RICHTER, Gerald <richter@ecos.de>
SCHMIDT, Susanne <banshee@zedat.fu-berlin.de>
SIGEL, Alexander <sigel@bonn.iz-soz.de>
--
------------------------------
Date: Fri, 17 Dec 1999 18:24:59 GMT
From: jjseif@my-deja.com
Subject: getgrent
Message-Id: <83dv5l$3sa$1@nnrp1.deja.com>
I am trying to use the getgrent function to access my group nis+
database. When I put the getgrent in a while loop and try to build a
hash, it appears to only access the database once and then exits the
while loop. Does anybody know how build a hash with getgrent and NIS+,
or should I look at alternative ways.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 18 Dec 1999 17:13:25 -0500
From: "Someone Insignificant" <isomeone@yahoo.com>
Subject: gethostbyaddr not working
Message-Id: <385bfad0.0@news.city-guide.com>
Im writing a perl program in which I need to lookup the hostname of a given
ip address. The code for this looks like the following:
use Sockets;
$ipstr = "204.71.200.74";
$hostname = gethostbyaddr(inet_aton($ipstr), AF_INET);
However, when I run this program, $hostname returns as an empty
string everytime. The program is running on a Virtual Server account
with my hosting company ( Digital Daze ).
Does anyone out there have any clue as to why this code isnt working?
It works fine on my local Linux machine. I seem to remember something
about perl and resolver libraries but no specifics.
If anyone can help me out of this jam, send me some email.
Thanks in advance!
Mike
mike@vtracks.com
------------------------------
Date: Sat, 18 Dec 1999 16:28:12 -0400
From: "Kevin Howe" <khowe@performance-net.com>
Subject: Getting a file's Datestamp
Message-Id: <09S64.198956$5r2.502752@tor-nn1.netcom.ca>
How do you get a files "Last Modified" Timestamp and turn it into an
understandable date?
A Perl Book I have says to do this:
$date = (stat($filename))[9];
My file has a value of "December 17, 1999 6:59:48 PM" for it's stamp. The
value generated by the above code is "945471588".
What is needed to turn that value into understandable $Month,$Day,$Year
values? All I need are the numercial values, not the English month
(November, December, etc.).
Thanks
kh
------------------------------
Date: Sat, 18 Dec 1999 16:42:06 -0400
From: "Kevin Howe" <khowe@performance-net.com>
Subject: Re: Getting a file's Datestamp
Message-Id: <3mS64.198958$5r2.503061@tor-nn1.netcom.ca>
Found it in the perl5FAQ:
http://www.loria.fr/~talleu/perl/perlfaq5/How_do_I_get_a_file_s_timestamp_.h
tml
Kevin Howe wrote in message <09S64.198956$5r2.502752@tor-nn1.netcom.ca>...
>How do you get a files "Last Modified" Timestamp and turn it into an
>understandable date?
>
>A Perl Book I have says to do this:
>
> $date = (stat($filename))[9];
>
>My file has a value of "December 17, 1999 6:59:48 PM" for it's stamp. The
>value generated by the above code is "945471588".
>
>What is needed to turn that value into understandable $Month,$Day,$Year
>values? All I need are the numercial values, not the English month
>(November, December, etc.).
>
>Thanks
>kh
>
>
------------------------------
Date: 18 Dec 1999 20:47:51 +0000
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Getting a file's Datestamp
Message-Id: <87n1r8asco.fsf@schleppie.tony.org>
"Kevin Howe" <khowe@performance-net.com> writes:
> How do you get a files "Last Modified" Timestamp and turn it into an
> understandable date?
>
> A Perl Book I have says to do this:
>
> $date = (stat($filename))[9];
I'd recommend using the File::stat module, it's friendlier.
> My file has a value of "December 17, 1999 6:59:48 PM" for it's stamp. The
> value generated by the above code is "945471588".
You need to take this epoch time and turn it into
the local time (perldoc -f localtime). Then give it
to something like POSIX::strftime (perldoc POSIX) to
format it, e.g.
use File::stat;
use POSIX qw(strftime);
my $filename = '.newsrc'; # for example
my $s = stat($filename) or die "$filename: $!";
print strftime('%d %b %Y', localtime($s->mtime)), "\n";
hth
tony
------------------------------
Date: Sat, 18 Dec 1999 22:28:33 -0600
From: "Blair Heuer" <ab@cd.com>
Subject: gmtime + hour = timezone?
Message-Id: <83hmtu$qo7$1@ash.prod.itd.earthlink.net>
I posted this about a week ago, but got no responce, so I am trying again,
to see if anyone can help me:
I am sorry if this is mentioned in some perldoc or other manual, if so
please refer me there.
I wrote a message board script that handles message boards for multiple
users. I want to be able to add the ability for members to set the time/date
on their board to their own time zone. I assume i want to use gmtime and
have them add or subtract from that to get their time, but how would I go
about this. Writing a script to take the time, and +/- to the time and check
to see if it sets the day back/forward, and month and year, and check for
leaps years would be too clunky. There must be a better way.
So basically, i need to be able to take the gmtime, +/- hours from it, and
output the time in a list or string which is readable much like 'scalar
gmtime'.
Thanks,
Blair Heuer
------------------------------
Date: Sun, 19 Dec 1999 13:41:06 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: gmtime + hour = timezone?
Message-Id: <83inem$ct6$1@newnews1.news.nl.uu.net>
In article <83hmtu$qo7$1@ash.prod.itd.earthlink.net>, "Blair Heuer" <ab@cd.com> wrote:
[snip]
>So basically, i need to be able to take the gmtime, +/- hours from it, and
>output the time in a list or string which is readable much like 'scalar
>gmtime'.
print scalar gmtime(time() + $offset);
You might want to drop the 'GMT' part, though :-)
And have a look at Time::Local as well.
Michel
------------------------------
Date: Sun, 19 Dec 1999 08:17:07 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: gmtime + hour = timezone?
Message-Id: <MPG.12c6a4d98e1f165d98a3a1@nntp.hpl.hp.com>
In article <83hmtu$qo7$1@ash.prod.itd.earthlink.net> on Sat, 18 Dec 1999
22:28:33 -0600, Blair Heuer <ab@cd.com> says...
> I posted this about a week ago, but got no responce, so I am trying again,
> to see if anyone can help me:
Perhaps your newsfeed isn't functioning correctly.
http://x31.deja.com/[ST_rn=ps]/getdoc.xp?AN=560426682
But I didn't think about filtering out the 'GMT', as Michel Dalle did.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 20 Dec 1999 01:05:20 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: gmtime + hour = timezone?
Message-Id: <83jvcg$n9b$1@news.NERO.NET>
In article <83inem$ct6$1@newnews1.news.nl.uu.net>,
Michel Dalle <michel.dalle@usa.net> wrote:
>In article <83hmtu$qo7$1@ash.prod.itd.earthlink.net>, "Blair Heuer" <ab@cd.com> wrote:
>[snip]
>>So basically, i need to be able to take the gmtime, +/- hours from it, and
>>output the time in a list or string which is readable much like 'scalar
>>gmtime'.
>
>print scalar gmtime(time() + $offset);
>You might want to drop the 'GMT' part, though :-)
Is there a reason you cannot simply set the TZ environment variable
based on the user and let the system worry about it?
------------------------------
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 1673
**************************************