[18016] in Perl-Users-Digest
Perl-Users Digest, Issue: 176 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 30 14:22:45 2001
Date: Tue, 30 Jan 2001 11:10:21 -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: <980881821-v10-i176@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 30 Jan 2001 Volume: 10 Number: 176
Today's topics:
GIF Generator <rbfitzpa@my-deja.com>
Re: GIF Generator bits101010@my-deja.com
Re: GIF Generator <tore@extend.no>
Re: HELP Read from file on different server? nobull@mail.com
Re: idea for extension of perldoc and CPAN shell nobull@mail.com
Re: idea for extension of perldoc and CPAN shell (Rich Lafferty)
Re: maintaining Session with Apache nobull@mail.com
Re: perl and embedded systems. <md5.bbs@bbs.ntu.edu.tw>
Re: Perl on 98 <rbfitzpa@my-deja.com>
Re: Perl on 98 (Richard Williams)
printf and leading zeros <russ_jones@rac.ray.com>
Re: Printing to a device, not a local port? <mischief@velma.motion.net>
Re: Question on appending to file <ccx138@coventry.ac.uk>
Re: reading input file and returning values (Garry Williams)
Re: Regular expression question <barmar@genuity.net>
Re: Remotely Update <rbfitzpa@my-deja.com>
Re: Seeking timezone conversion advice <juex@deja.com>
Re: Shared temporary error array in object hierarchy nobull@mail.com
simple hash question. msalerno@my-deja.com
sockaddr_in <m_ario@my-deja.com>
Re: sockaddr_in nobull@mail.com
Re: Sort not working (John Joseph Trammell)
Re: Sort not working <joe+usenet@sunstarsys.com>
Re: Using Braces (Rich Lafferty)
Re: Which one to use...Date::Cal or Date::manip ? (Chris Fedde)
Windows NT Version <sturdevr@yahoo.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 30 Jan 2001 15:59:25 GMT
From: igotlooks.com <rbfitzpa@my-deja.com>
Subject: GIF Generator
Message-Id: <956ocn$75i$1@nnrp1.deja.com>
Does anyone have any simple 'on-the-fly' graphics generator? I'm looking
for something where I could graph an array and create a gif. Any extra
features would be nice but anything will do for now.
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Tue, 30 Jan 2001 16:06:26 GMT
From: bits101010@my-deja.com
Subject: Re: GIF Generator
Message-Id: <956opr$7lr$1@nnrp1.deja.com>
Use the GD module!
http://stein.cshl.org/WWW/software/GD/GD.html
Winston.
In article <956ocn$75i$1@nnrp1.deja.com>,
igotlooks.com <rbfitzpa@my-deja.com> wrote:
> Does anyone have any simple 'on-the-fly' graphics generator? I'm
looking
> for something where I could graph an array and create a gif. Any extra
> features would be nice but anything will do for now.
>
> Sent via Deja.com
> http://www.deja.com/
>
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Tue, 30 Jan 2001 19:17:43 +0100
From: Tore Aursand <tore@extend.no>
Subject: Re: GIF Generator
Message-Id: <MPG.14e123b162777ee2989874@news.online.no>
In article <956ocn$75i$1@nnrp1.deja.com>, rbfitzpa@my-deja.com says...
> Does anyone have any simple 'on-the-fly' graphics generator?
Search for the 'GD' module(s) at <http://www.cpan.org/>
--
Tore Aursand - tore@extend.no - http://www.extend.no/~tore/
------------------------------
Date: 30 Jan 2001 17:47:52 +0000
From: nobull@mail.com
Subject: Re: HELP Read from file on different server?
Message-Id: <u9puh5q6d3.fsf@wcl-l.bham.ac.uk>
emelin@my-deja.com writes:
> Is it possible to read data from a file on a different server?
Yes, you use some sort of network file access/transfer protocol like
NFS, SMB, FTP, HTTP...
Clients for NFS and SMB are usually built into the OS.
Perl clients for FTP and HTTP are available on CPAN.
This question is asked here at least once a week. Please read before
you post.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 30 Jan 2001 17:48:47 +0000
From: nobull@mail.com
Subject: Re: idea for extension of perldoc and CPAN shell
Message-Id: <u9n1c9q6bk.fsf@wcl-l.bham.ac.uk>
Eli the Bearded <elijah@workspot.net> writes:
> Yes, but that requires downloading the whole module first. Often
> I'd like to know if the module can solve my problem before I do
> that. It simplifies my disk space maintainance. (I like to keep
> the source to the modules I install, but usually don't care about
> the ones I don't install.)
This would require changes not only to the CPAN package but also to
the CPAN repositories so that they store the documentation outside of
the module distributions.
Why not simply read the documentation on the CPAN web site?
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 30 Jan 2001 18:57:57 GMT
From: rich@bofh.concordia.ca (Rich Lafferty)
Subject: Re: idea for extension of perldoc and CPAN shell
Message-Id: <slrn97e3pb.k3v.rich@bofh.concordia.ca>
In comp.lang.perl.misc,
nobull@mail.com <nobull@mail.com> wrote:
> Eli the Bearded <elijah@workspot.net> writes:
>
> > Yes, but that requires downloading the whole module first. Often
> > I'd like to know if the module can solve my problem before I do
> > that. It simplifies my disk space maintainance. (I like to keep
> > the source to the modules I install, but usually don't care about
> > the ones I don't install.)
>
> This would require changes not only to the CPAN package but also to
> the CPAN repositories so that they store the documentation outside of
> the module distributions.
>
> Why not simply read the documentation on the CPAN web site?
Or, for that matter, at <URL:http://www.perldoc.org/>, which, while
not having doco for *all* modules, tends to do pretty well. Doing the
equivalent of
lynx -dump -nolist "http://www.perldoc.org/cgi-bin/perldoc.cgi?input=Foo::Bar
as an alias/function in your shell makes it even handier. :-)
-Rich
--
Rich Lafferty ----------------------------------------
Nocturnal Aviation Division, IITS Computing Services
Concordia University, Montreal, QC
rich@bofh.concordia.ca -------------------------------
------------------------------
Date: 30 Jan 2001 18:31:11 +0000
From: nobull@mail.com
Subject: Re: maintaining Session with Apache
Message-Id: <u98znsrixc.fsf@wcl-l.bham.ac.uk>
harilaos <harilaos@ntlworld.com> writes:
> i was wondering if anyone could help me
Your problem is not related to Perl - it is related to your (lack of)
understanding of HTTP. This is the wrong place.
> I want to maintain sessions across several perl scripts and
> i thought a good way was to modify the .htacess file and input
> a user name and password. Then i could pass this information to apache
> to authenticate. By doing this i could have the global variable
> REMOTE_USER for that users session without having to pass it
> though the url, cookies of hidden fields.
> My question: Is there a way to pass authentication information
> to apache without the login window popping up?
The authentication information is in the HTTP request. The request
originates at the client. It _may_ be possible to set credentials in
the client using some sort of client side script. This would require
a much higher level of trust in the server by the client than would
simply accepting cookies. It would also be harder to program and
likely only work on one specific client.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 30 Jan 2001 11:59:49 -0500
From: Abraham S. Lin <md5.bbs@bbs.ntu.edu.tw>
Subject: Re: perl and embedded systems.
Message-Id: <gnsd7t85f95f5o99smb5caikoopp7g9uou@4ax.com>
On Mon, 29 Jan 2001 21:30:35 -0500, Shuo Lin <shuo.lin@sita.int>
wrote:
>Is there an embedded system with perl?
>Thanks/SL@news
Anyone?
------------------------------
Date: Tue, 30 Jan 2001 16:04:41 GMT
From: igotlooks.com <rbfitzpa@my-deja.com>
Subject: Re: Perl on 98
Message-Id: <956omi$7ip$1@nnrp1.deja.com>
You might need to set your PATH or simply execute
>c:\perl\bin\perl <script_name>
and if it's a cgi you can still run it on the command line by:
>echo "var1=somedata&var2=otherdata" | c:\perl\bin\perl <script_name>
or
>echo "var1=somedata&var2=otherdata" | <script_name>
** Replace 'var1' and 'var2' with your form variables and values that
the CGI is expecting.
But you should be running everything from a dos shell so that you don't
lose the output. Command Line is everything - thank you UNIX. (Yes the
above syntax works on Win98).
In article <3A76CCC4.508444AC@bbsrc.ac.uk>,
Simon Andrews <simon.andrews@bbsrc.ac.uk> wrote:
> Anton Pieters wrote:
> >
> > I seem to have a problem running Perl on windows 98. As soon as I
start
> > a CGI-script it bursts out in a DOS window and closes again. I have
got
> > WPS installed and running. I just can't get it going. Is there
someone
> > who can help me with this?
>
> If you are starting the script by double clicking on the file this is
> quite often all you will see. Windows will close the window when the
> program has finished running. A better way to run scripts is to open
a
> DOS shell and use the syntax
>
> 'perl myscript.pl'
>
> to run your scripts. This will leave the output visible.
>
> Obviously, if you are trying to run a CGI script in its final form you
> need to open the file from a browser to get it to run. It's usually
> (always?) better to debug from the command line though.
>
> HTH
>
> Simon
>
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: 30 Jan 2001 18:28:21 GMT
From: rdwillia@hgmp.mrc.ac.uk (Richard Williams)
Subject: Re: Perl on 98
Message-Id: <957145$220$1@niobium.hgmp.mrc.ac.uk>
In article <3A7496EE.CC24E059@chello.nl>,
Anton Pieters <a.pieters@chello.nl> wrote:
>I seem to have a problem running Perl on windows 98. As soon as I start
>a CGI-script it bursts out in a DOS window and closes again. I have got
>WPS installed and running. I just can't get it going. Is there someone
>who can help me with this?
For CGI, you may want to give the IndigoPerl build a try - comes complete
with an Apache webserver (works out of the box), and is compatible with
ActivePerl binary modules):
http://www.indigostar.com/
(Free download)
------------------------------
Date: Tue, 30 Jan 2001 10:03:22 -0600
From: Russ Jones <russ_jones@rac.ray.com>
Subject: printf and leading zeros
Message-Id: <3A76E5CA.6E7583FB@rac.ray.com>
I have a number that looks like this:
$num = 0.33;
and I want to print it as
.33
without the leading zero. Is there any way to do it with printf? I
know I could
something like s/^0//, but even a format of %.2f gives me 0.33, not
just .33.
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
Cacatne ursus in sylvis? - Ovid
------------------------------
Date: Tue, 30 Jan 2001 18:29:41 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Printing to a device, not a local port?
Message-Id: <t7e20l7jjfk333@corp.supernews.com>
Chris W <chrisw@dynamite.com.au> wrote:
> "Chris W" <chrisw@dynamite.com.au> wrote in message
> news:Drqd6.40$rP4.2085@news0.optus.net.au...
> [snip]
>> open(PRINTER, '> file://server/laserjet') || die;
> Pardon Outlook Express' braindead munging of my file name.
> You need to remove the file: bit that it added (leaving slash slash server
> slash laserjet)
The original post you made didn't include 'file:'. That was added by OE
when you reread your own post ;)
Don't forget, too, that at least some (I'm not sure if all do) HP
network print servers allow FTP of a file to the print server, with
any username and password. I often just FTP my files (text, PS, or
PCL) straight to the JetDirect, which then sends it to the printer.
This is convenient, and a good reason to consider an access list
on your router as well. ;)
Chris
--
Christopher E. Stith
Disclaimer: Actual product may not resemble picture in ad in any way.
------------------------------
Date: Tue, 30 Jan 2001 16:20:51 +0000
From: John Tutchings <ccx138@coventry.ac.uk>
Subject: Re: Question on appending to file
Message-Id: <3A76E9E2.65D3115F@coventry.ac.uk>
I still say the other program should be fixed to handle one line files.
Jerome Abela wrote:
> "igotlooks.com" wrote :
> > You might want to add the 'close(FILE)' lines if you want it to work,
> > but I agree - this is probably the quickest/easiest solution.
>
> I agree that you may want to add the 'close(FILE)' for many reasons
> (make it more readable, easier to maintain, ...). However, you don't
> have to add them to make it work, as open() behaviour is *defined* as
> closing the file handle first. The manual for close() goes even further:
>
> "You don't have to close FILEHANDLE if you are immediately going to do
> another `open' on it, because `open' will close it for you."
>
> Jerome
------------------------------
Date: Tue, 30 Jan 2001 19:03:20 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: reading input file and returning values
Message-Id: <YdEd6.4645$GF2.65292@eagle.america.net>
On Mon, 29 Jan 2001 09:18:22 -0800, Razi Ahmed <rahmed@corp.phone.com>
wrote:
>I have a file (config) like this
>mta= s1,s2,s3;
>to =you@s1.com
>from=me@s2.com
>subject= hello
>
>i want to read this file and parse it and return the values..
>i opened a filehandle
Are warnings enabled? Are strictures enabled? How would I know that?
>sub config(){
>open(config, "/xy/z/cfg.text")
This code does not compile. Did you cut and paste the actual code?
(When I cut and pasted this code, I got a fatal error message: `syntax
error at - line 3, near "<config>{"'.)
It looks like you don't check the result of the open() for success.
*Always* check the result of open().
>while<config>{
>
>chomp; # no newline
> s/#.*//; # no comments
> s/^\s+//; # no leading white
> s/\s+$//; # no trailing white
> next unless length; # anything left?
> #my ($var, $value) = split(/\s*=\s*/, $_, 2);
> my ($var, $value) = split(/\s*=\s*/, $_, 2);
> $User_Preferences{$var} = $value;
>}
>
>Now I am wanna return the four values from config module..
>need some help..
What does that mean? Does the caller expect to receive a list of four
values? If so, why did you store them into a package hash variable.
Save them in an array and return the array.
Does the caller expect a hash to be returned? Then
return(%User_Preferences);
And, if so, why store them in a package hash variable? Make it a
lexical.
Does the caller expect a reference to a hash to be returned? Then
return(\%User_Preferences);
And, if so, why store them in a package hash variable? Make it a
lexical.
Have you considered making %User_Preferences a lexical? :-)
Does the caller expect the subroutine to load the values into the
package hash variable %User_Preferences? If so, there's no need to
return anything.
By the way, your code is hard to read (and thus will be hard to
maintain for either you or someone else) because you use very little
white space and your indentation style is confused. You would benefit
by reading the perlstyle manual page.
--
Garry Williams
------------------------------
Date: Tue, 30 Jan 2001 16:27:49 GMT
From: Barry Margolin <barmar@genuity.net>
Subject: Re: Regular expression question
Message-Id: <9YBd6.8$W1.360@burlma1-snr2>
In article <135d7t83bpgp8nr4igcmf6cpsm4530ncgc@4ax.com>,
Bart Lateur <bart.lateur@skynet.be> wrote:
>Barry Margolin wrote:
>
>>s/^.\{15\}//
>
>That is an understandable mistake, if you use more other regexp packages
>(like sed/grep/awk/lex, or search tools inside text editors) than Perl.
I read the message in comp.unix.questions and didn't notice that it was
x-posted to comp.lang.perl.misc, so I answered in a sed/grep frame of mind.
--
Barry Margolin, barmar@genuity.net
Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
------------------------------
Date: Tue, 30 Jan 2001 15:57:15 GMT
From: igotlooks.com <rbfitzpa@my-deja.com>
Subject: Re: Remotely Update
Message-Id: <956o8o$73p$1@nnrp1.deja.com>
Sure this can be done. After a lot of research on the web I have been
able to implement a rather large online documentation system where my
client can Upload/Download/Create/Edit/Delete/Search files on an entire
filesystem which contains all of their On-Call procedures and
documentation.
I've been thinking about releasing the code as freeware on
http://buildacom.com but I haven't gotten around to doing it yet.
There are several ways of doing what your looking for, I have
accomplished it by using Perl/CGI and HTML/Forms. You need to learn how
to master forms and server side scripting to get it right, I have a cgi
for each function (upload,delete,create,edit) which essentially takes
the input of the form and stores it on the server. Vice versa, it takes
the contents of a file and displays it in the content (textarea) of the
form.
I wish there was a simple solution but theres not, as of yet. You have
to get to know Mime types, possibly configure your webserver, file
permissions etc... If your working on a Unix platform I can setup a
download area on http://buildacom.com and you can have all the source
code, if your working on windows it's the same principle but you would
have to port the code over. At the very least you would learn the
principles behind online File Managers.
Feel free to contact me at bfitz70@hotmail.com or through the contact
form on http://buildacom.com. http://buildacom.com will be down for a
few hours today thanks to (?*!#$) TimeWarner.
In article <fDzd6.1533$zZ.529028@news02.optonline.net>,
"blnukem" <blnukem@hotmail.com> wrote:
> I was just wondering if it is possible for a client to log on to his
web
> server threw a web browser and then remotely update a file say
"data.txt"
> from another server totally elimination the client ever touching it?
> Basically transfer from server to server. If it can be done please
tell me
> where can I read up on it.
>
>
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Tue, 30 Jan 2001 10:12:54 -0800
From: "Jürgen Exner" <juex@deja.com>
Subject: Re: Seeking timezone conversion advice
Message-Id: <3a770425$1@news.microsoft.com>
"James Weisberg" <chadbour@wwa.com> wrote in message
news:UIod6.13898$Sl.606099@iad-read.news.verio.net...
> This isn't strictly a perl question, per se, and I apologize in
> advance for the length, but I'm looking for some advice using perl
> to calculate a timezone offset. Let me start by describing the idea.
> Imagine you have a file with configuration info for four sites in
> different timezones:
[...]
> Each site has a database associated with it and there will be some
> script which comes along and wants to combine records of one database
> with those of another, but perhaps the combination wants to take into
> account the timezone difference between the sites. What I have above
[long description snipped]
Forget it. The easiest and most reliable way is to store your data (for the
databases in all four time zones!!!) in UTC. Then merging and maintaining
the data will a snap.
Only for displaying the time to the user you should convert it into local
time according to their current setting.
jue
------------------------------
Date: 30 Jan 2001 18:07:14 +0000
From: nobull@mail.com
Subject: Re: Shared temporary error array in object hierarchy
Message-Id: <u9hf2grk19.fsf@wcl-l.bham.ac.uk>
twolfmaier@acm.org writes:
> I have an object hierarchy that consists of two or more levels, a base
> clase and several derived classes. In certain subroutines, save() in the
> example below, each class in the hierarchy performs validations. Any
> errors should be collected into an array of errors that is shared
> between the classes in the hierarchy.
> sub save {
> my $self = shift;
>
> # Perform some validation
> push @errors, 'There was an error in the derived class';
>
> return $self->SUPER::save;
> }
> The only problem is that errors keep accumulating. I could clear the
> error array at the beginning of each subroutine, but then I run into the
> problem of how objects higher in the hierarchy know that objects in the
> lower level have already cleared the array. I would have the same
> problem if I would assign the errors to an attribute of the object hash.
One solution would be to separate the save and validate methods.
sub save {
@errors = ();
my $self = shift;
$self->validate;
return if @errors;
# Save the object
return 1;
}
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 30 Jan 2001 17:51:39 GMT
From: msalerno@my-deja.com
Subject: simple hash question.
Message-Id: <956uv6$dq1$1@nnrp1.deja.com>
I have an array of passwords that I want to convert to a hash so there
are no duplicates.
I have a subroutine returning a scalar var that is the password.
Then the password is placed inside an array.
I am just using an array for now because I am having problems with the
hash.
The array looks like the following:
$pwarray[0] = "rndpw1";
$pwarray[1] = "rndpw2";
$pwarray[2] = "rndpw3";
$pwarray[3] = "rndpw4";
Any assistance would be appreciated.
Thanks,
Matt
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Tue, 30 Jan 2001 17:36:40 GMT
From: Mario <m_ario@my-deja.com>
Subject: sockaddr_in
Message-Id: <956u37$d18$1@nnrp1.deja.com>
I get a 'undefined function' error while using the sockaddr_in function
on an NT server so I am trying to pack the address using this template
but doesn't work.
Could anyone give me a working smtp mailer or help me with this error?
thanks.
$SOCK_ADDR = "S n a4 x8";
pack($SOCK_ADDR, $AF_INET, $SMTP_PORT, $I_ADDR);
--
Mario
diab.litoATusa.net
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: 30 Jan 2001 18:16:48 +0000
From: nobull@mail.com
Subject: Re: sockaddr_in
Message-Id: <u9bssorjlb.fsf@wcl-l.bham.ac.uk>
Mario <m_ario@my-deja.com> writes:
> I get a 'undefined function' error while using the sockaddr_in function
Did you forget to "use Socket"?
Anyhow the low level "use Socket" stuff is really tedious. Much
better to "use IO::Socket" and stop worring about the low level stuff.
> on an NT server so I am trying to pack the address using this template
> but doesn't work.
>
> Could anyone give me a working smtp mailer or help me with this error?
> thanks.
Working SMTP mailers can be found on CPAN in the "mail" section.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 30 Jan 2001 16:15:45 GMT
From: trammell@bayazid.hypersloth.net (John Joseph Trammell)
Subject: Re: Sort not working
Message-Id: <slrn97do6n.9kc.trammell@bayazid.hypersloth.net>
On 30 Jan 2001 15:53:02 GMT, Blstone77 <blstone77@aol.com> wrote:
> I thought I had this all figured out, but obviously NOT! can anyone
> tell me why this perl sortscript is not working correctly. I am
> trying to sort by score, but It prints nothing, and I can't seem to
> find the problem. Is this sorting orcan you explain to me where I
> am going wrong!
>
For starters:
#!/usr/local/bin/perl -w
use strict;
...
------------------------------
Date: 30 Jan 2001 11:29:25 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Sort not working
Message-Id: <m3lmrt9f6i.fsf@mumonkan.sunstarsys.com>
blstone77@aol.com (Blstone77) writes:
> I thought I had this all figured out, but obviously NOT!
> can anyone tell me why this perl sortscript is not working
> correctly. I am trying to sort by score, but It prints nothing,
nothing, or just $word?
> and I can't seem to find the problem. Is this sorting orcan
> you explain to me where I am going wrong!
>
> #!/usr/local/bin/perl
^^
-wT
use strict;
>
> $scorefile = "scorelog.txt";
^^
my
[...]
> open (THELOG, "<$scorefile") or die $!;
my (%scores, $total, $score2, %scores2);
> while (<THELOG> ) {
> chomp;
> ($screenname, $password, $score, $date, $quesnum, $status)
> = split(/\|/);
> $scores{$screenname} = [$password,$score,$date,$quesnum,$status];
> $total =($total + $score2);
while(<THELOG>) {
chomp;
my @line = split [[|]]; # yikes!
$scores{shift(@line)} = \@line; # @line must be lexically-scoped!
$total += $score2; # are you sure you have a $score2?
> }
> close THELOG;
> foreach $word (sort { $scores{$b}->[0] <=> $scores{$a}->[0] }
^ ^ ^
y/0/1/ or s/<=>/cmp/; # why aren't warnings enabled?
> keys %scores) {
> print "$word $scores2{$word}->[0] $scores2{$word}->[1]\n";
^ ^
Where is %scores2 defined?
--
Joe Schaefer
------------------------------
Date: 30 Jan 2001 19:00:11 GMT
From: rich@bofh.concordia.ca (Rich Lafferty)
Subject: Re: Using Braces
Message-Id: <slrn97e3th.k3v.rich@bofh.concordia.ca>
In comp.lang.perl.misc,
jlamport@calarts.edu <jlamport@calarts.edu> wrote:
>
> Read the docs a little more carefully. The "quote like" operators
> ( q qq qx qw s m tr ) can use *any* set of delimiters you choose. The
> following are all equivalent:
>
> $sql=q{select sysdate from dual};
> $sql=q(select sysdate from dual);
[etc]
You left out my favorites: q`` qw'' qx"" :-)
-Rich
--
Rich Lafferty ----------------------------------------
Nocturnal Aviation Division, IITS Computing Services
Concordia University, Montreal, QC
rich@bofh.concordia.ca -------------------------------
------------------------------
Date: Tue, 30 Jan 2001 17:45:02 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Which one to use...Date::Cal or Date::manip ?
Message-Id: <y4Dd6.1477$B9.194320384@news.frii.net>
In article <956ket$3an$1@nnrp1.deja.com>,
smax <sumera.shaozab@lmco.com> wrote:
>Hi,
>
>I am trying to find the difference between two dates in days. One date
>is given in this format: mm/dd/yy and the other date is the current
>date that I have to get from the system. Which module should I use to
>calculate the difference between the two dates. Should I convert the
>system date in the mm/dd/yy format too?
>
>any help is appreciated. Thanks
>
>SAS
>
Date::Manip supports conversion between large numbers of date
formats and reletive date formats. It also has most of the delta
functions that you want. It has some problems with date ranges
that cross time zones (such as the convertion from daylight savings
to standard time).
Time::ParseDate does a pretty good job of converting odd string
representations of the date and time into epoch seconds. It is
also reasonably fast. From epoch seconds the math is up to you.
you can always use POSIX::strftime to convert back to a string
representation of the date.
Date::Calc has lots and functions for working with wierd and
wonderful date operations. Be sure to check out the RECIPES section
of it's manual.
There are probably other choices but these are the ones that I've used.
Good luck
--
This space intentionally left blank
------------------------------
Date: Tue, 30 Jan 2001 13:36:43 -0500
From: "BobS" <sturdevr@yahoo.com>
Subject: Windows NT Version
Message-Id: <9571gr$oq3$1@bob.news.rcn.net>
Hi,
Does anyone know of a Perl way to identify NT Server vs NT Workstation?
Environment variables only identify Windows_NT in both platforms. I've come
up with a kludge using winmsd.exe but it's bad ;-( Thanks.
Bob
------------------------------
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 V10 Issue 176
**************************************