[17058] in Perl-Users-Digest
Perl-Users Digest, Issue: 4470 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 29 14:10:31 2000
Date: Fri, 29 Sep 2000 11:10:15 -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: <970251015-v9-i4470@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 29 Sep 2000 Volume: 9 Number: 4470
Today's topics:
Re: How to do a UDP broadcast using IO::Socket? <franl-removethis@world.omitthis.std.com>
Re: How to get length of scalar? <hartleh1@westat.com>
Re: More Newbie Help <bkennedy@hmsonline.com>
Re: MySQL vs. mSQL <bart.lateur@skynet.be>
Re: OFFTOPIC: Was: Al Gore's Mother Invented Perl (T. Postel)
Re: OFFTOPIC: Was: Al Gore's Mother Invented Perl <uri@sysarch.com>
Perl & CGI.pm - Textfield passing variable doesnt work lim_k@my-deja.com
Re: Perl & TK <bkennedy@hmsonline.com>
Problem with CGI::Cookie <siowkiat@yahoo.com>
question about regular expressions (shock, horror.. ) <stephen@bcl.com>
Re: question about regular expressions (shock, horror.. <jeff@vpservices.com>
Re: question about regular expressions (shock, horror.. <jeff@vpservices.com>
Re: question about regular expressions (shock, horror.. <godzilla@stomp.stomp.tokyo>
Re: question about regular expressions (shock, horror.. <lr@hpl.hp.com>
Re: Questions about space-saving techniques <bkennedy@hmsonline.com>
Re: REGEX problem <bart.lateur@skynet.be>
Re: Salary Range for Perl Programmers <uri@sysarch.com>
sorting array <sirg@my-deja.com>
Re: sorting array <lr@hpl.hp.com>
temporary file names <wilson@world.std.com>
Re: temporary file names (Rafael Garcia-Suarez)
Re: temporary file names <sariq@texas.net>
Re: temporary file names <franl-removethis@world.omitthis.std.com>
Re: UDP socket using perl? <bkennedy@hmsonline.com>
What is: Can't locate object method? <chriskeeler@home.com>
Re: Win32::Process::Create Help! dj_morri@my-deja.com
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 29 Sep 2000 16:41:21 GMT
From: Francis Litterio <franl-removethis@world.omitthis.std.com>
Subject: Re: How to do a UDP broadcast using IO::Socket?
Message-Id: <m34s2zjglq.fsf@franl.andover.net>
"Thomas Kratz" <Thomas.Kratz@lrp.de.nospam> writes:
> Francis Litterio wrote in message ...
> >Using Perl 5.005_03, there seems to be a chicken-and-egg problem when
> >doing a UDP broadcast with module IO::Socket:
> The following works for me
> (5.6.0 on WinNT/5.00503 on AIX/5.00503 on VMS):
>
> my($BCAddr) = shift;
> my($Port) = shift;
>
> $sock = new IO::Socket::INET(
> Proto => 'udp',
> PeerAddr => $BCAddr,
> PeerPort => $Port,
> )
> Does this work for you?
Nope. I get "Permission denied" on the call to new() -- perhaps
IO::Socket::INET::new() does not connect UDP sockets in version 5.6. I'm
using version 5.005_03 on Linux.
Reading IO/Socket.pm, I disovered the undocumented method
IO::Socket::INET::connect(), and found that this will work:
#!/usr/bin/perl -w
use strict;
use IO::Socket;
my $sock = IO::Socket::INET->new(Proto => 'udp',
Type => SOCK_DGRAM,
Reuse => 1);
die "IO::Socket::INET->new: $!\n" unless $sock;
$sock->sockopt(SO_BROADCAST, 1) or die("sockopt: $!\n");
# WARNING: Method connect() is undocumented!
$sock->connect(9999, inet_aton('209.192.217.255'))
or die("connect: $!\n");
$sock->autoflush();
print "Enter data:\n";
while (<>)
{
print $sock $_ or die("print: $!\n");
}
close $sock;
But using undocumented interfaces doesn't seem right.
--
Francis Litterio
franl-removethis@world.std.omit-this.com
PGP public keys available on keyservers.
------------------------------
Date: Fri, 29 Sep 2000 11:54:24 -0400
From: Henry Hartley <hartleh1@westat.com>
Subject: Re: How to get length of scalar?
Message-Id: <39D4BB30.B4FA639B@westat.com>
Mark Carruth wrote:
>
> The reason I post HTML is that I use Outlook Express to look at these
> newsgroups, and I also use Outlook Express to read my mail.
>
> As I send all my emails (which are part of my LIFE Uri) using HTML, the
> programme sends all my posts in HTML. I never have people moaning about HTML
> in Email so I don't know why I should change.
The reason I speak in English is that my brain works in that language.
I make all my phone calls (which are part of my LIFE) using English.
The other day, I called someone in Kazakhstan and the rude person on the
other end wouldn't help me. He told me (IN RUSSIAN!) that I would have
to speak Russian if I wanted him to talk to me. Actually, he said that
if I spoke Kazakh, that would be fine, too, but that wasn't much help.
I don't know where he got an attitude like this but it's really
annoying. Why should I use his standard? After all, English is the
language of the phone system. At least, I've never had any other people
I talk to complaining that I speak English.
Anyway, I started answering his questions before he asked them. It just
seemed the right thing to do. He hung up on me and now he won't take my
calls! All he said was *plonk*. I wonder what he meant by that.
--
Henry Hartley
------------------------------
Date: Fri, 29 Sep 2000 16:33:50 GMT
From: "Ben Kennedy" <bkennedy@hmsonline.com>
Subject: Re: More Newbie Help
Message-Id: <Ov3B5.13363$td5.2365104@news1.rdc2.pa.home.com>
"Jonathan Klaff" <jon.klaff@rdel.co.uk> wrote in message
news:01c027c5$d41684a0$30b815ac@ntwc0585...
> I have found a way around my earlier problem, but would also like to know
> how I can source a shell script from a perl script.
>
> Please excuse my newbiesness.
What do you mean by source? To source a script generally means to execute
the contents of that script as if they were inserted into the file - it does
not make sense to source a shell script into a Perl script. If you mean
just execute a shell script, you can use system() or backticks, assuming the
execute permissions are set correctly or you want to explicly redirect a
file into a shell.
--Ben Kennedy
------------------------------
Date: Fri, 29 Sep 2000 17:18:01 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: MySQL vs. mSQL
Message-Id: <ikj9tskukji884q9cv3dcsd3ke49kmr6ad@4ax.com>
Jonathan Stowe wrote:
>> This brings with it many other disadvantages, but data corruption is
>> not one of them.
>>
>
>And those disadvantages include the fact that it is impossible to ensure
>that multitable or multirow updates are finished in their entirety or
>not at all
Which is precisely the situation I was talking about. According to some
db specialists, a database with only one table is not even a database.
And, as soon as you need to update two tables that are linked, you'll
have to do that in two steps. That, of course, opens the door wide open
for race conditions.
--
Bart.
------------------------------
Date: Fri, 29 Sep 2000 17:10:08 GMT
From: T.Postel@ieee.org (T. Postel)
Subject: Re: OFFTOPIC: Was: Al Gore's Mother Invented Perl
Message-Id: <Z14B5.2310$z1%1.28574077@news.randori.com>
In article <yxs7k8bvmiei.fsf@nortelnetworks.com.nospam>, Joe Halpin
<jhalpin@nortelnetworks.com.nospam> wrote:
>Well, what he said was:
>
>"During my service in the United States Congress, I took the
>initiative in creating the Internet."--- Albert Gore on CNN's "Late
>Edition with Wolf Blitzer" (March 9, 1999).
>
>What he did (as I understand it) was to help broker a deal which
>stopped direct government funding of NSF, and let the private sector
>run with it.
>
>That was a good thing, but I think he's catching flak because he tried
>to claim more than he deserved from it. He didn't create the internet,
>I don't think he really understood what he was doing. I suspect he
>found it politically advantageous for some reason, not that he was
>the technological visionary he portrayed himself to be.
>
>Just my $.02 U.S.
>
>Joe
That is a bit harsh. Gore knew my brother, they weren't personal
friends though. Gore was pushing to fund internet research while it
was still a DOD ARPA project. He was there at the beginning, and
probably knows all the founders and most of the people who would be
considered stewards. He may have a clue.
--
While my e-mail address is not munged, | T.Postel@ieee.org
I probably won't read anything sent there. |
------------------------------
Date: Fri, 29 Sep 2000 17:56:53 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: OFFTOPIC: Was: Al Gore's Mother Invented Perl
Message-Id: <x73dij6pzt.fsf@home.sysarch.com>
>>>>> "TP" == T Postel <T.Postel@ieee.org> writes:
TP> That is a bit harsh. Gore knew my brother, they weren't personal
TP> friends though. Gore was pushing to fund internet research while it
TP> was still a DOD ARPA project. He was there at the beginning, and
TP> probably knows all the founders and most of the people who would be
TP> considered stewards. He may have a clue.
i was curious if you were related. my condolences.
as for gore, i believe he had a clue on this issue but misspoke
political stuff. he was trying to say he created/workd on the bill to
'create' the internet as we know it, instead of a covernment funded
thing. if it stayed under NSF funding, it would not have grown like it
has. this is a good thing and one rare big win for deregulation (not
saying all reregulation is good).
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Fri, 29 Sep 2000 16:44:58 GMT
From: lim_k@my-deja.com
Subject: Perl & CGI.pm - Textfield passing variable doesnt work
Message-Id: <8r2gu7$2tc$1@nnrp1.deja.com>
I have a HTML form with a textfield and submit button. The text
entered is passed as a variable $id, but the issue I'm having is that
$id is not being passed.
$var = new CGI;
print $var->start_form, "\n",
$var->textfield( -name=>'id', -default=>''),
$var->submit,
$var->end_form, "\n";
$id = $var->param('id');
print "$id\n";
When running this print statement, the error I'm having is use of
unitialized value at line (where this print statement is located at).
I have a created another script before this, which uses the exact same
code, except for the $var being different and it works fine. Any
suggestions/ideas is greatly appreciated.
Thanks!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 29 Sep 2000 17:13:53 GMT
From: "Ben Kennedy" <bkennedy@hmsonline.com>
Subject: Re: Perl & TK
Message-Id: <l54B5.13370$td5.2370826@news1.rdc2.pa.home.com>
"marvin" <alesr@siol.net> wrote in message news:39D3398C.71DF@siol.net...
> The problem is that when I click on START button, event
> steps into begintrace and is inside forever.
> So I put before openint TCP/IP connection following code:
>
> defined($PID=fork) or die "Cannot fork"
> return if $PID;
> setsif;
>
> Now, when I press START button, procedure creates its child, but
> now child doesnt see $lb .
>
> Any help or hint would be appreciated.
One thing you can do is use the after method of the main window obect
my $mw = MainWindow->new;
# rest of the setup
MainLoop;
sub begintrace {
# set up listening socket, etc
$mw->after(100, \&pollSocks); # after a tenth of a second, execute
polling sub
}
sub pollSocks {
# check for incoming connections, data, etc
$mw->after(100, \&pollSocks); # after a tenth of a second, etc
}
With this setup, every tenth of a second you have an oppurtunity to drain
you socket buffers, which should be adequate - if not, you can lower the
polling interval. See
http://ket.ft.uam.es/doc/perl-tk/examples/timer.gz
for a working timers example
--Ben Kennedy
--Ben Kennedy
------------------------------
Date: Sat, 30 Sep 2000 01:53:35 +0800
From: "Tan Siow Kiat" <siowkiat@yahoo.com>
Subject: Problem with CGI::Cookie
Message-Id: <8r2jt4$ga8da$1@ID-44868.news.cis.dfn.de>
Hi there,
I'm new to perl and learning how to set a cookie, so I copied a section off
the CGI::Cookie documentation (in ActivePerl):
------------------------------------------------------
use CGI qw/:standard/;
use CGI::Cookie;
# Create new cookies and send them
$cookie1 = new CGI::Cookie(-name=>'ID',-value=>123456);
$cookie2 = new CGI::Cookie(-name=>'preferences',
-value=>{ font => Helvetica,
size => 12 }
);
print header(-cookie=>[$cookie1,$cookie2]);
# fetch existing cookies
%cookies = fetch CGI::Cookie;
$id = $cookies{'ID'}->value;
# create cookies returned from an external source
%cookies = parse CGI::Cookie($ENV{COOKIE});
------------------------------------------------------
My questions are:
1. When I run the script "perl -w cookie.pl", there is an error msg
"Can't call method "value" on an undefined value at cookie.pl line
12."
What could be wrong? Isn't $cookie{'ID'} a proper instance of CGI::Cookie?
2. Then I tried commenting out the offending line12. The code now compiles,
so I tried running the script http://homepc/cgi-bin/cookie.pl using IE5 in
Win2000.
But thereafter, I couldn't find a new cookie.txt file created in my
"Cookies" folder. Is this behaviour correct? I mean, why aren't $cookie1
and $cookie2 settings saved on my PC, whereas other cookies from commercial
sites are saved correctly?
Thanks in advance for any help.
Regards,
siowkiat
------------------------------
Date: Fri, 29 Sep 2000 16:02:45 +0100
From: Steve Howe <stephen@bcl.com>
Subject: question about regular expressions (shock, horror.. )
Message-Id: <jK7UOX8gke1=KfEPEdYUI5b1XQpD@4ax.com>
for the clever people out there..
what the _heck_ does the regular expression in this do, please?
if ($query->param('save-as-filename') !~ /^[ \t]*$/) {
$filename = $query->param('save-as-filename');
(taken from a file upload script)
thanks very much in advance for any replies.
Steve Howe
------------------------------
Date: Fri, 29 Sep 2000 09:11:44 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: question about regular expressions (shock, horror.. )
Message-Id: <39D4BF40.2A49BDF1@vpservices.com>
Steve Howe wrote:
>
> for the clever people out there..
> what the _heck_ does the regular expression in this do, please?
>
> if ($query->param('save-as-filename') !~ /^[ \t]*$/) {
> $filename = $query->param('save-as-filename');
>
It checks to see if the user submitted a filename that consists only of
spaces and tabs.
!~ # does not contain the following patern:
^ # starts with
[ \t]* # zero or more spaces or tabs
$ # and then ends
--
Jeff
------------------------------
Date: Fri, 29 Sep 2000 09:16:44 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: question about regular expressions (shock, horror.. )
Message-Id: <39D4C06C.27B67C7E@vpservices.com>
Jeff Zucker wrote:
>
> Steve Howe wrote:
> >
> > for the clever people out there..
> > what the _heck_ does the regular expression in this do, please?
> >
> > if ($query->param('save-as-filename') !~ /^[ \t]*$/) {
> > $filename = $query->param('save-as-filename');
> >
>
> It checks to see if the user submitted a filename that consists only of
> spaces and tabs.
Or if the filename field was left empty.
> !~ # does not contain the following patern:
>
> ^ # starts with
> [ \t]* # zero or more spaces or tabs
> $ # and then ends
--
Jeff
------------------------------
Date: Fri, 29 Sep 2000 09:32:22 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: question about regular expressions (shock, horror.. )
Message-Id: <39D4C416.C59DDA32@stomp.stomp.tokyo>
Steve Howe wrote:
> for the clever people out there..
Oh, oh, gotta be careful with words like this.
Clever can mean a quick-witted fast thinking person,
or a diabolically crafty person who is clever like a
fox. Did you know the difference between a dog and
a fox is about six drinks?
> what the _heck_ does the regular expression in this do, please?
> if ($query->param('save-as-filename') !~ /^[ \t]*$/) {
> $filename = $query->param('save-as-filename');
I have both amazed and shamed myself this morning.
Amazed by actually being able to read this type
of Techno-Geekster gibberish and, shamed becaused
this indicates, oh woe is me, I am becoming just
such, a gibberish speaking Techno-Geekster.
if filename...
!~
does not match, does not...
^
begin with...
[ \t]
a space or a tab...
*
don't care if zero or more spaces or tabs
$
and nothing else all the way to the end..
then use this filename although it might
be totally FUBAR in other ways.
If the filename is only spaces, tabs or nothing,
do not use the filename.
...instead use this filename, *.*
heh... heh... hehhhh....
Godzilla!
--
Professional Techno-Geekster Gibberish Translator
------------------------------
Date: Fri, 29 Sep 2000 10:19:12 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: question about regular expressions (shock, horror.. )
Message-Id: <MPG.143e6eef71babfe798addb@nntp.hpl.hp.com>
In article <39D4C06C.27B67C7E@vpservices.com> on Fri, 29 Sep 2000
09:16:44 -0700, Jeff Zucker <jeff@vpservices.com> says...
> Jeff Zucker wrote:
> >
> > Steve Howe wrote:
> > >
> > > for the clever people out there..
> > > what the _heck_ does the regular expression in this do, please?
> > >
> > > if ($query->param('save-as-filename') !~ /^[ \t]*$/) {
> > > $filename = $query->param('save-as-filename');
> >
> > It checks to see if the user submitted a filename that consists only of
> > spaces and tabs.
>
> Or if the filename field was left empty.
But it accepts a filename consisting only of a newline character. That
is a valid character in a Unix filename (though anyone who uses it
deserves chastisement -- think of what it does to an `ls` listing, for
example).
A purist would write that regex as /^\s*\z/ or -- much better and
clearer -- would rewrite the condition as:
if ($query->param('save-as-filename') =~ /\S/) {
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 29 Sep 2000 16:05:53 GMT
From: "Ben Kennedy" <bkennedy@hmsonline.com>
Subject: Re: Questions about space-saving techniques
Message-Id: <B53B5.13337$td5.2361678@news1.rdc2.pa.home.com>
"James Weisberg" <chadbour@wwa.com> wrote in message
news:usKA5.5654$l35.133134@iad-read.news.verio.net...
> And it's one I've been wrestling with for a while. As I said in my
> original post, I'm using MLDBM to do multidimensional ties. And because
> of the way MLDBM works, it's a bit finicky FETCHing records out of the
> database. In fact, given a $date and an $object, it FETCHes *all*
> records (i.e. all intervals) associated with that date and object. I
> cannot control that part (and you can see the MLDBM man page for more
> if interested).
I'm not sure on the details of the serialization, but I have a feeling that
by accessing under a $date and $object key (via $DB{$data}{$object}), what
happens is somethings like
$ref = $DB{$data};
$intervals = $ref->{$object};
I don't know if its possible to get to $intervals without having the whole
thing deserialized at some point, bringing into scope data about $object's
you don't care about. Though it may only be long enough to store the
correct $intervals reference, and let the rest fade out of scope, I don't
know. I don't even know if it matters or not, just more stuff to think
about. But have you considered moving to a true DBMS? That would solve a
lot of problems. Something like MySQL seems well suited for this kind of
thing. Once you get past the overhead of setting it up, learning some SQL
syntax, and installing DBI, it becomes very easy to maintain and query. Not
to mention there is a lot of personal satisfaction getting the whole thing
running smoothly.
--Ben Kennedy
------------------------------
Date: Fri, 29 Sep 2000 17:19:30 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: REGEX problem
Message-Id: <loj9tsonqfpgu38jjc3q9fjpg46i7pok5c@4ax.com>
Keith Calvert Ivey wrote:
>You're reading Usenet (especially a programming newsgroup) in a
>proportional font!?
Of course. Fixed pitch fonts are very tiring for my eyes.
>Watch out, you'll be drifting into Jeopardy
>posting next. And then comes posting in HTML.
Not a chance in hell.
--
Bart.
------------------------------
Date: Fri, 29 Sep 2000 18:02:15 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Salary Range for Perl Programmers
Message-Id: <x7u2az5b6g.fsf@home.sysarch.com>
>>>>> "NM" == Nicolas MONNET <nico@monnet.to> writes:
NM> What the fuck was Jonathan Stowe <gellyfish@gellyfish.com> trying to say:
>> On Wed, 27 Sep 2000 10:55:14 +0100 Nicolas MONNET wrote:
>>> What the fuck was Tom Briles <sariq@texas.net> trying to say:
>>>
>>>> Any class that allows its students to leave calling 'Perl' 'PERL'
>>>> isn't worth two cents, much less four hundred bucks.
>>>
>>> It's spelled A-N-A-L R-E-T-E-N-T-I-V-E.
>>>
>>
>> Its spelt K-I-L-L-F-I-L-E actually.
NM> Offtopic: I'd never get around to understand why some people
NM> seem to be so proud to announce to the world the content
NM> of their killfile.
you don't understand much about usenet in general it seems.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Fri, 29 Sep 2000 17:02:15 GMT
From: Serge Zlobin <sirg@my-deja.com>
Subject: sorting array
Message-Id: <8r2huf$419$1@nnrp1.deja.com>
Possibly dumb question.
Suppose I have array A[$index] and every element of it has some fields
(lets' say filed1, field2, ...),
i.e A[$i]{filed%} (I think it's called hash in perl)
(I wanna make something like array of records in C;maybe there's more
useful method in perl).
I want to sort array, let's say, by field1. But when I write something
like
@A= sort {$a{field1} cmp $b{field1}} @A,
I get nothing and the array remains the same.
What's the problem?
--
With best regards, Sir-G.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 29 Sep 2000 10:44:45 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: sorting array
Message-Id: <MPG.143e74e8d9b7898398addc@nntp.hpl.hp.com>
In article <8r2huf$419$1@nnrp1.deja.com> on Fri, 29 Sep 2000 17:02:15
GMT, Serge Zlobin <sirg@my-deja.com> says...
> Possibly dumb question.
Not really. Ignorant, perhaps, but not dumb.
> Suppose I have array A[$index] and every element of it has some fields
> (lets' say filed1, field2, ...),
> i.e A[$i]{filed%} (I think it's called hash in perl)
Yes, it is. And the array is called @A, though using a capital-letter
name for a variable misleadingly implies a constant (as in C),
> (I wanna make something like array of records in C;maybe there's more
> useful method in perl).
You are making an array of references to hashes, which is analogous. In
C, you can have an array of any single type of data-structure element.
In Perl, arrays can contain only scalars, so references are used to
create multi-dimensional data structures.
> I want to sort array, let's say, by field1. But when I write something
> like
> @A= sort {$a{field1} cmp $b{field1}} @A,
> I get nothing and the array remains the same.
> What's the problem?
More than one problem, really.
You didn't run your program with warnings and 'use strict;' in effect.
Had you done so, you would have discovered that $a{field1} tries to
access an undeclared hash %a; similarly for %b.
As the elements of @A are references, not hashes, you must use them as
such.
@A = sort {$a->{field1} cmp $b->{field1}} @A;
The -> operator should be familiar to a C programmer.
A good place for you to read would be the Perl document perldsc (data-
structure cookbook). At a command prompt, type:
perldoc perldsc
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 29 Sep 2000 15:08:45 GMT
From: Nick Wilson <wilson@world.std.com>
Subject: temporary file names
Message-Id: <G1nM2M.Kws@world.std.com>
Hello all,
Does Perl have a built-in mechanism for generating temporary file names
(something like tmpnam() in C)?
Thanks,
Nick
------------------------------
Date: Fri, 29 Sep 2000 15:57:39 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: temporary file names
Message-Id: <slrn8t9fc6.mmt.rgarciasuarez@rafael.kazibao.net>
Nick Wilson wrote in comp.lang.perl.misc:
>Hello all,
>Does Perl have a built-in mechanism for generating temporary file names
>(something like tmpnam() in C)?
tmpnam(3) is a POSIX function :
use POSIX qw/tmpnam/;
my $tempfilename = tmpnam;
--
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: Fri, 29 Sep 2000 16:03:50 GMT
From: Tom Briles <sariq@texas.net>
Subject: Re: temporary file names
Message-Id: <39D4BD57.74883490@texas.net>
Nick Wilson wrote:
>
> Hello all,
> Does Perl have a built-in mechanism for generating temporary file names
> (something like tmpnam() in C)?
RTFFAQ. Even the most cursory attempt would have found the answer.
perldoc -q temporary
- Tom
------------------------------
Date: Fri, 29 Sep 2000 16:49:23 GMT
From: Francis Litterio <franl-removethis@world.omitthis.std.com>
Subject: Re: temporary file names
Message-Id: <m3zokri1nw.fsf@franl.andover.net>
Nick Wilson <wilson@world.std.com> writes:
> Does Perl have a built-in mechanism for generating temporary file names
> (something like tmpnam() in C)?
Do this:
use POSIX qw(tmpnam);
my $tmpfile = POSIX::tmpnam();
Of course, by the time you use that filename, some other process may
already be using it, but that's a different problem altogether.
--
Francis Litterio
franl-removethis@world.std.omit-this.com
PGP public keys available on keyservers.
------------------------------
Date: Fri, 29 Sep 2000 16:23:38 GMT
From: "Ben Kennedy" <bkennedy@hmsonline.com>
Subject: Re: UDP socket using perl?
Message-Id: <em3B5.13357$td5.2364038@news1.rdc2.pa.home.com>
"Djoko Tri" <trisa@sby.dnet.net.id> wrote in message
news:39D2A24F.DF57090E@sby.dnet.net.id...
> do anyone now how to create socket connection for UDP protocol using
> perl?
> or maybe some simple client/server script example of it in perl?
> help....
There is an example of UDP message passing in the page:
perldoc perlipc
and the ever-popular "Perl Cookbook" (ram on cover, available where books
are sold) has some enlightening examples of UDP clients and servers.
--Ben Kennedy
------------------------------
Date: Fri, 29 Sep 2000 16:24:51 GMT
From: MuLE <chriskeeler@home.com>
Subject: What is: Can't locate object method?
Message-Id: <39D4C512.88C0E31B@home.com>
Apache server start fine with mod_perl.
When I try to pull a page, I get an "Internal Server Error"
Checking the error.log it says:
Can't locate object method "TIEHASH" via package "Apache::Session::DBI"
What does this mean in english?
Thanks.
Chris
------------------------------
Date: Fri, 29 Sep 2000 17:01:16 GMT
From: dj_morri@my-deja.com
Subject: Re: Win32::Process::Create Help!
Message-Id: <8r2hsk$3pi$1@nnrp1.deja.com>
Hello all,
Well I did find the answer in the examples suggested after all.
Just in case anyone else is having the same prob, to save some time
the answer is as follows.
<snip>
> Win32::Process::Create($ProcessObj,
> "D:\\Perl\\bin\\perl.exe",
"D:\\InetPub\\wwwroot\\cgi-bin\\zedo\\local.pl",
> '0',
> DETACHED_PROCESS,
> "."
> )|| die ErrorReport();
>
is *almost* there. If you want to spawn another perl script in
Win32 the arguments you must pass to perl.exe are in fact
"perl D:\\yourpathto\\your.pl".
e.g.
> Win32::Process::Create(
> $ProcessObj,
> "D:\\Perl\\bin\\perl.exe",
> "perl D:\\InetPub\\wwwroot\\cgi-bin\\zedo\\local.pl",
> '0',
> CREATE_NEW_PROCESS,
> "."
> )|| die ErrorReport();
I also used the flag CREATE_NEW_PROCESS instead.
I don't fully understand this, but it works for me and
hopefully may save you some time as this isn't clear in any standard
documentation. If anyone can explain the meaning of the flags, feel
free.
Thanks to all other contributors, I now have the wonderful world of
multi-threaded processes to explore! Pipes next I suppose...
Cheers.
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 4470
**************************************