[11269] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4869 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 11 05:08:18 1999

Date: Thu, 11 Feb 99 02:00:20 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 11 Feb 1999     Volume: 8 Number: 4869

Today's topics:
    Re: a perl/cgi language reference? <jbc@west.net>
    Re: Calculate yesterdays date (Larry Rosler)
    Re: Calculate yesterdays date <dgris@moiraine.dimensional.com>
    Re: cgi help with form <galahadthedestroyer@earthlink.net>
    Re: cgi help with form <tunejunkie@tunejunkie.com>
    Re: change column of nmbers to 2 dim array (Bart Lateur)
    Re: fun with strings... (Larry Rosler)
        hashes too big <freem26@ibm.net>
    Re: Help editing script chall5@hotmail.com
    Re: Help extracting Internet Address with Regular Expre <jjarrett@ecpi.com>
    Re: Hex 0a always prints 0d followed by 0a (Bart Lateur)
    Re: Interactive Programs and Perl (I R A Aggie)
    Re: Interactive Programs and Perl <roger@novobcs.ee>
    Re: irc and chanserv problems <davidj@zipworld.net>
        Newbie sockets question <rhall@theramp.net>
    Re: Perl 'zine <galahadthedestroyer@earthlink.net>
    Re: Perl 'zine <jjarrett@ecpi.com>
        Perl / C++ / Zombie <muennich@uni-tuebingen.de>
    Re: perl floating points [benchmarking] (Tad McClellan)
    Re: perl x- times an equal sentence (Tad McClellan)
    Re: perl x- times an equal sentence (Larry Rosler)
    Re: perl x- times an equal sentence simc@gmx.net
    Re: perl x- times an equal sentence (Sam Holden)
        perl5.005_02 configuration problems <jwaide@earthlink.net>
    Re: Question: Arrays of associative arrays <tchrist@mox.perl.com>
    Re: shift multi-dimension array <tchrist@mox.perl.com>
    Re: Unix to DOS linefeed conversion? (I R A Aggie)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Wed, 10 Feb 1999 23:11:56 -0800
From: John Callender <jbc@west.net>
Subject: Re: a perl/cgi language reference?
Message-Id: <36C282BC.E055A6A@west.net>

Another beginner-friendly Perl/CGI tutorial is the one I did at:

http://www.lies.com/begperl/

-- 
John Callender
jbc@west.net
http://www.west.net/~jbc/


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

Date: Wed, 10 Feb 1999 13:41:05 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Calculate yesterdays date
Message-Id: <MPG.112b9cc8f7fdfab989a1b@nntp.hpl.hp.com>

In article <ylu2wtbqbn.fsf@windlord.stanford.edu> on 10 Feb 1999 
18:57:00 -0800, Russ Allbery <rra@stanford.edu> says...
 ...
> windlord:~> wc /usr/pubsw/lib/perl5/site_perl/Date/Manip.pm 
>    5378   23939  184930 /usr/pubsw/lib/perl5/site_perl/Date/Manip.pm
> windlord:~> time perl -MDate::Manip -e1
> 0.36u 0.05s 0:00.38 107.8%
> 
> Eek.

This seems like a good post on which to hang a question that has been 
troubling me for some time (pun intended).

Many Frequently Asked Questions here seem to resolve simply to:  Convert 
your input date/time string to Unix-Epoch seconds, then do some simple 
manipulations.  The Frequent Answers point to these humongous, very 
general Date modules.

But (as I have posted several times recently), conversion from a broken-
down date/time array to epoch seconds takes only a few lines of trivial 
but very ugly code.  It does not require a module at all.  (I know there 
is a 'timelocal' function, but I believe it is embedded in one of these 
big modules.)

As a relative newcomer to Perl, I find CPAN to be a very rich collection 
of well-tested, formally-documented modules.  I have not found a 
comparable collection of usable, short code snippets (though perhaps 
CPAN started out that way).

What I would like to see is a dynamic on-line equivalent of the kind of 
code published in The Perl Cookbook, contributed to and reviewed 
collaboratively, and with a searchable index.  Such collections exist 
for modules (on CPAN), and for complete programs elsewhere (often 
maligned here for their style or quality).  The Perl Journal often 
publishes useful one-liners.

How about an archive (in CPAN?) of 'small' functions or snippets, from 
one line to one page of code?  I wouldn't be able to organize it, but I 
certainly would be able to contribute.

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


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

Date: 11 Feb 1999 02:51:22 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Calculate yesterdays date
Message-Id: <m3yam58e05.fsf@moiraine.dimensional.com>

Russ Allbery <rra@stanford.edu> writes:

> windlord:~> perl -MDate::Manip -e'print join ("\n", keys %INC, "")'
> integer.pm
> Cwd.pm
> Carp.pm
> Exporter.pm
> strict.pm
> Date/Manip.pm

Hmmmm... you have a much lighter Date::Manip than I do.

$ perl -MDate::Manip -le 'print join "\n", keys %INC'
Exporter.pm
Carp.pm
Date/Manip.pm
strict.pm
vars.pm
DynaLoader.pm
IO/Handle.pm
Symbol.pm
SelectSaver.pm
IO/File.pm
Fcntl.pm
integer.pm
AutoLoader.pm
IO.pm
Cwd.pm
IO/Seekable.pm
$ cpan

cpan shell -- CPAN exploration and modules installation (v1.47)
ReadLine support enabled

cpan> m Date::Manip
Module id = Date::Manip
    DESCRIPTION  Manipulate/parse international dates/times
    CPAN_USERID  SBECK (Sullivan Beck <sbeck@cise.ufl.edu>)
    CPAN_VERSION 5.33
    CPAN_FILE    SBECK/DateManip-5.33.tar.gz
    DSLI_STATUS  Rdpf (released,developer,perl,functions)
    MANPAGE      Date::Manip - date manipulation routines
    INST_FILE    /home/dgris/lib/perl5/site_perl/5.00554/Date/Manip.pm
    INST_VERSION 5.33

cpan> q
Lockfile removed.
$

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, 10 Feb 1999 21:03:26 -0800
From: Chuck Theobald <galahadthedestroyer@earthlink.net>
To: jldorner@bsuvc.bsu.edu
Subject: Re: cgi help with form
Message-Id: <36C2649E.5878D8CC@earthlink.net>

If you are using cgi-lib.pl, multiple selections are included in the
same %in variable but are separated by nulls. Use the PrintVariables
subroutine to see all your form variables and values. You could
also simple split your multiply selected variable thusly:

# Change nulls to comma-and-space.
$in{'Days'} =~ s/\0/, /g;

Days is a drop-down form field with multiple specified

Cheers,
Chuck


Jennifer Dorner wrote:

> I have created a form that includes a drop down menu of
> goals. Using the MULTIPLE tag I've made it
> possible to select more than one goal at a time. But
> the CGI script is sending only one of the goals in the mail
> message. How do I make it send all of the goals selected?
>
> Jennifer
> jldorner@bsu.edu






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

Date: Wed, 10 Feb 1999 21:08:14 +0000
From: Tunejunkie <tunejunkie@tunejunkie.com>
To: jldorner@bsuvc.bsu.edu
Subject: Re: cgi help with form
Message-Id: <36C1F53E.7962FCD3@tunejunkie.com>

Jennifer Dorner wrote:

> I have created a form that includes a drop down menu of
> goals. Using the MULTIPLE tag I've made it
> possible to select more than one goal at a time. But
> the CGI script is sending only one of the goals in the mail
> message. How do I make it send all of the goals selected?
>
> Jennifer
> jldorner@bsu.edu

did you try using the CGI.pm module?  it has a function (or method if
you like OOP) called param() for getting/setting the CGI parameter names

and values.  it supports parameters with multiple values (returning them

in an array).

-marcos alves



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

Date: Thu, 11 Feb 1999 08:25:19 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: change column of nmbers to 2 dim array
Message-Id: <36c4918b.3748576@news.skynet.be>

Martien Verbruggen wrote:

>The reasons
>that it is considered bad form is that people normally read their
>email before they read Usenet.

They'll probably *get* the mail message, before the Usenet message
appears.

	Bart.


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

Date: Wed, 10 Feb 1999 12:34:32 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: fun with strings...
Message-Id: <MPG.112b8d33b15b305d989a19@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <1dn17nb.aec6fnlg36izN@bay1-169.quincy.ziplink.net> on Wed, 
10 Feb 1999 23:13:42 -0500, Ronald J Kimball ...
> I wrote my solution on the assumptions that
> a) the substitution may need to be extended to other escape sequences
> and
> b) redundancy should be avoided as much as possible.
 ...
> > my %replace = ( n => "\n", t => "\t" );
 ...
> >    Bart   => sub { $_ = $x; s/\\([nt])/$replace{$1}/g },
> 
> In order to extend this solution, you have to update the %replace hash
> and the regular expression.
> This one is also rather redundant.  Each escape sequence is specified
> three times; twice in the hash, and once in the regex.

How about this variation?

       Bart1  => sub { $_ = $x; s/\\(.)/$replace{$1} || "\\$1"/egs },

Now each escape sequence is specified only in the hash.  One can write 
the hash automatically from a single list of escape characters, putting 
your 'eval' cleverness to work outside the main processing loop:

    my %replace = map { $_ => eval qq["\\$_"] } qw( n t );

  a) the substitution may be extended to other escape sequences
  and
  b) redundancy is avoided completely.

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


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

Date: Thu, 11 Feb 1999 18:00:27 +1300
From: Rob Freeman <freem26@ibm.net>
Subject: hashes too big
Message-Id: <36C263EB.644A4F00@ibm.net>

I'm working on a language processing idea. As part of that I want to
make an index of word relationships. Coding is not my subject, but I've
cobbled together a few lines of basic Perl which index the right words
to each other according to the data I have. Trouble is the
data-structures get way too big and clumsy with real data. Any
data-structure studs out there like to take a look at my clumsy attempts
and see if the task can be fit into my little laptop's 40Mb memory (and
geological time). I've tried dbms and all the shuffling options I can
think of, but it the hashes get too big, fall over, or it slows to a
crawl, every time. Perl hashes really seem to be memory eaters.

If you're interested let me know and I'll send you what I've got

Cheers,

Rob Freeman



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

Date: Thu, 11 Feb 1999 09:07:49 GMT
From: chall5@hotmail.com
Subject: Re: Help editing script
Message-Id: <79u6kv$deg$1@nnrp1.dejanews.com>

For anyone with any experience of Perl I should think the task I described
would take no more than 20 minutes for which I would be happy to pay $33.

As regards your other comment I was under the impression the script was
written in Perl making it completely 'on topic' for this forum.

regards
Chris

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 11 Feb 1999 01:36:40 -0500
From: "John T. Jarrett" <jjarrett@ecpi.com>
Subject: Re: Help extracting Internet Address with Regular Expression.
Message-Id: <36C27A77.273F8525@ecpi.com>

And we just had an idiotic string started by Ed Hitler that *more* than
answered that. If it has fallen off, you might check your archives or archives
at dejanews.com

John T. Jarrett



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

Date: Thu, 11 Feb 1999 08:26:22 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Hex 0a always prints 0d followed by 0a
Message-Id: <36c693e1.4346984@news.skynet.be>

Alastair wrote:

>>You on PC?
>
>Hm. I'm on a PC but I don't have to use 'binmode'. You mean using DOS/Windows
>probably. Sorry for splitting hairs!

If you want to write portable code, you should use binmode() whenever
you want to access a file as binary. binmode() is a noop on Unix anyway,
but at least it's self-documenting code.

	Bart.


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

Date: 11 Feb 1999 06:37:23 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Interactive Programs and Perl
Message-Id: <slrn7c4ups.55v.fl_aggie@enso.coaps.fsu.edu>

On Thu, 11 Feb 1999 04:44:55 GMT, Eric Bohlman <ebohlman@netcom.com> wrote:

+ I think you want Net::Telnet,

Indeed.

+ which is part of the libnet bundle 

A common mythconception, but it is not [now]. Net::Telnet is on its
own.

+ available from CPAN.

But is still available from CPAN!

James


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

Date: Thu, 11 Feb 1999 10:09:13 +0200
From: Anton Klevtsov <roger@novobcs.ee>
Subject: Re: Interactive Programs and Perl
Message-Id: <36C29029.4CF9FEF9@novobcs.ee>

or try open2:

use IPC::Open2;

$pid = open2( \*Reader, \*Writer, $telnet_host);
Writer->autoflush(); 
# default here, actually    
print Writer $output_string;
@got = <Reader>;

Thomas Brian Holdren wrote:
> 
> Dear Perlers,
> 
> I am currently working on a user creation script in perl.  But I have run into
> a snag.  I need to run processes on a remote server from within the script,
> such as mkdir, chmod, etc.  Unfortunately, the only remote tools available to
> me are interactive programs like telnet and ftp.  Can perl interact with these
> programs?  For example, can it:
> 
> pseudocode:
> --------------------
> 
> system("telnet $system");
> 
> (perl waits for /login: /)
> login: (perl spits out $username\n)
> (perl waits for /password: /)
> password: (perl spits out $password\n)
> 
> # (perl does this)
> # (perl does that)
> ---------------------
> 
> If perl can do this, the please point this befuddled newbie to the appropriate
> FAQ/Camel Chapter, or maybe you can share it with me yourself.  If it is not
> possible, perhaps you could gracefully point me towards a language that has
> this capability?
> 
> Thank you for your time, dear sirs/madames.
> 
> --
> tbholdren
> irc_addict@hotmail.com.nospam (remove .nospam to email me)
> 
> if ($anyone_cares) {print "Just Another Perl Newbie\n"}

-- 
Anton Klevtsov, programmer
NovoBcs, Tel: +372 6261077


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

Date: Thu, 11 Feb 1999 20:16:52 +1100
From: "David James" <davidj@zipworld.net>
Subject: Re: irc and chanserv problems
Message-Id: <79u73c$gst$1@the-fly.zip.com.au>

Hi,

Gary Lowder wrote in message <36C0E8AB.94BF82C8@bayou.com>...
>
>I'm having problems receiving messages back from chanserv.
<snip>
>I think what I'm missing here is the format that ChanServ sends it's
>messages back to me as, and what type of sub-routine I'd include that
>in. (heh, excuse the horrible sentence structure)  I'm sure I'm missing
>something simple.  Any help would be appreciated.


ChanServ replies via NOTICE. The message format is like this:
:ChanServ!service@dal.net NOTICE YourNick :some text
This is of the general form :SendersNick!user@host NOTICE Destination :text
of the notice. Your IRC client converts this into what you see on the
screen, usually by dropping everything except the Sender's nick and the
text, and turns it into +ChanServ+ BlahBLAHblah or whatever.

Also, /msg's and normal text on a channel are sent via PRIVMSG, in case you
need to do this as well...

The IRC protocol is described in RFC 1459, available from
http://info.internet.isi.edu/in-notes/rfc/files/rfc1459.txt or your local
RFC mirror :) Section 4, "Messages", contains the most interesting bits ;)


Hope this helps,

Dave
davidj@zip.com.au




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

Date: Wed, 10 Feb 1999 23:05:34 -0600
From: Rich Hall <rhall@theramp.net>
Subject: Newbie sockets question
Message-Id: <36C26508.7AB5@theramp.net>

I've read the FAQ and checked out reference.perl.com but can't quite
find the info I need. I would like to be able to clean up sockets that
hang in FIN_WAIT. I wish our developers would do this, but other
projects have a higher priority. 

The situation is this: we have occasionally fallen prey to runaway
processes on the server side of our app. If we restart the server (the
app, not the box - to clean up the runaway), the clients don't recieve a
proper close signal and so will sit indefinitely in FIN_WAIT. We can't
restart the server until they've all cleared. Our only solution at this
point is to resh to each client box and kill the client side process.
But this takes too long. I'm hoping I could use perl to issue shutdown
to each open socket, thus shortening the cleanup phase. Does this sound
possible? Would I do any harm by shutting down those sockets? How can I
determine what filehandle the system is using for those sockets
(netstat?)?

TIA and sorry for the stupid newbie (and possibly off topic) post.

-Rich


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

Date: Wed, 10 Feb 1999 21:16:13 -0800
From: Chuck Theobald <galahadthedestroyer@earthlink.net>
To: orwant@media.mit.edu
Subject: Re: Perl 'zine
Message-Id: <36C2679D.659786F6@earthlink.net>

Hi Jon,

Why glossy?  I've seen other posts supporting the non-glossy format and
I'd like to put my US$0.02 in for non-glossy also. Easier to read, better
feel, IMO.

Cheers,
Chuck Theobald

Jon Orwant wrote:

> I guess I'm a little bit confused by how TPJ isn't meeting your
> needs.  If it's not frequent enough (I'm working on that; it'll
> go bimonthly in 2000, and all-glossy with the next issue), then






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

Date: Thu, 11 Feb 1999 00:25:22 -0500
From: "John T. Jarrett" <jjarrett@ecpi.com>
To: keydet89@yahoo.com
Subject: Re: Perl 'zine
Message-Id: <36C269C2.166CACB7@ecpi.com>

Hey Carv,

Yeah, ditto.

John



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

Date: Thu, 11 Feb 1999 09:52:45 +0100
From: Ralf Muennich <muennich@uni-tuebingen.de>
Subject: Perl / C++ / Zombie
Message-Id: <36C29A5D.642BC250@uni-tuebingen.de>

I want to start simulation programs (in C++) via internet. The computer
for the simulation study is running under Linux with Apache.
The problem is that the Perl script should only start the C++ program.
Unfortunately the time effort for the simulation programs is huge such
that the
Perl script should not wait for it. But then I have a lot of zombies in
the process
list after a while.
Can anyone tell me, how to start a program in C++ from a Perl script
via internet as nohup without producing zombies.
Any suggestions are very welcome, preferably by e-mail.
Thanks,
Ralf Muennich

-------------------------------------
Dr. Ralf Muennich
Wirtschaftswissenschaftliches Seminar
Abteilung Statistik, Oekonometrie
   und Unternehmensforschung
Mohlstrasse 36
D-72074 Tuebingen
TN: +49 7071 29-72570    Fax: -5546
ralf.muennich@uni-tuebingen.de




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

Date: Wed, 10 Feb 1999 22:42:51 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: perl floating points [benchmarking]
Message-Id: <b4nt97.rjl.ln@magna.metronet.com>

Tom Briles (tbriles@austin.ibm.com) wrote:
: Ilya Zakharevich wrote:

: > @array for the sound to be above the ear threshold).  What I always
: > was interesting in is how the speed of sort algorithm depends on
: > having a desktop case vs. a tower case (with the same processor).  I
: > would think that bubbles may accelerate to much higher speed given a
: > tower case.
: >
: > Anybody ready for a benchmark?


: Actually, from my testing, it depends (as is generally the case with
: benchmarks).

: If a single array is being bubble sorted, the tower is much faster - but if you
: code your program such that many arrays are sorted in parallel, the desktop will
: win out.  EACH array sorted in parallel takes longer on the desktop, but the
: TOTAL time for all sorts is less.

: I'm currently working on an article for submission to TPJ.


   Be sure to include a benchmark after laying the tower
   on its side too.

   Hmmm. Better do some tests on the beach, in the Rockies, and
   in Death Valley too, to reveal the effects of altitute on
   sorting algorithms.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 10 Feb 1999 22:47:13 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: perl x- times an equal sentence
Message-Id: <hcnt97.rjl.ln@magna.metronet.com>

simc@gmx.net wrote:

: print $SAVEFILE "$name]$email]$school]$location]";
: print $SAVEFILE "$vday]$vmonth]$vyear]$bday]$bmonth]$byear\n";


   That is a pretty obfuscated way to write it.

   Something like this would seem to me to be easier to maintain:


      print $SAVEFILE join ']', $name, $email, $school, ... , "\n";


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 10 Feb 1999 12:46:06 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: perl x- times an equal sentence
Message-Id: <MPG.112b8fdff736b87d989a1a@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <hcnt97.rjl.ln@magna.metronet.com> on Wed, 10 Feb 1999 
22:47:13 -0600, Tad McClellan <tadmc@metronet.com> says...
> simc@gmx.net wrote:
> : print $SAVEFILE "$name]$email]$school]$location]";
> : print $SAVEFILE "$vday]$vmonth]$vyear]$bday]$bmonth]$byear\n";
> 
>    That is a pretty obfuscated way to write it.
> 
>    Something like this would seem to me to be easier to maintain:
> 
>       print $SAVEFILE join ']', $name, $email, $school, ... , "\n";

        print $SAVEFILE join(']', $name, $email, $school, ... ), "\n";

unless you want a ']' at the end of the line (which the original post 
didn't have).

> --
>     Tad McClellan                          SGML Consulting

You too are missing the invisible trailing space on your cut line.  Damn 
that stupid convention!

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


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

Date: Thu, 11 Feb 1999 08:29:33 GMT
From: simc@gmx.net
Subject: Re: perl x- times an equal sentence
Message-Id: <79u4d6$bkh$1@nnrp1.dejanews.com>

In article <m390e6kylo.fsf@joshua.panix.com>,

Jonathan Feinberg <jdf@pobox.com> wrote:
>Why are you using a symbolic reference to a filehandle, rather than
>just using a filehandle directly?

ok, i change this.

>Also, it's very bad to not check
>the success of a system call like open().

 ... if a file not exist, ">>" will create it, so i thought i can
omit "|| die "Can't append to $save_file: $!\n";". ... ?
(when i want to read a file, i make always a check.)

>#!/path/to/perl -w

i have tested my script with "-w" and without this, have the same
effect: none.

***an other script with the equal source code functions.***

maybe ... the webserver is configured wrong ... ?


to Tad McClellan:
>print $SAVEFILE join ']', $name, $email, $school, ... , "\n";

 ... i have never heard of "join" (i am a perl- beginner), i will try it.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 11 Feb 1999 09:01:05 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: perl x- times an equal sentence
Message-Id: <slrn7c572h.7m4.sholden@pgrad.cs.usyd.edu.au>

On Thu, 11 Feb 1999 08:29:33 GMT, simc@gmx.net <simc@gmx.net> wrote:
>In article <m390e6kylo.fsf@joshua.panix.com>,
>
>Jonathan Feinberg <jdf@pobox.com> wrote:
>>Why are you using a symbolic reference to a filehandle, rather than
>>just using a filehandle directly?
>
>ok, i change this.
>
>>Also, it's very bad to not check
>>the success of a system call like open().
>
>... if a file not exist, ">>" will create it, so i thought i can
>omit "|| die "Can't append to $save_file: $!\n";". ... ?
>(when i want to read a file, i make always a check.)

What if the process doesn't have permission to create the file? What if
the file system has used up all it's inodes? What if there are already the
maximum number of files the OS allows open? What if the OS decides it doesn't
like you and refuses to open the file for you?

There are ways open can fail, you may think they can't happen, but one day 
you'll find the directory permissions were wrong, or the current working
directory was not what you thought it was. Better to get into the habit of
always checking.




>
>>#!/path/to/perl -w
>
>i have tested my script with "-w" and without this, have the same
>effect: none.

Again -w is a habit that some people think you should always use no matter
what. Perl itself seems to be one of those people since it lists 
'The -w switch is not mandatory.' as a bug.

-- 
Sam

Another result of the tyranny of Pascal is that beginners don't use
function pointers.
	--Rob Pike


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

Date: Thu, 11 Feb 1999 00:04:08 -0800
From: "Jon Waide" <jwaide@earthlink.net>
Subject: perl5.005_02 configuration problems
Message-Id: <79u2g6$pui$1@ash.prod.itd.earthlink.net>

I'm trying to install Perl5.005_02 onto a HPUX 10.20 system.  The Configure
aborts because my c-compiler (cc -D_HPUX_SOURCE) fails to understand
function prototypes.

We already run Perl5.002 on our system, and have a config.sh file that
works.  I copied over the old config.sh file and ran 'sh Configure' using
the same defaults, and received the same error message.

Short of compiling Gnu cc for my system (which I've been advised would be
too invasive), does anybody have any suggestions?

Thanks in advance!
Jon Waide
Unix System Administrator
Graham & James, LLP
jwaide@gj.com/jwaide@earthlink.net







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

Date: 11 Feb 1999 02:16:45 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Question: Arrays of associative arrays
Message-Id: <36c29ffd@csnews>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, cpierce1@ford.com (Clinton Pierce) writes:
:On Tue, 09 Feb 1999 15:37:51 -0600, James Ludlow <ludlow@us.ibm.com>
:wrote:
:>Ok.  It still has the basic documentation and the faq.  I don't see how
:>not providing binaries makes it any less useful for reading about Perl
:>syntax.
:
:Simply that, in days of old I'd simply give my students the one URL
:(www.perl.com) and just have them use that as a general-purpose Perl
:Portal.)
:
:Now that perl.com is more firmly in ORA's grip, they've "trimmed"
:pointers to non-ORA resources (consultants, Activestate, etc...).  I
:find myself being _very_ specific about trying to indicate which
:resources may be tainted in which directions, and which resources are
:clearly better than others.

What the hell are you talking about?

--tom
-- 
_doprnt(pat, args, &fakebuf); /* what a kludge */
    --Larry Wall, from util.c in the v5.0 perl distribution


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

Date: 11 Feb 1999 02:38:49 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: shift multi-dimension array
Message-Id: <36c2a529@csnews>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Rick Delaney <rick.delaney@home.com> writes:
:Perl really only has one dimensional arrays, on which shift will work
:fine.  Multi-dimensional arrays are emulated by storing references to
:other arrays.  

That's a semantic issue.  Larry has stated that Perl *implements* (not
the pejorative `emulates') multi-dimensional arrays using references.
Perl *has* multi-dimensional arrays: but you should know that they are
implemented as references.

--tom
-- 
    The only disadvantage I see is that it would force everyone to get Perl.
    Horrors.  :-)
                    --Larry Wall in  <8854@jpl-devvax.JPL.NASA.GOV>


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

Date: 11 Feb 1999 06:41:10 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Unix to DOS linefeed conversion?
Message-Id: <slrn7c4v0v.55v.fl_aggie@enso.coaps.fsu.edu>

On Thu, 11 Feb 1999 04:13:30 GMT, Ken Williams <tekkin@hotmail.com> wrote:

+ I have some text coming from a unix server that is in normal linefeed format.  
+ How could I use perl to convert this text to have a linefeed & carrige return 
+ so when it is displayed on a windows95 computer it will look proper

A non-perl solution: ascii mode in FTP will automatically handle this
conversion between platforms...

James


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

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

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