[13693] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1103 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 17 21:05:30 1999

Date: Sun, 17 Oct 1999 18:05:06 -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: <940208706-v9-i1103@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 17 Oct 1999     Volume: 9 Number: 1103

Today's topics:
    Re: *MY* answer... emlyn_a@my-deja.com
        animated gif won't blink mr_potato_head@my-deja.com
    Re: animated gif won't blink phil-news-nospam@ipal.net
    Re: CGI.pm background graphics <gellyfish@gellyfish.com>
    Re: CGI.pm background graphics (Larry Rosler)
    Re: email RegExp problem (Bart Lateur)
    Re: email RegExp problem (Larry Rosler)
    Re: hashes (Larry Rosler)
    Re: Help - Can't figure this out (Abigail)
        Ignore the idiots emlyn_a@my-deja.com
    Re: Problem adding module for SCO Unixware 2.13 <vin@one.net.au>
        Q: Sorting anonymous array <tony@unheardmusic.com>
    Re: Q: Sorting anonymous array (Abigail)
    Re: Q: Sorting anonymous array (Larry Rosler)
        qmail trigger code ported to Perl (Dave Bailey)
    Re: Range checking (Larry Rosler)
    Re: THANKS FOR ALL THE HELP (Larry Rosler)
    Re: Uses of # (Larry Rosler)
    Re: Uses of # (Abigail)
        why don't this darm s..... work <dane@forum.dk>
    Re: why don't this darm s..... work <marcel.grunauer@lovely.net>
    Re: why don't this darm s..... work <rootbeer@redcat.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 18 Oct 1999 00:25:35 GMT
From: emlyn_a@my-deja.com
Subject: Re: *MY* answer...
Message-Id: <7udpdp$jsc$1@nnrp1.deja.com>


> From memory, %0D == carriage return and %0A = line feed.  Some systems
use
> a carriage return only (MacOS) and some use a combination of carriage
> return *and* line feed (WinDOS).  Thus by replacing the %0D you
actually
> catch data from both platforms (because the character is common to
both
> platforms).  The MacOS never generates %0A characters, so attempting
to
> catch a %0D%0A combo means you never get a match on input generated on
a
> Mac.
>
> Unless I've mistaken this for another thread, weren't you trying to
find a
> way to turn the contents of a text field (submitted by way of a form)
into
> a single clean line of text that you could store in a database?  If
so,
> have you encountered any other problems apart from the line wrapping
> issue?
>
> Thanks for posting your solution, by the way.
>
I thought doing a search on both %0A and %0D was going to be a
cross-platform problem, but since %0A isn't found when run on a Mac, it
works out that only %0D data gets substituted with a <br>. On both
platforms I've got good spacing, and writing the data to a file as a
field looks something like this: Previous field|I like Perl.<br><br>Do
you?|Next field

I've encountered no other problems, although limiting the field length
to 400 characters is something I'm working


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


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

Date: Sun, 17 Oct 1999 21:09:04 GMT
From: mr_potato_head@my-deja.com
Subject: animated gif won't blink
Message-Id: <7uddtc$cou$1@nnrp1.deja.com>

Hi,
   I have apache 1.3.4 installed on my ultra1 running solaris 2.6 and I
can't get the animated gif to blink.  If I copy the gif directly to my
'98 machine and open it in my browser it blinks.  When I have my perl
cgi reference the gif "  print "<td align=center><img
src=\"http://my.machine.com/icons/green_ball.gif\"></td>\n";  " the icon
frame shows up in the browser and flashes once the color its suppose to
be and then stops animating.  Is it a permission problem?  Did I call
the image wrong in my script?  Thanks for the help...



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


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

Date: Sun, 17 Oct 1999 22:47:14 GMT
From: phil-news-nospam@ipal.net
Subject: Re: animated gif won't blink
Message-Id: <SlsO3.2889$Gj1.23489@newsfeed.slurp.net>

In comp.infosystems.www.servers.unix mr_potato_head@my-deja.com wrote:

| Hi,
|    I have apache 1.3.4 installed on my ultra1 running solaris 2.6 and I
| can't get the animated gif to blink.  If I copy the gif directly to my
| '98 machine and open it in my browser it blinks.  When I have my perl
| cgi reference the gif "  print "<td align=center><img
| src=\"http://my.machine.com/icons/green_ball.gif\"></td>\n";  " the icon
| frame shows up in the browser and flashes once the color its suppose to
| be and then stops animating.  Is it a permission problem?  Did I call
| the image wrong in my script?  Thanks for the help...

The most common problem is the GIF file gets truncated.  If the browser
never receives the last control block in the GIF stream, then the image
thread in the browser will abort and the image won't have a thread to
repeat its animation.

Access the GIF in the way it is failing, and save it to disk.   Then
compare the lengths.  If the lengths are the same, compare the contents.

If it looks OK, give me the real URL so I can diagnose further (do not
send me any attachments).

-- 
Phil Howard | no9way67@no6where.org a3b5c2d2@spam9mer.com ads7suck@s0p1a6m4.net
  phil      | no69ads5@dumbads0.edu crash943@no82ads0.org no8way70@noplace8.net
      at    | stop3it3@no92ads5.net stop2823@nowhere9.com stop4it9@nowhere4.org
  ipal      | no0spam8@spam1mer.net stop5it0@anyplace.net eat73me8@anyplace.net
     dot    | stop9it9@dumbads6.net die0spam@no8where.net a5b1c9d3@anyplace.org
  net       | suck6it1@s0p0a2m0.org blow1me0@noplace0.com no92ads3@dumb9ads.com


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

Date: 17 Oct 1999 20:58:59 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: CGI.pm background graphics
Message-Id: <7uddaj$5s8$1@gellyfish.btinternet.com>

On Sun, 17 Oct 1999 19:54:35 GMT AcCeSsDeNiEd wrote:
> 
> Pls go ahead and mark my mistakes like Jeff Zucker did but you do not
> need to be crude in your language!
> 

I really dont understand what you are on about here - I dont believe
anyone in this thread has addressed you with any crude language.

> 
> On Wed, 13 Oct 1999 07:12:30 -0700, lr@hpl.hp.com (Larry Rosler)
> wrote:
> 
>>In article <380445b8.8549415@news.magix.com.sg> on Wed, 13 Oct 1999 
>>09:57:06 GMT, AcCeSsDeNiEd <dillon_rm@magix.com.sg> says...
>>> 
>>> Hash: SHA1
>>
>>Why do you trouble us with that noise?  Would someone go to the
> trouble 
>>of forging your name to these errors?
> 
> Errors or not I was once impersonated and once was enough! PGP is a
> good practice in NGs. It avoids unnecessary conflicts and problems.
> You already have a conflict with me. It is possible for you to decide
> to impersonate me. So stop bothering me with this. If you really have
> nothing else better to do, pls go screw the posters who have long
> signatures in their posts. Not PGP users like me.
> 

I think that the point is no-one is going to be any the wiser if the post
was forged or not as they are unlikely to be using a PGP enabled newsreader
and if they are then they are equally unlikely to have obtained your
public key for the purpose of ascertaining the veracity of the post.

Furthermore I would suggest that saying that Larry is in 'conflict' with
you and might be bothered therefore to forge a posting by you smacks of
paranoia and is unlikely to help you win friends and influence people
in these parts.

Anyhow to the code:

>>
>>...
>>
>>> Change:
>>> print "BACKGROUND=\"bakc.gif\""; 
>>> 
>>> To: 
>>> print "BACKGROUND=\bakc.gif\"; 
>>                    ^        ^
>>A backspace and a syntax error.  Kill the backslashes also.
> 
> What backspace? Pls elaborate or is it just your newsreader seeing
> something else?

Please look at the perlop manpage to learn about the significance of
various backslashed characters in a double quoted strings.

Yes everyone does make mistakes but if we were just to let them slip
then there is a grave danger that someone might be misled by that
false information.  

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 17 Oct 1999 17:15:14 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: CGI.pm background graphics
Message-Id: <MPG.127406681538df6498a0af@nntp.hpl.hp.com>

In article <380a16d2.6266576@news.magix.com.sg> on Sun, 17 Oct 1999 
19:54:35 GMT, AcCeSsDeNiEd <dillon_rm@magix.com.sg> says...
> 
> Hash: SHA1

It is still noise, and out of place in this environment.

 ...

> Pls go ahead and mark my mistakes like Jeff Zucker did but you do not
> need to be crude in your language!

Jonathan Stowe has dealt with the rest of this.

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


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

Date: Sun, 17 Oct 1999 20:54:50 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: email RegExp problem
Message-Id: <380e3776.3363991@news.skynet.be>

Abigail wrote:

>`` Johnny Boy! <John.Smith@dcs.warwick.ac.uk>, or indeed
>`` j.c.smith@dcs.war . . . 
>
>The problem is unclear.  'Johnny Boy! <John.Smith@dcs.warwick.ac.uk>'
>*is* a valid address:
>
>     $ perl -MRFC::RFC822::Address -wle 'print "Valid" if 
>               RFC::RFC822::Address::valid
>               (q {Johnny Boy! <John.Smith@dcs.warwick.ac.uk>})'
>     Valid

Ok. Likely he just ment "canonical e-mail address" instead (probably not
the official name...) AKA a "mailbox" as per RFC-821 (SMTP). That
constitutes only of:

	<local-part> "@" <domain>

and with all comments removed.

-- 
	Bart.


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

Date: Sun, 17 Oct 1999 11:18:50 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: email RegExp problem
Message-Id: <MPG.1273b2df637f2a4598a0aa@nntp.hpl.hp.com>

In article <EomO3.11985$E_1.665347@typ11.nn.bcandid.com> on Sun, 17 Oct 
1999 16:00:36 GMT, Kragen Sitaker <kragen@dnaco.net> says...
> In article <Pine.GSO.4.10.9910171631170.29805-100000@mimosa.csv.warwick.ac.uk>,
> MTW  <suaai@csv.warwick.ac.uk> wrote:
> >I know - but I'm doing some code to be used internally at this university.
> >I already _know_ that the email addresses that I'll be finding will end
> >".warwick.ac.uk", but I need to extract John.Smith@dcs from 
> >John.Smith@dcs.warwick.ac.uk, where the whole From: line that I'm
> >processing will be
> >
> >Johnny Boy! <John.Smith@dcs.warwick.ac.uk>, or indeed
> >j.c.smith@dcs.war . . . 
> >
> >In other words, I know how to extract the first \w after the @ sign, but
> >how do I extract all the x.y.z.abc@ . .  stuff before the @?
> 
> How about /([\w.]+)\@(\w+)\.warwick\.ac\.uk/ for starters?

Perhaps more generally:

            /<(.+)\@([^.]+)/

\w rules out '-' which is permissible in email addresses.
       
-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Sun, 17 Oct 1999 11:42:26 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: hashes
Message-Id: <MPG.1273b86b4fc25d1198a0ac@nntp.hpl.hp.com>

In article <3r1cu7.2b8.ln@magna.metronet.com> on Sun, 17 Oct 1999 
04:36:51 -0400, Tad McClellan <tadmc@metronet.com> says...

 ...

>    If you want to keep the first login time, then check for it
>    when you add new values:
> 
>       $logins{$name} = $login_time unless exists $logins{$name};

Or, more compactly (assuming all values in the hash are 'true', which is 
surely the case here):

        $logins{$name} ||= $login_time;

This is the Orcish ('or-cache') Maneuver used in some sorting methods.

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


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

Date: 17 Oct 1999 18:31:02 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Help - Can't figure this out
Message-Id: <slrn80kn0u.q8s.abigail@alexandra.delanet.com>

AcCeSsDeNiEd (dillon_rm@magix.com.sg) wrote on MMCCXXXVIII September
MCMXCIII in <URL:news:380a2aca.11379580@news.magix.com.sg>:
;; Hi folks. Firstly, sorry for the intrusion. I know this is not the
;; right place to post my question, but I have not been able to get into
;; comp.infosystems.www.authoring.cgi for the past 2 days. Yes, I do know
;; about their new regulation with first time posters and their "approve"
;; stuff. But I still don't see my post.

Why should this group suffer because you have problems posting in
comp.infosystems.www.authoring.cgi? Why not post in alt.bork.bork?
Or in sci.math?

;; And for this, we want to make use of the same alphabet table A-Z. 
;; I'm not allowed to create a second alphabet table A-Z which will
;; obviously solve the problem. 

If you are make arbitrary restrictions for yourself, and are seeking an
algorithm to solve this - try rec.puzzles. This has absolutely nothing
to do with any programming language; and specially not Perl.

;; I have therefore added two Radio buttons named "Find Company Names by
;; using an Alphabet" & Find Category Names by using an Alphabet"
;; 
;; I am now stuck here, I don't have idea how to combine the two into one
;; (Radio and alphabet table A-Z) and sent the info to my cgi script to
;; be processed. The info that my script must get from the html form are
;; the radio button selection and the alphabet selected.

It looks you are on the wrong track. Backtrack, and try again.



Abigail
-- 
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
         % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
         BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 18 Oct 1999 00:44:10 GMT
From: emlyn_a@my-deja.com
Subject: Ignore the idiots
Message-Id: <7udqgp$kh1$1@nnrp1.deja.com>

Ignore Abigail - People like him make this place a whole lot more
intimidating to use (which is their intent, I think). I mean what hell
is this forum for if you can't ask a simple Perl question like you did?

Someone should boot his ass.

Don't know the answer (I'm still learning myself), but have fun.



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


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

Date: Mon, 18 Oct 1999 09:48:59 +1000
From: "Vin" <vin@one.net.au>
Subject: Re: Problem adding module for SCO Unixware 2.13
Message-Id: <380a5fa6@pink.one.net.au>

Thanks for your reply Jonathan...

I'm still getting the same problem after h2ph..etc...
make test gives a connect: socket operation on non-socket (SOCK_DGRAM after
trying SOCK_STREAM) at blib/lib/Net/Daemon/Log.pm line 84

I've tried through FAQ's and docco included with this modual. I've even
installed it successfully on a Linux box...the only variable is this is
running on SCO Unixware 2.x.

Any ideas?


{ivrdevl01}/home/vchoy/daemon/Net-Daemon-0.28 # make test
        PERL_DL_NONLAZY=1
/bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl5/5.00503/i386-svr4 -I
/usr/local/lib/perl5/5.00503 -e 'use Test::Harness qw(&runtests $verbose);
$verbose=0; runtests @ARGV;' t/*.t
t/base..............ok
=> *VC***   What's wrong here????     t/config............connect: Socket
operation on non-socket (SOCK_DGRAM after trying SOCK_STREAM) at
blib/lib/Net/Daemon/Log.pm line 84
Server process didn't create a file 'ndtest.prt'. at
blib/lib/Net/Daemon/Test.pm line 317.
dubious
        Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 1-5
        Failed 5/5 tests, 0.00% okay
t/fork..............connect: Socket operation on non-socket (SOCK_DGRAM
after trying SOCK_STREAM) at blib/lib/Net/Daemon/Log.pm line 84
Jonathan Stowe <gellyfish@gellyfish.com> wrote in message
news:7uc246$3ni$1@gellyfish.btinternet.com...
> On Fri, 15 Oct 1999 18:21:42 +1000 Vin wrote:
> > Hi, I'm trying to install the NET::Daemon module on Perl 5.00503
> > I'm logged in as root
> >
> > and when I do the 'make test'
> > I get the following:
> > t/config............Cannot open Syslog: Can't locate syslog.ph in @INC
(did
> > you run h2ph?) (@INC contains: blib/arch blib/lib blib/lib blib/arch
> >
>
> Well did you run h2ph ?
>
>
> H2PH(1)          Perl Programmers Reference Guide         H2PH(1)
>
>
> NAME
>        h2ph - convert .h C header files to .ph Perl header files
>
> SYNOPSIS
>        h2ph [-d destination directory] [-r | -a] [-l]
>        [headerfiles]
>
> DESCRIPTION
>        h2ph converts any C header files specified to the
>        corresponding Perl header file format.  It is most easily
>        run while in /usr/include:
>
>                cd /usr/include; h2ph * sys/*
>
> /J\
> --
> Jonathan Stowe <jns@gellyfish.com>
> <http://www.gellyfish.com>
> Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>




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

Date: Sun, 17 Oct 1999 14:11:47 -0700
From: "Tony B." <tony@unheardmusic.com>
Subject: Q: Sorting anonymous array
Message-Id: <7ude14$eod$1@fu-berlin.de>

I'm having trouble sorting a hash with an anonymous array. The following
hash is sorted by "ID" field:

%hash = (ID => 2, 5, 18, 27, 40],
         Type => E, D, A, C, B],
         Update => yes, yes, no, yes, no],
         Name => Joe, Mary, Bob, Jane, Tim]);

But I want to sort by the "Type" field and have the other fields and array
items follow suit:

%hash = (ID => 18, 40, 27, 5, 2],
         Type => A, B, C, D, E],
         Update => no, no, yes, yes, yes],
         Name => Bob, Tim, Jane, Mary, Joe]);

I've tried sorting it: @array = sort $mysort @{hash{$field}}
but that only sorts one array and the others remain the same. I also tried
@{hash{$field}} = sort $mysort @{hash{$field}}, which doesn't work at all.
Any ideas on how to sort the hash into records based on a specific field
would be appreciated.

Thanks in advance




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

Date: 17 Oct 1999 19:21:55 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Q: Sorting anonymous array
Message-Id: <slrn80kq0d.q8s.abigail@alexandra.delanet.com>

Tony B. (tony@unheardmusic.com) wrote on MMCCXXXVIII September MCMXCIII
in <URL:news:7ude14$eod$1@fu-berlin.de>:
|| I'm having trouble sorting a hash with an anonymous array. The following
|| hash is sorted by "ID" field:
|| 
|| %hash = (ID => 2, 5, 18, 27, 40],
||          Type => E, D, A, C, B],
||          Update => yes, yes, no, yes, no],
||          Name => Joe, Mary, Bob, Jane, Tim]);

You're missing some ['s. And you miss lots of quotes.

|| But I want to sort by the "Type" field and have the other fields and array
|| items follow suit:
|| 
|| %hash = (ID => 18, 40, 27, 5, 2],
||          Type => A, B, C, D, E],
||          Update => no, no, yes, yes, yes],
||          Name => Bob, Tim, Jane, Mary, Joe]);
|| 
|| I've tried sorting it: @array = sort $mysort @{hash{$field}}
|| but that only sorts one array and the others remain the same. I also tried
|| @{hash{$field}} = sort $mysort @{hash{$field}}, which doesn't work at all.
|| Any ideas on how to sort the hash into records based on a specific field
|| would be appreciated.


Sorting is just applying a permutation. Sort the array, find the
permutation, apply to the rest. We have to take care of the fact
that it isn't given that Type contains unique values.

    my ($i, %O)      = (0);
    map {push @{$O {$_}} => $i ++} @{$hash {Type}}; # Don't bother commenting.
    $hash {Type}     = [sort @{$hash {Type}}];
    foreach my $key (keys %hash) {
        next if $key eq 'Type';
        my %o        =  map {$_ => [@{$O {$_}}]} keys %O;
        $hash {$key} = [map {$hash {$key} [pop @{$o {$_}}]} @{$hash {Type}}];
    }  


This is of course more an algorithmic issue than a language issue;
you wouldn't have known how to do it in C or Python either, would you?


Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Sun, 17 Oct 1999 17:56:04 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Q: Sorting anonymous array
Message-Id: <MPG.127410007a5cf70598a0b0@nntp.hpl.hp.com>

In article <7ude14$eod$1@fu-berlin.de> on Sun, 17 Oct 1999 14:11:47 -
0700, Tony B. <tony@unheardmusic.com> says...
> I'm having trouble sorting a hash with an anonymous array. The following
> hash is sorted by "ID" field:
> 
> %hash = (ID => 2, 5, 18, 27, 40],
>          Type => E, D, A, C, B],
>          Update => yes, yes, no, yes, no],
>          Name => Joe, Mary, Bob, Jane, Tim]);

The syntax is wrong (no left brackets), and it is full of barewords; 
correctd below.

> But I want to sort by the "Type" field and have the other fields and array
> items follow suit:
> 
> %hash = (ID => 18, 40, 27, 5, 2],
>          Type => A, B, C, D, E],
>          Update => no, no, yes, yes, yes],
>          Name => Bob, Tim, Jane, Mary, Joe]);
> 
> I've tried sorting it: @array = sort $mysort @{hash{$field}}
> but that only sorts one array and the others remain the same. I also tried
> @{hash{$field}} = sort $mysort @{hash{$field}}, which doesn't work at all.
> Any ideas on how to sort the hash into records based on a specific field
> would be appreciated.

You need to sort the indexes of the 'Type' array, then use them to sort 
all the arrays.


#!/usr/local/bin/perl -w
use strict;

my %hash = (ID     => [2, 5, 18, 27, 40],
            Type   => [qw(E D A C B)],
            Update => [qw(yes yes no yes no)],
            Name   => [qw(Joe Mary Bob Jane Tim)]);

my @indexes =
  sort { $hash{Type}[$a] cmp $hash{Type}[$b] } 0 .. $#{$hash{Type}};

@{$hash{$_}} = @{$hash{$_}}[@indexes] for keys %hash;

print "$_\t=> [@{$hash{$_}}]\n" for sort keys %hash;
__END__

Output:

ID      => [18 40 27 5 2]
Name    => [Bob Tim Jane Mary Joe]
Type    => [A B C D E]
Update  => [no no yes yes yes]

> Thanks in advance

You're welcome.  A simple but instructive exercise.  Homework???

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


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

Date: Sun, 17 Oct 1999 22:23:02 GMT
From: dave@ribbit.vfrogs.com (Dave Bailey)
Subject: qmail trigger code ported to Perl
Message-Id: <slrn80kj28.2bf.dave@ribbit.vfrogs.com>

I've been looking at qmail and I noticed there is a 
mechanism for "triggering" a named pipe such that if
you are listening on the other end of the pipe, you
know to wake up and "do something".  In qmail, this
is implemented as part of the mail delivery system;
whenever a mail message is queued, the "trigger" is
pulled, and this signals qmail that it's time to wake
up and do some work.  For one of my projects, I needed
almost exactly the same functionality, only in Perl,
and I needed to make it as simple as possible (i.e.
a module) such that my codevelopers can use it without
much effort.  Plus, it seemed like a nice way to learn
how to make a Perl module.  Anyway, I've finished the
prelim version and if anybody is interested, drop me
a line.  Also, if anyone is aware of another module 
which does this, please let me know.  Thanks.

-- 
Dave Bailey
dave@vfrogs.com


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

Date: Sun, 17 Oct 1999 11:49:19 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Range checking
Message-Id: <MPG.1273ba093f436e2698a0ad@nntp.hpl.hp.com>

In article <spamfree-1810990146170001@d7.metropolis.net.au> on Mon, 18 
Oct 1999 01:46:17 +0930, Henry Penninkilampi 
<spamfree@metropolis.net.au> says...
> I'm currently testing for:
> 
>   $min < $x <= $max
> 
> ....in the predictable manner:
> 
> if (($min < $x) and ($x <= $max))
> 
> I was just wondering if anyone knows of a more succinct approach?

  if ($min < $x && $x <= $max)

Short of the seven superfluous spaces, no one will beat par on this 
hole.

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


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

Date: Sun, 17 Oct 1999 11:57:01 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: THANKS FOR ALL THE HELP
Message-Id: <MPG.1273bbd3311b09d598a0ae@nntp.hpl.hp.com>

In article <7ucv5o$3rd$1@nnrp1.deja.com> on Sun, 17 Oct 1999 16:57:31 
GMT, kstephan <kstephan@my-deja.com> says...
> Reading through the threads, I noticed the line
> 
> $thisyear = $year + 1900;
> 
> What happens on 1 January 2000???
> 
> Sorry if this is a dumb question!!

It is indeed dumb, because the answer was at your fingertips.
 
> Thanks, In advance for a "heads up".
> 
> Ken S
> Escondido, CA
> 
> ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
> $thisyear = $year + 1900;
> $mon++;

Some kind soul has answered your question already.  But don't you think 
it was dumb to post the question before reading the description of the 
localtime() function?

<SNIP> of fully quoted Jeopardized question.  What can one expect? 

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


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

Date: Sun, 17 Oct 1999 11:23:18 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Uses of #
Message-Id: <MPG.1273b3f39e61272598a0ab@nntp.hpl.hp.com>

In article <slrn80j42e.q8s.abigail@alexandra.delanet.com> on 17 Oct 1999 
04:01:21 -0500, Abigail <abigail@delanet.com> says...

 ...

>       s#foo#bar;

!!!

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


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

Date: 17 Oct 1999 19:41:16 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Uses of #
Message-Id: <slrn80kr4n.q8s.abigail@alexandra.delanet.com>

Alex Rhomberg (rhomberg@ife.ee.ethz.ch) wrote on MMCCXXXVIII September
MCMXCIII in <URL:news:380A10B3.6E14467@ife.ee.ethz.ch>:
-- Kragen Sitaker wrote:
--
-- > You want to parse Perl.  Only perl can parse Perl, my friend.
--
-- So Perl must have been there from the beginning.

No. "Perl" ne "perl".


HTH. HAND.



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Sun, 17 Oct 1999 23:11:38 +0100
From: "dane" <dane@forum.dk>
Subject: why don't this darm s..... work
Message-Id: <SYqO3.775$C_4.833@news.get2net.dk>

I have been trying to make this script work for quite some time now.
I have added this line to my html file:
<!--#exec cgi="/cgi-bin/get.cgi" -->
and the get.cgi file looks like this:

#!/usr/local/bin/perl
print <<end;
Content-Type: text/html
end

#search for dk in Host Addr. string
if($ENV{'REMOTE_HOST'} =~ /dk/)
   {  print <<end;
  <p>ok from Denmark</p>
  end  }
else
  {  print <<end;
  <p>not from dk</p>
  end  }

The cgi doesn't even give me an output.
And all I get from the server is:
"Premature end of script headers"
Hope I could get a more clear statement from You :)
Thx
dane







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

Date: Sun, 17 Oct 1999 21:40:47 GMT
From: Marcel Grunauer <marcel.grunauer@lovely.net>
Subject: Re: why don't this darm s..... work
Message-Id: <M04KODHeg5KyMoVSSJP3FvTUtlnz@4ax.com>

On Sun, 17 Oct 1999 23:11:38 +0100, "dane" <dane@forum.dk> wrote:

> #!/usr/local/bin/perl
> print <<end;
> Content-Type: text/html
> end

Here-document names should be all caps by convention. And there should
be two newlines after the Content-Type line.

> 
> #search for dk in Host Addr. string
> if($ENV{'REMOTE_HOST'} =~ /dk/)
>    {  print <<end;
>   <p>ok from Denmark</p>
>   end  }

That doesn't even compile. Did you type it in? You should use
copy-and-paste. The here-document name must be in the first column
otherwise it won't be recognized as the end of the here-document.

But it's really not necessary to use here-documents for such a simple
print statement. HTML doesn't care about newlines anyway. Just use

	print "<p>ok from Denmark</p>";

And although you specify text/html as the content type above, you
output plain text. Why?

And that regex test is flaky as well. Even if that was the correct way
to test for a danish hostname, you could use index(). But what do you
do with

	vodka.gov.ru
          ^^
??? You could try

	/\.dk$/


But why go to all that trouble of printing potentially wrong headers?
Just use CGI.pm:

	use CGI qw/:standard/;

	print header, start_html, "whatever", end_html;


-- 
Marcel, Perl Padawan
sub AUTOLOAD{$_=$AUTOLOAD;s;.*::;;;y;_; ;;print}&Just_Another_Perl_Hacker;


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

Date: Sun, 17 Oct 1999 17:21:22 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: why don't this darm s..... work
Message-Id: <Pine.GSO.4.10.9910171720580.19476-100000@user2.teleport.com>

On Sun, 17 Oct 1999, dane wrote:

> "Premature end of script headers"

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.

   http://www.perl.com/CPAN/
   http://www.cpan.org/
   http://www.cpan.org/doc/FAQs/cgi/idiots-guide.html
   http://www.cpan.org/doc/manual/html/pod/

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

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


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