[24775] in Perl-Users-Digest
Perl-Users Digest, Issue: 6928 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 29 06:11:38 2004
Date: Sun, 29 Aug 2004 03:10:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 29 Aug 2004 Volume: 10 Number: 6928
Today's topics:
Problem installing DBD::MySQL 2.9004 <hal@thresholddigital.com>
Re: Problem installing DBD::MySQL 2.9004 <zebee@zip.com.au>
Re: Problem installing DBD::MySQL 2.9004 <hal@thresholddigital.com>
Removing entries in array based on another array <leifwessman@hotmail.com>
Re: Removing entries in array based on another array <noreply@gunnar.cc>
Re: Removing entries in array based on another array (Anno Siegel)
Re: Removing entries in array based on another array <noreply@gunnar.cc>
The best way to parse a date in a known format <leifwessman@hotmail.com>
Re: The best way to parse a date in a known format <noreply@gunnar.cc>
Re: The best way to parse a date in a known format (Anno Siegel)
XP prints out html not page ? (newzguy)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 29 Aug 2004 04:14:13 -0400
From: Hal Vaughan <hal@thresholddigital.com>
Subject: Problem installing DBD::MySQL 2.9004
Message-Id: <G7ednd3tS_gkEqzcRVn-uw@comcast.com>
I have a Libranet (Debian based) Linux system. I tried installing MySQL and
DBD::mysql through apt-get, but it didn't work (I also used apt-get to get
all the packages, then install DBD::mysql separately, still no luck). I
finally decided to download the latest version of MySQL from mysql.com and
install it. I had to create the directory /usr/include/mysql and copy all
the header files to it.
I've been trying to install DBD::mysql for several hours. I have been
reading the directions, but I still can't find (including through Google --
but I tend to always search on the wrong terms, so Google search links are
helpful -- especially if you can let me know the terms that brought up the
right answer) anything that helps me get this module installed.
I do "perl Makefile.PL" and "make" and everything is fine. I've posted the
output from "make test" at the end of the post, due to it's length. I read
in the instructions that this might be a problem with the linker and added
the line:
-L/usr/lib/gcc-lib/i386-linux/3.2.3/libgcc.a -lgcc
at the end of the line in Makefile that starts with "CFLAGS = ", but it made
absolutely no difference.
So what can I do to install this? I'd prefer to get it working with the
later version of MySQL, but if I have to wipe that and go with apt-get
packages, I can do that. At this point, I ma very frustrated because it's
not working with the "official" package and it doesn't work with the
Debian .deb files (they don't include mysql_config, and it always complains
about not finding that).
Any help is appreciated.
Hal
---------------------------------
Output from "make test":
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base...........install_driver(mysql) failed: Can't load
'/root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module
DBD::mysql: /root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so:
undefined symbol: net_buffer_length at /usr/lib/perl/5.8.2/DynaLoader.pm
line 225.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/00base.t line 38
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 4-5
Failed 2/5 tests, 60.00% okay
t/10dsnlist........install_driver(mysql) failed: Can't load
'/root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module
DBD::mysql: /root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so:
undefined symbol: net_buffer_length at /usr/lib/perl/5.8.2/DynaLoader.pm
line 225.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/10dsnlist.t line 45
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-9
Failed 9/9 tests, 0.00% okay
t/20createdrop.....install_driver(mysql) failed: Can't load
'/root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module
DBD::mysql: /root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so:
undefined symbol: net_buffer_length at /usr/lib/perl/5.8.2/DynaLoader.pm
line 225.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/20createdrop.t line 45
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-5
Failed 5/5 tests, 0.00% okay
t/30insertfetch....install_driver(mysql) failed: Can't load
'/root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module
DBD::mysql: /root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so:
undefined symbol: net_buffer_length at /usr/lib/perl/5.8.2/DynaLoader.pm
line 225.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/30insertfetch.t line 48
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-11
Failed 11/11 tests, 0.00% okay
t/40bindparam......install_driver(mysql) failed: Can't load
'/root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module
DBD::mysql: /root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so:
undefined symbol: net_buffer_length at /usr/lib/perl/5.8.2/DynaLoader.pm
line 225.
at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/40bindparam.t line 64
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-28
Failed 28/28 tests, 0.00% okay
t/40blobs..........install_driver(mysql) failed: Can't load
'/root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module
DBD::mysql: /root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so:
undefined symbol: net_buffer_length at /usr/lib/perl/5.8.2/DynaLoader.pm
line 225.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/40blobs.t line 68
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-11
Failed 11/11 tests, 0.00% okay
t/40listfields.....install_driver(mysql) failed: Can't load
'/root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module
DBD::mysql: /root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so:
undefined symbol: net_buffer_length at /usr/lib/perl/5.8.2/DynaLoader.pm
line 225.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/40listfields.t line 57
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-18
Failed 18/18 tests, 0.00% okay
t/40nulls..........install_driver(mysql) failed: Can't load
'/root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module
DBD::mysql: /root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so:
undefined symbol: net_buffer_length at /usr/lib/perl/5.8.2/DynaLoader.pm
line 225.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/40nulls.t line 50
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-11
Failed 11/11 tests, 0.00% okay
t/40numrows........install_driver(mysql) failed: Can't load
'/root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module
DBD::mysql: /root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so:
undefined symbol: net_buffer_length at /usr/lib/perl/5.8.2/DynaLoader.pm
line 225.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/40numrows.t line 59
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-25
Failed 25/25 tests, 0.00% okay
t/50chopblanks.....install_driver(mysql) failed: Can't load
'/root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module
DBD::mysql: /root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so:
undefined symbol: net_buffer_length at /usr/lib/perl/5.8.2/DynaLoader.pm
line 225.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/50chopblanks.t line 57
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-35
Failed 35/35 tests, 0.00% okay
t/50commit.........install_driver(mysql) failed: Can't load
'/root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module
DBD::mysql: /root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so:
undefined symbol: net_buffer_length at /usr/lib/perl/5.8.2/DynaLoader.pm
line 225.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/50commit.t line 64
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-30
Failed 30/30 tests, 0.00% okay
t/60leaks..........skipped
all skipped: $ENV{SLOW_TESTS} is not set or Proc::ProcessTable not
installed
t/ak-dbd...........install_driver(mysql) failed: Can't load
'/root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module
DBD::mysql: /root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so:
undefined symbol: net_buffer_length at /usr/lib/perl/5.8.2/DynaLoader.pm
line 225.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/ak-dbd.t line 59
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-90
Failed 90/90 tests, 0.00% okay
t/akmisc...........Had to create DBD::mysql::dr::imp_data_size unexpectedly
at /usr/local/lib/perl/5.8.2/DBI.pm line 1011.
Use of uninitialized value in subroutine entry
at /usr/local/lib/perl/5.8.2/DBI.pm line 1011.
Can't locate object method "connect" via package "Mysql"
at /root/DBD-mysql-2.9004/blib/lib/Mysql.pm line 71.
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-351
Failed 351/351 tests, 0.00% okay
t/dbdadmin.........install_driver(mysql) failed: Can't load
'/root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module
DBD::mysql: /root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so:
undefined symbol: net_buffer_length at /usr/lib/perl/5.8.2/DynaLoader.pm
line 225.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/dbdadmin.t line 74
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-21
Failed 21/21 tests, 0.00% okay
t/insertid.........install_driver(mysql) failed: Can't load
'/root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module
DBD::mysql: /root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so:
undefined symbol: net_buffer_length at /usr/lib/perl/5.8.2/DynaLoader.pm
line 225.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/insertid.t line 13
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-12
Failed 12/12 tests, 0.00% okay
t/mysql............Can't load
'/root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module
DBD::mysql: /root/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so:
undefined symbol: net_buffer_length at /usr/lib/perl/5.8.2/DynaLoader.pm
line 225.
at /root/DBD-mysql-2.9004/blib/lib/Mysql.pm line 13
Compilation failed in require at /root/DBD-mysql-2.9004/blib/lib/Mysql.pm
line 13.
Compilation failed in require at t/mysql.t line 34.
BEGIN failed--compilation aborted at t/mysql.t line 34.
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-68
Failed 68/68 tests, 0.00% okay
t/mysql2...........Had to create DBD::mysql::dr::imp_data_size unexpectedly
at /usr/local/lib/perl/5.8.2/DBI.pm line 1011.
Use of uninitialized value in subroutine entry
at /usr/local/lib/perl/5.8.2/DBI.pm line 1011.
Can't locate object method "connect" via package "Mysql"
at /root/DBD-mysql-2.9004/blib/lib/Mysql.pm line 71.
dubious
Test returned status 255 (wstat 65280, 0xff00)
Failed 17/18 test scripts, 5.56% okay. 727/730 subtests failed, 0.41% okay.
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/00base.t 255 65280 5 4 80.00% 4-5
t/10dsnlist.t 255 65280 9 18 200.00% 1-9
t/20createdrop.t 255 65280 5 10 200.00% 1-5
t/30insertfetch.t 255 65280 11 22 200.00% 1-11
t/40bindparam.t 255 65280 28 56 200.00% 1-28
t/40blobs.t 255 65280 11 22 200.00% 1-11
t/40listfields.t 255 65280 18 36 200.00% 1-18
t/40nulls.t 255 65280 11 22 200.00% 1-11
t/40numrows.t 255 65280 25 50 200.00% 1-25
t/50chopblanks.t 255 65280 35 70 200.00% 1-35
t/50commit.t 255 65280 30 60 200.00% 1-30
t/ak-dbd.t 255 65280 90 180 200.00% 1-90
t/akmisc.t 255 65280 351 702 200.00% 1-351
t/dbdadmin.t 255 65280 21 42 200.00% 1-21
t/insertid.t 255 65280 12 24 200.00% 1-12
t/mysql.t 255 65280 68 136 200.00% 1-68
t/mysql2.t 255 65280 ?? ?? % ??
1 test skipped.
make: *** [test_dynamic] Error 255
------------------------------
Date: Sun, 29 Aug 2004 08:40:43 GMT
From: Zebee Johnstone <zebee@zip.com.au>
Subject: Re: Problem installing DBD::MySQL 2.9004
Message-Id: <slrncj359o.v74.zebee@zeus.zipworld.com.au>
In comp.lang.perl.misc on Sun, 29 Aug 2004 04:14:13 -0400
Hal Vaughan <hal@thresholddigital.com> wrote:
> I have a Libranet (Debian based) Linux system. I tried installing MySQL and
> DBD::mysql through apt-get, but it didn't work (I also used apt-get to get
> all the packages, then install DBD::mysql separately, still no luck). I
> finally decided to download the latest version of MySQL from mysql.com and
> install it. I had to create the directory /usr/include/mysql and copy all
> the header files to it.
From memory, you will also need stuff in lib
I have used /usr/local/include/mysql and /usr/local/lib/mysql, as well
as /usr/local/mysql/lib and /usr/local/mysql/include.
my lib dir has :
libdbug.a libmyisammrg.a libmysqlclient.so.12 libnisam.a
libheap.a libmysqlclient.a libmysqlclient.so.12.0.0 libvio.a
libmerge.a libmysqlclient.la libmystrings.a
libmyisam.a libmysqlclient.so libmysys.a
your errors do look a bit like the DBD module cant find libraries.
Zebee
------------------------------
Date: Sun, 29 Aug 2004 05:43:18 -0400
From: Hal Vaughan <hal@thresholddigital.com>
Subject: Re: Problem installing DBD::MySQL 2.9004
Message-Id: <A96dnbqAVdkFOazcRVn-rw@comcast.com>
Zebee Johnstone wrote:
> In comp.lang.perl.misc on Sun, 29 Aug 2004 04:14:13 -0400
> Hal Vaughan <hal@thresholddigital.com> wrote:
>> I have a Libranet (Debian based) Linux system. I tried installing MySQL
>> and DBD::mysql through apt-get, but it didn't work (I also used apt-get
>> to get
>> all the packages, then install DBD::mysql separately, still no luck). I
>> finally decided to download the latest version of MySQL from mysql.com
>> and
>> install it. I had to create the directory /usr/include/mysql and copy
>> all the header files to it.
>
> From memory, you will also need stuff in lib
>
> I have used /usr/local/include/mysql and /usr/local/lib/mysql, as well
> as /usr/local/mysql/lib and /usr/local/mysql/include.
>
> my lib dir has :
> libdbug.a libmyisammrg.a libmysqlclient.so.12 libnisam.a
> libheap.a libmysqlclient.a libmysqlclient.so.12.0.0 libvio.a
> libmerge.a libmysqlclient.la libmystrings.a
> libmyisam.a libmysqlclient.so libmysys.a
>
> your errors do look a bit like the DBD module cant find libraries.
That did it. Just did "cp /usr/local/mysql/lib/* /usr/lib/" and it worked
fine after that.
Wonder why they don't suggest that in the install docs, instead of
suggesting all the compiler links? I might suggest it to the maintainer.
Thanks!
Hal
>
>
> Zebee
------------------------------
Date: 29 Aug 2004 00:27:48 -0700
From: "Leif Wessman" <leifwessman@hotmail.com>
Subject: Removing entries in array based on another array
Message-Id: <cgs0hk$kgg@odah37.prod.google.com>
I would like to remove the complete entry in an array if the value of
the entry matches any of the values in another array.
Like this:
use strict;
use warnings;
my @names ("bob","barney","-","lisa","UNKNOWN");
my @delete ("-","unknown");
...
result should be that @names contains only bob, barney and lisa.
Thanks for any input!
Leif
------------------------------
Date: Sun, 29 Aug 2004 09:56:43 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Removing entries in array based on another array
Message-Id: <2pdgo5Fj1f24U2@uni-berlin.de>
Leif Wessman wrote:
> I would like to remove the complete entry in an array if the value
> of the entry matches any of the values in another array.
That's a Frequently Asked Question.
perldoc -q duplicate
You are expected to check the Perl FAQ before posting a question here.
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 29 Aug 2004 08:16:29 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Removing entries in array based on another array
Message-Id: <cgs3ct$7df$2@mamenchi.zrz.TU-Berlin.DE>
Gunnar Hjalmarsson <noreply@gunnar.cc> wrote in comp.lang.perl.misc:
> Leif Wessman wrote:
> > I would like to remove the complete entry in an array if the value
> > of the entry matches any of the values in another array.
>
> That's a Frequently Asked Question.
>
> perldoc -q duplicate
>
> You are expected to check the Perl FAQ before posting a question here.
That finds "How can I remove duplicate elements from a list or array?",
which doesn't deal with the OPs problem, tough it might help.
The one that deals with the problem directly is found through
perldoc -q difference
"How do I compute the difference of two arrays?"
Anno
------------------------------
Date: Sun, 29 Aug 2004 10:46:36 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Removing entries in array based on another array
Message-Id: <2pdjm5Fjp9atU1@uni-berlin.de>
Anno Siegel wrote:
> Gunnar Hjalmarsson wrote:
>> Leif Wessman wrote:
>>> I would like to remove the complete entry in an array if the
>>> value of the entry matches any of the values in another array.
>>
>> That's a Frequently Asked Question.
>>
>> perldoc -q duplicate
>>
>> You are expected to check the Perl FAQ before posting a question
>> here.
>
> That finds "How can I remove duplicate elements from a list or
> array?", which doesn't deal with the OPs problem, tough it might
> help.
Of course, thanks! Sorry Leif for pointing you to the wrong FAQ entry.
Maybe I should check the FAQ before posting such a comment... ;-)
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 28 Aug 2004 23:29:16 -0700
From: "Leif Wessman" <leifwessman@hotmail.com>
Subject: The best way to parse a date in a known format
Message-Id: <cgrt3s$ic4@odak26.prod.google.com>
What's the best way to parse a date in a, for me, known format?
In my case the months are spelled a little different (not matching a
specific locale). But I know than "janu" means "january" and that the
format of the date is "date year month".
First of all I need a way to check if the datetext has the format that
I think it should have.
Then I would like to change this datetext into a common format that a
regular date parser would understand.
use strict;
use warnings;
my @months =
("janu","febr","mars","apri","maj","juni","juli","augu","sept","okto","nove","dece");
my $dateformat = "dd yy/@months";
my $datetext = "05 04/janu";
# Now I need to create a regular expression
# to see if $datetext matches $dateformat
my $regexp = ...; # need help here
if ($datetext =~ /$regexp/) {
# Now I need to modify it into a common
# format, like: "05-01-2004"
} else {
print "wrong format";
}
Thanks for any input!
Leif
------------------------------
Date: Sun, 29 Aug 2004 09:56:36 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: The best way to parse a date in a known format
Message-Id: <2pdgnvFj1f24U1@uni-berlin.de>
Leif Wessman wrote:
> What's the best way to parse a date in a, for me, known format?
>
> In my case the months are spelled a little different (not matching
> a specific locale). But I know than "janu" means "january" and that
> the format of the date is "date year month".
>
> First of all I need a way to check if the datetext has the format
> that I think it should have.
>
> Then I would like to change this datetext into a common format that
> a regular date parser would understand.
Why would you involve a regular date parser at all?
> use strict;
> use warnings;
>
> my @months =
> ("janu","febr","mars","apri","maj","juni","juli","augu","sept","okto","nove","dece");
From here you can for instance do:
my $datetext = '05 04/janu';
my $regexp = qr!^(\d\d) (\d\d)/(@{ [ join '|', @months ] })$!;
my ($day, $month, $year);
if ( $datetext =~ /$regexp/ ) {
my %months;
@months{ @months } = 1 .. 12;
$day = $1;
$month = $months{$3};
$year = $2 + 2000;
printf "ISO 8601 format: %d-%02d-%02d\n",
$year, $month, $day;
} else {
print "wrong format\n";
}
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 29 Aug 2004 08:25:52 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: The best way to parse a date in a known format
Message-Id: <cgs3ug$7df$3@mamenchi.zrz.TU-Berlin.DE>
Gunnar Hjalmarsson <noreply@gunnar.cc> wrote in comp.lang.perl.misc:
> Leif Wessman wrote:
> > What's the best way to parse a date in a, for me, known format?
[...]^
> Why would you involve a regular date parser at all?
>
> > use strict;
> > use warnings;
> >
> > my @months =
> >
> ("janu","febr","mars","apri","maj","juni","juli","augu","sept","okto","nove","dece");
>
> From here you can for instance do:
>
> my $datetext = '05 04/janu';
> my $regexp = qr!^(\d\d) (\d\d)/(@{ [ join '|', @months ] })$!;
It would be more robust to sort the month names into descending order by
length before building the month-parsing part:
join '|' sort { length( $b) <=> length( $a) } @months
It doesn't make a difference with this set of month names, but
who knows...
Anno
------------------------------
Date: 28 Aug 2004 20:37:32 -0700
From: newzguy@ziplip.com (newzguy)
Subject: XP prints out html not page ?
Message-Id: <6d7814d4.0408281937.6f8321fd@posting.google.com>
One a computer I use when a cgi script is called on,
instead of getting the web page I get the html code
as text. Can anyone tell me what settings to change
to fix this?
Probably off topic sorry.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V10 Issue 6928
***************************************