[17534] in Perl-Users-Digest
Perl-Users Digest, Issue: 4954 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 23 00:05:32 2000
Date: Wed, 22 Nov 2000 21:05:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <974955910-v9-i4954@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 22 Nov 2000 Volume: 9 Number: 4954
Today's topics:
Add Group user <brianlk@pacific.net.hk>
Re: C to C++ conversion (Jon Ericson)
Re: Catching a pop-up dialog? (Jon Ericson)
Re: email parsing body <bwalton@rochester.rr.com>
External run under diffrend user. <fire@fshosting.net>
Re: How do I read line by line of data from a file usin (Martien Verbruggen)
How do i use head($url)? <me@privacy.net>
Re: I'm confused <mischief@velma.motion.net>
Re: I'm confused (Martien Verbruggen)
If/else problem. <johngros@Spam.bigpond.net.au>
Re: If/else problem. (Tad McClellan)
Re: If/else problem. (Martien Verbruggen)
Re: Image Gallery Script <ms@klmoberg.no>
Is it possible <joseph@jpereira.com>
Making data persist under modperl? (William Gray)
Perl and dbi <cd_cook@yahoo.com>
Re: Perl and dbi <jeff@vpservices.com>
PerlIS.dll headers in html extra INFO <web@web.com>
Re: rearranging a text file (Wyzelli)
Re: running a script as root <godoy@conectiva.com>
Signals fallenang3l@my-deja.com
Re: Signals <mischief@velma.motion.net>
Re: Sort strings before numbers <hbhb@gmx.de>
Re: Sort strings before numbers <hbhb@gmx.de>
Re: Using exists with hashes (Alan Barclay)
Re: Using exists with hashes <rick.delaney@home.com>
Wrtiing on a Win32 system <rtek84@email.com>
Re: Wrtiing on a Win32 system <carvdawg@patriot.net>
Re: Wrtiing on a Win32 system <res06xbi@gte.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 23 Nov 2000 10:41:01 +0800
From: Brian Leung <brianlk@pacific.net.hk>
Subject: Add Group user
Message-Id: <3A1C83BD.945E8026@pacific.net.hk>
Hi,
I login as administrator in win2000 server and write a simple script
like that
use Win32::NetAdmin;
Win32::NetAdmin::GroupAddUsers('','Administrators','sadmin13') or
print "can't add\n";
However, it always prompts me that "can't add". why?
Thanks
Brian
------------------------------
Date: 22 Nov 2000 22:31:05 GMT
From: Jonathan.L.Ericson@jpl.nasa.gov (Jon Ericson)
Subject: Re: C to C++ conversion
Message-Id: <8FF494815JonathanLEricsonjpln@137.78.50.25>
On 22 Nov 2000, vidulats@yahoo.co.uk wrote:
>My project is in C.
>I want to convert it in C++.
>I know that re-coding the entire project is the solution to that.
>
>But, I also heard that the easiest way is by writing Perl script. Which
>can convert my entire project from C to C++.
This is horribly off-topic, but often the only thing required is judicious
use of:
extern "C" { ... };
But you really should find out more from C/C++ information sources.
Jon
------------------------------
Date: 22 Nov 2000 22:12:03 GMT
From: Jonathan.L.Ericson@jpl.nasa.gov (Jon Ericson)
Subject: Re: Catching a pop-up dialog?
Message-Id: <8FF49F4EEJonathanLEricsonjpln@137.78.50.25>
On 22 Nov 2000, orret@wmn.net (Lourdes Orret) wrote:
>Maybe better way to ask: There is a way to have access to the information,
>events and data
>structure of the window that have the FOCUS on MS-WINDOWS?
search.cpan.org for Win32.
Jon
------------------------------
Date: Thu, 23 Nov 2000 04:51:51 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: email parsing body
Message-Id: <3A1CA31A.E0C27B5D@rochester.rr.com>
Kevin Hanrahan wrote:
>
> Can anybody tell me how to parse out the body of an email and pass it to
> another prog. or part of the same program as a variable? Can you give me
> an example? I am new to perl and am trying to learn from seeing actual
> examples...thanks
Well, there's a lot one needs to know in order to do this that you don't
tell us. Like what is the form in which the incoming email is stored.
Therefore, making assumptions: Assume the incoming email is a string in
a scalar variable, newlines included, and that the header is separated
from the body in the valid standard way using a null line [warning:
untested]:
($header,$body)=$email=~s/(.*?)\n\n(.*)/;
should do the trick. To pass it to another program, you are probably
best off to open a pipe to the program and print the email via the pipe
to the other program (the body could be too long and/or contain stuff
that couldn't be easily or reliably passed via command line arguments)
[warning: untested]:
open PIPE,"|programname" or die "Clogged pipe, $!\n";
print PIPE $body;
close PIPE;
--
Bob Walton
------------------------------
Date: Thu, 23 Nov 2000 05:38:01 +0100
From: "Daniel" <fire@fshosting.net>
Subject: External run under diffrend user.
Message-Id: <8vi7ul$jsu$1@doppler.a2000.nl>
Hello as most people here i got a question to ;o)
i want to run EXTERNAL script ( shell scripts ) under a system USER.
how do i do this ?
Thanks for any information ! ;o)
- Daniel
------------------------------
Date: Thu, 23 Nov 2000 02:16:43 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: How do I read line by line of data from a file using perl
Message-Id: <slrn91ovco.r2.mgjv@verbruggen.comdyn.com.au>
On Wed, 22 Nov 2000 17:51:17 -0500,
Kip <kip@skiltrip.com> wrote:
> # first you need to open a filehandle to the file...
>
> open (DB, "yourfilenamehere");
You might as well teach them some good habits:
open(DB, "yourfile") or die "Cannot open 'yourfile' for read: $!";
Martien
--
Martien Verbruggen |
Interactive Media Division | Unix is user friendly. It's just
Commercial Dynamics Pty. Ltd. | selective about its friends.
NSW, Australia |
------------------------------
Date: Thu, 23 Nov 2000 02:06:41 GMT
From: "EM" <me@privacy.net>
Subject: How do i use head($url)?
Message-Id: <RY_S5.4842$Nw6.16179@news.iol.ie>
Under LWP Simple on CPAN i found this
head($url)
Get document headers. Returns the following 5 values if successful:
($content_type, $document_length, $modified_time, $expires, $server)
Returns an empty list if it fails. In scalar context returns TRUE if
successful.
how exactly do i use this?
i tried this
#!/usr/bin/perl
print "Content-type: text/html\n\n";
use LWP::Simple;
$url = "http://www.ericscgi.com/?debug";
$file = "./debug.html";
$response = head($url);
print $response->content_type; # This works
print $response->document_length; # DOESNT WORK
print $response->modified_time; # DOESNT WORK
print $response->expires; # DOENST WORK
print $response->server; # DOENST WORK
------------------------------
Date: Wed, 22 Nov 2000 23:05:39 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: I'm confused
Message-Id: <t1oka3i74gp3ce@corp.supernews.com>
Uri Guttman <uri@sysarch.com> wrote:
>>>>>> "RS" == Ralf Siedow <replynews@bigfoot.com> writes:
> RS> I'm just mangling the following trainig course at
> RS> http://www.bjnet.edu.cn/tech/book/perl/ch18.htm
> eewwww!!! i just took a gander at that site and i am barfing chunks. it
> is garbage perl teaching and i highly recommend you (and all others)
> stay away from it. the code is wrong in many cases and the formatting
> (in particular close braces) is horrifying.
Not only is it bad Perl, it's bad programming. The site doesn't even
use proper terminology.
The fools don't even realize that after $foo and $bar come $baz,
$wumpus, $xyzzy, $plugh, $zorkmid, $yondor, $quux, and $blammo. Of
course, the order of the last 7 can be shuffled as long as the
magic words stay together. ;)
I'd stay away from any site that claims a Perl reference is exactly
like a C pointer. They are similar, but so are a yacht and a barge.
I wouldn't haul coal to a power plant in a yacht. I also find on that
same page a reference to a perl listing as a "shell script".
I propose a web site dedicated to the listing of information sources
best left unused. We can put this one right up next to
Matt`s s<r1pt Ar<h1v3.
Chris
--
Christopher E. Stith - mischief@motion.net
------------------------------
Date: Wed, 22 Nov 2000 23:06:59 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: I'm confused
Message-Id: <slrn91ok8v.r2.mgjv@verbruggen.comdyn.com.au>
On Wed, 22 Nov 2000 22:44:24 +0100,
Ralf Siedow <replynews@bigfoot.com> wrote:
> Hello,
>
> I'm just mangling the following trainig course at
> http://www.bjnet.edu.cn/tech/book/perl/ch18.htm
Euhm, that book isn't exactly good. Is that a legal copy anyway?
> They have an exercise at the end of the chapter that confuses me a little
> bit:
> Why is $b not being set in the following line of code? What do you have to
> do to make it okay?
> sub xxx {
> my ($a, $b) = @_;
> }
Nonsense. Pure nonsense. $a and $b are set fine, as long as you pass
something in the call.
sub xxx { my ($a, $b) = @_; print "$a, $b\n" }
xxx(1, 2)
But it's a bad idea to use $a and $b there. Imagine that at some point
you want to insert a sort routine in there:
sub xxx
{
my ($a, $b) = @_;
my @a = (4, 3, 2, 1);
my @b = sort { $a cmp $b } @a;
print "@b\n"
}
try to compile that.
> Answer:
> Make the line
> my($a,$b)
> look like this:
> my (\$a,\$b)
> Then use @$a and @$b to access these arrays by reference.
Nonsense. There was not a single reference to arrays or array
references in the example. I think that the question probably should
have been a totally different one. One with a lot more explanation of
the problem.
Don't waste your time on this crud. Their 'solutions' are crap as
well.
This gem was in there somewhere (unrelated to the question above):
1.Here is one possible solution:
$p1 = @a;
$p2 = %a;
$p3 = sub { return @_ ; };
printf "\n Array reference = $p1";
printf "\n Hash reference = $p2";
printf "\n Subroutine reference = $p3";
It is clear that these jokers never even ran this. Unless this is an
artefact introduced by the person who scanned these pages and made
them available. But then you probably are getting what you deserve for
reading illegal copies of books.
Martien
--
Martien Verbruggen |
Interactive Media Division | The world is complex; sendmail.cf
Commercial Dynamics Pty. Ltd. | reflects this.
NSW, Australia |
------------------------------
Date: Wed, 22 Nov 2000 23:26:44 GMT
From: "John Boy Walton" <johngros@Spam.bigpond.net.au>
Subject: If/else problem.
Message-Id: <UCYS5.30$GW5.472@news-server.bigpond.net.au>
I have the following code which I think is incorrect because the if always
evaluates $pass does eq <BOGUS>!
Anybody know how to get a correct evaluation?
sub verifyuser
{
&oops("Unable to open FTP User database") unless open BOGUS,"+>>$file";
if ($pass eq <BOGUS>){
goto success;
}else{
------------------------------
Date: Wed, 22 Nov 2000 18:51:27 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: If/else problem.
Message-Id: <slrn91omvv.o7s.tadmc@magna.metronet.com>
John Boy Walton <johngros@Spam.bigpond.net.au> wrote:
>I have the following code which I think is incorrect because the if always
>evaluates $pass does eq <BOGUS>!
>Anybody know how to get a correct evaluation?
No.
> if ($pass eq <BOGUS>){
What is in $pass?
What does the data that you are reading look like?
We can't (generally) read minds hereabouts.
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 23 Nov 2000 02:15:05 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: If/else problem.
Message-Id: <slrn91ov9m.r2.mgjv@verbruggen.comdyn.com.au>
On Wed, 22 Nov 2000 18:51:27 -0500,
Tad McClellan <tadmc@metronet.com> wrote:
> John Boy Walton <johngros@Spam.bigpond.net.au> wrote:
>>I have the following code which I think is incorrect because the if always
>>evaluates $pass does eq <BOGUS>!
>>Anybody know how to get a correct evaluation?
>
>
> No.
I happen to bvelieve it is correct. One line you snipped, just before
the one you quote below, said:
&oops("Unable to open FTP User database") unless open BOGUS,"+>>$file";
>> if ($pass eq <BOGUS>){
so, we know what <BOGUS> evaluates to; namely undef.
If $pass is also undef or the empty string, the equality will evaluate
to true.
It may be not what he wants, but it is correct.
:)
> What is in $pass?
undef or ""
> What does the data that you are reading look like?
undef.
> We can't (generally) read minds hereabouts.
Nope, that's true. We have no clue whatsoever what the OP is _trying_
to do.
Martien
--
Martien Verbruggen |
Interactive Media Division | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd. | make a better idiot.
NSW, Australia |
------------------------------
Date: Thu, 23 Nov 2000 00:44:12 +0100
From: "Martin Sarajervi" <ms@klmoberg.no>
Subject: Re: Image Gallery Script
Message-Id: <8vhll4$pv7$1@news.netpower.no>
"Dan" <drinkbeer3@hotmail.com> wrote in message
news:8uvhbk$dmf$1@seagoon.newcastle.edu.au...
> Hi,
>
> I was wondering if anyone knows of a good photo gallery script. I am
looking
> for one that will create thumbnails automatically and then display them in
> an HTML table.
>
> Please email me at drinkbeer3@hotmail.com if you can help.
>
I made on myself with the Imager module, but I won't contact you :-)
- Martin
------------------------------
Date: Wed, 22 Nov 2000 19:21:49 -0700
From: Joseph Lee Pereira <joseph@jpereira.com>
Subject: Is it possible
Message-Id: <uavo1t0t7q984hgja3u84hl2lv27dkbdn0@4ax.com>
to do this with Perl?
From within Linux platform.
I would like to be asked for text input (I want to enter a text
message), for a timer setting (in minutes or seconds) and have Perl
send my text input into an open window and have it click on the "send"
button. I want this process to be repeated automatically according to
my initial Timer input.
The application I want to have this send the input to is X-Chat (irc
app)
-Joseph
Joseph L. Pereira
joseph@jpereira.com
------------------------------
Date: 22 Nov 2000 18:24:27 -0800
From: smiths@alumni.cse.ucsc.edu (William Gray)
Subject: Making data persist under modperl?
Message-Id: <slrn91p0ir.8dm.smiths@alumni.cse.ucsc.edu>
I have a function which selects the same data from the DB over and over.
I'm running under mod_perl and I would like to select the data once
when the function is first called and then use the copy in memory after
that. I am confused about how to define a variable under mod_perl which
will not get destroyed when my function returns. This must be obvious,
but I haven't found any docs that explain it yet.
Thanks for any help,
-Wes
--
"Sigourney Weaver is pretty cool, he really kicks ass in all those
alien movies, even if he does look a little like a chick."
------------------------------
Date: Wed, 22 Nov 2000 18:49:51 -0500
From: "news@videotron.ca" <cd_cook@yahoo.com>
Subject: Perl and dbi
Message-Id: <JVYS5.9507$RN4.335628@wagner.videotron.net>
Anyone with Perl dbi knowledge/experience,
I am attempting to learn dbi using DBD::CSV but it is not behaving as I
expected. I have tried every example script I can find, read the perldoc's
for dbd::csv, Text::csv_xs, as well as the dbi faq and I am stumped.
When I use the 'fetch' method or any of its brethren, it either returns
nothing or is not running. I am using activestate perl v5.6.0 618 on
Win2000.
Following is a copy of my script as well as the csv table I am using, on the
off chance I have totally misinterpreted the specs for csv files.
---[ dbitest.pl ]----------------------------
use DBI;
use strict;
my($id, $name);
my $dbh = DBI->connect("DBI:CSV:") or die "Cannot connect: " . $DBI::errstr;
my $sth = $dbh->prepare( q{ SELECT * FROM info })
|| die "Can't prepare statement: $DBI::errstr";
$sth->execute || die "Can't execute statement: $DBI::errstr";
print "Query will return $sth->{NUM_OF_FIELDS} fields.\n\n";
print "Field names: @{ $sth->{NAME} }\n";
# This is where script fails/does nothing
while (($id, $name) = $sth->fetchrow_array) {
print "$id: $name\n";
}
# check for problems which may have terminated the fetch early
die $sth->errstr if $sth->err;
$sth->finish();
$dbh->disconnect;
---[ info ] -----------------------------------
id,name
1,George
2,Pam
3,Steven
4,Henry
---[ stdout] ----------------------------------
Query will return 2 fields.
Field names: id name
----------------------------------------------
Any hints or clues as to why this 'fetch' method (I have tried a variation
with '$sth->fetch' with the same results) is not returning anything?
Thanks
------------------------------
Date: Wed, 22 Nov 2000 19:37:22 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Perl and dbi
Message-Id: <3A1C90F2.53654791@vpservices.com>
"news@videotron.ca" wrote:
>
> Anyone with Perl dbi knowledge/experience,
>
> I am attempting to learn dbi using DBD::CSV but it is not behaving as I
> expected.
The script that you attatched works fine for me. Therefore my guess is
that you created your data test file with some text editor that fouled
up the line endings. Instead of using a text editor to create the file,
create it with SQL "CREATE" and "INSERT" commands, or, if you FTP'd the
file somewhere, use binary mode rather than text mode to FTP it. Or
else use DBD::RAM and the following script. DBD::RAM behaves exactly
like DBD::CSV except that it also handles other types of data formats
and it allows you to do the kind of practising you are doing either with
or without creating files. The script below uses the __END__ and <DATA>
features of Perl to simulate a file, thus avoiding the kind of line
endings problem you apparently ran into. That makes it very easy to
prototype and test things, because you can just do it all at once in the
script.
#!/usr/local/bin/perl -w
use DBI;
use strict;
my $dbh = DBI->connect('dbi:RAM:','','',{RaiseError=>1})
or die "Cannot connect: " . $DBI::errstr;
$dbh->func({col_names=>'first_line'},[<DATA>],'import');
my $sth = $dbh->prepare( q{ SELECT * FROM table1 });
$sth->execute;
print "Query will return $sth->{NUM_OF_FIELDS} fields.\n";
print "Field names: @{ $sth->{NAME} }\n";
while (my($id, $name) = $sth->fetchrow_array) {
print "$id: $name\n";
}
$dbh->disconnect;
__END__
id,name
1,George
2,Pam
3,Steven
4,Henry
As one would expect, this script prints out:
Query will return 2 fields.
Field names: id name
1: George
2: Pam
3: Steven
4: Henry
Hope that helps.
--
Jeff
------------------------------
Date: Thu, 23 Nov 2000 03:08:52 GMT
From: "web" <web@web.com>
Subject: PerlIS.dll headers in html extra INFO
Message-Id: <8T%S5.13811$kd.2861353@news3.rdc1.on.home.com>
I forgot to mention that I am executing this as a SSI <!--#exec
cgi="/intrawebs/cgi-bin/hello.pl" -->
my code is as such:
#!/usr/bin/perl -w
use strict;
use CGI qw(:standard);
print header;
print "hello world";
I am currently running windows 2000 and have installed ActiveState perl 5.6.
My IIS (pws) is configured to run perl.exe (.pl) and perlIS.dll (plx).
The problem I'm having is that when I run a simple hello world script using
the plx extension which uses the perlIS.dll my html file outputs the header
as well ex:
HTTP/1.1 200 OK Date: Thu, 23 Nov 2000 14:37:48 GMT Server:
Microsoft-IIS/5.0 Content-Type: text/html; charset=ISO-8859-1 hello world
When I use the pl extension which uses the Perl.exe I just get the hello
world.
I want to take advantage of using the PerlIS.dll but I don't want to see
that header, how do I turn it off?
I've looked at the online documentation that came with PERL 5.6 and it
mentions to turn off header by changing an entry in the registry
Excerpt: The Registry value that governs this is EnableCGIHeader, a
REG_DWORD value that is set to 1 by default. This value is stored under the
Registry key HKEY_LOCAL_MACHINE\SOFTWARE\ActiveState\PerlIS. If you need to
turn off the automatic generation of the header, set this value to 0.
Unfortunately I do not have this in my registry. Is it a Windows2000
problem?
Your help is grealy appreciated.
Thank you
Luc Martel
intrawebs@home.com
------------------------------
Date: Thu, 23 Nov 2000 03:16:13 GMT
From: wyzelli@yahoo.com (Wyzelli)
Subject: Re: rearranging a text file
Message-Id: <Xns8FF5893FFwyzelliyahoocom@203.39.3.131>
"Wyzelli" <wyzelli@yahoo.com> wrote in
<eq3S5.46$Is1.2692@vic.nntp.telstra.net>:
>"Steven Smolinski" <sjs@yorku.ca> wrote in message
>news:slrn91hk89.ii.sjs@ragnar.stevens.gulch...
>>
>> Do you really write code with no indents anywhere? Don't you find
>> it unnecessarily difficult to read? Don't get me wrong, I'm not a
>> python programmer :-) but the extra time it takes to indent is paid
>> for by the ease with which the code is read thereafter.
>>
>> Unindented == unmaintainable.
>>
>
>No I don't. But Microsoft OE5 which I use to post likes to make it's
>own assumptions about what constitutes spaces and so on, which
>invariably means that what I see before I post, and what I see when I
>read my own post are often two different things (sometimes including the
>actual code, as you will see from the post you comment on, where an
>entire equality test has ... well... gone away, along with a close
>bracket and open brace)
>
>For example the code I posted was fully indented, with each block set to
>a 4 space tab to line up with the opening statement of each block.
>
>But you make a good point.
>
>(Actually I use an IDE which handles most of the indenting for me so it
>doesn't even take any effort.)
>
>Wyzelli
>--
>($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass
>it around');
>for(reverse(1..100)){$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n$_$a$s$b\n$t\n";
>$_--;$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n\n";}print"$c*hic*";
>
>
>
>
Same Post as before without OE5 to see if the problem goes away.
#!/usr/bin/perl -w
use strict;
my (@array1, @array2);
my $first = 0;
while (<DATA>){
chomp;
if (/^\s*$/) {
$first = 1;
next;
}
if ($first == 0){
push @array1,$_;
}
else {
push @array2,$_;
}
}
my $i = 0;
for (@array1){
print "$array1[$i] $array2[$i]\n";
$i++;
}
Wyzelli
--
#beer v2
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass it
around');
for(reverse(1..100)){$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n$_$a$s$b\n$t\n";
$_--;$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n\n";}print"$c*hic*";
------------------------------
Date: 22 Nov 2000 20:02:55 -0200
From: Jorge Godoy <godoy@conectiva.com>
Subject: Re: running a script as root
Message-Id: <kpg0kju0kw.fsf@dagon.conectiva>
On Wed, 22 Nov 2000, news@#nospam#althepal.com wrote:
> Is it possible to allow anyone to run a particular script as root?
> Specifically, say I want to allow visitors to my website to create
> an account for themselves. If I have a perl script which can create
> an account, can I allow them to run this script as root without
> allowing them any other privleges?
perldoc perlsec
Regards,
--
Godoy. <godoy@conectiva.com>
Departamento de Publicações Conectiva S.A.
Publishing Department Conectiva Inc.
------------------------------
Date: Wed, 22 Nov 2000 22:59:43 GMT
From: fallenang3l@my-deja.com
Subject: Signals
Message-Id: <8vhj4u$coo$1@nnrp1.deja.com>
What is HUP signal for? Thank you.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 23 Nov 2000 00:35:31 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Signals
Message-Id: <t1opijkkr6n85b@corp.supernews.com>
fallenang3l@my-deja.com wrote:
> What is HUP signal for? Thank you.
HUP stands for HangUP, which was originally intended to be
sent when a terminal stopped using a program. This would
give the program a chance to realize it needed to refresh
its configuration and such for the next time something
connected to it.
More recent uses of HUP generally use it to cause a daemon
process to reread configuration info. This is a bit different,
because many of these daemons have no sense of terminals (or
more accurately, of TTYs). Often they are dealing with sockets
as their main I/O method.
The default behavior upon receiving HUP is to die.
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Thu, 23 Nov 2000 00:54:59 +0100
From: Holger <hbhb@gmx.de>
Subject: Re: Sort strings before numbers
Message-Id: <otjo1tsju92igfrfmegsuk40c9vbsinrpt@4ax.com>
On Tue, 21 Nov 2000 18:39:11 -0500, tadmc@metronet.com (Tad McClellan)
wrote:
>>Is there a difference between an (anonymous)
>>list and array (in perl, in C at least I know that there is)?
>
>Whoa!
>
>Let's start over.
>
>Perl FAQ, part 4:
>
I guess I have to apologize to have bugged you. It is just the problem that
I have only recently started with perl (rather obvious) and read a lot of
the docs, but not all. I thought arrays have something to do with data
structures and didn't find anything in <perldata>. Didn't get the idea of
looking in a tutorial for references.
>I guess you were looking at the "List value constructors" section?
Right, I did.
>
>Note that it does not say what you just paraphrased above.
>It says parens are only required where precedence requires them.
As mentioned above I am willing, but haven't read all yet. This section I
read rather carefully, but still missed the first sentences.
>That's the name for the map/sort/map code snippet. It is in the
>Perl FAQs about sorting. Surely you have already seen the Perl
>FAQs about sorting, haven't you?
Got me, sorry. Now I did.
Thanks and regards,
Holger
------------------------------
Date: Thu, 23 Nov 2000 00:55:02 +0100
From: Holger <hbhb@gmx.de>
Subject: Re: Sort strings before numbers
Message-Id: <6emo1t00rgmlhi98m21is5slcu7thdlcge@4ax.com>
On Wed, 22 Nov 2000 01:31:34 GMT, Darren Dunham <ddunham@redwood.taos.com>
wrote:
>> Yes, I meant the square ones. Is there a difference between an (anonymous)
>> list and array (in perl, in C at least I know that there is)? In <perldata>
>> I only found parentheses, that form a list.
>
>Arrays can contain lists. Subroutines can return a list. A list is
>not a variable. An array is a variable. There is no such thing as an
>anonymous list.
>
>An anonymous array doesn't (usually) have a name..
>
>@a = (1,2,3);
>
>"@a" is a name for an array that contains 1,2, and 3. The "(1,2,3)"
>will return a list of values (in list context).
I got confused because, as I now know, arrays can be initialised with
lists. I just mixed the facts somehow together.
>$ref = \@a;
>
>A "reference" to @a has been taken and stored in $ref. We can now use
>the ref to get to the elements of @a.
>
>$ref->[1]
This about references I knew already because I am "coming" from C.
Nevertheless, thanks for helping.
Holger
------------------------------
Date: 23 Nov 2000 00:48:49 GMT
From: gorilla@elaine.furryape.com (Alan Barclay)
Subject: Re: Using exists with hashes
Message-Id: <974940497.468339@elaine.furryape.com>
In article <8vgc27$nvl$1@bignews.shef.ac.uk>,
Paul Clough <cloughie@dcs.shef.ac.uk> wrote:
>Can anyone tell me how I can use the exists hash function but with a fuzzy
>match? Rather than matching the expr exactly, I would like to be able to
>match with a given degree of similarity? Is it possible to change the exists
>function to do this?
You can't.
An approximation would be something like
foreach(keys %hash){
if(/match/){
# do something
}
}
This will be inefficent on large hashes though.
------------------------------
Date: Thu, 23 Nov 2000 01:45:44 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Using exists with hashes
Message-Id: <3A1C7A0D.F80D6E6F@home.com>
[posted & mailed]
Paul Clough wrote:
>
> Can anyone tell me how I can use the exists hash function but with a fuzzy
> match?
Create a class with a suitable EXISTS method that you can tie your hash
to. This should be pretty easy if you use String::Approx from CPAN.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Thu, 23 Nov 2000 09:30:03 +0800
From: "Roland Tek" <rtek84@email.com>
Subject: Wrtiing on a Win32 system
Message-Id: <3a1c73bc.0@news.tm.net.my>
Lately, I have downloaded the Active Perl for Win32 system. After installing
it, I have no idea where I should start. I read the readme, they taught me
how to make the "hello world", I just don't know where I should write that.
There is no console or anything for me to type on Windows 98. Can anyone
show me how?
------------------------------
Date: Wed, 22 Nov 2000 20:52:19 -0500
From: H C <carvdawg@patriot.net>
Subject: Re: Wrtiing on a Win32 system
Message-Id: <3A1C7852.2F00DF4D@patriot.net>
Roland Tek wrote:
> Lately, I have downloaded the Active Perl for Win32 system. After installing
> it, I have no idea where I should start. I read the readme, they taught me
> how to make the "hello world", I just don't know where I should write that.
> There is no console or anything for me to type on Windows 98.
Sure there is...it's called the MS-DOS command prompt...click "Start", then
"Programs", and
find the listing that says "command prompt".
As far as writing programs...you can do this in Notepad...
------------------------------
Date: Thu, 23 Nov 2000 01:45:07 GMT
From: "res06xbi" <res06xbi@gte.net>
Subject: Re: Wrtiing on a Win32 system
Message-Id: <DE_S5.828$jt4.319211@dfiatx1-snr1.gtei.net>
Roland -- You have to open a window in dos. After you write your program
(your "Hello, World" for example) you will then type (on the command line)
perl program_name.pl.
HTH
Harold Jackson
"Roland Tek" <rtek84@email.com> wrote in message
news:3a1c73bc.0@news.tm.net.my...
> Lately, I have downloaded the Active Perl for Win32 system. After
installing
> it, I have no idea where I should start. I read the readme, they taught me
> how to make the "hello world", I just don't know where I should write
that.
> There is no console or anything for me to type on Windows 98. Can anyone
> show me how?
>
>
>
------------------------------
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 4954
**************************************