[12122] in Perl-Users-Digest
Perl-Users Digest, Issue: 5722 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 19 09:07:25 1999
Date: Wed, 19 May 99 06:00:20 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 19 May 1999 Volume: 8 Number: 5722
Today's topics:
Re: _Please_ improve localtime! <gellyfish@gellyfish.com>
Re: about: use strict; (Bart Lateur)
Re: fetching specific info from a text file (Andrea L. Spinelli)
fork() it OVER!! <wassimk@iname.com>
Re: Help w/ /tr func <wyzelli@yahoo.com>
Help!! vanishing variables <Bernd.Kronmueller@eedn.ericsson.se>
Re: How to pass params by ref/addr into subroutines smnayeem@my-dejanews.com
Re: IRIX and Perl Menu (Alastair)
Re: Pentium III Chips Released with IDs - Intel won't b (Donal K. Fellows)
Re: Perl "constructors" armchair@my-dejanews.com
Re: Perl Librarys for NT (Andrea L. Spinelli)
Problem moving OS/2-Perl, please help <ibelgaufts@gfc-net.de>
Sorting arrays <sa@community.net.uk>
su and perl <wemuis@itwol.bhp.com.au>
Re: su and perl <jll@skynet.be>
Re: things that make you go ICK! (Chris Nandor)
Re: Tie Fighter (Chris Nandor)
Re: TROLL ALERT (Re: Perl "constructors") armchair@my-dejanews.com
Re: Verilog and VHDL (Bart Lateur)
Re: Y2K. localtime(time) <dgris@moiraine.dimensional.com>
Re: Your assistance humbly requested (file processing p smnayeem@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 19 May 1999 12:52:47 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: _Please_ improve localtime!
Message-Id: <3742a60f@newsread3.dircon.co.uk>
Daniel Pfeiffer <occitan@esperanto.org> wrote:
> Going from 2 to 3 digits in the year returned by localtime is hardly a
> feature, though it should mostly avert the Y2k headaches. This likely
> means touching a lot of proggies before year's end.
>
Who didnt read the localtime documentation then ?
> The other hassle is the absurd month number (time and again I have
> fallen into the trap). It prevents me from writing something neat like
> join '.', (localtime)[5,4,3]. Instead I have to assign to variables and
> increment the month. The only advantage of this weird numbering is
> indexing a month-name-array, but then I need a scalar anyways, so it
> doesn't hurt to subtract one.
>
I cant comment on the absurdity or otherwise of the month number, er because
there isnt one in reality - if my documentation of the underlying C library
function is to be believed - the perlfunc entry for localtime() says:
All array elements are numeric, and come straight out of a struct tm.
And the documentation for localtime C function says:
Declarations of all the functions and externals, and the tm structure,
are in the <time.h> header file. The structure declaration is:
struct tm {
int tm_sec; /* seconds after the minute - [0, 59] */
int tm_min; /* minutes after the hour - [0, 59] */
int tm_hour; /* hour since midnight - [0, 23] */
int tm_mday; /* day of the month - [1, 31] */
int tm_mon; /* months since January - [0, 11] */
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday - [0, 6] */
int tm_yday; /* days since January 1 - [0, 365] */
int tm_isdst; /* flag for daylight savings time */
long tm_tzadj; /* seconds from GMT (east < 0) */
char tm_name[LTZNMAX]; /* name of timezone */
};
So what you are calling an 'absurd month number' is infact something quite
else. I would reflect on the incidence of the words 'since' and 'after' in
the above comments.
Of course this doesnt help you 'do something neat' as you would like and
I've been wracking my brain trying to think of some suitable one-liner but
I think basically you are stuck with something like:
$datestring = do { my @tm = localtime; sprintf("%02d/%02d/%04d",$tm[3],
$tm[4] + 1,
$tm[5] + 1900); };
> So, hey, give us poor programmers a break.
Hey, we're (nearly all ) programmers here. It might of course be that most
of us have got used to this, some of those before they even saw Perl.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Wed, 19 May 1999 11:02:08 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: about: use strict;
Message-Id: <37438a33.3645262@news.skynet.be>
Austin Ming wrote:
>Why it is a good recomendation to use "use strict;" after "#!/usr/bin/perl" ?
Because it doesn't work if you swap those lines...
I'm not a big fan of "use strict" myself, except for
"use strict qw(refs);". I always use "-w".
But the answer that you're looking for is that there is an extra check
for mistypes of variables' names. You KNOW which global variable there
are, because you have to declare them. That's nice, especially for
rather large scripts.
Bart.
------------------------------
Date: Wed, 19 May 1999 12:06:09 GMT
From: aspinelli@ismes.it (Andrea L. Spinelli)
Subject: Re: fetching specific info from a text file
Message-Id: <3742a626.520447505@news.inet.it>
On Mon, 17 May 1999 23:49:43 +0800, "Brian Altman" <ba@iamd.com>
wrote:
>Hi there,
>
>I am just beginning to learn how to program in Perl.
>Right now I am wondering if it is possible to 'get' specific data from an
>existing file (any text based file), and write it to a new file.
Yes. In a myriad ways.
>Can someone help me with this ?
A good librarian or somebody in a bookshop.
Try: "Do you have any books about Perl?"
Or, better, from the perlbook manpage:
The Camel Book, officially known as Programming Perl, Second Edition,
by Larry Wall et al, is the definitive reference
work covering nearly all of Perl. You can order it and other Perl
books from O'Reilly & Associates, 1-800-998-9938.
Local/overseas is +1 707 829 0515. If you can locate an O'Reilly order
form, you can also fax to +1 707 829 0104. If you're
web-connected, you can even mosey on over to http://www.ora.com/ for
an online order form.
>Thanks a lot in advance !!
You're welcome. I hope next time you will have gone
past infancy and will be able ask the group
some more specific question.
Seriously, doing file I/O is far beyond the scope
of a newsgroup posting. If you are in such a state
that you ask such questions, you desperately need
to study an introductory book.
Go ahead!
Andrea
--
Andrea Spinelli, Ismes SpA, Via Pastrengo 9, 24068 Seriate BG, Italy
e-mail: aspinelli@ismes.it Phone: +39-035-307209 Fax: +39-035-302999
------------------------------
Date: Wed, 19 May 1999 07:24:38 -0500
From: "Wassim Metallaoui" <wassimk@iname.com>
Subject: fork() it OVER!!
Message-Id: <3742ae57.0@wznews.webzone.net>
Can anyone tell me what the heck the fork and pid; stuff in here does.. This
is how I was told to mass mail to everyone listed in a text file.. I was
told to do it this way because it would keep the browser from timing out by
starting a new process... Please explain it.. Can you please send the
explanation to wassimk@iname.com or you can post a reply... Either way will
work.. I appreciate all the help you can give me...
$pid = fork(); #what in the world is this?
print "Content-type: text/html \n\n fork failed: $!" unless defined
#????????
$pid; #????????
if ($pid) { #???????????
#parent, what in the world is a parent!
print "Content-type: text/html \n\n";
print <<EOF;
<HTML><HEAD><TITLE>Mailing Success</TITLE></HEAD><BODY
BGCOLOR=\"#FFFFFF\Mail sent successfully!</BODY></HTML>
EOF
exit(0); #what does the 0 mean?
}
else {
#child, what in the world is a child?
close (STDOUT); #what does this do?
open (LIST,"<$listdir/emails.txt");
if ($LOCK_EX)
flock(LIST, $LOCK_EX);
}
@emails = <LIST>;
close (LIST);
foreach $line (@emails) {
chomp($line);
open (MAIL, "|$mailprog -t") || print "Can't start mail program";
print MAIL "To: $line\n";
print MAIL "From: $youremail\n";
print MAIL "Subject: $INPUT{'subject'}\n\n";
print MAIL "$INPUT{'message'}";
print MAIL"\n\n";
close (MAIL);
}
}
}
------------------------------
Date: Wed, 19 May 1999 19:37:54 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Help w/ /tr func
Message-Id: <_3w03.1$RL3.1001@vic.nntp.telstra.net>
Steve Short <sshort@ribi.com> wrote in message
news:374182E7.780125B4@ribi.com...
> I would like to use either the tr/ or s/ function to remove all
> occurances of carriage returns from a text variable. What searchtext
> character should I try??
>
> I tried \n & \r but neither worked. Sometimes people will add these CR's
>
> to the forms, and I'm writing a tab delimeted file with these forms, so
> the extra CR's are being intepreted as record delimeters in my
> database.... Help!!
>
>
Why not chomp the contents of each field as you read it in?
Or am I missing something?
Wyzelli
------------------------------
Date: Wed, 19 May 1999 12:39:03 +0200
From: Bernd Kronmueller <Bernd.Kronmueller@eedn.ericsson.se>
Subject: Help!! vanishing variables
Message-Id: <374294C7.2361DAC8@eedn.ericsson.se>
Hello all,
I have the following problem:
I declared sveral global variables (e.g. filenames for temorary
file,...) so I can access them
from all subroutines.
Now the problem is one of these variables disappears when I close a
filehandle.
The following is a debugger piece of a run.
-I reset some array called script_name
-I list all the vaiables and the $traceback_file variable is declared as
it should
-I close a file handle SUB_STACK
-and list all vaiables again and the $traceback_file variable has
disappeared.
The question is how, why ....
I don't understand it and if anybody knows the answer please let me
know.
Cheers, Bernd
:
DB<2> s
RUM::WhereFrom(RUM.pm:202): reset 'script_name';
DB<2> X
$first_step_entry_UL = 0
$first_step_entry_Control = 0
$traceback_file = 'first_step.tmp'
FileHandle(SUB_STACK) => fileno(3)
$call_specific_counter = 'first_step_entry_Init'
$first_step_entry_DL = 0
$first_step_entry_Init = 1
FileHandle(SUB_STACK_SUB) => fileno(6)
$first_step_entry = 1
DB<2> s
RUM::WhereFrom(RUM.pm:217): close SUB_STACK;
DB<2> X
$first_step_entry_UL = 0
$first_step_entry_Control = 0
FileHandle(SUB_STACK) => fileno(3)
$first_step_entry_DL = 0
$first_step_entry_Init = 1
FileHandle(SUB_STACK_SUB) => fileno(6)
$first_step_entry = 1
DB<2> v
------------------------------
Date: Wed, 19 May 1999 11:09:31 GMT
From: smnayeem@my-dejanews.com
Subject: Re: How to pass params by ref/addr into subroutines
Message-Id: <7hu65b$qq3$1@nnrp1.deja.com>
In article <7hq9k5$bb1$1@fcnews.fc.hp.com>,
ada@fc.hp.com (Andrew Allen) wrote:
> Medi Montaseri (medim@beyond.com) wrote:
> : Assuming you know the difference between "Pass-by-Value" and
> : "Pass-by-reference",
> : You'd need to pass a reference to your object (data) if you want
changes to be
> : persistant.
>
> wrong. @_ becomes an alias of your passed-in variables. Changes to
> elements of @_ will be reflected in changes to the corresponding
> variables passed as parameters.
>
> The code given below does exactly what the author intended.
>
> : > this is xxx.pl file
> : >
------------------------------------------------------------------------
----
> : > -----------
> : > #!c:/perl/bin
> : > require "yyy.pl"; #file with
subroutine in it
> : > (below)
> : > print "Enter your age>"; #say 5 <enter>
> : > read (STDIN,$age,2); #get input
> : > chop($age); #take out the
return char
> : > changeage($age); #change age by adding 10
to it in
> : > sub
> : > print "So your age is $age\n"; #print out $age after it has
been
> : > changed
> : > #eg. if
you enter
> : > 5, it will be printed as 15!
> : >
> : >
------------------------------------------------------------------------
----
> : > -----------
> : >
> : > "this is yyy.pl file"
> : > #!c:/perl/bin
> : > sub changeage
> : > {
> : > @_[0] += 10;
>
> I'd probably use $_[0] to be correct here (@_[0] is an array slice,
$_[0]
> is the 0th element of @_.)
>
> : > }
> : > 1;
> : >
> : > To be extremely verbose about what i want, you enter say "5" as
your age.
> : > Then this is passed into the sub. The sub alters the val of the
parameter
> : > by adding 10 to it
> : > When printed, the val will be 15 instead of 5.
>
> That's exactly what this code does. I don't understand what your
> question is.
>
> Andrew
>
Hmm... there seems to be two ways of doing the same thing here, one is
by making a reference, passing it and dereferencing it inside the
subroutine and do whatever necessary,
another way is to use the _ system variable.
now my question is, which would be the better way? what are the pros and
cons of both? say sometimes i have need to pass several parameters, is
it better to use _ or references in those cases?
thanks to anyone who might clear me on this :)
smnayeem
smnayeem@agni.com
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Wed, 19 May 1999 11:05:02 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: IRIX and Perl Menu
Message-Id: <slrn7k5a9s.5n.alastair@calliope.demon.co.uk>
I R A Aggie <fl_aggie@thepentagon.com> wrote:
>On Wed, 19 May 1999 00:03:04 GMT, Alastair <alastair@calliope.demon.co.uk>, in
><slrn7k43gl.5o.alastair@calliope.demon.co.uk> wrote:
>+ Marco Radaelli <radaelli@digipoint.it> wrote:
>+ >
>+ >
>+ >I tried the perl version 5.00503 in the tardist format and no problems in
>+ >installing and using it.
>+
>+ Maybe a newer (prebullt) Perl will help. Doesn't 6.5 come with Perl 5.005?
>
>5.00503 *is* the latest, stable release.
Oops. I completely misread the version number there!
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: 19 May 1999 09:56:04 GMT
From: fellowsd@cs.man.ac.uk (Donal K. Fellows)
Subject: Re: Pentium III Chips Released with IDs - Intel won't budge
Message-Id: <7hu1rk$352$1@m1.cs.man.ac.uk>
In article <7hfv1s$oi5$1@mohawk.hwcn.org>,
Mike Barber <al013@freenet.hamilton.on.ca> wrote:
> HELP! HELP!
> THE PARANOIDS ARE AFTER ME!!!!!
And just what does any of this (either the above message or the rest
of the thread) have to do with comp.lang.tcl? Or any of the other
newsgroups on this list for that matter? Take it where it belongs,
lest I sic Godwin upon it...
Donal.
--
Donal K. Fellows http://www.cs.man.ac.uk/~fellowsd/ fellowsd@cs.man.ac.uk
-- The small advantage of not having California being part of my country would
be overweighed by having California as a heavily-armed rabid weasel on our
borders. -- David Parsons <o r c @ p e l l . p o r t l a n d . o r . u s>
------------------------------
Date: Wed, 19 May 1999 09:55:40 GMT
From: armchair@my-dejanews.com
Subject: Re: Perl "constructors"
Message-Id: <7hu1qs$o54$1@nnrp1.deja.com>
In article <37404364.DACD828D@atrieva.com>,
Jerome O'Neil <jeromeo@atrieva.com> wrote:
> armchair@my-dejanews.com wrote:
> >
>
> > Or perhaps I have done something that most Perl programmers
> > have not:
> > had to modify other people's code. I don't want to inflict
> > anything on
> > Perl, but I will certainly not be at service this weekend.
>
> Oh please. Taking care of other peoples code is part and parcel of
> most work-a-day buisness. When you come down off your cross,
> you might figure that out.
>
> $martyr->look_at('somone_elese_code') || die;
>
Glad to hear that you have some strong and firm opinions about what
other Perl programmers are doing regarding writing their own or
maintaining others Perl code. What's a typical month of Perl programming
like in your job, in terms of writing new and maintaining old, and what
kind of programming is it, and how big is the shop?
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Wed, 19 May 1999 12:35:32 GMT
From: aspinelli@ismes.it (Andrea L. Spinelli)
Subject: Re: Perl Librarys for NT
Message-Id: <3742af6e.522823495@news.inet.it>
On Mon, 17 May 1999 11:54:51 -0400, "Kim Kulasa"
<Kimberly.Kulasa@daytonoh.ncr.com> wrote:
>Does anyone know if the LWP (library for www access for Perl) or the GD.pm
>(Graphics library) are available for NT? We have NT 4 with IIS 4 and
>ActiveState's latest activeperl release.
Yes. LWP is included in the standard distribution, so you already
have it.
GD may be downloaded from ActiveState's site, I think with
ppm install GD
from the DOS prompt. If you pass through a proxy,
consult activestate's documentation in HTML
...\perl\html\index.html
HTH
Andrea
--
Andrea Spinelli, Ismes SpA, Via Pastrengo 9, 24068 Seriate BG, Italy
e-mail: aspinelli@ismes.it Phone: +39-035-307209 Fax: +39-035-302999
------------------------------
Date: Wed, 19 May 1999 13:15:24 +0100
From: Juergen Ibelgaufts <ibelgaufts@gfc-net.de>
Subject: Problem moving OS/2-Perl, please help
Message-Id: <3742AB5C.70F92559@gfc-net.de>
Hi,
Is there a way to move a Perl installation (latest OS/2 Perl) from one
drive to another without using the complete installation procedure?
Where is @INC defined? Is it possible to patch it?
Any suggestions welcome.
Juergen Ibelgaufts
------------------------------
Date: Wed, 19 May 1999 11:40:05 +0100
From: "Sam Allen" <sa@community.net.uk>
Subject: Sorting arrays
Message-Id: <7hu4ik$a3h$1@supernews.com>
Can you sort arrays to order their entries alphabetically, without having to
write a shit load of sorting code yourself!
------------------------------
Date: Wed, 19 May 1999 20:25:20 +1000
From: Steve Muir <wemuis@itwol.bhp.com.au>
Subject: su and perl
Message-Id: <37429190.B8F830CB@itwol.bhp.com.au>
Hi All...
I'd like to write a perl script which automates the unix su program. I
would like to be able to pass the password as
a command line argument. The end result would look somehting like ...
$ suprog -u <username> -p <password>
And it would pass the password to su automagically.
Has anyone done anything like this before ? Any help would be
appreciated
Thanks
Steve
--
=======================================
Steve Muir
BHP IT Network Management
Email: muir.steve.sg@bhp.com.au
wemuis@itwol.bhp.com.au
sgm04@uow.edu.au
=======================================
------------------------------
Date: Wed, 19 May 1999 12:46:37 +0100
From: Jean-Louis Leroy <jll@skynet.be>
Subject: Re: su and perl
Message-Id: <VA.00000240.24896980@godot>
In article <37429190.B8F830CB@itwol.bhp.com.au>, Steve Muir wrote:
> $ suprog -u <username> -p <password>
Are you aware that any user will be able to read the
<username> and <password> by means of a simple `ps -ef'?
Jean-Louis Leroy
http://ourworld.compuserve.com/homepages/jl_leroy
------------------------------
Date: Wed, 19 May 1999 12:06:38 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: things that make you go ICK!
Message-Id: <pudge-1905990806410001@192.168.0.77>
In article <7ht7j6$6h5$1@nnrp1.deja.com>, S Starre
<sstarre@my-dejanews.com> wrote:
# Illegal character \015 (carriage return) at ..//CGI.pm line 1.
# (Maybe you didn't strip carriage returns after a network transfer?)
# BEGIN failed--compilation aborted at ./mpost.cgi line 30.
#
# I tried to take your advice (Larry R & Tom C) and use CGI.pm- and I get
# this sucky result.. As usual, the unix sysadmin, in true unix sysadmin
# form, says "it's no problem just turn off warnings"...
Well, you could install your own version as Tad suggested, but it most
certainly CAN be a problem. Perl is not completely immune to whitespace,
and your file there has characters in the file that should not be there.
Sounds like it was transferred incorrectly. He is wrong. You can tell
him he is wrong, and that we say he is. :)
You can also have him run this one-liner on the module file. It should work.
perl -pi.bak -e 's/\015?\012/\n/g' CGI.pm
# Making modules out of the programmer's control is both annoying and
# obstructive..
To reiterate, install your own. I do it all the time.
use lib '/path/to/my/personal/module/directory';
use CGI; # mine!
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: Wed, 19 May 1999 12:02:15 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Tie Fighter
Message-Id: <pudge-1905990802180001@192.168.0.77>
In article <37435353.107522791@news.oz.net>, tgy@chocobo.org wrote:
# On Wed, 19 May 1999 02:45:33 GMT, pudge@pobox.com (Chris Nandor) wrote:
#
# >In article <3744083a.88294931@news.oz.net>, tgy@chocobo.org wrote:
# >
# ># Instead of returning the tied scalar, return a reference to it. Then
assign
# ># the reference to a typeglob.
# >
# >A solution requiring the use of global variables is no solution at all.
#
# I disagree. And I didn't use any. :)
Well, it is no use for a general-purpose solution, certainly, because many
of us want to use globals only when globals are specifically called for,
not as hacks to get around the fact that you can't pass a tied scalar
around.
And yes, you did use a global variable. All package variables are global
variables. Any time you manipulate the symbol table, you are using a
global / package variable.
# for (qw/chocobo moogle/) {
# *_ = new Shout "I want a $_ stuffy\n";
# s/$/!!!!/;
# print;
# }
*_ is a typeglob representing, in this case, the global variable $_. You
could local()ize it, diminishing the negative impact:
$_ = 2;
{
local $_;
my $x = 1;
*_ = \$x;
print; # 1
}
print; # 2
But it is still a global variable. And using any other symbol in that
case would also be a global, by virtue of the fact that you are using
typeglobs.
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: Wed, 19 May 1999 10:05:23 GMT
From: armchair@my-dejanews.com
Subject: Re: TROLL ALERT (Re: Perl "constructors")
Message-Id: <7hu2d3$ogb$1@nnrp1.deja.com>
In article <37404B9A.C0511C24@atrieva.com>,
Jerome O'Neil <jeromeo@atrieva.com> wrote:
> Arved Sandstrom wrote:
> >
>
> > Why is this a troll?
>
> Because the behavior of this particular person is well known.
> Same guy
> got trashed here a few months back for the same pattern of behavior,
> except then he was mad that Perl wasn't VisualBasic.
>
> The short story is this. He's an unemployed accounting aide who
> knows a
> little VB, and can't figure out why we don't consider him an expert.
> And he *still* can't seem to figure out the documentation.
Hey Jerome, good to see you are still an integral part of the discussion
here. I can say with all sincerity that I always respected your opinion,
however often we managed to disagree. Yep, I'm back. I knew I could fool
most of the group, but had to expect a top mind would eventually know it
was me. And the documentation does still have me baffled. For instance:
"localtime - convert UNIX time into record or string using local time"
Maybe you can explain why they are using the term record in Perl
documentation?
All the best.
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Wed, 19 May 1999 11:02:12 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Verilog and VHDL
Message-Id: <37489764.7022930@news.skynet.be>
Greg Bartels wrote:
>I've written a perl module that enables you to write
>code that describes hardware in perl and simulate it.
>it is similar in structure to Verilog and VHDL, but
>it has all the handy, easy-to-use, features that comes
>with the perl language. the module is called phdl.pm.
>The module supports signals (vhdl style), variables, simulation time,
>multiple parallel processes, sensitivity lists, and all event
>scheduling, event handling, etc.
>
>Think of it as a lightweight version of Verilog or VHDL.
>Anyone interested?
Well *I* am interested. VERY. Can I have a copy, and is there a demo
available, that demonstrates how to use it? Otherwise, it's pretty damn
hard to get started.
Bart.
------------------------------
Date: 19 May 1999 06:23:46 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Y2K. localtime(time)
Message-Id: <m3n1z1qmct.fsf@moiraine.dimensional.com>
Jonathan Stowe <gellyfish@gellyfish.com> writes:
> Yes but it is an emisssion of Matts Script Archive so we dont really
> expect that much of it ;-{
Maybe someday somebody with a clue will reimplement those
dumb little programs.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Wed, 19 May 1999 11:25:14 GMT
From: smnayeem@my-dejanews.com
Subject: Re: Your assistance humbly requested (file processing problem)
Message-Id: <7hu72p$rh8$1@nnrp1.deja.com>
In article <3740B9C6.4401@bitwell.net>,
josh@bitwell.net wrote:
> Hi,
>
> My problem is as follows. I need to read in an existing file, throw
away
> certain predefined lines and write the remaining lines to a new file
> which replaces the existing file. Being overly blessed with hubris, I
> thought I had it, but I apparently don't. The following code produces
a
> blank file. Having faithfully but fruitlessly perused the FAQ,
> Programming Perl, Learning Perl, and the past two weeks' postings to
> this group in search of enlightenment, I now throw myself on the mercy
> of this distinguished body. Please be gentle. Thanks in advance.
>
> Josh Pointer
>
> # The values in @initialize correspond to the number of lines which
are
> needed (positives) and
> # the number which aren't (negatives). These are ordered from the
> beginning of the file.
> # In other words, the first 27 lines need to go, the next 2 we keep,
the
> next 16 go, etc.
>
> my(@initialize) = ( -27, 2, -16, 3, -8, 3, -8, 3, -10, 2, -8, 3, -9,
3,
> -8, 3, -8, 3, -29 );
> open(FILE_IN, $temp_file) or die "fatal
error on open sub a 1";
> open(FILE_OUT, ">${temp_file}.tmp") or die "fatal error on
open sub a
> 2";
> for ( $i = 0; $i < 19; $i++ ) {
# cycle through @initialize
> $length = $initialize[$i];
# pull the value
> if ($length < 0) {
# i.e., if we're throwing away these lines
> $length *= -1;
# make $length usable
> for ( $j = 0; $j < $length; $j++) { # pull
the corresponding number
> of lines
> <FILE_IN>;
# throw them away
> }
> } else {
# i.e., we're keeping these lines
> for ( $j = 0; $j < $length; $j++) { # pull
the corresponding number
> of lines
> $line = <FILE_IN>;
> print FILE_OUT $line;
# write them out
> }
> }
> }
> close(FILE_IN);
> close(FILE_OUT);
> rename("${temp_file}.tmp", $temp_file); #
presto! same file, new
> contents. (yeah,
>
# too bad it doesn't work...)
>
I had a very similar problem once. all i can remember is that i used the
FileHandle module that comes with perl. that rescued me then. U might
like to look at that module and use it on ur code here.
smnayeem
smnayeem@agni.com
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5722
**************************************