[13585] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 995 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 5 20:05:50 1999

Date: Tue, 5 Oct 1999 17:05:23 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <939168323-v9-i995@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 5 Oct 1999     Volume: 9 Number: 995

Today's topics:
    Re: ActivePerl <cassell@mail.cor.epa.gov>
        C style was Re: Random Numbers <ltl@rgsun5.viasystems.com>
        CGI Date Datebase? <rgrnbrg@xmission.com>
        CGI::Cookie, how much of a load (Derek Lavine)
    Re: Compile my Perl Scripts(s)? <cassell@mail.cor.epa.gov>
    Re: Converting 1.1.1.1 to blah.foo.com (Greg Bacon)
    Re: Download Perl 5 <cassell@mail.cor.epa.gov>
        fork & NT Perl <hazard@eznetN-O~S'P&A`M.net>
        help on compile dbd-odbc (Julie Chen)
    Re: how does her butt taste? (Greg Bacon)
    Re: Knowing sizeof (int) inside a Perl program (Martien Verbruggen)
    Re: libraries "die"ing (Sam Holden)
    Re: Need help with input verifier <cassell@mail.cor.epa.gov>
    Re: Need help with input verifier <laurensmith@sprynet.com>
        newbie help, module for changing date/time fromat to si <psmith3@tampabay.rr.com>
    Re: newbie help, module for changing date/time fromat t (Larry Rosler)
    Re: Newbie question ! (Martien Verbruggen)
        NEWBIE: how do I pull out second or third words from a  <dm@astrolog.demon.co.uknospam>
    Re: News, Apache, and Perl <cassell@mail.cor.epa.gov>
    Re: odd or even numbers? (Sam Holden)
    Re: odd or even numbers? <homelessinseattle@yahoo.com>
    Re: Perl Debugger <hazard@eznetN-O~S'P&A`M.net>
    Re: Random Numbers <sjohns17@uic.edu>
    Re: Redirecting with a SSI from perl (Martien Verbruggen)
        Regular Expressions with ÔÕÖØŒŠÙÚÛÜÝŸÞàáâãäåæçèéê chara (Bill Moseley)
        Response appreciated but.... <jb4mt@verbatims.com>
    Re: Response appreciated but.... (Matthew Bafford)
    Re: Response appreciated but.... (Sam Holden)
    Re: Seperating records in a text file: just getting eve (Greg Bacon)
    Re: Simple - yet won't work! (Martien Verbruggen)
    Re: Simple - yet won't work! <nihad@yahoo.com>
    Re: To Abigail re: reading current threads <elaine@chaos.wustl.edu>
    Re: To Abigail re: reading current threads <ltl@rgsun5.viasystems.com>
    Re: tool to convert BMPs to GIFs programatically? (Hywel Jenkins)
    Re: why use references - in laymans terms? jdkronicz@my-deja.com
    Re: why use references - in laymans terms? jdkronicz@my-deja.com
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 05 Oct 1999 15:09:53 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: ActivePerl
Message-Id: <37FA7731.465CF579@mail.cor.epa.gov>

Ralph Grothe wrote:
[snip of good suggestion about typo]
> Apart from this if you are using a Win32 based webserver
> you better prepend CRs to the linefeeds, which is the
> way Mightgosoft's file system indicates new lines:
> print "Content-type: text/html\r\n\r\n";

Umm, no.  Perl handles this for you.  Perl automagically
uses whatever newline character is needed for whatever
OS you're on.  This makes scripts portable.  Drop those
'\r's and you'll find that Perl knows what you meant
when working on win32 systems.

> However you can circumvent these traps by using the
> excellent CGI.pm module such as:
> 
> use CGI;

Another excellent suggestion.

> find out about all the flutes and whistles CGI.pm offers by typing:
> perldoc CGI
> on the command line.

Ditto.  Keep up the good work.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 5 Oct 1999 22:23:58 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: C style was Re: Random Numbers
Message-Id: <7tdtpu$i0q$1@rguxd.viasystems.com>

Uri Guttman <uri@sysarch.com> wrote:
:>c style for loops are not cool in perl. rarely needed in fact. and i
:>don't mean foreach loops which are a different animal.

Dear Perl Style Doctor,

When I write C code for most of the day, then switch to writing Perl,
my Perl looks like C.  Oh the shame, the shame.  ;-)

It may just be a vestigal habit, but I still find myself using
C-style for loops at times.  Although Perl allows for nice data
structures to represent relationships in the data, sometimes for
simple data it seems easier to use multiple arrays that share the
same index instead.

I've written plenty of Perl code that uses something like:

while (some loop conditional) {
	push @coords, [$x, $y];
}
 ...
for my $coord (@coords) {
	do something with $coord->[0] and with $coord->[1]
}

### but is that really any better than

while (some loop conditional) {
	push @xvals, $x; push @yvals, $y;
}
 ...
for (my $i = $#xvals; $i >= 0; $i--) {
	do something with $xvals[$i] and $yvals[$i]
}

The first way has a certain elegance in the way it models coordinate
pairs as "things", but all of that creation of anonymous arrays and
extra dereferencing seems so wasteful to my spendthrift side.

What's the matter with the simplicty of just using 2 arrays and
sharing the index?  Or is that a false simplicity?

Signed,

Conflicted in Richmond.


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

Date: Tue, 05 Oct 1999 17:58:56 -0600
From: "Ryan Greenberg" <rgrnbrg@xmission.com>
Subject: CGI Date Datebase?
Message-Id: <7te3bv$hta$1@news.xmission.com>

Hello All,

    I've been doing basic HTML and graphic design for some time, but I
recently undertook my largest project to date that requires me to move
ahead. Unfortunately, I am uncertain where to begin.
    I am in charge of a page that has a sidebar which contains information
updated daily. The sidebar has the long date (e.g. Monday, October 4, 1999)
followed by a list of events from that day. Thus far, I have been manually
entering the list of events into a small .ssi file which I call "today.ssi".
Every evening, I upload the today.ssi file for the next day. I have only
been doing this for a few days now, and already it has become a tedious
chore.
    I have begun to learn Perl in hopes that it will allow me to overcome
this problem. Really, though, I have no idea where to begin. I thought
perhaps it would be possible to store all the events in a text file on my
remote server and have a mini-program run automatically every evening at
midnight to change the today.ssi file, or even the index.html file that
includes the today file.
    I am running this site on a UNIX server, and changing to an NT server is
not an option. Could anyone offer advice on how to begin this task? I
realize this is a very broad question and there are probably a number of
ways to approach it, but I would greatly appreciate any help.

Thanks,
Ryan

(If anyone is interested in seeing the case in point, the page is available
at www.judgememorial.com/main.shtml)

--
Ryan Greenberg - rgrnbrg@xmission.com
http://www.xmission.com/~rgrnbrg


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

Date: Wed, 6 Oct 1999 08:22:38 +1000
From: derek@realware.com.au (Derek Lavine)
Subject: CGI::Cookie, how much of a load
Message-Id: <MPG.12652537db4762b7989685@news.hutch.com.au>

Hi all,

I am wondering what the general consensus on using the CGI::Cookie module 
is. I know that it uses CGI and I have read that it is quite large. I 
also appreciate that it is possible to use

use CGI qw/:standard/;
use CGI::Cookie;

Which I assume some what lessens the load (?) but all I want to do is set 
cookies I don't need any other CGI features as I do not generate any HTML 
content in my scripts. I provide all my HTML pages as templates and the 
scripts process the templates replacing escaped variable with actual 
values yada, yada and so produce a page.

So I currently use CGI and CGI::Cookie just to obtain data come from the 
browser and to write cookies.

Performance is an issue for me and I will be using ModPerl with this in 
mind would you suggest that I bake my own cookies so to speak and process 
any data coming from the browser 'manually'

Or is it possible to use very small parts of CGI and CGI::Cookie so that 
it is not such a big load.

Thanks for your opinion

Derek


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

Date: Tue, 05 Oct 1999 15:35:47 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Compile my Perl Scripts(s)?
Message-Id: <37FA7D43.A8AFF28F@mail.cor.epa.gov>

but86@my-deja.com wrote:
> 
> Hello!

Howdy.

> how can i compile my perl scripts for running on a unix or nt machine
> (better unix)?

Compiling removes the portability of Perl.  Are you sure you
want to do that?

> helps the perl2exe tool? or could i (partly) translate it to C ...?

Yes.  The FAQ discusses this.

> there are many html forms in the scripts. are they still functional
> after compiling a script?

Now that part may not work.  Are you saying that you want to
hide the HTML as well?  Why?

> i could need some speed improvements and prevent abuse of my scripts. as

You won't get speed improvements, except in the tiny startup
costs.  And those are better dealt with in other ways,
such as mod_perl or PerlEx or VelociGen or fast_cgi or...

Abuse of your scripts?  Compiling won't keep hackers from
mutilating your source.  How do you think viruses work?
Or cracks?  If you're worried that people will take your
scripts and modify them, put a copyright notice in your
scripts.

> long as the source is open, that cant be done in the way i want it.

That *is* the idea behind Open Source, you know.  That
people share source code.
 
> i am really unexperienced and can need any help

Please read the FAQ on this topic, and look in the archives
of this newsgroup, where your question gets asked about twice
a week.  You'll see that the group consensus is that you're
on the wrong track.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 5 Oct 1999 22:11:02 GMT
From: gbacon@ruby.itsc.uah.edu (Greg Bacon)
Subject: Re: Converting 1.1.1.1 to blah.foo.com
Message-Id: <7tdt1m$m6o$1@info2.uah.edu>

In article <37FA5A90.D15D62DA@chaos.wustl.edu>,
	Elaine -HFB- Ashton <elaine@chaos.wustl.edu> writes:

: This newsgroup has become nothing more than a bunch of arrogant wanking.

In that case, we should heed the wise advice of Mr. Kickass himself,
Norm Abram: "There is no more important safety tip than to wear these,
safety glasses." :-)

Greg
-- 
If you try to fail and succeed, which have you done?
    -- George Carlin


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

Date: Tue, 05 Oct 1999 15:06:55 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Download Perl 5
Message-Id: <37FA767F.784CCB76@mail.cor.epa.gov>

Paul Smith wrote:
> 
> Hi,
>     Where can I download Perl 5.001?

There are places where you can download 5.001 .

But don't.  Download 5.005_03 from CPAN [www.cpan.org].
Or, if you're on a win32 box, go to www.activestate.com
and get their latest stable build of ActivePerl.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Tue, 05 Oct 1999 11:24:12 -0400
From: Wizard of VOBs <hazard@eznetN-O~S'P&A`M.net>
Subject: fork & NT Perl
Message-Id: <7td5ma$346$1@news.wrc.xerox.com>

We are running an older version of perl5 on many of our machines, and
fork is not implemented.

Is fork implemented in newer versions of NT perl?  If so which version
to get?

Also, I have heard of a spawn function in the Win32 module. Does spawn
function exactly like fork?  

I would prefer to use fork because A) it would not require platform
specific implementation, and B) If I am going to update the NT perl
distribuions at 6 development sites around the world I would prefer to
put out a whole new version rather than just a new module (of course, I
could always do BOTH ;>) 

Please use simple words as maintaining the perl environment is not part
of my normal responsibilities. :-)


-- 
"Never put off 'til tomorrow what you can delegate today"

To contact me remove "N-O~S'P&A`M " from my address


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

Date: 5 Oct 1999 22:37:22 GMT
From: chenj@nicco.sscnet.ucla.edu (Julie Chen)
Subject: help on compile dbd-odbc
Message-Id: <7tduj2$b72$1@carroll.library.ucla.edu>


We have perl 5.005 on our system.  DBI-1.13 is compiled and
installed on the system.  libiodbc-2.50.3 also compiled and
installed.  when I try to compile DBD-ODBC-0.20, it seems
to be ok.  But when I do make test, I got:

PERL_DL_NONLAZY=1 /usr/local/bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl5/5.00502/sun4-solaris -I/usr/local/lib/perl5/5.00502 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
t/01base............install_driver(ODBC) failed: Can't load 'blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: ld.so.1: /usr/local/bin/perl: fatal: relocation error: file blib/arch/auto/DBD/ODBC/ODBC.so: symbol SQLGetFunctions: referenced symbol not found at /usr/local/lib/perl5/5.00502/sun4-solaris/DynaLoader.pm line 168.

 at (eval 1) line 2

 at t/01base.t line 14
dubious
        Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 4-5
        Failed 2/5 tests, 60.00% okay
t/02simple..........Can't connect(), no database driver specified and DBI_DSN env var not set at t/02simple.t line 16
dubious
        Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 2-12
        Failed 11/12 tests, 8.33% okay
t/03dbatt...........Can't connect(), no database driver specified and DBI_DSN env var not set at t/03dbatt.t line 12
dubious
        Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 2-6
        Failed 5/6 tests, 16.67% okay
t/05meth............Can't connect(), no database driver specified and DBI_DSN env var not set at t/05meth.t line 13
dubious
        Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 2-6
        Failed 5/6 tests, 16.67% okay
t/09bind............Can't connect(), no database driver specified and DBI_DSN env var not set at t/09bind.t line 11
dubious
        Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 2-5
        Failed 4/5 tests, 20.00% okay
Failed Test  Status Wstat Total Fail  Failed  List of failed
-------------------------------------------------------------------------------
t/01base.t        2   512     5    2  40.00%  4-5
t/02simple.t      2   512    12   11  91.67%  2-12
t/03dbatt.t       2   512     6    5  83.33%  2-6
t/05meth.t        2   512     6    5  83.33%  2-6
t/09bind.t        2   512     5    4  80.00%  2-5
Failed 5/5 test scripts, 0.00% okay. 27/34 subtests failed, 20.59% okay.
*** Error code 2
make: Fatal error: Command failed for target `test_dynamic'

Anyone here would offer me some help?  Thank you very much for your
help. 
====================================================================
Julie Chen	         	 email: chenj@nicco.sscnet.ucla.edu
UCLA Social Sciences Computing   phone: (310) 825-7335
2041 Public Policy BLDG          fax:   (310) 825-4936
LA, CA 90095


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

Date: 5 Oct 1999 22:24:57 GMT
From: gbacon@ruby.itsc.uah.edu (Greg Bacon)
Subject: Re: how does her butt taste?
Message-Id: <7tdtrp$m6o$3@info2.uah.edu>

In article <EbuK3.783$ry3.7992@news.rdc1.ne.home.com>,
	"George Jempty" <jb4mt@verbatims.com> writes:

: I don't want to piss off the truly helpful people on this board who
: did not mind answering my easy question to begin with,

No one is so helpful as he who helps himself.

:                                                        but Uri: if I'm
: so clueless, how come I got my answer more quickly than it would have
: taken to sift through hundreds of earlier posts?

By sharing with us your belief that the primary source of information
is previous posts, you betray your cluelessness.

RTFM.  FOAD.

Greg
-- 
When I was studying programming, one of my classmates was having serious
troubles with his program.  When he asked me for help, I leaned over his
screen and saw all of his code in comments. The reason: "Well, it compiles
much faster that way."  -- From "Computer Stupidities"


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

Date: Tue, 05 Oct 1999 23:12:30 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Knowing sizeof (int) inside a Perl program
Message-Id: <yBvK3.73$_G2.2310@nsw.nnrp.telstra.net>

\begin[pedantic]{offtopic}

On Tue, 05 Oct 1999 09:07:09 GMT,
	JAG <greenej@my-deja.com> wrote:
> In article <37F93B62.5A371C6@mail.cor.epa.gov>,
>   David Cassell <cassell@mail.cor.epa.gov> wrote:
> > I thought that by definition sizeof(char) had to be 1.

You are right.

> > Huh.  Oh well, live and learn...  :-)

And learn more :)

> Unicode and far-eastern language systems (Kanji, traditional chinese,
> etc.) use a 2-byte character format.

And that is why character constants are integers, _not_ chars. And
code that uses Kanji or Unicode character sets better be aware of
that.

The type char, and what is used to store 'characters' have no
formal relationship anymore.

(I don't have the C specs here, and besides I wouldn't want to
manually type the relevant parts, but here's the next best thing)

From the C FAQ:

7.8:    I see code like

                char *p = malloc(strlen(s) + 1);
                strcpy(p, s);

        Shouldn't that be malloc((strlen(s) + 1) * sizeof(char))?

A:      It's never necessary to multiply by sizeof(char), since
        sizeof(char) is, by definition, exactly 1.  (On the other
        hand, multiplying by sizeof(char) doesn't hurt, and in some
        circumstances may help by introducing a size_t into the
        expression.)  See also question 8.9.

        References: ISO Sec. 6.3.3.4; H&S Sec. 7.5.2 p. 195.

8.9:    I think something's wrong with my compiler: I just noticed that
        sizeof('a') is 2, not 1 (i.e. not sizeof(char)).

A:      Perhaps surprisingly, character constants in C are of type int,
        so sizeof('a') is sizeof(int) (though this is another area
        where C++ differs).  See also question 7.8.

        References: ISO Sec. 6.1.3.4; H&S Sec. 2.7.3 p. 29.

\end{offtopic}

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | Little girls, like butterflies, need no
Commercial Dynamics Pty. Ltd.       | excuse - Lazarus Long
NSW, Australia                      | 


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

Date: 5 Oct 1999 23:56:24 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: libraries "die"ing
Message-Id: <slrn7vl418.ni6.sholden@pgrad.cs.usyd.edu.au>

On Tue, 05 Oct 1999 13:18:47 GMT,
	Benjamin Franz <snowhare@long-lake.nihongo.org> wrote:
>In article <OOD5N2inbanE5PHHhLWT3bJCOgf1@4ax.com>,
>David Cantrell  <NukeEmUp@ThePentagon.com> wrote:
>>
>>I suspect that modules/libraries dieing is often because the authors
>>are aware that programmers frequently don't bother checking return
>>values. 
>
>That's why I do it. There is almost never a good result from
>ignoring a failure. By dieing or croaking, I usually ensure
>that if it is ignored, it was on purpose. How many postings 
>relating to 'tie' and 'open' FAQs would vanish from this group 
>if they threw exceptions on failure rather than returning a false
>value?

Down that path lies python and *shudder* java...

-- 
Sam

Many modern computer languages aspire to be minimalistic. They either
succeed in being minimalistic, in which case they're relatively useless,
or they don't succeed in being truly minimalistic, in which case you can
actually solve real problems with them.  --Larry Wall


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

Date: Tue, 05 Oct 1999 15:29:02 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Need help with input verifier
Message-Id: <37FA7BAE.EAED4717@mail.cor.epa.gov>

Jana Cole or John Sayre wrote:
> 
> I take all the credit!  And to think I just read the book three days
> ago!
>
> This is my second post to this group, and I swear, this is the most
> sarcastic newsgroup that I've ever posted to, and I've posted to
> _many, many_ newsgroups........

Well, we try.  :-)  But Larry R. is far from the most sarcastic
poster here, so consider yourself forewarned.
 
> Seriously, I truly appreciate the feedback.  I always have my goal in
> mind, and I don't always focus on elegance in getting there.  If you

But well-written Perl code is usually *faster* than badly-
written Perl code.  A lot of the issues discussed in this
newsgroup relate to more than someone's opinion of 'pretty'
code.

> would be so kind, could you rewrite the code so I can see how it
> should be done?  I mean that sincerely.  I am new to Perl, I've done
> plenty of C++ and Java, but I just started reading the Perl book less
> than a week ago and could really use the example of someone who knows
> the language.

Well then, read this newsgroup and look in the archives of
this newsgroup.  You can learn a lot of good Perlstyle that
way.
 
> On Tue, 5 Oct 1999 10:30:49 -0700, lr@hpl.hp.com (Larry Rosler) wrote:
> 
> >In article <37f9f1c9.2777093@nntp.ix.netcom.com> on Tue, 05 Oct 1999
> >12:49:36 GMT, Jana Cole or John Sayre <quikscor@ix.netcom.com> says...
[snip]
> >>    $month = (qw(1 2 3 4 5 6 7 8 9 10 11 12)) [(localtime)[4]];
> >>    $day = (qw(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
> >> 22 23 24 25 26 27 28 29 30 31)) [(localtime)[3]];
> >>    $year = (localtime)[5];
> >>    if ($year > 99)
> >>    {
> >>       $year = year - 100;
> >>    }
> >>    $todays_date = "$month/$day/$year";

Okay, Larry's points boil down to this.  You can get all
the info you need in one call to localtime().  You don't need
to run through those arrays, since Perl will do any transforms
of string-to-number or _vice_versa_ for you.  Your time
adjustments are not a great way to handle dates.  And you'd
probably want to get your date a little differently.

my ($day,$month,$year) = (localtime)[3,4,5];
my $todays_date = sprintf "%d/%02d/%02d", $day, $month+1, $year%100;

You may want to get a copy of Learning Perl or
Learning Perl for Win32 Systems, both by Randal Schwartz et al.
You'll find lots of helpful discussion and nice idioms 
inside.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Tue, 5 Oct 1999 15:23:33 -0700
From: "Lauren Smith" <laurensmith@sprynet.com>
Subject: Re: Need help with input verifier
Message-Id: <7tdtpv$1qt$1@brokaw.wa.com>


Jana Cole or John Sayre wrote in message
<37fa6480.984832@nntp.ix.netcom.com>...
>>In article <37f9f1c9.2777093@nntp.ix.netcom.com> on Tue, 05 Oct 1999
>>12:49:36 GMT, Jana Cole or John Sayre <quikscor@ix.netcom.com> says...
>>>    $month = (qw(1 2 3 4 5 6 7 8 9 10 11 12)) [(localtime)[4]];
>>>    $day = (qw(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
21
>>> 22 23 24 25 26 27 28 29 30 31)) [(localtime)[3]];
>>>    $year = (localtime)[5];
>>>    if ($year > 99)
>>>    {
>>>       $year = year - 100;
>>>    }
>>>    $todays_date = "$month/$day/$year";
>>
>Seriously, I truly appreciate the feedback.  I always have my goal in
>mind, and I don't always focus on elegance in getting there.  If you
>would be so kind, could you rewrite the code so I can see how it
>should be done?

#!perl -w
($mday,$month,$year) = (localtime)[3..5];
$todays_date = sprintf("%u/%u/%u",$month+1,$mday,1900+$year);
print $todays_date;

Lauren




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

Date: Tue, 05 Oct 1999 22:36:45 GMT
From: "Patrick A. Smith" <psmith3@tampabay.rr.com>
Subject: newbie help, module for changing date/time fromat to single number.
Message-Id: <37FA7E9E.65190316@tampabay.rr.com>

Hi, I am new to this and working on a project.

I have an array with perhaps 100+ rows of data.

I need to convert a date/time format for each row so that I can sort the
rows by date/time. I know how to do the sort, but I need a module that
will convert the date and time into a single number specific for that
date/time keeping the rest of the elements in the row intact for each
row so that I can sort it. I have no idea how to do this. I have heard
of something called a year date, but is there such a thing as year date
time?

The format of the date/time and row info is like this;

8-16-99 00:20:00  (other data that follows in row-> 23  1016.5  12  380
0.0  86 etc.)

This is followed by several rows with the same format but out of sorted
order.

I appreciate any help you can give, and thank you in advance.

Patrick



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

Date: Tue, 5 Oct 1999 16:57:39 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: newbie help, module for changing date/time fromat to single number.
Message-Id: <MPG.1264304a1922854098a03d@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <37FA7E9E.65190316@tampabay.rr.com> on Tue, 05 Oct 1999 
22:36:45 GMT, Patrick A. Smith <psmith3@tampabay.rr.com> says...
> I have an array with perhaps 100+ rows of data.
> 
> I need to convert a date/time format for each row so that I can sort the
> rows by date/time. I know how to do the sort, but I need a module that
> will convert the date and time into a single number specific for that
> date/time keeping the rest of the elements in the row intact for each
> row so that I can sort it. I have no idea how to do this. I have heard
> of something called a year date, but is there such a thing as year date
> time?
> 
> The format of the date/time and row info is like this;
> 
> 8-16-99 00:20:00  (other data that follows in row-> 23  1016.5  12  380
> 0.0  86 etc.)
> 
> This is followed by several rows with the same format but out of sorted
> order.

It's harder to describe the solution than to write it out and have you 
pore through it and the documentation.  It uses the Schwartz Transform, 
which you can read about in perlfaq4: "How do I sort an array by 
(anything)?"

The date is extracted from the line by a regex; the month and year 
values are adjusted; and then it is converted to a sortable integer.

#!/usr/bin/perl -w
use strict;
use Time::Local;

my @out = map $_->[0] =>
          sort { $a->[1] <=> $b->[1] }
          map {
               my ($mon, $day, $year, $hour, $min, $sec) =
                   /(\d+)-(\d+)-(\d+)\s+(\d+):(\d+):(\d+)/;
               $mon--;
               $year += 100 if $year < 70;
               [ $_, timelocal($sec, $min, $hour, $day, $mon, $year) ]
          } <DATA>;

print @out;
__END__
8-16-99  00:20:00 rest of stuff
8-16-00  00:20:00 rest of stuff
1-1-00   00:00:00 rest of stuff
12-31-99 00:00:00 rest of stuff
8-16-99  00:20:01 rest of stuff

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Tue, 05 Oct 1999 23:00:06 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Newbie question !
Message-Id: <WpvK3.72$_G2.2310@nsw.nnrp.telstra.net>

[Please choose a more meaningful subject for your post next time. Many
people will skip posts that contain inane statements like 'newbie' or
guru'. I normally do]


On Tue, 05 Oct 1999 08:13:36 GMT,
	Wise Guy <WiseGuy_73@go.com> wrote:
> Hi !
> 
> I am pretty new to perl and would like some help. In Benchmark, what is
> the "iterations" ? From basic definition, I understand it is a loop.

More or less, yes. In practical terms it's the same thing.

> Why do I need iterations - can I not make do with only one iteration ?
> Or is it that the more the number of iterations, the more accurate is
> the result ?

Not only more accurate, it also becomes measurable. There are two main
reasons for wanting many iterations: You need to have a total running
time which is meaningfully larger than the resolution you can measure
the running time with, and you need a large number of runs to get rid
of potentially anomalous individuals. Standard statistics practices
:). The second one in computing may be less important, but may be
important if the first run of a series intialises something somewhere.
Doing many subsequent runs will make that initial extra load less
visible.

> Pls excuse me for the simple nature of the question - like I said
> before, I am still learning.

Having a  willingness to learn is laudable.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | 
Commercial Dynamics Pty. Ltd.       | "Mr Kaplan. Paging Mr Kaplan..."
NSW, Australia                      | 


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

Date: Tue, 05 Oct 1999 23:22:07 +0100
From: Dermod Moore <dm@astrolog.demon.co.uknospam>
Subject: NEWBIE: how do I pull out second or third words from a string?
Message-Id: <37FA7A0E.CE217B61@astrolog.demon.co.uknospam>

Hi,

I'm trying to sort a database like this:

21430908,"England","Bloggs, Joe"
07070870,"Ireland","O'Connor, Pat" 
08708078,"New Zealand","Smith, Mary"

I want to be able to sort this, depending on what the search query is,
by either the country OR the name field in each record.

I'm nearly there, in that I've got it to sort on the country field,
by using, from the FAQ:

    @idx = ();
    for (@data) {
        ($item) = /\d+\s*(\S+)/;
        push @idx, uc($item);
    }
    @sorted = @data[ sort { $idx[$a] cmp $idx[$b] } 0 .. $#idx ];

which pulls out the first word after the digits. I then use that as the 
part to sort. How do I pull the second field, NOT the second word,
(keeping New Zealand in mind) and use that to sort the database? 

Thanks for your help in this,

Dermod Moore


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

Date: Tue, 05 Oct 1999 15:14:08 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: News, Apache, and Perl
Message-Id: <37FA7830.519D79F7@mail.cor.epa.gov>

seanleblanc@bigfoot.com wrote:
> 
> I wanted to find a way to download articles from a news server (NNTP),
> and then use a browser front-end to search the articles. Now, is what
> I'm trying to do already done? If so, I'd rather not waste my time.
> I have the part where it gets the articles, but that's as far as I got
> - which isn't very far. 
[snip]

You'll find that CPAN [www.cpan.org] has several modules that
do news and NNTP thingies.  Just look in the News::* and 
NNTP::* hierarchies and see if what you want is already there.

And as for your problem with deja.com , I would recommend
going somewhere else.  Not only are you burdened with their
interface and their limitations, you will find that you are
going to be burdened by the reputation they are rapidly
acquiring in some technical newsgroups as "The New AOL".

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 5 Oct 1999 23:43:56 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: odd or even numbers?
Message-Id: <slrn7vl39s.na9.sholden@pgrad.cs.usyd.edu.au>

On Tue, 05 Oct 1999 15:11:29 +0200,
	Alex Rhomberg <rhomberg@ife.ee.ethz.ch> wrote:
>Abigail wrote:
>
>> __ Does anybody know if there is an easy way to check whether a scalar value
>> __ contains a odd or even integer?
>
>> 
>>     sub is_even {
>>         my $number = abs shift;
>>            $number ? is_odd -- $number : 1;
>>     }
>> 
>>     sub is_odd {!is_even shift}
>> 
>> Or if you don't want to type that much:
>> 
>>     sub is_even {"${\5*$_[0]}" =~ /0$/}
>
>
>- it doesn't terminate given fractional numbers

Which is reasoanable since they are neither even nor odd.

>- returns true given text (which clearly aren't even integers)

Which is reasonable since text is 0 in perl (unless the text looks like a
number of course). And 0 is usually considered to be even.

-- 
Sam

why can't newbies use hash slices in their hello world programs? :-)
	-- Uri Guttman in <x74skxhve5.fsf@home.sysarch.com>


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

Date: Tue, 5 Oct 1999 19:01:17 -0500
From: "homeless" <homelessinseattle@yahoo.com>
Subject: Re: odd or even numbers?
Message-Id: <newK3.1712$V4.8138802@typhoon.stlnet.com>


>Does anybody know if there is an easy way to check whether a scalar value
>contains a odd or even integer?


hmmmm,
 I'm not near as smart as all you perl pros, but it seems to me like
"contains" an odd or even number
 is a bit different than "is" an odd or even number.

$number =~  m/[13579]/ and $number_contains_odd_integer="TRUE";

Am I close?

--homeless
"newbie at heart"





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

Date: Tue, 05 Oct 1999 15:34:35 -0400
From: Wizard of VOBs <hazard@eznetN-O~S'P&A`M.net>
Subject: Re: Perl Debugger
Message-Id: <7tdkai$674$1@news.wrc.xerox.com>

Speaking of the Perl Debugger, I have a question on methodology.. sorry
if this is sounds clueless to some of you.

I love the perl debugger, it has saved me a lot of headaches. However,
one thing I have problems with is deubbing forked processes.  Is there a
way I can do this effectively and confidently?  Whenver I debug
something that is forked, the debugger seems to randomly switch from one
process to the other, usually after each step but not always.  I usually
end up pulling the forked subroutine out into a test script and
debugging in a test scaffolding that fakes the interface and
environement variables.

Is there a better way to debug?

Thanks, 
Al




M.J.T. Guy wrote:
> 
> G.Ananth Somayaji <gs_ananth@ti.com> wrote:
> >Hello,
> >       Is there any way I can emulate tcsh inside the perl debugger.
> >  What I would like specifically is something like history,
> >  inteligent completion etc.
> 
> perl5db.pl provides history  -  see the ! command in perldebug, and also
> this quote:
> 
>      As shipped, the only command line history supplied is a
>      simplistic one that checks for leading exclamation points.
>      However, if you install the Term::ReadKey and Term::ReadLine
>      modules from CPAN, you will have full editing capabilities
>      much like GNU readline(3) provides.
> 
> I'm not sure what you mean by "inteligent completion", but the 'f'
> command provides filename completion, and perldoc perdebug also says
> 
>      A rudimentary command line completion is also available.
>      Unfortunately, the names of lexical variables are not
>      available for completion.
> 
> Mike Guy

-- 
"Never put off 'til tomorrow what you can delegate today"

To contact me remove "N-O~S'P&A`M " from my address


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

Date: Tue, 5 Oct 1999 18:13:21 -0500
From: Seth David Johnson <sjohns17@uic.edu>
Subject: Re: Random Numbers
Message-Id: <Pine.A41.4.10.9910051812440.108372-100000@tigger.cc.uic.edu>

On Tue, 5 Oct 1999, Graeme Sandwell wrote:

> Hi,
> 
> Can you tell me how to generate 9 random numbers and assign them to a value
> called $ran.

Yeah, read the docs.

perldoc -f rand

-Seth
 www.pdamusic.com



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

Date: Wed, 06 Oct 1999 00:02:45 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Redirecting with a SSI from perl
Message-Id: <FkwK3.96$_G2.2665@nsw.nnrp.telstra.net>

On Tue, 05 Oct 1999 18:16:48 GMT,
	jnoviell@my-deja.com <jnoviell@my-deja.com> wrote:
> Greetings All,

[snip]

No code, no relevance to perl at all. Please go to one of the
comp.infosystems.www.* groups, and ask there. And when you do, provide
some mor einformation than you do here.

Martien

PS. Time to add SSI in the subject to the killfile.
-- 
Martien Verbruggen                  | 
Interactive Media Division          | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.       | Gates?
NSW, Australia                      | 


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

Date: Tue, 5 Oct 1999 15:09:23 -0700
From: moseley@best.com (Bill Moseley)
Subject: Regular Expressions with ÔÕÖØŒŠÙÚÛÜÝŸÞàáâãäåæçèéê characters
Message-Id: <MPG.126416ee8ba5a3639897d7@206.184.139.132>


I've got a routine that is passed a list of 'words' and then bolds the 
words in a HTML document by substituting the 'word' with'<B>word</B>'.

Up until now I've used \b to find a word boundary -- I don't want to 
bold words within a longer word (if my word is 'dry' I don't want to 
bold the 'dry' in 'laundry').

s[\bdry\b][<b>dry</b>]g;


My question is in dealing with 8 bit characters such as:
ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØŒŠÙÚÛÜÝŸÞàáâãäåæçèéêëìíîïðñòóôõöøœšßùúûüýþÿ

How should I match a word boundary?  I'm unclear if use locale will 
help.  Or do I need to create my own word boundary as described in 
"Creating custom RE engines" in perlre?

I also have the case being passed a word like "perl*" and then I want to 
bold anything that begins with perl through the end of the word 
boundary.


-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: Tue, 05 Oct 1999 22:36:37 GMT
From: "George Jempty" <jb4mt@verbatims.com>
Subject: Response appreciated but....
Message-Id: <V3vK3.787$ry3.8160@news.rdc1.ne.home.com>

> No one is so helpful as he who helps himself.

I suppose you crank out perfect code in a vacuum

>
> :                                                        but Uri: if I'm
> : so clueless, how come I got my answer more quickly than it would have
> : taken to sift through hundreds of earlier posts?
>
> By sharing with us your belief that the primary source of information
> is previous posts, you betray your cluelessness.

That would actually be Abigail's cluelessness then

PS  Regarding Uri's remark that I wouldn't know spam if I opened a can of
it, how about his totally unhelpful comments that some working Perl code is
"not cool" -- get over yourself!





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

Date: Tue, 05 Oct 1999 22:51:37 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: Response appreciated but....
Message-Id: <slrn7vkvdd.2j4.*@dragons.duesouth.net>

On Tue, 05 Oct 1999 22:36:37 GMT, "George Jempty" <jb4mt@verbatims.com>
enriched us with: 
: > No one is so helpful as he who helps himself.
: 
: I suppose you crank out perfect code in a vacuum

Please don't change the subject line every time you post a reply.

The references header is there to let the newsreaders know which messages
go together.  The subject line is to let the human readers know.

You only change the subject line when you are switching topics, and then
custom dictates that you do something like:

    Re: perl golf (WAS: How do I find the sum of the elements of a list?)

HTH, HAND,

--Matthew


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

Date: 5 Oct 1999 23:54:33 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Response appreciated but....
Message-Id: <slrn7vl3tp.ni6.sholden@pgrad.cs.usyd.edu.au>

On Tue, 05 Oct 1999 22:36:37 GMT, George Jempty <jb4mt@verbatims.com> wrote:
>> No one is so helpful as he who helps himself.
>
>I suppose you crank out perfect code in a vacuum

No, he just knows how to read the documentation. You know the
way they should have taught you to learn things in primary school.

>
>>
>> :                                                        but Uri: if I'm
>> : so clueless, how come I got my answer more quickly than it would have
>> : taken to sift through hundreds of earlier posts?
>>
>> By sharing with us your belief that the primary source of information
>> is previous posts, you betray your cluelessness.
>
>That would actually be Abigail's cluelessness then

No, Abigail most definantly knows how to read the documentation.

-- 
Sam

It has been discovered that C++ provides a remarkable facility for
concealing the trival details of a program--such as where its bugs are.
	--David Keppel


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

Date: 5 Oct 1999 22:21:16 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Seperating records in a text file: just getting every OTHER one.
Message-Id: <7tdtks$m6o$2@info2.uah.edu>

[Posted and mailed]

In article <19991005173436.21744.00001238@ng-ch1.aol.com>,
	pfash1@aol.com (Pfash1) writes:

: I am trying to have my script open a text file with multiple records,
: each seperated by "+++++++++++++++++++++++".
:
: [...]
:
: #!perl-w
: open (FH, 'Buncha emails');
: while (<FH>)
: 	 {
: 		$/ = "+++++++++++++++++++++++";
: 		$_ = <FH>;          
: 		s/\n[ \t]+/ /g;
: 		push(@eachrecord, $_);
: 	 }
: This actually just pushes every OTHER record into the @eachrecord
: array. Why oh why?

The perlop manpage contains

    [T]he following lines are equivalent to each other:

        while (defined($_ = <STDIN>)) { print; }
        while ($_ = <STDIN>) { print; }
        while (<STDIN>) { print; }

In other words, while (<FH>) is doing the reading for you.  When you
then execute $_ = <FH>, you're throwing away the previous record.

: How can I get each record into the array?

    $/ = "+++++++++++++++++++++++";

    my @eachrecord;

    open (FH, 'Buncha email') || die "$0: open Buncha email: $!";
    while (<FH>) {
        chomp;
        s/\n[ \t]+/ /g;
        push @eachrecord, $_;
    }

Greg
-- 
The engineers built a special instruction to encapsulate the function of [a
sequence of frequently executed instructions], rebuilt the system, and found
it made no difference at all; they had optimized the idle loop for the
operating system.  -- bwk and rob, TPOP


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

Date: Tue, 05 Oct 1999 23:43:06 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Simple - yet won't work!
Message-Id: <e2wK3.87$_G2.2665@nsw.nnrp.telstra.net>

On Tue, 05 Oct 1999 19:15:38 GMT,
	Matthew Bafford <*@dragons.duesouth.net> wrote:

> The problem with unlocking the file before the close is buffering.  If
> you write to the file, unlock it, and then close, something like this
> could happen:

Is that still true? The 5.005_03 source seems to do a flush before
unlocking, and I seem to remember that there was a thread not that
long ago about this (where I made the same assertion as you are making
:), and got corrected). (Thread with title 'baffle about flock()
please help', a title which contains two keywords that will accrue a
negative score in my newsreader nowadays)

# perldoc -f flock
[snip]
To avoid the possibility of mis-coordination, Perl flushes FILEHANDLE
before (un)locking it.
[snip]

both the 5.004_04 and 5.005_03 sources contain an 

	(void)PerlIO_flush(fp);

in the definition of the flock internal.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | Useful Statistic: 75% of the people
Commercial Dynamics Pty. Ltd.       | make up 3/4 of the population.
NSW, Australia                      | 


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

Date: Wed, 06 Oct 1999 00:00:11 GMT
From: <nihad@yahoo.com>
Subject: Re: Simple - yet won't work!
Message-Id: <rvl48bmdrad14@corp.supernews.com>

Tom Briles wrote:
> 
> nihad@yahoo.com wrote:
> > 
> > Randal L. Schwartz wrote:
> > >
> > >
> > > >>>>> "Anon" ==   <nihad@yahoo.com> writes:
> > >
> > > Anon>     flock(INF, 8);
> > >
> > > That line is pointless where it is, and dangerous if moved.
> > > Delete it.  And distrust any place that you got it from.
> > >
> >
> > Randal,
> 
> I'm not Randal.  I hope you don't mind if I answer.
> 
> > Why is unlocking the file dangerous?
> 
> A)  Don't post Jeopardy style!
> B)  Don't quote sigs!
> C)  Unlocking the file will open the same holes as not locking it in the
> first place.  I.e., you've just defeated the purpose of locking.
> D)  The close function unlocks the file for you.
>  
> - Tom


Excellent.  I got it.  Thanks everyone for a great tutorial on file 
locking.

Nihad

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


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

Date: Tue, 05 Oct 1999 18:37:49 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: To Abigail re: reading current threads
Message-Id: <37FA7D02.F1238884@chaos.wustl.edu>

Uri Guttman wrote:
> that is not spam. but you wouldn't know spam if you opened a can of it.

I believe spam was used here in the sentiment of 'useless waste of
bandwidth'. I think spam is distinctive enough in texture, colour, smell
and taste to be recogniseable by almost anyone. 
 
> and FYI it is not beginners who are dispised, but clueless ones who
> won't do any homework first before posting here. usenet is not your
> mother.

True, but is the constant noise, wanking, bitching, moaning, whining,
more bitching, flaming, ad infinitum really really really necessary? I
mean, hell, if the people don't read, what makes you think they are
going to read through all the senseless BS posted here every hour? clpm
is the most infantile rabid newsgroup I have ever observed.

The cabal approach is obviously _not_ teaching people anything other
than that the Perl community is a bunch of pedantic assholes who have
nothing better to do than beat idiots senseless as blood sport. 

I think of the collective time and energy wasted daily and boggle at all
of the really useful stuff the Perl community could be doing.

e.


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

Date: 5 Oct 1999 23:13:13 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: To Abigail re: reading current threads
Message-Id: <7te0m9$img$1@rguxd.viasystems.com>

Elaine -HFB- Ashton <elaine@chaos.wustl.edu> wrote:
:>True, but is the constant noise, wanking, bitching, moaning, whining,
:>more bitching, flaming, ad infinitum really really really necessary? I

But what would we do for entertainment if it stopped?

:>mean, hell, if the people don't read, what makes you think they are
:>going to read through all the senseless BS posted here every hour? clpm
:>is the most infantile rabid newsgroup I have ever observed.

Yeah, but it grows on you.  When I first started lurking here I would
suffer pangs of empathy for the poor people on the receiving end
of the vitirol. But after a while, it started to be funny.  Those
aren't real people anyway.  They are just clueless newbies.

OTOH, I haven't quite gotten over my squeamishness enough to actually
flame anybody yet.  They look so cute and cuddly with their awkward
little questions and sincere pleas for help.  I just don't see how
these awful bullies can be so mean to the little critters.

:>The cabal approach is obviously _not_ teaching people anything other
:>than that the Perl community is a bunch of pedantic assholes who have
:>nothing better to do than beat idiots senseless as blood sport. 

You stop right there now.  I can do without the bitching and flaming,
but I'm not giving up my pedantry!  

Speaking of pedantry, are you really sure that the above is an appropriate
use of the word "cabal?"  My dictionary defines...  :-)


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

Date: Wed, 6 Oct 1999 00:02:46 +0100
From: hyweljenkins@hotmail.com (Hywel Jenkins)
Subject: Re: tool to convert BMPs to GIFs programatically?
Message-Id: <MPG.126493f15f6a8f5d989c10@news.freeserve.net>

In article <rvki22lgrad65@corp.supernews.com>, Colin Reinhardt 
(colinrei@oz.net) said...
> Imagine that! You actually helped me out.  See, I wasn't so far off-track
> after all.  It's the best suggestion I've yet received. I'm doing this from
> an MFC app so an OCX should be workable.  much obliged,
You should have seen my original post, that I quickly cancelled!  

Good luck.
-- 
Hywel
http://hyweljenkins.com/
EMail Reply Form:
 http://hyweljenkins.com/support/replyform.htm


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

Date: Tue, 05 Oct 1999 23:23:31 GMT
From: jdkronicz@my-deja.com
Subject: Re: why use references - in laymans terms?
Message-Id: <7te19a$nll$1@nnrp1.deja.com>

In article <7sr1fg$59u$1@brokaw.wa.com>,
  "Lauren Smith" <laurensmith@sprynet.com> wrote:
 ....
> Try reading
> perlref
> perldsc
> perllol
>
> Lauren
>
>
Thanks for your reply Lauren.  Where can I find the documents you
reference?

Thanks .. JDK


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 05 Oct 1999 23:39:51 GMT
From: jdkronicz@my-deja.com
Subject: Re: why use references - in laymans terms?
Message-Id: <7te287$ob1$1@nnrp1.deja.com>

Thanks for your reply Colin.
In regards to your comment:
> also, references are the preferred way to pass more than one data
> structure into or out of a subroutine.  for example, trying to pass
> 2 hashes as such into a subroutine:
>
> foo(%bar, %baz);
>
> is flattened to something like:
>
> foo((all of the keys and values in both hashes))
>
> without references.
>
Could you give me a concrete example?

and in regards to your comment:
> see the documentation for examples (perltoot is a good starting
place).

Where might I find perltoot?

Thanks much -
JDK


Sent via Deja.com http://www.deja.com/
Before you buy.


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

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 995
*************************************


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