[10569] in Perl-Users-Digest
Perl-Users Digest, Issue: 4161 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 5 17:08:04 1998
Date: Thu, 5 Nov 98 14:00:24 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 5 Nov 1998 Volume: 8 Number: 4161
Today's topics:
Re: Array problems for newbie <mikeg@slpmbo.ed.ray.com>
Re: Can a Perl program effect the parent process?? <glauber@iws-irms.com>
Re: currancy variable, newbie question (Tad McClellan)
Re: DELL Computers Knowingly Installs Malfunctioning Mc <uri@fastengines.com>
Re: From Unix to WinNT (Bbirthisel)
FTP in Perl (Hendrik 'MooseMan' Schnepel)
Re: FTP in Perl <glauber@iws-irms.com>
Re: Having problems with a long script <d-edwards@nospam.uchicago.edu>
Re: Heterogeneous Data Structures: possible? If so, how droby@copyright.com
Installation Error <scott.ranzal@mci.com>
Re: magic increment problem <d-edwards@nospam.uchicago.edu>
Re: magic increment problem (Tad McClellan)
Re: Not to start a language war but.. (Ilya Zakharevich)
ODBC Resource? <geoff@newinteractive.com>
Re: OO Question jbharvey@auspex.net
Re: OO Question <zenin@bawdycaste.org>
Re: Perl and Directory Permissions problem w/ IIS 3.0 <hoffmanpa@groton.pfizer.com>
Re: perl questions PLEASE HELP ASAP! (Tad McClellan)
Re: perl&cgi question jbharvey@auspex.net
Re: perl/split() question. <rootbeer@teleport.com>
Re: perl/split() question. <tim@iuinc.com>
Perl5 win32 directory structure and Config.PM <bbarnes@dev.tivoli.com>
PLEASE HELP! (Gord Barentsen)
Re: pointer question (Tad McClellan)
Problem running shell script in perl. <navin@ti.com>
Re: redirecting interpreter output <r_larsen@image.dk>
Re: reg. expr question. (Patrick Timmins)
Re: system(". $file"); #odd result! <navin@ti.com>
time question <cadman@tikipub.com>
Re: time question <gbc1@axe.humboldt.edu>
Re: time question <uri@fastengines.com>
WEB/CGI NT4.0/IIS problem executing an executable <pjl39@prc.erinet.com>
WEB/CGI NT4.0/IIS problem executing an executable <pjl39@prc.erinet.com>
why a newbie group should not be made (was Re: time que <uri@fastengines.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 05 Nov 1998 13:43:25 -0500
From: Michael Genovese <mikeg@slpmbo.ed.ray.com>
To: Tim Hicks <tim.hicks@iname.com>
Subject: Re: Array problems for newbie
Message-Id: <3641F1CD.7AAE9B94@slpmbo.ed.ray.com>
--------------FF2C4E879B3D6EF96017CBC4
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Tim Hicks wrote:
> (Apologies if this message has appeared twice, it didn't seem to show up the
> first time I tried to send.)
>
> Hi all,
>
> I am currently reading through 'Learning Perl' for Unix (despite running
> Win95, which was a mistake!) and trying to do the exercises at the end of
> chapters. Can anyone tell me what is wrong with this solution to chapter 6,
> question 1. It is supposed to have someone enter a list of words, and then
> print out those words in reverse order. The problem is, it doesn't print
> the last word that has been entered. Here is the code.
>
> #!/usr/bin/perl -w
> print "Enter your word list followed by 'control' Z\n";
> while (<>) {
> push (@array, $_);
> }
> @arrayr = reverse (@array);
> print @arrayr;
> <snip>
It seems to work fine for me here (in SunOS 5.6).
I can only suggest the problem you're experiencing is due to the handling of
input (your CTRL-Z) under DOS/WINDOWS.
Why not try ending the loop when the user simply hits RETURN, rather than
entering a word ?
Yours,
Mike G.
--
Mike Genovese, Sr. S/W Engineer
Software Engineering Laboratory, Raytheon, Marlborough, MA
508-490-3891
My opinions are my own, and not necessarily those of my employer.
--------------FF2C4E879B3D6EF96017CBC4
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Tim Hicks wrote:
<blockquote TYPE=CITE>(Apologies if this message has appeared twice, it
didn't seem to show up the
<br>first time I tried to send.)
<p>Hi all,
<p>I am currently reading through 'Learning Perl' for Unix (despite running
<br>Win95, which was a mistake!) and trying to do the exercises at the
end of
<br>chapters. Can anyone tell me what is wrong with this solution
to chapter 6,
<br>question 1. It is supposed to have someone enter a list of words,
and then
<br>print out those words in reverse order. The problem is, it doesn't
print
<br>the last word that has been entered. Here is the code.
<p>#!/usr/bin/perl -w
<br>print "Enter your word list followed by 'control' Z\n";
<br>while (<>) {
<br>push (@array, $_);
<br>}
<br>@arrayr = reverse (@array);
<br>print @arrayr;
<br><snip></blockquote>
<p><br>It seems to work fine for me here (in SunOS 5.6).
<br>I can only suggest the problem you're experiencing is due to the handling
of input (your CTRL-Z) under DOS/WINDOWS.
<br>Why not try ending the loop when the user simply hits RETURN, rather
than entering a word ?
<p>Yours,
<br> Mike G.
<br>
<pre>--
Mike Genovese, Sr. S/W Engineer
Software Engineering Laboratory, Raytheon, Marlborough, MA
508-490-3891
My opinions are my own, and not necessarily those of my employer.</pre>
</html>
--------------FF2C4E879B3D6EF96017CBC4--
------------------------------
Date: Thu, 05 Nov 1998 15:04:18 -0500
From: Glauber Ribeiro <glauber@iws-irms.com>
Subject: Re: Can a Perl program effect the parent process??
Message-Id: <364204C2.F6CC3580@iws-irms.com>
David Cantrell wrote:
>
> On Thu, 22 Oct 1998 22:31:46 GMT, drgreer@qtiworld.com (Darren Greer)
> enlightened us thusly:
>
> >The subject explains it all....but here is my situation. I have a
> >perl program that I want to set the DISPLAY env variable.
> >Unfortunatley from what I understand on a *nix system, a child process
> >(ie perl program) can not effect the parent process?) Is there anyway
> >to do this.
>
> Not on Unix. Please read the FAQ.
>
> On Win32 systems, I'd bet that it's possible, although I haven't
> tried. It would involve some really disgusting messing around in the
> DOS PSPs.
>
> [Copying newsgroup posts to me by mail is considered rude]
Well, in Unix, you need some sort of IPC, such as a signal handler or
shared memory. Same in Windows.
glauber
> --
> David Cantrell, part-time Unix/perl/SQL/java techie
> full-time chef/musician/homebrewer
> http://www.ThePentagon.com/NukeEmUp
--
Glauber Ribeiro --- IWS
mailto:glauber@iws-irms.com
http://www.iws-irms.com
------------------------------
Date: Thu, 5 Nov 1998 07:06:09 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: currancy variable, newbie question
Message-Id: <1s7s17.rj.ln@flash.net>
James Jones (jajej@ici.net) wrote:
: I want to limit this variable to two decimal places eqivalent to a currancy
: field.
: 12.2534586 -> 12.26
: How would I accomplish this??
By reading the Perl FAQ, part 4:
"Does perl have a round function? What about ceil() and floor()?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 05 Nov 1998 16:38:47 -0500
From: Uri Guttman <uri@fastengines.com>
To: ceo@ccgate.hac.com (Bill Campbell)
Subject: Re: DELL Computers Knowingly Installs Malfunctioning McAfee VirusScan Software
Message-Id: <sarsofxbz14.fsf@camel.fastserv.com>
<snip flame about dell, mcafee and viruses>
and what does this have to do with perl? are there perl viruses on pc's?
(interesting question: can you make a perl virus?) does mcaffee or dell
even know what perl is? do we care if they do? does anyone care at all
about this?
just asking,
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: 5 Nov 1998 21:53:00 GMT
From: bbirthisel@aol.com (Bbirthisel)
Subject: Re: From Unix to WinNT
Message-Id: <19981105165300.23339.00004363@ng-fd2.aol.com>
Hi Steve:
>I've written all of my Perl scripts for the Unix platform, and now I
>have to install some of them on a WinNT server. Am I in for a big
>surprise or will it be easy to move them to the WinNT server. I'd hate
>to have to program some
You don't say what your scripts DO, so it's hard to answer. Expect to
have to do a little extra programming, at least. While it's possible to
write scripts that run seamlessly across platforms (including NT), most
existing scripts need to tweak at least:
1. Binmode for some file accesses.
2. Line Endings (CRLF vs LF).
3. Directory paths and filenames.
4. Database calling parameters if any.
5. Anything that relys on the shell (system, backticks, wildcards).
6. The documented omissions: fork, alarm, etc.
Get the updated FAQs from the ActiveState site and don't be afraid to
ask reasonable questions.
Good luck.
-bill
Making computers work in Manufacturing for over 25 years (inquiries welcome)
------------------------------
Date: Thu, 05 Nov 1998 19:36:40 GMT
From: schnepel@cruise.de (Hendrik 'MooseMan' Schnepel)
Subject: FTP in Perl
Message-Id: <3641fdf0.638736@news.allcon.net>
Hi,
how do I access an FTP server with Perl?
Beispiel: Download von fremdem Server auf den, wo's CGI lduft.
Example: I want to download a file from a server to my server where a
CGI is running.
Would be happy about a little hind.
I already thought at Net::ftp - but where do I get it?
c ya
Hendrik (schnepel@cruise.de)
------------------------------
Date: Thu, 05 Nov 1998 15:05:27 -0500
From: Glauber Ribeiro <glauber@iws-irms.com>
Subject: Re: FTP in Perl
Message-Id: <36420507.F21369DF@iws-irms.com>
Hendrik 'MooseMan' Schnepel wrote:
> =
> Hi,
> =
> how do I access an FTP server with Perl?
> Beispiel: Download von fremdem Server auf den, wo's CGI l=E4uft.
> Example: I want to download a file from a server to my server where a
> CGI is running.
> =
> Would be happy about a little hind.
> I already thought at Net::ftp - but where do I get it?
> =
Net::ftp is part of "libnet", which you can get at CPAN (start at
www.cpan.org...). =
glauber
> c ya
> Hendrik (schnepel@cruise.de)
-- =
Glauber Ribeiro --- IWS
mailto:glauber@iws-irms.com
http://www.iws-irms.com
------------------------------
Date: Thu, 5 Nov 1998 21:35:54 GMT
From: Darrin Edwards <d-edwards@nospam.uchicago.edu>
Subject: Re: Having problems with a long script
Message-Id: <tg4ssd256t.fsf@noise.bsd.uchicago.edu>
"Kris (Menace Publishing & Manufacture)" <menace@ziplink.net> writes:
>
> Having problems with a very long script -- getting the error message it
> generates tells me it's due to "Premature end of script headers". Those
If you run "perldoc perldiag" on your computer, you will get
a description of all possible error messages that perl will produce.
Unfortunately, this one doesn't appear to be one of them. Could
this be a server error of some kind? (Can you run this perl
script at the command line without getting errors?)
> headers follow (I think -- I'm not
> even sure where the header ends and the body begins). Any and all help would
> be gratefully appreciated. I'm a total perl moron, surprise surprise.
Well, I'm a cgi moron, so I'm sorry I can't help you any more. :)
> #!/usr/bin/perl -- -*- C -*-
> $logging = 1;
> $logfile = '/usr/httpd/www/fakedomain/ORDER';
> $script_loc = '/usr/httpd/www/fakedomain/cgi-bin/mailto.pl';
> $cgi_lib = 'cgi-lib.pl';
> $script_http = 'http://vwww2.clark.net/fakedomain/cgi-bin/mailto.pl';
> $toname = 'fake@clark.net';
> require "cgi-lib.pl";
>
If you do try to test your script at the command line, you
might want to add " -w" after the word perl on that first line.
Then, if there are any problems on the perl side of things, you'll
find out more about what's going wrong.
Darrin
------------------------------
Date: Thu, 05 Nov 1998 19:45:41 GMT
From: droby@copyright.com
Subject: Re: Heterogeneous Data Structures: possible? If so, how?
Message-Id: <71sv94$54c$1@nnrp1.dejanews.com>
In article <xfkpvb3j66r.fsf@bigger.aa.net>,
Charles Roten <croten@bigger.aa.net> wrote:
> I want to do something more than a little odd ... I want to build a
> structure $DataStructure such that sometimes
>
> $DataStructure->[$index]->{$key}
>
> refers to a scalar/string, and sometimes to a named hash or array.
>
> As in (string case)
>
> $FireWall_Rule->[7]->{"install"}->"firewall_box"
>
> but (array case)
>
> $FireWall_Rule->[7]->{"services"}->[0]->"telnet"
> $FireWall_Rule->[7]->{"services"}->[1]->"login"
> $FireWall_Rule->[7]->{"services"}->[2]->"echo-request"
>
> and (hash case)
>
> $FireWall_Rule->[7]->{"action"}->{"accept"}->{"type"}->"accept"
> $FireWall_Rule->[7]->{"action"}->{"accept"}->{"color"}->"Dark green"
> $FireWall_Rule->[7]->{"action"}->{"accept"}->{"icon-name"}->"icon-accept"
>
> etc. All in the _same_ $FireWall_Rule structure.
>
perldoc perlref is helpful, as all of these constructs are really references
to arrays of references to hashes of references to things that might or
arrays of references or hashes of references .... eventually (let us hope)
leading to scalars.
You may also find it natural to use OO concepts in dealing with this sort of
data structure. Or not... ;-) Take a look at perltoot for help with that.
There are at any rate alot of references used in the OO stuff, so that'll give
you some examples.
To get you started, the structure you described can be initialized with your
sample data by
$FireWall_Rule->[7]={'install' => 'filewall_box',
'services' => ['telnet', 'login','echo-request'],
'action' => {'accept' => {'type' => 'accept',
'color' => 'Dark green',
'icon-name' => 'icon-accept'
}
}
};
or, equivalently, by
$FireWall_Rule->[7]->{'install'} = 'firewall_box';
$FireWall_Rule->[7]->{'services'}->[0] = 'telnet';
$FireWall_Rule->[7]->{'services'}->[1] = 'login';
$FireWall_Rule->[7]->{'services'}->[2] = 'echo-request';
$FireWall_Rule->[7]->{'action'}->{'accept'}->{'type'} = 'accept';
$FireWall_Rule->[7]->{'action'}->{'accept'}->{'color'} = 'Dark green';
$FireWall_Rule->[7]->{'action'}->{'accept'}->{'icon-name'} = 'icon-accept';
or by a lot of other ways in between these. I reality you're likely to end
up referencing and dereferencing alot and never typing things quite this
long, but it's good to get a sense of the structure this way.
The Data::Dumper module is also useful with such structures, and if you need
to do this stuff with tied hashes, you should also look at the MLDBM module.
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 5 Nov 1998 11:09:06 -0800
From: "Scott Ranzal" <scott.ranzal@mci.com>
Subject: Installation Error
Message-Id: <8Im02.972$oL3.3776@news.cwix.com>
All
I am trying to install Perl 5.005_02 on a SCO system. I was using all
defaults except for the install directories using /u/local instead of
/usr/local.
During make I received a failure while "making re (static)" the failure was;
" chmod 755 ../../lib/auto/re/re.a
cc -L/usr/local/lib -o perl perlmain.o
lib/auto/DynaLoader/DynaLoade
r.a lib/auto/B/B.a lib/auto/Data/Dumper/Dumper.a lib/auto/Fcntl/Fcntl.a
lib/auto
/IO/IO.a lib/auto/IPC/SysV/SysV.a lib/auto/NDBM_File/NDBM_File.a
lib/auto/ODBM_F
ile/ODBM_File.a lib/auto/Opcode/Opcode.a lib/auto/POSIX/POSIX.a
lib/auto/SDBM_Fi
le/SDBM_File.a lib/auto/Socket/Socket.a lib/auto/attrs/attrs.a
lib/auto/re/re.a
libperl.a `cat
ext.libs` -ldbm.nfs -lintl -lsocket -lnsl_s -lndbm -lld -lm -lc -
lPW -lx
undefined first referenced
symbol in file
ctob lib/auto/IPC/SysV/SysV.a
stoc lib/auto/IPC/SysV/SysV.a
ld fatal: Symbol referencing errors. No output written to perl
*** Error code 13
"
I'm not really sure what this error is. I was unable to locate information
about an error of this type in the INSTALL or hints/sco.sh file.
Any advice would be appreciated
Scott
scott.ranzal@mci.com
------------------------------
Date: Thu, 5 Nov 1998 21:01:37 GMT
From: Darrin Edwards <d-edwards@nospam.uchicago.edu>
Subject: Re: magic increment problem
Message-Id: <tg67ct26ry.fsf@noise.bsd.uchicago.edu>
karlon@bnr.ca (Karlon West) writes:
> Stephen Riehm (sr@pc-plus.de) wrote:
> > Hi JAPH's,
>
> > I was astounded to find the following "magic" in perl's magical
> > autoincrementation. Here are a few simple strings to be incremented:
>
> > $a = "123";
> > $b = "file1";
> > $c = "1file";
> > $d = "my1stfile";
>
> from "perldoc perlop" $c and $d above do not match the pattern
> specified below that invokes the autoincrment magic:
[snip]
> a numeric context, you get a normal increment. If, however, the
> variable has been used in only string contexts since it was set, and
> has a value that is not null and matches the pattern
> C</^[a-zA-Z]*[0-9]*$/>, the increment is done as a string, preserving each
> character within its range, with carry:
But why does $c become 2 then? $d I understand; a string in numeric
context is 0, so it increments to 1. I expected the same behavior
from $c, but I get:
noise:~>perl -e '$Homer="17file"; $Homer += 0; print "Homer is $Homer.\n";'
Homer is 17.
Aha! Found it in the _Perl Cookbook_, p. 42:
'Perl quietly converts non-numeric strings to 0, and it will stop
converting the string once it reaches a non-numeric character -- so
"A7" is still 0, and "7A" is just 7. (Note, however, that the -w
^^^^^^
flag will warn you of such improper conversions.)'
^^^^
(Emphasis (^^^) added...)
Couldn't find that bit in the faq, at least not in that much
detail... Certainly the _moral_ is the same one that every perl
tale seems to have. :)
Darrin
------------------------------
Date: Thu, 5 Nov 1998 06:59:30 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: magic increment problem
Message-Id: <if7s17.rj.ln@flash.net>
Stephen Riehm (sr@pc-plus.de) wrote:
: Hi JAPH's,
: I was astounded to find the following "magic" in perl's magical
: autoincrementation. Here are a few simple strings to be incremented:
: $a = "123";
: $b = "file1";
: $c = "1file";
: $d = "my1stfile";
: now we try:
: $a++; $b++; $c++; $d++;
: and we get:
: $a: "124"
: $b: "file2"
: $c: "2" <--- whoa there >:-|
: $d: "1" <--- whoa there >:-|
: what's the deal with $c and $d - shouldn't they be "1filf" and
: "my1stfilf" respectively? Essentially if there are any embedded digits,
: with the exception of the end of the string, the whole string is treated
: as a number, and when the first character isn't a digit it's
: treated as '0'.
: This effect showed itself in every version of perl I could find,
: is it intended to work this way? Should this be fixed?
That is how it is documented to work ;-)
From the "Auto-increment and Auto-decrement" section in 'perlop':
"If, however, the variable has been used in only string
contexts since it was set, and has a value that is not
null and matches the pattern /^[a-zA-Z]*[0-9]*$/, the
increment is done as a string"
Your last two do not match the pattern.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 5 Nov 1998 19:07:22 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Not to start a language war but..
Message-Id: <71st1a$q35$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to John Edstrom
<edstrom@Poopsie.hmsc.orst.edu>],
who wrote in article <71qoad$qi6$1@news.NERO.NET>:
> Circular refs are also used to build character.
But most the time walking barefoot in snow works much better.
Ilya
------------------------------
Date: Thu, 5 Nov 1998 12:13:27 -0800
From: "Geoff Caylor" <geoff@newinteractive.com>
Subject: ODBC Resource?
Message-Id: <uFn02.268$R31.1010@news14.ispnews.com>
Hello, I'm looking for any sort of resource for ODBC programming for the
Win32 environment, and so far haven't found anything of value...
Any leads are greatly appreciated!
Geoff Caylor
------------------------------
Date: Thu, 05 Nov 1998 19:46:48 GMT
From: jbharvey@auspex.net
Subject: Re: OO Question
Message-Id: <71svb8$550$1@nnrp1.dejanews.com>
If you're lazy, you can use AUTOLOAD, I find that's pretty helpful when
dealing with databases.
j
In article <71sdct$6bp$1@csnews.cs.colorado.edu>,
tchrist@mox.perl.com (Tom Christiansen) wrote:
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc, lemull@unx.sas.com writes:
> :If I wanted to reference "myvar" in some external code I would use the
> :following syntax:
> :
> :use MyClass;
> :$q = new MyClass;
> :print "myvar = $q->{'myvar'}\n";
>
> Oh my! Why are you having something outside the class poke at its
> private bits? That's wicked.
>
> You need accessor methods:
>
> sub myvar {
> my $self = shift;
> $self->{'myvar'} = shift if @_;
> return $self->{'myvar'};
> }
>
> :but, how can I reference the instance variable "myvar" (for this
> :instance) in the DESTROY method of this class?
>
> DESTROY is a method, and has its self reference sitting there
> at the front of @_ waiting for you to snag, as I did above.
>
> --tom
> --
> The secretaries don't understand me. --Rob Pike
>
--
Justin B. Harvey
jbharvey@auspex.net
http://www.auspex.net/jbharvey
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 05 Nov 1998 21:42:45 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: OO Question
Message-Id: <910302120.171067@thrush.omix.com>
[posted & mailed]
Lee Mulleady <lemull@unx.sas.com> wrote:
>snip
: but, how can I reference the instance variable "myvar" (for this
: instance) in the DESTROY method of this class?
sub DESTROY {
my $self = shift; ## By convention, most Perl code uses "self"
## instead of "this".
doSomethingWith ($self->{myvar});
}
All methods, DESTROY and AUTOLOAD included, have the object passed
as the first argument in @_.
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Wed, 4 Nov 1998 14:01:59 -0500
From: "Phil Hoffman" <hoffmanpa@groton.pfizer.com>
Subject: Re: Perl and Directory Permissions problem w/ IIS 3.0
Message-Id: <71q8bc$7ts3@mascagni.pfizer.com>
Thanks. I've been investigating that path, but so far haven't turned
anything up.
Strangely enough when the event occurs, the rest of the web server functions
completely normally. Even other Perl apps on the same box are unaffected!
Phil
Tom Phoenix wrote in message ...
>On Mon, 2 Nov 1998, Phil Hoffman wrote:
>
>> I'm currently running an IIS 3.0 server on NT 4.0 SP3, and have a web
>> application based upon Perl 5 Build 307. From time to time
(unfortunately,
>> this is not reproduceable) the link that *should* execute the Perl script
>> instead prompts the client to save the file. Its as if the association
to
>> the *.pl extension has been lost.
>
>Sounds like a problem with your server. Perhaps the docs, FAQs, and
>newsgroups about servers could help you here. Good luck!
>
>--
>Tom Phoenix Perl Training and Hacking Esperanto
>Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
>
------------------------------
Date: Thu, 5 Nov 1998 07:03:27 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: perl questions PLEASE HELP ASAP!
Message-Id: <vm7s17.rj.ln@flash.net>
jcl (jcl4sale@yahoo.com) wrote:
: I also would like to know away, to thorw away the current input.
: What i mean is, i'm reading from stdio, and i sometime just wan't to
: toss the current string and read the next one, there's probably a real
: simple way to do this, but i don't know, (BTW i'm using a while to get
: data from stdio).
<STDIN>; # read a line, but don't store it anywhere (ie. discard it)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 05 Nov 1998 19:30:00 GMT
From: jbharvey@auspex.net
Subject: Re: perl&cgi question
Message-Id: <71subo$3if$1@nnrp1.dejanews.com>
comp.infosystems.www.*
I did a little research on DejaNews, you are definately not the first to
encounter this problem. Go to www.dejanews.com and search on 'perl download
cgi' and you'll find answers to your problem. One possible solution is to
check your content-type.
j
PS - last post in this thread, wrong newsgroup for this thread.
PPS - sorry
In article <363EC5AF.14E81D60@balder.no>,
Kjetil Svendsberget <kjetil@balder.no> wrote:
>
>
> brian d foy wrote:
> >
> > In article <363DDAE2.A18140AE@corp.home.net>, Justin Harvey
<jbharvey@corp.home.net> posted:
> >
> > > You need to change the mime association for .pl extension inside your
> > > browsers so that it will use it as a CGI, and not try to download it.
> >
> > sorry, but it's the server that does what you are thinking about.
>
> Sorry for asking this in the wrong newsgroup, but as i said this is NOT
> a web server problem, since both machines acess the same web-server
> (www.balder.no), they even have the same browser. IE 4.0 (v.4.72). But i
> get different results looking at the same page.
> I really thought there was something wrong with my perl script because
> whenever the perl script is uncompilable it sometimes happened that the
> browser wants to download the script instead of executing it.
> So if this is not perl related in what newsgroup should i ask this
> question then?
>
> Kjetil
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 05 Nov 1998 19:17:54 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: perl/split() question.
Message-Id: <Pine.GSO.4.02A.9811051114160.3759-100000@user2.teleport.com>
On Thu, 5 Nov 1998, tc lewis wrote:
> any ideas on why:
> $charnum = scalar(split(//, $dname[$#dname]));
>
> gives me the following warning:
> Use of implicit split to @_ is deprecated at ./dnsutil.pl line 439.
Have you seen what perldiag says about this message? You didn't need
scalar() in there, and you probably wanted something different anyway.
Maybe one of these?
$charnum = length $dname[-1];
$charnum = [ split //, $dname[-1] ];
@charnum = split //, $dname[-1];
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 5 Nov 1998 14:38:17 -0500
From: tc lewis <tim@iuinc.com>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: perl/split() question.
Message-Id: <Pine.LNX.3.96.981105143546.25537e-100000@wopr.iuinc.com>
On Thu, 5 Nov 1998, Tom Phoenix wrote:
> On Thu, 5 Nov 1998, tc lewis wrote:
> > any ideas on why:
> > $charnum = scalar(split(//, $dname[$#dname]));
> >
> > gives me the following warning:
> > Use of implicit split to @_ is deprecated at ./dnsutil.pl line 439.
>
> Have you seen what perldiag says about this message? You didn't need
> scalar() in there, and you probably wanted something different anyway.
> Maybe one of these?
>
> $charnum = length $dname[-1];
>
> $charnum = [ split //, $dname[-1] ];
>
> @charnum = split //, $dname[-1];
>
> Hope this helps!
it did help, thanks.
i totally forgot about the length function--that's exactly what i was
looking for. i never saw the -1 index before, but that's cool too. =)
i know the scalar() isn't necessary, but i just like being as "complete"
as possible. i still don't really understand why it warned on the
operation i have above, re: i don't really see anything "wrong" with doing
it like that, but oh well. length() works great. thanks!
-tcl.
tim@iuinc.com
------------------------------
Date: Thu, 05 Nov 1998 13:44:32 -0600
From: "Brian P. Barnes" <bbarnes@dev.tivoli.com>
Subject: Perl5 win32 directory structure and Config.PM
Message-Id: <36420020.EC20D393@dev.tivoli.com>
Hi,
I have tried numerous times to compile the new source for Win32
Perl5.005 according to the README. It always gives me a
/perl/perl5.005/lib directory, no bin directory at all and Perl located
at /perl/perl5.005/perl.exe. I seem to have DBI compiled (miraculously)
and it even seems to pass the initial tests. DBD complains that it can't
find /perl/lib directory, probably because it is buried behind the
perl5.005 directory.
I want to try to organize the essential files by hand and it would be
great to have a normal, working model to look at. Could somebody who has
compiled a WIN32, 5.005, (VC++ ?) possibly do a "ls -R" from the Perl
root directory and post it here. It would also be most helpful if you
could throw in the /perl/lib/Config.PM file.
Is this a common problem and can anyone shed any light on how it
happened?
Many Thanks,
Brian
------------------------------
Date: Thu, 05 Nov 1998 19:12:46 GMT
From: gpb@ppaolucci.com (Gord Barentsen)
Subject: PLEASE HELP!
Message-Id: <3641f78c.6373348@news.the-wire.com>
Hello,
I am just scratching the surface of Perl, and I have come up against
an obstacle I am HOPING someone can help me with...
I am going through Erik Strom's _Perl CGI Programming - No Experience
Required_ and using Sambar Server V4.1. I am doing a very simple
(don't laugh!) "Hellow World!" exercise that uses require statements
to import HTML header and footer files. The original 1-file
HelloWorld works fine; but when I put all the files (hiworld.pl, and
the two required files header.pl and footer.pl) in the same directory,
then try and run it through http://localhost, it refuses to work. In
NS 4.07 I get "Document Contains No Data" and in MSIE 4.0 (4.72) the
download meter starts and slows to a crawl - and this happens when I
am NOT hooked up to the Internet.
If anyone could help me with this dilemma I would be most grateful!
Gord Barentsen
------------------------------
Date: Thu, 5 Nov 1998 07:09:32 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: pointer question
Message-Id: <c28s17.rj.ln@flash.net>
Raj Singh (rsingh@polymail.calpoly.edu) wrote:
: When I run the following code:
: $a = 2;
: $b = /$a;
^
^ that slash is leaning the wrong way
: print $b;
^^
^^ this prints the reference itself, you need to dereference it...
: This is supposed to print the value of $a b/c $b is a reference to it.
: However, my compiler outputs the error:
------------------
#!/usr/bin/perl -w
$a = 2;
$b = \$a;
print $$b;
------------------
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 05 Nov 1998 14:46:52 -0600
From: Navin Chander <navin@ti.com>
Subject: Problem running shell script in perl.
Message-Id: <36420EBC.C49507C2@ti.com>
--------------2EF117EBBACE4488E167F36C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I have three problems
1. I have a shell script that sets my environment before executing
another command which invokes a tool.
In my perl script I would like to execute this shell script followed by
the command for the tool.
Does someone have any suggestions??
I tried
system(" shell.scr");
system("command");
I tried
exec("shell.scr");
exec("scommand");
I tried
`shell.scr`;
`command`;
none of these seem to work.
2. I use tcsh shell. so when I want to execute a script that does not
have a header ("#!/bin/csh") I would like to use
source shell.scr
When I do this in perl, using system or back ticks or exec, I get an
error that says
sh: source not found
I tried to change shells, does not seem to work.
3. when I use system to execute unix commands in perl and if I have
to place braces "( or )" , the shell has some problems in executing the
command. Any idea how to get around this problem??
If you have some insight on this, please send me an email.
thanks in advance
navin
--
****************************************************
Navin Chander Ph: (972)480-2430
PCI Bus Solutions Fax: (972)480-6400
Texas Instruments, Dallas TX Email: navin@ti.com
http://www.ti.com/sc/bus
****************************************************
--------------2EF117EBBACE4488E167F36C
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
I have three problems
<P>1. I have a shell script that sets my environment
before executing another command which invokes a tool.
<P>In my perl script I would like to execute this shell script followed
by the command for the tool.
<P>Does someone have any suggestions??
<P>I tried
<BR>system(" shell.scr");
<BR>system("command");
<P>I tried
<BR>exec("shell.scr");
<BR>exec("scommand");
<P>I tried
<BR>`shell.scr`;
<BR>`command`;
<P>none of these seem to work.
<BR>
<P>2. I use tcsh shell. so when I want to execute a script
that does not have a header ("#!/bin/csh") I would like to use
<P>source shell.scr
<P>When I do this in perl, using system or back ticks or exec, I get an
error that says
<BR>sh: source not found
<P>I tried to change shells, does not seem to work.
<P>3. when I use system to execute unix commands in perl
and if I have to place braces "( or )" , the shell has some problems in
executing the command. Any idea how to get around this problem??
<BR>If you have some insight on this, please send me an email.
<BR>thanks in advance
<BR>navin
<PRE>--
****************************************************
Navin Chander Ph: (972)480-2430
PCI Bus Solutions Fax: (972)480-6400
Texas Instruments, Dallas TX Email: navin@ti.com
<A HREF="http://www.ti.com/sc/bus">http://www.ti.com/sc/bus</A>
****************************************************</PRE>
</HTML>
--------------2EF117EBBACE4488E167F36C--
------------------------------
Date: Thu, 05 Nov 1998 22:43:13 +0100
From: R. A. Larsen <r_larsen@image.dk>
Subject: Re: redirecting interpreter output
Message-Id: <VA.00000072.0086d351@octo>
rebel <rebelvideo@hotmail.com> wrote:
[has a problem redirecting STDERR from the perl interpreter]
I have a program that does exactly what you want. I have downloaded
DJGPP V2 (a MS-DOS port of gcc) and one of the programs included is
called redir.
Here is some info from the manual:
This is the reference manual for the miscellaneous utility programs that
come with DJGPP.
[cut]
* redir:: Manage I/O Redirection.
[cut]
redir
*****
DOS, in its many flavors and versions, lacks a decent I/O redirection
mechanism. Sure, it's got < and > and >>, but what about error
messages? Lots of people ask, "How do you send those error messages to
a file?" Well, you use a program like `redir'.
`redir' is basically a program that manipulates the standard file
descriptors by copying them, closing and opening them, etc. Once it
has the file descriptors where it wants them, it runs your program,
which inherits the changed descriptors. Thus, `redir' has nearly
complete control over the input and output of your program.
[cut]
I am not sure if you what file(s) to download in order to get this
program.
Try looking for it on any SimTel.NET mirror in the
pub/simtelnet/gnu/djgpp/ subdirectory.
I hope this helps.
Reni
--
Using Virtual Access
http://www.vamail.com
------------------------------
Date: Thu, 05 Nov 1998 20:37:53 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: reg. expr question.
Message-Id: <71t2b1$9t7$1@nnrp1.dejanews.com>
In article <3641CB10.E0156884@balder.no>,
Kjetil Svendsberget <kjetil@balder.no> wrote:
> > >any suggestions?
> >
> > ($bit) = $dest_dir =~ /([a-z])\\*$/;
>
> works like a charm. Im still dazzled about what it does though. Care to
> explain?
But you should probably use '\w' instead of 'a-z', put in a '+' after
the character class, and probably use '?' instead of '*' (although for
this example, I don't think it would ever make any difference, as you
are not likely to have a directory that ends in two or more backslashes).
That is, use /([\w]+)\\?$/ if you have any directories that
are more than one character in length, or that have upper case letters,
numbers, etc, in them.
( means "begin capture"
[ means "beginning of a character class"
\w means "any alpha-numeric character"
] means "end of character class"
+ means "one or more" elements from the preceding character class
) means "end capture"
\\ means "a literal backslash"
? means "zero or one" (ie, optional) of the preceding backslashes
$ means "anchored to the end of the string" (ie, nothing following it)
"Mastering Regular Expressions" by Jeffrey Friedl is an excellent
source for learning about regexes in general, and Perl regexes, in
particular.
Patrick Timmins
$monger{Omaha}[0]
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 05 Nov 1998 15:08:53 -0600
From: Navin Chander <navin@ti.com>
Subject: Re: system(". $file"); #odd result!
Message-Id: <364213E5.ABCBF10@ti.com>
--------------162F46146CFECDBADA8A360E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I am having a similar problem, except that the file that I am sourcing not only
sets the env but does other stuff too. I then follow this by executing a command
which uses the setup done by the previous shellscript. It works fine in unix, but
in perl using system or exec it does not work.
Is there a way to run two commands one after another in the same sub shell using
system
thanks
navin
ronald_f@my-dejanews.com wrote:
> In article <71pugo$j9u@fidoii.cc.Lehigh.EDU>,
> "Phil R Lawrence" <prl2@lehigh.edu> wrote:
> > When I run . /path/set_env_vars from the shell prompt there is no problem. If
> > I run the following perl, however...
> >
> > test.pl:
> > ===========================
> > #!/usr/local/bin/perl -w
> > use diagnostics;
> > use strict;
> >
> > # Set environmental variables
> > my $file = '/path/set_env_vars';
> > my $x = system(". $file");
> > print "\$x = $x\n";
> > ===========================
>
> There are several problems with your approach, the main one being that you
> can not set the environment variables that way. Remember that system()
> executes its argument in a sub-shell, so any env setting would get lost when
> system returns.
>
> If you need to set the environment inside a perl prog, assign to the %ENV
> hash, i.e. $ENV{VARIABLE}="value";
>
> Ronald
> --
> Ronald Fischer <ronald_f@my-dejanews.com>
> http://ourworld.compuserve.com/homepages/ronald_fischer/
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
--
****************************************************
Navin Chander Ph: (972)480-2430
PCI Bus Solutions Fax: (972)480-6400
Texas Instruments, Dallas TX Email: navin@ti.com
http://www.ti.com/sc/bus
****************************************************
--------------162F46146CFECDBADA8A360E
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
I am having a similar problem, except that the file that I am sourcing
not only sets the env but does other stuff too. I then follow this by executing
a command which uses the setup done by the previous shellscript. It works
fine in unix, but in perl using system or exec it does not work.
<P>Is there a way to run two commands one after another in the same sub
shell using system
<BR>thanks
<BR>navin
<BR>ronald_f@my-dejanews.com wrote:
<BLOCKQUOTE TYPE=CITE>In article <71pugo$j9u@fidoii.cc.Lehigh.EDU>,
<BR> "Phil R Lawrence" <prl2@lehigh.edu> wrote:
<BR>> When I run . /path/set_env_vars from the shell prompt there is no
problem. If
<BR>> I run the following perl, however...
<BR>>
<BR>> test.pl:
<BR>> ===========================
<BR>> #!/usr/local/bin/perl -w
<BR>> use diagnostics;
<BR>> use strict;
<BR>>
<BR>> # Set environmental variables
<BR>> my $file = '/path/set_env_vars';
<BR>> my $x = system(". $file");
<BR>> print "\$x = $x\n";
<BR>> ===========================
<P>There are several problems with your approach, the main one being that
you
<BR>can not set the environment variables that way. Remember that system()
<BR>executes its argument in a sub-shell, so any env setting would get
lost when
<BR>system returns.
<P>If you need to set the environment inside a perl prog, assign to the
%ENV
<BR>hash, i.e. $ENV{VARIABLE}="value";
<P>Ronald
<BR>--
<BR>Ronald Fischer <ronald_f@my-dejanews.com>
<BR><A HREF="http://ourworld.compuserve.com/homepages/ronald_fischer/">http://ourworld.compuserve.com/homepages/ronald_fischer/</A>
<P>-----------== Posted via Deja News, The Discussion Network ==----------
<BR><A HREF="http://www.dejanews.com/">http://www.dejanews.com/</A>
Search, Read, Discuss, or Start Your Own</BLOCKQUOTE>
<PRE>--
****************************************************
Navin Chander Ph: (972)480-2430
PCI Bus Solutions Fax: (972)480-6400
Texas Instruments, Dallas TX Email: navin@ti.com
<A HREF="http://www.ti.com/sc/bus">http://www.ti.com/sc/bus</A>
****************************************************</PRE>
</HTML>
--------------162F46146CFECDBADA8A360E--
------------------------------
Date: Thu, 05 Nov 1998 11:46:54 -0800
From: cadman <cadman@tikipub.com>
Subject: time question
Message-Id: <364200AD.E63CC7F9@tikipub.com>
How can I get "Wed Oct 21 15:00:30 1998" into the time format in perl?
So that it will show the above date as an integer number of seconds past
midnight GMT, January 1, 1970.
------------------------------
Date: Thu, 05 Nov 1998 13:37:18 -0800
From: Greg Coit <gbc1@axe.humboldt.edu>
Subject: Re: time question
Message-Id: <36421A8D.DC83D449@axe.humboldt.edu>
cadman wrote:
> How can I get "Wed Oct 21 15:00:30 1998" into the time format in perl?
> So that it will show the above date as an integer number of seconds past
> midnight GMT, January 1, 1970.
I use :
($sec,$min,$hour,$day,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$mon = $mon + 1; #convert months from 0-11 to
1-12
$mon = "0$mon" if ($mon < 10); #This ensures a two digit month
$day = "0$day" if ($day < 10); #This ensures a two digit day
$hour = "0$hour" if ($hour < 10); #This ensures a two digit hour
$min = "0$min" if ($min < 10); #This ensures a two digit minute
I believe wday is the number of the day of the week (i.e. 1 for Monday, 3
for Wednesday).
Same for yday (1 for Jan 1st, 46 for Feb 15th etc).
Can't remember what isdst is, but I got this script from the CPAN archives,
it may have an explanation.
Hope this helps,
Greg Coit
gbc1@axe.humboldt.edu
------------------------------
Date: 05 Nov 1998 16:35:00 -0500
From: Uri Guttman <uri@fastengines.com>
To: Navin Chander <navin@ti.com>
Subject: Re: time question
Message-Id: <sarww59bz7f.fsf@camel.fastserv.com>
>>>>> "NC" == Navin Chander <navin@ti.com> writes:
please don't post mime.
NC> cadman wrote:
>> How can I get "Wed Oct 21 15:00:30 1998" into the time format in perl?
>> So that it will show the above date as an integer number of seconds past
>> midnight GMT, January 1, 1970.
NC> You could use
NC> $foo = `time`;
NC> might work
not really. that is a major waste of cpu power and doesn't answer the
question. the program time is used to time other programs. you probably
meant date which is wrong too. that would give the date in the format
shown above. he asked how to convert a formated time string to the
seconds since the epoch. the proper solution is to parse out the string
and use the Time::Local module. other Date:: modules can do the parsing
for you. all this is in perlfaq4 (data: dates).
and please don't post html.
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: Thu, 05 Nov 1998 14:33:18 -0500
From: Pete Lucuk <pjl39@prc.erinet.com>
Subject: WEB/CGI NT4.0/IIS problem executing an executable
Message-Id: <3641FD7E.F4482A23@prc.erinet.com>
I have a Web/CGI NT4.0/I.I.S. application that is written in Perl. I
use a system call in my Perl code to execute some complied C code like
so:
$translate = "c:\\inetpub\\prcweb\\cgi-bin\\test.exe GE 0 *
c:\\temp\\in159.GE c:\\temp\\out159.eng 0 6 10.0.0.5";
system("$translate");
I know all this is possible to do because I have it up and running on a
production machine and it works 100%.
On a development machine, the one I am having a problem with, I formated
the machine and installed NT4.0/IIS, Perl, and my Web/CGI App from
scracth and now I am not able to execute this executable,
c:\inetpub\prcweb\cgi-bin\test.exe!!!
I have made all the changes that are nessecary to make Perl run on the
IIS webserver, registry edits and metadatabases changes and associating
.pl with perl in the management console.
The only thing I can think of is that this executable uses .dlls in the
systtm32 folder but I even put those in my CGI directory and that did
not work.
I am running out of things to try. Like I said, I know this does and
can work beacause I have it up and running on another NT server.
Any ideas or help would be greatly appreciated!!!!
thanks
pjl39@prc.erinet.com
------------------------------
Date: Thu, 05 Nov 1998 14:35:05 -0500
From: Pete Lucuk <pjl39@prc.erinet.com>
Subject: WEB/CGI NT4.0/IIS problem executing an executable
Message-Id: <3641FDE9.7F610722@prc.erinet.com>
I have a Web/CGI NT4.0/I.I.S. application that is written in Perl. I
use a system call in my Perl code to execute some complied C code like
so:
$translate = "c:\\inetpub\\prcweb\\cgi-bin\\test.exe GE 0 *
c:\\temp\\in159.GE c:\\temp\\out159.eng 0 6 10.0.0.5";
system("$translate");
I know all this is possible to do because I have it up and running on a
production machine and it works 100%.
On a development machine, the one I am having a problem with, I formated
the machine and installed NT4.0/IIS, Perl, and my Web/CGI App from
scracth and now I am not able to execute this executable,
c:\inetpub\prcweb\cgi-bin\test.exe!!!
I have made all the changes that are nessecary to make Perl run on the
IIS webserver, registry edits and metadatabases changes and associating
.pl with perl in the management console.
The only thing I can think of is that this executable uses .dlls in the
systtm32 folder but I even put those in my CGI directory and that did
not work.
I am running out of things to try. Like I said, I know this does and
can work beacause I have it up and running on another NT server.
Any ideas or help would be greatly appreciated!!!!
thanks
pjl39@prc.erinet.com
------------------------------
Date: 05 Nov 1998 16:52:29 -0500
From: Uri Guttman <uri@fastengines.com>
Subject: why a newbie group should not be made (was Re: time question)
Message-Id: <sarogqlbyea.fsf_-_@camel.fastserv.com>
>>>>> "GC" == Greg Coit <gbc1@axe.humboldt.edu> writes:
GC> cadman wrote:
>> How can I get "Wed Oct 21 15:00:30 1998" into the time format in perl?
>> So that it will show the above date as an integer number of seconds past
>> midnight GMT, January 1, 1970.
GC> I use :
GC> ($sec,$min,$hour,$day,$mon,$year,$wday,$yday,$isdst) = localtime(time);
GC> $mon = $mon + 1; #convert months from 0-11 to
GC> 1-12
GC> $mon = "0$mon" if ($mon < 10); #This ensures a two digit month
GC> $day = "0$day" if ($day < 10); #This ensures a two digit day
GC> $hour = "0$hour" if ($hour < 10); #This ensures a two digit hour
GC> $min = "0$min" if ($min < 10); #This ensures a two digit minute
boy that is 2 replies that can't read a simple query. he asked how to
get from a formatted time TO the epoch seconds. you just posted the
opposite and in a wasteful way. localtime in a scalar context does what
you wrote
GC> Can't remember what isdst is, but I got this script from the CPAN
GC> archives, it may have an explanation.
is daylight savings time.
i hate (or love) to rant here, but this is why a newbies perl newsgroup
would be funny and painful to read. all of these FAQ's and all of these
wrong answers running in circles around each other. just remember, if it
needs to be done, a matt's script has done it (poorly)!
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 4161
**************************************