[17509] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4929 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 20 03:05:29 2000

Date: Mon, 20 Nov 2000 00:05:10 -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: <974707509-v9-i4929@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 20 Nov 2000     Volume: 9 Number: 4929

Today's topics:
    Re: Accessing windows terminal server (Homer Simpson)
        C to C++ conversion <vidulats@yahoo.co.uk>
    Re: composer wants web page designed - nyc (David H. Adler)
    Re: Getting Bold Font on plain ASCII (Logan Shaw)
    Re: how do I delete initial and final spaces in a strin (Garry Williams)
    Re: how do I delete initial and final spaces in a strin <wyzelli@yahoo.com>
    Re: how do I delete initial and final spaces in a strin (Christopher Burke)
    Re: how do I delete initial and final spaces in a strin (Christopher Burke)
        Is "use GD;" part of the standard Perl library ? <claudej@videotron.ca>
    Re: Is "use GD;" part of the standard Perl library ? (Martien Verbruggen)
        problem with Upload method of CGI object. <Ashok.Nagaraj@in.bosch.com>
        Problems saving an uploaded file. <johan.ditmar@era.ericsson.se>
    Re: rearranging a text file (Logan Shaw)
    Re: rearranging a text file (Steven Smolinski)
    Re: rearranging a text file <wyzelli@yahoo.com>
    Re: Strange behavior from localtime() Oct31 2000 or lat <softh@bellsouth.net>
    Re: Strange behavior from localtime() Oct31 2000 or lat <softh@bellsouth.net>
    Re: Strange behavior from localtime() Oct31 2000 or lat <joe+usenet@sunstarsys.com>
    Re: trim() equivalent in Perl? <uri@sysarch.com>
    Re: What is a Junior Perl Programmer? <uri@sysarch.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 20 Nov 2000 05:11:36 GMT
From: homer.simpson@springfield.nul (Homer Simpson)
Subject: Re: Accessing windows terminal server
Message-Id: <8vabq8$pu3$0@216.39.130.222>

In article <8v9e3k$sn3$1@nnrp1.deja.com>, luca_vertua@my-deja.com wrote:
>Hi, I need to retrive data using a windows terminal server connection,
>perl may act as a client or may use some microsoft library to "emulate"
>client.    Any idea will be appreciated.
>Luke

The only "data" you retrive with a Windows TS connection is the session on the 
Terminal Server.

Are you trying to get Terminal Server session infomation with Perl so that 
you can manage the sessions?

If you're trying to pick up data that resides on the TS in a subdirectory you 
can get to it via the unc path  and a file open script

\\tsrv-1\someshare\filename.txt




------------------------------

Date: Mon, 20 Nov 2000 06:30:06 -0000
From: <vidulats@yahoo.co.uk>
Subject: C to C++ conversion
Message-Id: <t1hh7etm9n98cc@corp.supernews.com>

Hello,

I heard that, by using Perl scripts, we could convert our C source code to 
C++ source code.

Where I will get the detail information of these?

I have one project in C, which I want to convert in C++.

I know re-coding is one of the alternatives to that.

How can I use Perl here?

Will anyone guide me for this.
or send me some sites where I will get the information of this.

Thanks in advance,

Regards,
Vidula


--
Posted via CNET Help.com
http://www.help.com/


------------------------------

Date: 20 Nov 2000 08:00:40 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: composer wants web page designed - nyc
Message-Id: <slrn91hmh8.g04.dha@panix6.panix.com>

On Sat, 18 Nov 2000 04:51:14 GMT, ;; h e l m e r . . . wrote:
> contact me if you want a small job

You have posted a job posting or a resume in a technical group.

Longstanding Usenet tradition dictates that such postings go into
groups with names that contain "jobs", like "misc.jobs.offered", not
technical discussion groups like the ones to which you posted.

Had you read and understood the Usenet user manual posted frequently
to "news.announce.newusers", you might have already known this. :)  (If
n.a.n is quieter than it should be, the relevent FAQs are available at
http://www.faqs.org/faqs/by-newsgroup/news/news.announce.newusers.html)

Please do not explain your posting by saying "but I saw other job
postings here".  Just because one person jumps off a bridge, doesn't
mean everyone does.  Those postings are also in error, and I've
probably already notified them as well.

If you have questions about this policy, take it up with the news
administrators in the newsgroup news.admin.misc.

There is a Perl Jobs Announce list that may be more helpful to you.  See
<http://www.pm.org/mailing_lists.shtml> for details.

Yours for a better usenet,

dha


-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
And, considering the prevalence of displaced psychiatric patients
among the ranks of the homeless, the viewpoints are usually guaranteed
to involve aliens or 7 foot tall magical cats.	- Mark Rogaski


------------------------------

Date: 19 Nov 2000 23:47:51 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Getting Bold Font on plain ASCII
Message-Id: <8vadu7$7m7$1@boomer.cs.utexas.edu>

In article <8vaa8e$n2f@junior.apk.net>,
Mark W. Schumann <catfood@apk.net> wrote:
>If you have bold face type, it's not plain ASCII anymore.

Not if you're sending to a good old-fashioned dot matrix or daisy wheel
printer where backspace makes the print head move to the left.

For instance, to send "JAPH" in bold, just send this sequence of ASCII
codes:

	0x4A 0x08 0x4A 0x08 0x4A 0x08 0x4A
	0x41 0x08 0x41 0x08 0x41 0x08 0x41
	0x50 0x08 0x50 0x08 0x50 0x08 0x50 
	0x48 0x08 0x48 0x08 0x48 0x08 0x48 

Or, if you like, send this sequence instead, since it will quite
possibly print faster:

	0x4A 0x41 0x50 0x48 0x08 0x08 0x08 0x08
	0x4A 0x41 0x50 0x48 0x08 0x08 0x08 0x08
	0x4A 0x41 0x50 0x48 0x08 0x08 0x08 0x08
	0x4A 0x41 0x50 0x48

Of course, somehow I don't think that's what the original poster
wanted, but it is a way to do bold using only ASCII.  (Well, O.K.,
ASCII plus long since obsolete printing equipment.)

  - Logan


------------------------------

Date: Mon, 20 Nov 2000 05:06:23 GMT
From: garry@zweb.zvolve.net (Garry Williams)
Subject: Re: how do I delete initial and final spaces in a string?
Message-Id: <jj2S5.1113$xb1.68410@eagle.america.net>

On Mon, 20 Nov 2000 14:20:49 +0930, Wyzelli <wyzelli@yahoo.com> wrote:
>"Mauro" <-@-.com> wrote in message news:8v9tq3$4ge$1@nslave3.tin.it...
>
>Well, I would use a regex.
>
>while (<DATA>){
>    s/\s*(.*\S)\s*\|\s*(.*\S)\s*/$1|$2/;
>    print "$_\n";
>}

Doesn't anyone read the FAQs?  

-- 
Garry Williams


------------------------------

Date: Mon, 20 Nov 2000 14:45:34 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: how do I delete initial and final spaces in a string?
Message-Id: <Sm2S5.42$Is1.2437@vic.nntp.telstra.net>

"Garry Williams" <garry@zweb.zvolve.net> wrote in message
news:jj2S5.1113$xb1.68410@eagle.america.net...
> On Mon, 20 Nov 2000 14:20:49 +0930, Wyzelli <wyzelli@yahoo.com> wrote:
> >"Mauro" <-@-.com> wrote in message
news:8v9tq3$4ge$1@nslave3.tin.it...
> >
> >Well, I would use a regex.
> >
> >while (<DATA>){
> >    s/\s*(.*\S)\s*\|\s*(.*\S)\s*/$1|$2/;
> >    print "$_\n";
> >}
>

Initial spaces and Trailing spaces is in the FAQ, but I havent seen
anything about a pipe delimited file with extraneous leading, trailing
and internal spaces before... :)


Wyzelli
--
@x='07411711511603209711011111610410111403208010111410803210409709910710
1114'=~/(...)/g;
print chr for @x;




------------------------------

Date: 20 Nov 2000 07:13:56 GMT
From: craznar@hotmail.com (Christopher Burke)
Subject: Re: how do I delete initial and final spaces in a string?
Message-Id: <8FF2AB2BCcraznar@130.102.2.1>

sub trim { my $a=$_[0]; $a =~ s/^\s*(.*?)\s*$/\1/; return($a); };

-@-.com (Mauro) wrote in <8v9tq3$4ge$1@nslave3.tin.it>:

>I need to transform data like below:
>
>input:
>         fgdfgsdf fgdfgklh fgdfslhjfd           |     25,534
>   fsdhj  asgh flhfsdhjklfda fsdhjlfd   |  543,432,344
>      fdfsdg fsdgfsdg fdg fsdg f              |          344
>
>output:
>fgdfgsdf fgdfgklh fgdfslhjfd|25,534
>fsdhj  asgh flhfsdhjklfda fsdhjlfd|543,432,344
>fdfsdg fsdgfsdg fdg fsdg f|344
>
>Using regexps it seems there isn't a way to perform it..
>(please think on solution with fastest exec. time)
>
>thanks all
>Marco
>
>



------------------------------

Date: 20 Nov 2000 07:15:01 GMT
From: craznar@hotmail.com (Christopher Burke)
Subject: Re: how do I delete initial and final spaces in a string?
Message-Id: <8FF2A0738craznar@130.102.2.1>

trammell@nitz.hep.umn.edu (John J. Trammell) wrote in 
<slrn91ggr2.sb9.trammell@nitz.hep.umn.edu>:

>On Mon, 20 Nov 2000 02:13:18 -0800, Mauro <-@-.com> wrote:
>>I need to transform data like below:
>>
>>input:
>>         fgdfgsdf fgdfgklh fgdfslhjfd           |     25,534
>>   fsdhj  asgh flhfsdhjklfda fsdhjlfd   |  543,432,344
>>      fdfsdg fsdgfsdg fdg fsdg f              |          344
>>
>>output:
>>fgdfgsdf fgdfgklh fgdfslhjfd|25,534
>>fsdhj  asgh flhfsdhjklfda fsdhjlfd|543,432,344
>>fdfsdg fsdgfsdg fdg fsdg f|344
>
>How about doing it in two steps:
>
>    $line =~ s(^\s+)();
>    $line =~ s(\s+\|\s+)(\|);
>
>Of course this depends on "sdfgsdfg" not including "|", and
>is kind of narky about those spaces.
>

OR even one step ...
$line =~ s/^\s*(.*?)\s*$/\1/;


------------------------------

Date: Sun, 19 Nov 2000 20:41:49 -0500
From: claudej <claudej@videotron.ca>
Subject: Is "use GD;" part of the standard Perl library ?
Message-Id: <B63DEB8D.6262%claudej@videotron.ca>

Is "use GD;" part of the standard Perl library ?

What are the graphical instructions available under Perl 5 ?

filledRectangle ??

Where can I find this information ?

I have 2 books on Perl and CGI and nothing about that subject !!

Thanks

claudej



------------------------------

Date: Mon, 20 Nov 2000 05:48:10 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Is "use GD;" part of the standard Perl library ?
Message-Id: <slrn91henq.r2.mgjv@verbruggen.comdyn.com.au>

On Sun, 19 Nov 2000 20:41:49 -0500,
	claudej <claudej@videotron.ca> wrote:
> Is "use GD;" part of the standard Perl library ?

No.

You can get the GD module from CPAN, or if you have ActiveState's Perl
port, with ppm.

> What are the graphical instructions available under Perl 5 ?
> 
> filledRectangle ??
> 
> Where can I find this information ?

In the documentation that comes with the GD module. On unix systems,
you use man to get to it, on Mac Shuck, and on others perldoc (unless
you've installed something better). If you want to have a look at the
doucmentation before downloading: http://search.cpan.org/

> I have 2 books on Perl and CGI and nothing about that subject !!

Doesn't surprise me at all. :)

Martien
-- 
Martien Verbruggen                      |
Interactive Media Division              | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


------------------------------

Date: Mon, 20 Nov 2000 10:46:05 +0530
From: Ashok Nagaraj <Ashok.Nagaraj@in.bosch.com>
Subject: problem with Upload method of CGI object.
Message-Id: <3A18B395.431311F4@in.bosch.com>


--------------B1C07FF63172F8A46AEB22B0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


Hello ,

I have a problem with the upload method of the CGI object.

I have 'use Strict' in my CGI script and hence I have to have a valid
file handle for Uploading.

My script is...................

use Strict;

my $obj = new CGI ;
$file_path =$obj->param("file_loc");
# file_loc is the complete path of the location of the file obtained
from the File field of the HTML( like C:\ApInstall.log ).

$file_hndl = $obj->upload($file_path);

I do not receive a file handle at all, hence my upload does'nt work.

Can anyone tell me whatz the problem ?.

Ashok

--------------B1C07FF63172F8A46AEB22B0
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
&nbsp;
<br>Hello ,
<p>I have a problem with the upload method of the CGI object.
<p>I have 'use Strict' in my CGI script and hence I have to have a valid
file handle for Uploading.
<p>My script is...................
<p>use Strict;
<p><b>my $obj = new CGI ;</b>
<br><b>$file_path =$obj->param("file_loc");</b>
<br># file_loc is the complete path of the location of the file obtained
from the File field of the HTML( like C:\ApInstall.log ).
<p><b>$file_hndl = $obj->upload($file_path);</b>
<p>I do not receive a file handle at all, hence my upload does'nt work.
<p>Can anyone tell me whatz the problem ?.
<p>Ashok</html>

--------------B1C07FF63172F8A46AEB22B0--



------------------------------

Date: Fri, 17 Nov 2000 15:58:08 +0100
From: "Johan Ditmar" <johan.ditmar@era.ericsson.se>
Subject: Problems saving an uploaded file.
Message-Id: <8vahk8$1pb$1@newstoo.ericsson.se>

Hi all,

I am using Apache 1.3 together with ActiveState Perl 5.6.0.618 and I have
the following problem. I want to upload a file from a webpage and save it at
a server. I am using the following code to do that:

   $bitfile = param("bitfile");

   open (SAVE,">./bitfile.bit") || die $!;
   binmode(SAVE);

    while ( read($bitfile,$data,1024) ) {
      print SAVE $data;
    }
   close SAVE;

What it does is that it takes the file handle and then saves the clients
file under 'bitfile.bit' on the server.

Sometimes this works, but many times it happens that the file is not saved
(it is created, but has size 0 or is only 1 byte long). I have enough space
on my disk and enough memory. Could this be a bug?

Johan




------------------------------

Date: 19 Nov 2000 23:35:02 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: rearranging a text file
Message-Id: <8vad66$7e8$1@boomer.cs.utexas.edu>

In article <DD5F4E269FD2FFA8.8ACF7244F2B12DA1.139E2C712354EA39@lp.airnews.net>,
Stuart Vigne  <vigne@nhamp.net> wrote:
>I have a text file that has 12 lines (could be more or less) at the
>top, and an equal number of lines at the bottom.  There is a blank
>line between the 24 lines I want to rearrange.  There are a total of
>25 lines this file.
>
>Using this 25 line file as an example...I want to take line #1 and
>print it out with line #14 immediately to its right on the same line.
>Ditto for line #2 & 15, #3 & 16, and so on.

I'd solve this problem by having an array whose elements are all
references to other arrays.  Each of these arrays would eventually hold
all the stuff that would go on one line of the screen.

Before reading anything, the array would conceptually look like this:

	(
	[],
	[],
	[],
	[],
	[],
	[],
	[],
	[],
	[],
	[],
	[],
	[]
	)

i.e. an array with twelve elements, each of which is a reference to an
empty array.  It wouldn't actually look like this, of course, since you
don't know ahead of time that you'll have twelve elements.  But we'll
pretend that it does for now.

Anyway, then I'd read in the first 12 lines and put each one at the end
of the array referred to by the reference in the current position in
the outer array, and then advance to the next position in the outer
array.  At the end of that process, I'd have this:

	(
	[ "data from line 1" ],
	[ "data from line 2" ],
	[ "data from line 3" ],
	[ "data from line 4" ],
	[ "data from line 5" ],
	[ "data from line 6" ],
	[ "data from line 7" ],
	[ "data from line 8" ],
	[ "data from line 9" ],
	[ "data from line 10" ],
	[ "data from line 11" ],
	[ "data from line 12" ]
	)

Then, upon detecting the blank line, I'd reset the position in the
outer array to the beginning, so that subsequent lines would get put
onto the end of the existing arrays.  When it's all done with, that
should give me an array that looks like this:

	(
	[ "data from line 1", "data from line 14" ],
	[ "data from line 2", "data from line 15" ],
	[ "data from line 3", "data from line 16" ],
	[ "data from line 4", "data from line 17" ],
	[ "data from line 5", "data from line 18" ],
	[ "data from line 6", "data from line 19" ],
	[ "data from line 7", "data from line 20" ],
	[ "data from line 8", "data from line 21" ],
	[ "data from line 9", "data from line 22" ],
	[ "data from line 10", "data from line 23" ],
	[ "data from line 11", "data from line 24" ],
	[ "data from line 12", "data from line 25" ]
	)

The code would look like this:

	#! /usr/local/bin/perl -w

	use strict;

	my (@merged_list, $counter);

	$counter = 0;

	while (<>)
		{
		chomp;  # remove line terminator

		if (/^$/)
			{
			# it's a blank line.
			$counter = 0;
			}
		else
			{
			# it's not a blank line.
			push (@{ $merged_list[$counter] }, $_);
			$counter++;
			}
		}

	foreach my $row (@merged_list)
		{ print join ("\t", @$row), "\n"; }

One of the great things about Perl, and the reason that the above
works, is a feature called autovivification.  Basically, it means that
if you pretend a reference exists in a variable by accessing the
variable like the reference were there, then Perl will create the
reference if necessary.  And thus, the very first time through the
loop, the array @merged_list is transformed from an empty list to
this:

	( [] )

i.e., an array containing a single element, which is a reference to a
another array that contains no elements.  This is done so that
the expression

	@{ $merged_list[$counter] }

can make sense, because it's treating $merged_list[0] as if it were a
reference to an array .  Anyway, once that reference exists, then $_ is
pushed onto the end of it, and voila, the first line is stored in the
data structure just like we want it.  $counter is incremented, and on
the next time through the loop, $merged_list[1] will get turned into a
reference to an array so that something can get pushed onto it.

As soon as the regular expression /^$/ matches the input line (which
will be when it's empty), $counter is reset to zero, and subsequent
lines are pushed onto existing elements in the array.  (Well, unless
there are more lines after the blank line before, in which case some of
them are pushed onto new entries in @merged_list.)

You may want to change the code that prints out the data structure a
little.  It just does a simple join of the list right now, whereas what
you want probably is to do some more elaborate formatting with printf()
or something.

Hope that helps.

  - Logan


------------------------------

Date: Mon, 20 Nov 2000 06:13:27 GMT
From: sjs@yorku.ca (Steven Smolinski)
Subject: Re: rearranging a text file
Message-Id: <slrn91hk89.ii.sjs@ragnar.stevens.gulch>

Wyzelli <wyzelli@yahoo.com> wrote:
> #!/usr/bin/perl -w
> use strict;
> 
> my (@array1, @array2);
> my $first = 0;
> while (<DATA>){
> chomp;
> if (/^\s*$/){
> $first = 1;
> next;
> }
[...snip more unindented code...]

Do you really write code with no indents anywhere?  Don't you find
it unnecessarily difficult to read?  Don't get me wrong, I'm not a
python programmer :-) but the extra time it takes to indent is paid
for by the ease with which the code is read thereafter.  

Unindented == unmaintainable.

Steve
-- 
But they all have the same weakness: they're flipping web crud.
	--Tom Christiansen in <3a02e17a@cs.colorado.edu>


------------------------------

Date: Mon, 20 Nov 2000 15:57:24 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: rearranging a text file
Message-Id: <eq3S5.46$Is1.2692@vic.nntp.telstra.net>

"Steven Smolinski" <sjs@yorku.ca> wrote in message
news:slrn91hk89.ii.sjs@ragnar.stevens.gulch...
>
> Do you really write code with no indents anywhere?  Don't you find
> it unnecessarily difficult to read?  Don't get me wrong, I'm not a
> python programmer :-) but the extra time it takes to indent is paid
> for by the ease with which the code is read thereafter.
>
> Unindented == unmaintainable.
>

No I don't.  But Microsoft OE5 which I use to post likes to make it's
own assumptions about what constitutes spaces and so on, which
invariably means that what I see before I post, and what I see when I
read my own post are often two different things (sometimes including the
actual code, as you will see from the post you comment on, where an
entire equality test has ... well... gone away, along with a close
bracket and open brace)

For example the code I posted was fully indented, with each block set to
a 4 space tab to line up with the opening statement of each block.

But you make a good point.

(Actually I use an IDE which handles most of the indenting for me so it
doesn't even take any effort.)

Wyzelli
--
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass
it around');
for(reverse(1..100)){$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n$_$a$s$b\n$t\n";
$_--;$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n\n";}print"$c*hic*";





------------------------------

Date: Sun, 19 Nov 2000 23:30:10 -0500
From: Matt <softh@bellsouth.net>
Subject: Re: Strange behavior from localtime() Oct31 2000 or later
Message-Id: <3A18A8D2.96F4B5B8@bellsouth.net>

This is a multi-part message in MIME format.
--------------52930D31E199E3A0EB08F515
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Thanks Joe, I'll give it a try.

meanwhile an update...........

Hi it's just me again, I threw together another version of the script using
gmtime() and note that the results go screwy in September concurrent with the
change from 9 to 10 decimal places. My best guess is that one will simply have
to define the seconds string one more character to make it repeat evenly  like
before. Guess I'll have to find out tommorrow.
Later
Matt

###############################################

The url for the Greenwich script:

http://everyquest.net/cgi-bin/util/gmdateq.cgi

###############################################

The Greenwich script:

#!/usr/bin/perl

#############################################
## Date: 01/01/2000
## EveryQuest Version 2.0 Date Query Module
## Copyright 10/24/2000 EveryQuest http://www.everyquest.net
## matt@everyquest.net  All rights reserved.
##
## This is a little that parses a delimited flat database file of date strings
into human readable date format.
## This is FREE and OPEN SOURCE software released under the GPL.
##

 print "<body bgcolor=#000000 link=#0000FF vlink=#FF33FF alink=#00FF00>
 <hr>
 <font color=FFBB00><h3>Local Time Date Parser US Central Time - 6 hrs
Greenwich</h3></font>
 <hr><a href=http://everyquest.net/cgi-bin/util/dateq.cgi>US Central
Corrections</a><hr>";

 &oops('There was an error opening the Date file') unless
 (open(DATEFILE, "/home/everyqu/public_html/cgi-bin/util/gmdatefile.dat"));
 while (<DATEFILE>)  {
 ($DateString, $Interval) = split(/::/, $_ );
 {$Date=gmtime($DateString)};
 print "<dt><font color=FFBB00>$DateString  $Interval</font></dt><dd><font
color=00FF00>$Date</font></dd><hr>";
 }

 close DATEFILE;

#############################################
##OOPs messages for plain ole dummys
##

sub oops {
 print "Error Message: $_[0] . datefile.dat\n";
 die;
}


###############################################

The Greenwich datafile:


000000000::+0
000000060::+1 minute
000003600::+1 hour
000021600::+6 hours
000043200::+12 hours
000086400::+1 day
002629800::+1 month (365/12)
031557600::+1 year (365.25)
063115200::+2 years
094672800::+3 years
126230400::+4 years
157788000::+5 years
189345600::+6 years
220903200::+7 years
252460800::+8 years
284018400::+9 years
315576000::+10 years
347133600::+11 years
378691200::+12 years
410248800::+13 years
441806400::+14 years
473364000::+15 years
504921600::+16 years
536479200::+17 years
568036800::+18 years
599594400::+19 years
631152000::+20 years
662709600::+21 years
694267200::+22 years
725824800::+23 years
757382400::+24 years
788940000::+25 years
820497600::+26 years
852055200::+27 years
883612800::+28 years
915170400::+29 years
946728000::+30 years
978285600::+31 years
980985601::+31 years 2001 Feb 01 (86400x31=2678400)
983404801::+31 years 2001 Mar 01 (86400x28=2419200)
986083201::+31 years 2001 Apr 01 (86400x31=2678400)
988675201::+31 years 2001 May 01 (86400x30=2592000)
991353601::+31 years 2001 Jun 01 (86400x31=2678400)
993945601::+31 years 2001 Jul 01 (86400x30=2592000)
996662401::+31 years 2001 Aug 01 (86400x31=2678400)
999302401::+31 years 2001 Sep 01 (86400x31=2678400)
1001894001::+31 years 2001 Oct 01 (86400x30=2592000)
1004572001::+31 years 2001 Nov 01 (86400x31=2678400)
1007164001::+31 years 2001 Dec 01 (86400x30=2592000)
1009843000::+32 years
1041401000::+33 years
1072959000::+34 years
1104517000::+35 years

###############################################
###############################################

The US Central url

http://everyquest.net/cgi-bin/util/dateq.cgi

###############################################

The US Central script:

###############################################

#!/usr/bin/perl

#############################################
## Date: 01/01/2000
## EveryQuest Version 2.0 Date Query Module
## Copyright 10/24/2000 EveryQuest http://www.everyquest.net
## matt@everyquest.net  All rights reserved.
##
## This is a little that parses a delimited flat database file of date strings
into human readable date format.
## This is FREE and OPEN SOURCE software released under the GPL.
##

 print "<body bgcolor=#000000 link=#0000FF vlink=#FF33FF alink=#00FF00>
 <hr>
 <font color=FFBB00><h3>Local Time Date Parser US Central Time - 6 hrs
Greenwich</h3></font>
 <hr><a href=http://everyquest.net/cgi-bin/util/gmdateq.cgi>Greenwich Base
Time</a><hr>";

 &oops('There was an error opening the Date file') unless
 (open(DATEFILE, "/home/everyqu/public_html/cgi-bin/util/datefile.dat"));
 while (<DATEFILE>)  {
 ($DateString, $Interval) = split(/::/, $_ );
 {$Date=localtime($DateString)};
 print "<dt><font color=FFBB00>$DateString  $Interval</font></dt><dd><font
color=00FF00>$Date</font></dd><hr>";
 }

 close DATEFILE;

#############################################
##OOPs messages for plain ole dummys
##

sub oops {
 print "Error Message: $_[0] . datefile.dat\n";
 die;
}

The US Central datafile:

000000000::+0
000000060::+1 minute
000003600::+1 hour
000021600::+6 hours
000043200::+12 hours
000086400::+1 day
002629800::+1 month (365/12)
031557600::+1 year (365.25)
063115200::+2 years
094672800::+3 years
126230400::+4 years
157788000::+5 years
189345600::+6 years
220903200::+7 years
252460800::+8 years
284018400::+9 years
315576000::+10 years
347133600::+11 years
378691200::+12 years
410248800::+13 years
441806400::+14 years
473364000::+15 years
504921600::+16 years
536479200::+17 years
568036800::+18 years
599594400::+19 years
631152000::+20 years
662709600::+21 years
694267200::+22 years
725824800::+23 years
757382400::+24 years
788940000::+25 years
820497600::+26 years
852055200::+27 years
883612800::+28 years
915170400::+29 years
946728000::+30 years
946706401::+30 years 2000 New Year Time
978285600::+31 years
978328801::+31 years 2001 Jan 01 New Year Time
981007201::+31 years 2001 Feb 01 (86400x31=2678400)
983426401::+31 years 2001 Mar 01 (86400x28=2419200)
986104801::+31 years 2001 Apr 01 (86400x31=2678400)
988696801::+31 years 2001 May 01 (86400x30=2592000)
991375201::+31 years 2001 Jun 01 (86400x31=2678400)
993967201::+31 years 2001 Jul 01 (86400x30=2592000)
996645601::+31 years 2001 Aug 01 (86400x31=2678400)
999324001::+31 years 2001 Sep 01 (86400x31=2678400)
1001916001::+31 years 2001 Oct 01 (86400x30=2592000)
1004594001::+31 years 2001 Nov 01 (86400x31=2678400)
1007186001::+31 years 2001 Dec 01 (86400x30=2592000)
1009843000::+32 years
1009843001::+32 years 2002 New Year Time
1041401000::+33 years
1041401001::+33 years 2003 New Year Time
1072959000::+34 years
1072959001::+34 years 2004 New Year Time
1104517000::+35 years
1104517001::+35 years 2005 New Year Time


--------------52930D31E199E3A0EB08F515
Content-Type: text/x-vcard; charset=us-ascii;
 name="softh.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Matt
Content-Disposition: attachment;
 filename="softh.vcf"

begin:vcard 
n:Hill;Matthew
x-mozilla-html:TRUE
url:everyquest.net
org:EveryQuest.Net
adr:;;address confidental for now;Manitou;Ky;;
version:2.1
email;internet:matt@everyquest.net
title:COO
fn:Matt
end:vcard

--------------52930D31E199E3A0EB08F515--



------------------------------

Date: Mon, 20 Nov 2000 00:04:18 -0500
From: Matt <softh@bellsouth.net>
Subject: Re: Strange behavior from localtime() Oct31 2000 or later
Message-Id: <3A18B0D2.C019FD6@bellsouth.net>

This is a multi-part message in MIME format.
--------------277809D648946E5328F27ACB
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Joe Schaefer wrote:

>
> What specifically do you mean by "fall apart"?
> I don't see any Oct 2000 dates in your data file.
>

Yipes, dumb ole me meant 2001, notice the how the string fails to fall evenly.
Like I note in the last post I guess I will just have take the defination one
more decimal place to make things even back out.

>
>
> None at all. What happens if you try this snippet on your data:
>
> ==========
> #!/usr/bin/perl -wT
> while (<DATA>)  {
>   my ($DateString, $Interval) = split(/::/, $_ );
>   my $Date=localtime($DateString);
>   print "$DateString  $Interval $Date \n";
> }
>
> _DATA__
>
> 000000000::+0
> 000000060::+1 minute
> 000003600::+1 hour
> 000021600::+6 hours
> 000043200::+12 hours
> 000086400::+1 day
> [...]
> ==========
>
> Do you still see a problem? (Run the code directly,
> *not* via your browser/webserver.)
>
> --
> Joe Schaefer

I'll run this when I boot over to Linux or reboot OS/2. I'm on OS/2 now but
don't have emx/perl loaded.
I tried to run it via Telenet but got a lot of errors I could not capture all
but here is the last half or so:

Number found where operator expected at joe.cgi line 13, near "hour
  000021600"
        (Do you need to predeclare hour?)
Bareword found where operator expected at joe.cgi line 13, near "000021600::"
        (Missing operator before ::?)
Bareword found where operator expected at joe.cgi line 13, near "6 hours"
        (Missing operator before hours?)
Number found where operator expected at joe.cgi line 14, near "hours
  000043200"
        (Do you need to predeclare hours?)
Bareword found where operator expected at joe.cgi line 14, near "000043200::"
        (Missing operator before ::?)
Bareword found where operator expected at joe.cgi line 14, near "12 hours"
        (Missing operator before hours?)
Illegal octal digit at joe.cgi line 15, at end of line
Number found where operator expected at joe.cgi line 15, near "hours
  000086400"
        (Do you need to predeclare hours?)
Bareword found where operator expected at joe.cgi line 15, near "000086400::"
        (Missing operator before ::?)
Bareword found where operator expected at joe.cgi line 15, near "1 day"
        (Missing operator before day?)
Execution of joe.cgi aborted due to compilation errors.
virgo:/public_html/cgi-bin/util >



Thanks for your help though
Matt


--------------277809D648946E5328F27ACB
Content-Type: text/x-vcard; charset=us-ascii;
 name="softh.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Matt
Content-Disposition: attachment;
 filename="softh.vcf"

begin:vcard 
n:Hill;Matthew
x-mozilla-html:TRUE
url:everyquest.net
org:EveryQuest.Net
adr:;;address confidental for now;Manitou;Ky;;
version:2.1
email;internet:matt@everyquest.net
title:COO
fn:Matt
end:vcard

--------------277809D648946E5328F27ACB--



------------------------------

Date: 20 Nov 2000 01:18:08 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Strange behavior from localtime() Oct31 2000 or later
Message-Id: <m3ofzbrwtb.fsf@mumonkan.sunstarsys.com>

Matt <softh@bellsouth.net> writes:

> Joe Schaefer wrote:
> > ==========
> > #!/usr/bin/perl -wT
> > while (<DATA>)  {
> >   my ($DateString, $Interval) = split(/::/, $_ );
> >   my $Date=localtime($DateString);
> >   print "$DateString  $Interval $Date \n";
> > }
> >
> > _DATA__
   ^^
That's a typo on my part, sorry about that. Change it 
to 

__DATA__

and see what happens.
-- 
Joe Schaefer



------------------------------

Date: Mon, 20 Nov 2000 06:20:11 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: trim() equivalent in Perl?
Message-Id: <x7k89zdv1g.fsf@home.sysarch.com>

>>>>> "W" == Wyzelli  <wyzelli@yahoo.com> writes:

  W> "hokiebear" <ayambema@adelphia.net> wrote in message
  >> have a sentence " This is a great newsgroup". I would like to count
  W> the
  W> $chars = $string =~ tr/a-zA-Z/a-zA-Z/;

	tr/ //c ;

basically count all non-blank chars.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


------------------------------

Date: Mon, 20 Nov 2000 06:13:30 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: What is a Junior Perl Programmer?
Message-Id: <x7n1evdvcl.fsf@home.sysarch.com>

>>>>> "RLS" == Randal L Schwartz <merlyn@stonehenge.com> writes:

  RLS> Not that I call myself a 10.  I leave others to label me. :)

no way are you as good looking as bo derek. i would rate you a 4.

maybe a 6 after i have a few beers.

:)

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 4929
**************************************


home help back first fref pref prev next nref lref last post