[18554] in Perl-Users-Digest
Perl-Users Digest, Issue: 722 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 19 18:06:08 2001
Date: Thu, 19 Apr 2001 15:05:12 -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: <987717912-v10-i722@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 19 Apr 2001 Volume: 10 Number: 722
Today's topics:
Re: " XXX.pl did not return a true value at ./YYY line <dontuspamme@nospammers.com>
Re: " XXX.pl did not return a true value at ./YYY line (Anno Siegel)
Re: " XXX.pl did not return a true value at ./YYY line <bart.lateur@skynet.be>
Re: " XXX.pl did not return a true value at ./YYY line <juex@deja.com>
Re: " XXX.pl did not return a true value at ./YYY line <juex@deja.com>
Re: " XXX.pl did not return a true value at ./YYY line <bart.lateur@skynet.be>
Re: " XXX.pl did not return a true value at ./YYY line (Craig Berry)
Re: $& <ren@tivoli.com>
a naming problem <taskiran@ecn.purdue.edu>
Re: a naming problem (Anno Siegel)
Re: a naming problem (Craig Berry)
Re: CGI.pm V. Here Docs . . . (Ameen Dausha)
Combining hierarchical and alphabetical sorting? <dharding@uiuc.edu>
Re: Combining hierarchical and alphabetical sorting? (Craig Berry)
Daemon: should the parent exit or _exit after the fork? <pne-news-20010419@newton.digitalspace.net>
Re: does perl implement polymorphism (late binding)? <ren@tivoli.com>
FAQ .: What will happen if you mail your Perl program <faq@denver.pm.org>
GD/TrueType weirdness. <dharding@uiuc.edu>
Re: GD/TrueType weirdness. <bcoon@sequenom.com>
Re: Getting and using dates from user entry <dodger@necrosoft.net>
Re: help for a basic hash value access question (Anno Siegel)
https module <smilepak@hotmail.com>
Java&Perl or Java by itself? akiyomiya@hotmail.com
Re: mkdir and mv <webmaster@webdragon.unmunge.net>
Net::SMTP <dkelly@quisic.com>
Re: Net::SMTP <randy@theoryx5.uwinnipeg.ca>
Re: Net::SMTP <dkelly@quisic.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 19 Apr 2001 12:10:32 -0700
From: "kalasend at YAHOO dot COM" <dontuspamme@nospammers.com>
Subject: Re: " XXX.pl did not return a true value at ./YYY line 56. "
Message-Id: <TIGD6.19$2E4.188505@chrome-fe.eng.netapp.com>
Ha....this is interesting.
And just what the heck is the point of returning a value when including a
file?
"Jürgen Exner" <juex@my-deja.com> wrote in message
news:3ade5177$1@news.microsoft.com...
> "kalasend at YAHOO dot COM" <dontuspamme@nospammers.com> wrote in message
> news:ifsD6.18$2E4.188107@chrome-fe.eng.netapp.com...
> > line 56 of YYY:
> > require "XXX.pl";
> >
> >
> > contents of XXX.pl:
> > sub foo {
> > print "this is foo\n";
> > }
> >
> > I am just trying to include the subroutines in XXX.pl into YYY
> > Any idea what is wrong?
>
> Yes, your XXX.pl does not return a true value, just as the error message
> said.
> You forgot to end the XXX.pl with a true value: just add the statement
"1;"
> to the end of the script.
>
> jue
>
>
>
------------------------------
Date: 19 Apr 2001 19:17:22 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: " XXX.pl did not return a true value at ./YYY line 56. "
Message-Id: <9bndk2$gnh$2@mamenchi.zrz.TU-Berlin.DE>
Kalasend at YAHOO dot COM <dontuspamme@nospammers.com>:
[please place your reply where it belongs: below the text you're
replying to]
> Ha....this is interesting.
> And just what the heck is the point of returning a value when including a
> file?
That you don't see the point doesn't mean there is none. Instead of
bothering the newsgroup with a petulant query, you might have looked
into the documentation. The answer is in require().
Anno
------------------------------
Date: Thu, 19 Apr 2001 19:21:53 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: " XXX.pl did not return a true value at ./YYY line 56. "
Message-Id: <ogeudt0il11s4sa76g18h859qojitrsr64@4ax.com>
kalasend at YAHOO dot COM wrote:
>And just what the heck is the point of returning a value when including a
>file?
Tradition?
There are voices of removing this requirement in future versions of
Perl.
I think one of the origins of it, is in how require could be
implemented:
do $file or die "$file did not return a true value";
An advantage is that if $file is empty, this line also complains.
--
Bart.
------------------------------
Date: Thu, 19 Apr 2001 12:28:35 -0700
From: "Jürgen Exner" <juex@deja.com>
Subject: Re: " XXX.pl did not return a true value at ./YYY line 56. "
Message-Id: <3adf3c63$1@news.microsoft.com>
"kalasend at YAHOO dot COM" <dontuspamme@nospammers.com> wrote in message
news:TIGD6.19$2E4.188505@chrome-fe.eng.netapp.com...
> Ha....this is interesting.
> And just what the heck is the point of returning a value when including a
> file?
[Please don't post Jeopardy-style]
Which part of "perldoc -f require"
[...] The file must return true as the last statement
to indicate successful execution of any initialization code, so
it's customary to end such a file with `1;' unless you're sure
it'll return true otherwise. But it's better just to put the
`1;', in case you add more statements.
is it that you don't understand?
jue
------------------------------
Date: Thu, 19 Apr 2001 12:32:38 -0700
From: "Jürgen Exner" <juex@deja.com>
Subject: Re: " XXX.pl did not return a true value at ./YYY line 56. "
Message-Id: <3adf3d56$1@news.microsoft.com>
"Bart Lateur" <bart.lateur@skynet.be> wrote in message
news:ogeudt0il11s4sa76g18h859qojitrsr64@4ax.com...
> kalasend at YAHOO dot COM wrote:
> >And just what the heck is the point of returning a value when including a
> >file?
>
> Tradition?
Not at all.
By returning a FALSE the module/included file can indicate that it failed to
initialize itself properly.
If you think about it it's a very useful feature.
jue
------------------------------
Date: Thu, 19 Apr 2001 20:22:48 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: " XXX.pl did not return a true value at ./YYY line 56. "
Message-Id: <h8iudt401kcrvamf1o4v6mgctd6ob5ivos@4ax.com>
Jürgen Exner wrote:
>"Bart Lateur" wrote:
>> >And just what the heck is the point of returning a value when including a
>> >file?
>>
>> Tradition?
>
>Not at all.
>By returning a FALSE the module/included file can indicate that it failed to
>initialize itself properly.
>If you think about it it's a very useful feature.
There's nothing you can do with it that a simple die() can't do.
Check the perl6 mailing list archives. This has been beaten to death. I
think the consensus was that this will most likely be dropped in Perl 6.
--
Bart.
------------------------------
Date: Thu, 19 Apr 2001 20:50:57 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: " XXX.pl did not return a true value at ./YYY line 56. "
Message-Id: <tdujth88knsi1a@corp.supernews.com>
kalasend at YAHOO dot COM (dontuspamme@nospammers.com) wrote:
: Ha....this is interesting.
: And just what the heck is the point of returning a value when including a
: file?
The included file may contain code which does dynamic initialization stuff
during the load process, and in theory said code might determine that it
couldn't operate properly. Under such circumstances, it could return 0 to
indicate that the require failed.
This is purely theoretical for me -- I've never actually seen a required
file do this. See 'perldoc -f require' for a full discussion.
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "When the going gets weird, the weird turn pro."
| - Hunter S. Thompson
------------------------------
Date: 19 Apr 2001 14:59:19 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: $&
Message-Id: <m3k84g3bl4.fsf@dhcp9-172.support.tivoli.com>
On Wed, 18 Apr 2001, brianlk@pacific.net.hk wrote:
> What is the meaning of $& in perl script?
See perlvar(1):
$MATCH
$& The string matched by the last successful pattern
match (not counting any matches hidden within a
BLOCK or eval() enclosed by the current BLOCK).
(Mnemonic: like & in some editors.) This variable
is read-only and dynamically scoped to the current
BLOCK.
The use of this variable anywhere in a program
imposes a considerable performance penalty on all
regular expression matches. See the BUGS manpage.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Thu, 19 Apr 2001 15:10:36 -0500
From: CuneytTaskiran <taskiran@ecn.purdue.edu>
Subject: a naming problem
Message-Id: <3ADF463C.95EA9E4E@ecn.purdue.edu>
Hi,
I have the following problem:
I want to make a system call containg filenames made up on the fly using
variable names. Say $name holds the name of a file. Then I want to be
able to say
system( "some_executable $name_input" );
Is there a way to protext $name from the underscore analogous to the
{$name}_input
in the shell?
Thanks for your time,
Cuneyt
------------------------------
Date: 19 Apr 2001 20:34:08 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: a naming problem
Message-Id: <9bni40$qi1$1@mamenchi.zrz.TU-Berlin.DE>
According to CuneytTaskiran <taskiran@ecn.purdue.edu>:
> Hi,
>
> I have the following problem:
>
> I want to make a system call containg filenames made up on the fly using
>
> variable names. Say $name holds the name of a file. Then I want to be
> able to say
>
> system( "some_executable $name_input" );
>
> Is there a way to protext $name from the underscore analogous to the
> {$name}_input
> in the shell?
Yes, and the mechanism is the same. It's documented in perldata.
Anno
------------------------------
Date: Thu, 19 Apr 2001 20:53:48 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: a naming problem
Message-Id: <tduk2s1o5mbua5@corp.supernews.com>
CuneytTaskiran (taskiran@ecn.purdue.edu) wrote:
: I want to make a system call containg filenames made up on the fly using
: variable names. Say $name holds the name of a file. Then I want to be
: able to say
:
: system( "some_executable $name_input" );
:
: Is there a way to protext $name from the underscore analogous to the
: {$name}_input in the shell?
Quite similar: "some_executable ${name}_input"
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "When the going gets weird, the weird turn pro."
| - Hunter S. Thompson
------------------------------
Date: Thu, 19 Apr 2001 19:37:47 GMT
From: ameen @ dausha . net (Ameen Dausha)
Subject: Re: CGI.pm V. Here Docs . . .
Message-Id: <3adf3e49.161507905@news.bellatlantic.net>
Dan Baker <dan@nospam_dtbakerprojects.com> spake from on high
claiming:
>
>> >CGI.pm isn't bad. It's just slow for many reasons I won't get into.
>-------------------
>compared to the time it takes for the server-client response, cgi.pm
>speed seems trivial. I would recommend only pulling in the pieces you
>need. Its very easy.... with a statement like this:
>use CGI qw( cookie param ); # just add whatever subs you are actually
>using
>
>D
Thanks, Dan, that's pretty close to what I've been doing personally .
. . but I'm still a wee bit greedy. :-)
Ben Wilson (a.k.a. Ameen, Last of the Dausha)
____________________________
-"Ever heard of Aristotle . . . Plato . . . Socrates?!"
-"Yes."
-"Morons!"
------------------------------
Date: Thu, 19 Apr 2001 15:43:42 -0500
From: Dan Harding <dharding@uiuc.edu>
Subject: Combining hierarchical and alphabetical sorting?
Message-Id: <3ADF4DFE.36FE5B2E@uiuc.edu>
As is not uncommon these days, I found a partial solution
to a scripting problem via this newgroup. I've been
able to adapt the example code that was supplied to
fit my particular scenario, but I need to extend its
capabilities slightly. Unfortunately, my understanding
of the code in question is somewhat limited (I understand
most of what is happening in theory, but I find much
of the syntax baffling).
The original code provided is included in its entirety at
the end of this message.
The thread where I gleaned this code is:
http://groups.google.com/groups?hl=en&lr=&safe=off&ic=1&th=23a6d7fd84e4095&seekd=918358190#918358190
Using the original code, I can produce the following example:
Printing Division
Bindery
Folder
Cutter
Pressroom
Prepress
Production Office
Office of the Director
Quickcopy Centers
Large Format Plotting
Digital Imaging
Where (Bindery, Pressroom, Prepress, Production Office) are children
of Printing Division, (Folder, Cutter) are children of Bindery,
and (Large Format Plotting, Digital Imaging) are children of
QuickCopy Centers. Office of the Director has no children.
My question is how can children of the same parent be alphabetized?
The output I'm looking for is:
Office of the Director
Printing Division
Bindery
Cutter
Folder
Prepress
Pressroom
Production Office
Quickcopy Centers
Digital Imaging
Large Format Plotting
Assume data is in the prerequisite delimited
form being split below.
Thank you very much in advance,
-Dan
========== BEGIN CODE =============
------------------------------
#!/usr/bin/perl -w
use strict;
### collect up the node data
my %channel_hash;
while ( <DATA> ) {
chomp;
my($id, $name, $parent) = split /,/;
$channel_hash{$id} = { name => $name,
parent => $parent,
kids => [] # a list of the children node
IDs
};
}
#### collect up a list of children IDs for each node
foreach my $node ( keys %channel_hash ) {
my $parent = $channel_hash{$node}{parent};
push @{$channel_hash{$parent}{kids}}, $node;
}
### output with recursive subroutine
my $depth = 0; # for deciding indent level
foreach my $child ( sort @{$channel_hash{0}{kids}} ) { # children of the
root
walk($child);
}
sub walk {
my($id) = @_;
print '.' x ($depth * 4), $channel_hash{$id}{name}, "\n";
$depth++;
foreach my $child ( @{$channel_hash{$id}{kids}} ) {
walk($child);
} $depth--;
}
------------------------------
Date: Thu, 19 Apr 2001 21:32:17 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Combining hierarchical and alphabetical sorting?
Message-Id: <tdumb1hj37bb81@corp.supernews.com>
Dan Harding (dharding@uiuc.edu) wrote:
[big ol' snip]
: My question is how can children of the same parent be alphabetized?
Well, the children of the root are being alphabetized, right? And that's
happening here:
: foreach my $child ( sort @{$channel_hash{0}{kids}} ) { # children of the root
: walk($child);
: }
And inside walk, is where you iterate over that child's nodes, like this:
: foreach my $child ( @{$channel_hash{$id}{kids}} ) {
: walk($child);
: }
Notice any suggestive difference in the list expressions over which you're
iterating? :)
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "When the going gets weird, the weird turn pro."
| - Hunter S. Thompson
------------------------------
Date: Thu, 19 Apr 2001 20:25:51 +0200
From: Philip Newton <pne-news-20010419@newton.digitalspace.net>
Subject: Daemon: should the parent exit or _exit after the fork?
Message-Id: <k0budtosrd2g1i910p9ltfjru0b31qqio6@4ax.com>
I'm writing a daemon in Perl and am wondering whether I need to call exit or
_exit (well, POSIX::_exit) in the parent after the fork.
`perldoc -q daemon` and `perldoc perlipc` both use normal exit, but I seem to
recall having read somewhere that in fork environments, one should call _exit so
that stdio structures don't get prematurely cleaned up or something like that.
I noted that the example in the Unix Programming FAQ (v1.37) also uses _exit in
its daemon code.
Is this relevant for Perl, too? Camel III implies that the only difference is
whether DESTROY and END subroutines are run (of which I have none). Can I keep
the exit or should it be _exit? (I'm use-ing POSIX anyway for setsid().)
(I also used a double fork as in the Unix Programming FAQ, rather than a single
fork -- the actual worker process is thus the grandchild of the originally
started process, and has lost both its father and grandfather.)
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: 19 Apr 2001 14:17:29 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: does perl implement polymorphism (late binding)?
Message-Id: <m3ofts3diu.fsf@dhcp9-172.support.tivoli.com>
On Thu, 19 Apr 2001, bart.lateur@skynet.be wrote:
> Lachlan Rosenberg wrote:
>
>>By polymorphism i mean the invoking of a method of an object via a
>>reference to the object as an instance of its base class resulting
>>in the execution of the method defined by the objects actual
>>superclass definition
>
> Keyword to look for: "SUPER".
>
> But I don't think that is the actual meaning of the word
> "polymorphism". I think that, if one object is a Square, and the
> other a Circle, polymorphism allows you to do:
>
> $object->draw;
>
> where one object will execute the Square::draw method, and the other
> Circle::Draw. You DON'T need a superclass in order to be able to do
> that. All that you need is that the methods exist in the individual
> class packages.
In other words, using a common base class to implement polymorphism is
not a requirement -- just a popular implementation. Perl allows this
implementation, but does not require it. Since there is no
strong-typing, a scalar can hold a reference to any class of object,
and as long as that class implements (either directly or indirectly)
the prescribed method, you get a polymorphic effect.
As others have already recommended, Damian Conway's
_Object_Oriented_Perl_ is *the* work on this topic. Not surprisingly,
there is a chapter on Polymorphism (Chapter 7).
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Thu, 19 Apr 2001 18:15:58 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ .: What will happen if you mail your Perl programming problems to the authors
Message-Id: <yXFD6.1313$T3.195744768@news.frii.net>
This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with every Standard Distribution of
Perl.
+
What will happen if you mail your Perl programming problems to the authors
Your questions will probably go unread, unless they're suggestions of
new questions to add to the FAQ, in which case they should have gone to
the perlfaq-suggestions@perl.com instead.
You should have read section 2 of this faq. There you would have learned
that comp.lang.perl.misc is the appropriate place to go for free advice.
If your question is really important and you require a prompt and
correct answer, you should hire a consultant.
-
Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short. They represent an important
part of the Usenet tradition. They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep comming up. If you are some how irritated by
seeing these postings you are free to ignore them or add the sender
to your killfile. If you find errors or other problems with these
postings please send corrections or comments to the posting email
address.
If you are not able to find this or other Perl documentation from
your installation you may access it via the web by following the
appropriate links from one of the addresses listed below.
http://theoryx5.uwinnipeg.ca/mod_perl/cpan-search
http://www.perldoc.com
http://www.cpan.org
http://www.perl.com
Answers to questions about LOTS of other stuff, mostly not related to
Perl, can be found at
news:news.answers
and in the many thousands of other useful Usenet news groups.
Please note that the FAQ text posted by this server has been modified
from that distributed in the stable Perl release. It has been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ is available on request.
The perlfaq manual pages contain the following copyright notice.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-1999 Tom Christiansen and Nathan
Torkington. All rights reserved.
When included as an integrated part of the Standard
Distribution of Perl or of its documentation (printed or
otherwise), this work is covered under Perl's Artistic
License. For separate distributions of all or part of
this FAQ outside of that, see the perlfaq manpage.
Irrespective of its distribution, all code examples here
are public domain. You are permitted and encouraged to
use this code and any derivatives thereof in your own
programs for fun or for profit as you see fit. A simple
comment in the code giving credit to the FAQ would be
courteous but is not required.
This work is provided in the hope that it will be useful but does
not represent a commitment of any kind on the part of the contributers,
authors or their agents.
--
This space intentionally left blank
------------------------------
Date: Thu, 19 Apr 2001 15:10:20 -0500
From: Dan Harding <dharding@uiuc.edu>
Subject: GD/TrueType weirdness.
Message-Id: <3ADF462C.6A51A067@uiuc.edu>
I'm working with the GD module for the first time.
Server: WinNT
Perl: ActiveState 5.6.0
I've added GD via PPM. Everything appears to be working fine
with one small problem: things are going haywire with TrueType
fonts.
The command:
@bounds =
GD::Image->stringTTF($background,"c:/winnt/fonts/Gil_____.ttf",10,0,1,10,$textstring);
returns a valid array of values, so I'm assuming that TTF support
is there and that the font file in question is being found (if I
change the path to a bogus one things blow up).
The problem is that when I actually go to write the text on the image:
@bounds =
$final->stringTTF($brown,"c:/winnt/fonts/Gil_____.ttf",10,0,1,10,$textstring);
What should be the text shows up as boxes instead of the actual text.
This happens regardless of what font I choose (I initially thought it
might be a corrupted font, but it happens even with Arial).
The font file is obviously being found (and yes, the font is installed),
but it's not rendering properly. Is it a permissions problem?
Thanks in advance,
-Dan
------------------------------
Date: Thu, 19 Apr 2001 13:37:17 -0700
From: Bryan Coon <bcoon@sequenom.com>
Subject: Re: GD/TrueType weirdness.
Message-Id: <3ADF4C7D.8DFA7097@sequenom.com>
Dan Harding wrote:
> I'm working with the GD module for the first time.
>
> Server: WinNT
> Perl: ActiveState 5.6.0
>
> I've added GD via PPM. Everything appears to be working fine
> with one small problem: things are going haywire with TrueType
> fonts.
>
> The command:
>
> @bounds =
> GD::Image->stringTTF($background,"c:/winnt/fonts/Gil_____.ttf",10,0,1,10,$textstring);
>
> returns a valid array of values, so I'm assuming that TTF support
> is there and that the font file in question is being found (if I
> change the path to a bogus one things blow up).
>
> The problem is that when I actually go to write the text on the image:
>
> @bounds =
> $final->stringTTF($brown,"c:/winnt/fonts/Gil_____.ttf",10,0,1,10,$textstring);
>
> What should be the text shows up as boxes instead of the actual text.
> This happens regardless of what font I choose (I initially thought it
> might be a corrupted font, but it happens even with Arial).
>
> The font file is obviously being found (and yes, the font is installed),
> but it's not rendering properly. Is it a permissions problem?
>
> Thanks in advance,
>
> -Dan
I dont think so... I cant say for sure in windoze what version of GD.pm is installed, but
I do know that in unix the default version is not compiled with truetype support. So
chances are great that you need to rebuild the GD library to support truetype. Sadly,
I can tell you exactly how to do this in unix, but I have no clue in windows.
You can verify this by using the can_do_ttf() method included in the GD::Text module, but
I am 99.9% sure this is the problem.
The docs in GD::Text will tell you about this as well.
Good luck!
Bryan
------------------------------
Date: Thu, 19 Apr 2001 19:02:54 GMT
From: "Dodger" <dodger@necrosoft.net>
Subject: Re: Getting and using dates from user entry
Message-Id: <yDGD6.15636$B22.3592328@news1.rdc2.pa.home.com>
"Glenn & Pam" <glenn&pam@desertdoghouse.com> wrote in message
news:3ADBB365.8F65F5E3@desertdoghouse.com...
> Where is a good source of information on dealing with date information
> from user entry. I'm trying to reformat and compare date entries
> without being overly restrictive to the user input. I know there are
> date functions in perl and would like to know where to find detailed
> information on them.
There's no way to really know how to parse a date if you don't know the date
format. You can guess, but not always correctly.
For instance:
200101
could be 1 January 1920 or 1 January 2020 or January 2001 (no day) or 20
January 2001, depending on how you interpret it.
Unless you specify a date format they have to use, and assume they follow
directions, you can't just take a free text date and expect it to work.
On the other hand, you can, if this is a CGI, always do something like
follows:
#--------------------------------
my %months = (January=>0,
February=>1,
March=>2,
#etc
);
my @dates = (1..31);
my @years = (1937..2038);
use CGI;
my $cgi = new CGI;
print $cgi->header;
my $mtable = $cgi->popup_menu(-name=>'month',
-values=>keys %months,
-default=>'January',
-labels=>\%months);
my $dtable = $cgi->popup_menu('date',[@dates]);
my $ytable = $cgi->popup_menu('year',[@years],(localtime)[5]+1900);
print <<"eohtml" and exit;
<form method="POST" action="whatever.cgi">
<table>
<tr><td>Day</td><td>Month</td><td>Year</td></tr>
<tr><td>$dtable</td><td>$mtable</td><td>$ytable</td></tr>
<tr><td align-="right"><input type="submit"></td?</tr>
</table>
eohtml
------------------------------
Date: 19 Apr 2001 19:02:21 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: help for a basic hash value access question
Message-Id: <9bncnt$gnh$1@mamenchi.zrz.TU-Berlin.DE>
According to Gwyn Judd <tjla@guvfybir.qlaqaf.bet>:
> to the list. Actually I'm not really sure you can take a reference to a
> list, I think it would always be converted to an array reference.
You get a list of references. The "\" operator distributes over
a list. I have yet to find that useful...
Anno
------------------------------
Date: Thu, 19 Apr 2001 21:25:53 GMT
From: "smilepak" <smilepak@hotmail.com>
Subject: https module
Message-Id: <BJID6.971$cM1.57429@newsread1.prod.itd.earthlink.net>
Question:
I need to access a secure http site to pull data on a daily basis. The site
request a username/password. Anyone know of a way I can get perl to do a
https call and passing a username/password when it request for it?
I know perl has a "GET" function, however that doesn't work with secure http
server.
Any insight? Thanks,
KN
------------------------------
Date: 19 Apr 2001 21:55:08 GMT
From: akiyomiya@hotmail.com
Subject: Java&Perl or Java by itself?
Message-Id: <9bnmrs$4fm$1@news.netmar.com>
I took Java2 class (10 weeks) that covered the basic and I am ready to take a
next Java class.
At the same time, I feel like I need to improve my Perl skill.
However, I am wondering if there are many advantages learning/improving Perl
as well as learning Java. Are there many things that I cannot do in Java,
but can do in Perl? If so, please let me know in more details.
Since the technology is changing so fast, I cannot afford spending a lot of
time learning every language, so I like to know the pros and cons of
learning Perl in addition to Java.
Please let me know before I pick up Perl Cook Book.
Thank you
AK
----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net
------------------------------
Date: 19 Apr 2001 19:28:31 GMT
From: "Scott R. Godin" <webmaster@webdragon.unmunge.net>
Subject: Re: mkdir and mv
Message-Id: <9bne8v$qlg$0@216.155.32.202>
In article <slrn9dtof0.2pd.tadmc@tadmc26.august.net>,
tadmc@augustmail.com (Tad McClellan) wrote:
| > | Perl does have a primitives to make directories and rename files though.
| > | Why don't you use them?
| >
| >Oh fine, exploit the primitives.. You'll be sorry when they band
| >together and overthrow the system.
|
| When they overthrow the system, backticks, exec and pipe opens,
| _then_ we'll really be backed into a corner...
ROFL :D
just as long as they don't have a pipe with my name on it... *duck*
--
unmunge e-mail here:
#!perl -w
print map {chr(ord($_)-3)} split //, "zhepdvwhuCzhegudjrq1qhw";
# ( damn spammers. *shakes fist* take a hint. =:P )
------------------------------
Date: Thu, 19 Apr 2001 13:36:02 -0700
From: Darnell Kelly <dkelly@quisic.com>
Subject: Net::SMTP
Message-Id: <3ADF4C32.D03DD602@quisic.com>
all,
does this module support a cc: method...i tried to send emails with a
cc; field and i get the nasty error
can't find auto/NET/cc.al in @INC etc...
but when i use the smtp->to($to) or smtp->from($from) objects the script
is ok...
is cc: not allowed or is it? if this module can't support this which one
should i use? i searched CPAN but could not find one i need...
thanks,
darnell
------------------------------
Date: 19 Apr 2001 20:51:52 GMT
From: Randy Kobes <randy@theoryx5.uwinnipeg.ca>
Subject: Re: Net::SMTP
Message-Id: <9bnj58$se9$1@canopus.cc.umanitoba.ca>
In comp.lang.perl.misc, Darnell Kelly <dkelly@quisic.com> wrote:
> does this module support a cc: method...i tried to send emails with a
> cc; field and i get the nasty error
> can't find auto/NET/cc.al in @INC etc...
> but when i use the smtp->to($to) or smtp->from($from) objects the script
> is ok...
What if you try adding the cc recipient via
$smtp->to('whoever@wherever.com');
then later put in the header
$smtp->datasend("Cc: whoever\@wherever.com\n");
best regards,
randy kobes
------------------------------
Date: Thu, 19 Apr 2001 14:48:21 -0700
From: Darnell Kelly <dkelly@quisic.com>
Subject: Re: Net::SMTP
Message-Id: <3ADF5D25.87CAD571@quisic.com>
that did it...thanks...i used data instead of datasend...are these both real
methods or arbitrary because i know that data works but hadn't seen datasend
before.
Randy Kobes wrote:
> In comp.lang.perl.misc, Darnell Kelly <dkelly@quisic.com> wrote:
>
> > does this module support a cc: method...i tried to send emails with a
> > cc; field and i get the nasty error
> > can't find auto/NET/cc.al in @INC etc...
> > but when i use the smtp->to($to) or smtp->from($from) objects the script
> > is ok...
>
> What if you try adding the cc recipient via
> $smtp->to('whoever@wherever.com');
> then later put in the header
> $smtp->datasend("Cc: whoever\@wherever.com\n");
>
> best regards,
> randy kobes
------------------------------
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.
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 722
**************************************