[12802] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 212 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 21 11:07:16 1999

Date: Wed, 21 Jul 1999 08:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 21 Jul 1999     Volume: 9 Number: 212

Today's topics:
        CGI:calling subroutine from a form <mlopresti@bigfoot.com>
        email handling <jgc5a@j2.mail.virginia.edu>
    Re: email handling <gellyfish@gellyfish.com>
        exec || system || ` ` ???Help <bob.freedman@eis.noaa.gov>
    Re: fetch url with standard modules? (John Borwick)
    Re: Hashes (Abigail)
    Re: Hashes (Abigail)
    Re: Hashes (Abigail)
    Re: Hashes (Larry Rosler)
        HELP: Faster alternative of substr()? hassanov@my-deja.com
    Re: How do I do a date string (ala from strftime) conve (Gabriel Russell)
    Re: How to give Passwords on STDIN <tchrist@mox.perl.com>
    Re: How to give Passwords on STDIN <swiftkid@bigfoot.com>
    Re: How to give Passwords on STDIN <tchrist@mox.perl.com>
    Re: lexical $_ with threads question? <dehon_olivier@jpmorgan.com>
    Re: Perl binary IO question (Abigail)
    Re: Perl Programmer Wanted Urgently (Abigail)
    Re: Perl Programmer Wanted Urgently <toby@venice.cas.utk.edu>
    Re: Q: getting the decimal portion of a floating point  (Abigail)
    Re: reading from a file and THEN! (Abigail)
    Re: Regular expression question (Problems with parsing  (Abigail)
    Re: Script for e-mailing invoices, database ? (Abigail)
    Re: Subroutines in a deperate file (Abigail)
    Re: Sybperl stored procedure output <mpeppler@peppler.org>
    Re: Sybperl stored procedure output (Abigail)
        Testing for the existing of a key in a hash <pagib@aur.alcatel.com>
    Re: Testing for the existing of a key in a hash <marshalc@americasm01.nt.com>
    Re: Tiny error in perlfaq5 <doughera@lafayette.edu>
    Re: Tiny error in perlfaq5 <doughera@lafayette.edu>
        Web page generator rook268@my-deja.com
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Wed, 21 Jul 1999 10:28:09 -0400
From: matt <mlopresti@bigfoot.com>
Subject: CGI:calling subroutine from a form
Message-Id: <3795D8F9.C7351B08@bigfoot.com>

Is there a way to call a subroutine from a form, like:
<form action= &delete_record>
Is this possible?

Thanks in advance,
-Matt




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

Date: Wed, 21 Jul 1999 10:30:50 -0400
From: James Gerard Coleman <jgc5a@j2.mail.virginia.edu>
Subject: email handling
Message-Id: <Pine.A41.4.05.9907211028320.66414-100000@node8.unix.Virginia.EDU>

does anyone know of a module that will pull a message from a POP3 and let
me process it as a file?  maybe i've been looking in the wrong places, but
i haven't found one yet on some of the script/module archives i've looked
in.

thanks,

jim



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

Date: 21 Jul 1999 15:52:39 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: email handling
Message-Id: <3795deb7@newsread3.dircon.co.uk>

James Gerard Coleman <jgc5a@j2.mail.virginia.edu> wrote:
> does anyone know of a module that will pull a message from a POP3 and let
> me process it as a file?  maybe i've been looking in the wrong places, but
> i haven't found one yet on some of the script/module archives i've looked
> in.

You might want to go back and search at :

<http://theory.uwinnipeg.ca/search/cpan-search.html>

/J\
-- 
"The only man in the cabinet who supported them was that fucking lunatic
Redwood" - John Major


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

Date: Wed, 21 Jul 1999 10:04:29 -0400
From: Bob Freedman <bob.freedman@eis.noaa.gov>
Subject: exec || system || ` ` ???Help
Message-Id: <3795D36D.6AB94C08@eis.noaa.gov>

I am having trouble launching one perl program from another when I need
to send it 3 arguments. I am trying to let the launched process finish
on its own time while the original process continues. A snipet of code
follows:

foreach (@detailURL) {
  $sFile = "$cook\.$i\.sry";
  push (@sum, $sFile);
  $run = "perl httptest.pl|$_ $query $sFile";
  system ("$run"); # I can get the httptest.pl to run but it only gets 
                   # one of the aruments
  ++$i;
}


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

Date: Wed, 21 Jul 1999 13:42:32 GMT
From: John.Borwick@sas.com (John Borwick)
Subject: Re: fetch url with standard modules?
Message-Id: <3795bfa3.174579411@newshost.unx.sas.com>

On Tue, 20 Jul 1999 15:48:10 GMT, snowhare@long-lake.nihongo.org
(Benjamin Franz) wrote:

> #     # #     # #     #  #####  ######     #    ######
> #  #  # #  #  # #  #  # #     # #     #   # #   #     #
> #  #  # #  #  # #  #  # #       #     #  #   #  #     #
> #  #  # #  #  # #  #  # #  #### ######  #     # ######
> #  #  # #  #  # #  #  # #     # #   #   ####### #     #
> #  #  # #  #  # #  #  # #     # #    #  #     # #     #
>  ## ##   ## ##   ## ##   #####  #     # #     # ######

   GOOD LORD IN HEAVEN!

-- 
John Borwick


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

Date: 21 Jul 1999 08:51:43 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Hashes
Message-Id: <slrn7pbk2b.oqh.abigail@alexandra.delanet.com>

Thomas Weholt (thomas@bibsyst.no) wrote on MMCL September MCMXCIII in
<URL:news:37959B6D.85C24832@bibsyst.no>:
|| 
|| in a tied MLDBM-hash-kinda-thing. Does it matter where the input comes
|| from, I mean the $name,$age and $phone, because in my case it was from
|| to different record-like ... things.
|| To be exact the code above looked more like 
|| 
|| 	$rec = {
|| 		name 	=> $some_other_rec->{name},
|| 		age	=> $some_other_rec->{age},
|| 		phone 	=> $some_third_thing->{phone},
|| 		};
|| 
|| How can this be odd numbered elements ( or whatever ) ?


It can't. However, if you have something like $some_other_obj -> method(),
that method might return an empty list (after all, it *is* called in list
context). Remember that a 'return;' returns an empty list in list context!
And then you have your odd number of elements.



Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\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: 21 Jul 1999 08:52:38 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Hashes
Message-Id: <slrn7pbk3v.oqh.abigail@alexandra.delanet.com>

Jonathan Stowe (gellyfish@gellyfish.com) wrote on MMCL September MCMXCIII
in <URL:news:37959f19@newsread3.dircon.co.uk>:
:: Thomas Weholt <thomas@bibsyst.no> wrote:
:: > To be exact the code above looked more like 
:: > 
:: > 	$rec = {
:: > 		name 	=> $some_other_rec->{name},
:: > 		age	=> $some_other_rec->{age},
:: > 		phone 	=> $some_third_thing->{phone},
:: > 		};
:: > 
:: > How can this be odd numbered elements ( or whatever ) ?
:: 
:: This can be an odd number if any of those things are undef ...


No, it can't. "undef" is still a scalar value.




Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\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: 21 Jul 1999 08:53:26 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Hashes
Message-Id: <slrn7pbk5g.oqh.abigail@alexandra.delanet.com>

Thomas Weholt (thomas@bibsyst.no) wrote on MMCL September MCMXCIII in
<URL:news:3795A303.1C1765AC@bibsyst.no>:
:: > >
:: > >       $rec = {
:: > >               name    => $some_other_rec->{name},
:: > >               age     => $some_other_rec->{age},
:: > >               phone   => $some_third_thing->{phone},
:: > >               };
:: > >
:: > > How can this be odd numbered elements ( or whatever ) ?
:: > 
:: > This can be an odd number if any of those things are undef ...
:: 
:: Ah ... I see. Are there any idiomatic ( or whatever you cool perl-wiz
:: say ) to check this,
:: perhaps like an java try-catch exception-like thing, that could trap
:: instances like these and deal with them, put default values into the
:: record instead etc.


Not necessary as the previous poster is confused. "undef" is a perfectly
valid scalar.



Abigail
-- 
perl -weprint\<\<EOT\; -eJust -eanother -ePerl -eHacker -eEOT


  -----------== 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: Wed, 21 Jul 1999 07:10:52 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Hashes
Message-Id: <MPG.11ff74c592bde77c989d09@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <37959f19@newsread3.dircon.co.uk> on 21 Jul 1999 11:21:13 
+0100, Jonathan Stowe <gellyfish@gellyfish.com> says...
> Thomas Weholt <thomas@bibsyst.no> wrote:
 ...
> > 	$rec = {
> > 		name 	=> $some_other_rec->{name},
> > 		age	=> $some_other_rec->{age},
> > 		phone 	=> $some_third_thing->{phone},
> > 		};
> > 
> > How can this be odd numbered elements ( or whatever ) ?
> 
> This can be an odd number if any of those things are undef ...

Huh?  'undef' is a thing, not a nothing.


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

my $rec = { a => 0, b => undef, c => 2 };
print sort keys %$rec, "\n";
__END__

abc


Look, Ma, no warnings!

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


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

Date: Wed, 21 Jul 1999 13:37:51 GMT
From: hassanov@my-deja.com
Subject: HELP: Faster alternative of substr()?
Message-Id: <7n4ife$s5g$1@nnrp1.deja.com>

Regarding huge arrays, is there any better (faster) way to do the
following:
	for($i=0;$i<length($SrcArray);$i++)
	{
		$ord1=ord(substr($SrcArray, $i, 1));
		$ord2=ord(substr($EncryptionArray, $i, 1));
		substr($DstArray, $i, 1)=chr( $ord1 + ord2 );
	}

Thanks


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 21 Jul 1999 14:52:57 GMT
From: grussell@hushmail.com (Gabriel Russell)
Subject: Re: How do I do a date string (ala from strftime) conversion to time_t?
Message-Id: <379adbd2.151647577@news.supernews.com>

On Mon, 19 Jul 1999 11:14:52 -0700, lr@hpl.hp.com (Larry Rosler)
wrote:

>[Posted and a courtesy copy mailed.]
>
>In article <3793247c.508741461@news.supernews.com> on Mon, 19 Jul 1999 
>16:28:11 GMT, Gabriel Russell <grussell@hushmail.com> says...
>> How do I do a date string (ala strftime) to time (ala gmtime)
>> conversion? I would guess that this is a faq but was unable to find
>> it.
>
>Your guess is correct, and you didn't look all that hard.  In the 
>section Dates in perlfaq4: "How can I take a string and turn it into 
>epoch seconds?" 

Hmm, I looked farly hard. I didn't read the whole faq while looking
for it, but I did a few searches most of wich were for faq titles with
"time" "date" in them. On closer inspection, I don't think that that
question is named verry well -- oh well.

I heard some talk about creating a better perldoc search system. That
would be nice. If there were a couple of key-words associated with
this question then I would have gotten right to it.

Also, just another Larry Rosler, you posted a perl specific responce
to my qustion to comp.lang.c. Do you think they care?

Thanks
	Gabriel Russell


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

Date: 21 Jul 1999 07:11:13 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to give Passwords on STDIN
Message-Id: <3795c6f1@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    "osman durrani" <osman@focomedia.de> writes:
:Hi ,
: Does anyone know how to get passwords from a user from the STDIN without
:using the ReadKey.pm.

$passwd = <STDIN>;

--tom
-- 
We're going to have the best-educated American people in the world.
		--Vice President Dan Quayle


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

Date: Wed, 21 Jul 1999 19:09:36 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: How to give Passwords on STDIN
Message-Id: <7n5nl0$elf1@news.cyber.net.pk>

: $passwd = <STDIN>;

Awesome! :P

My program's even easier (and shorter):

$passwd = <>;




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

Date: 21 Jul 1999 08:40:41 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to give Passwords on STDIN
Message-Id: <3795dbe9@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, "Faisal Nasim" <swiftkid@bigfoot.com> writes:
:: $passwd = <STDIN>;
:Awesome! :P
:My program's even easier (and shorter):
:$passwd = <>;

And less correct, since <> is not <STDIN> if @ARGV.

--tom
-- 
"Aye, there's the rub...for in that sleep of death, what dreams may come when 
 we have shuffled off this mortal coil, must give us pause."
				- William Shakespeare, `Hamlet'


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

Date: 21 Jul 1999 15:30:21 +0100
From: Olivier Dehon <dehon_olivier@jpmorgan.com>
Subject: Re: lexical $_ with threads question?
Message-Id: <iuxwvvu5b42.fsf@in-csg58.uk.jpmorgan.com>

Tom Christiansen <tchrist@mox.perl.com> writes:

> In comp.lang.perl.misc, 
>     Olivier Dehon <dehon_olivier@jpmorgan.com> writes:
> :As $_ is turned into a lexical, does that mean that one can create
> :closures using $_ (eg. in a foreach loop), 
> 
> Apparently.  See below.
[nice example snipped]

Well, I did some tests as well, and was not expecting the results I
obtained (see below).
What am I missing? 

olivier% perl -v

This is perl, version 5.005_03 built for sun4-solaris-thread
 ...

[Code derived from example in the perlref manpage.]

    #!/usr/local/bin/perl -w
    use strict;
    
    for (qw/f1 f2/)
    {
      no strict 'refs';
      *$_ = sub { print "I am $_\n"; };
    }
    
    for my $f (qw/f3 f4/)
    {
      no strict 'refs';
      *$f = sub { print "I am $f\n"; };
    }
    
    f1(); f2();
    f3(); f4();

Produces the following output:

    Use of uninitialized value at ./foo.pl line 7.
    I am 
    Use of uninitialized value at ./foo.pl line 7.
    I am 
    I am f3
    I am f4


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

Date: 21 Jul 1999 08:59:55 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl binary IO question
Message-Id: <slrn7pbkhn.oqh.abigail@alexandra.delanet.com>

Eyal Ben-David (eyal.ben-david@aks.com) wrote on MMCL September MCMXCIII
in <URL:news:3795ADD6.500892BB@aks.com>:
"" Hello,
"" 
"" I'd like to know how I write perl code which its effect
"" is identical to the following C code.
"" 

local *FILE, "> /tmp/foo.$$.c" or die "Failed to open file: $!";
print  FILE <<END_OF_C;

    /**** C code *****/

    long n;

    /* ... */
    FILE* fp = fopen("foo", "rb");
    read( fileno(fp), &n, sizeof(n));
    fclose(fp);

    ++n;

    fp = fopen("foo", "wb");
    write(fileno(fp), &n, sizeof(n));
    fclose(fp);

    /**** End of C code ***/

END_OF_C
close  FILE;

system "cc -o /tmp/my_little_program /tmp/foo.$$.c";
exec   "/tmp/my_little_program";


"" This code writes raw bytes of the number n.

And, bothered to grep the Perl manual for this?


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: 21 Jul 1999 09:03:29 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl Programmer Wanted Urgently
Message-Id: <slrn7pbkod.oqh.abigail@alexandra.delanet.com>

The Main Man (webmaster@accessx.com) wrote on MMCXLIX September MCMXCIII
in <URL:news:3794CBDB.2FE6E174@accessx.com>:
// We are still in need for a Perl Programmer(s) to work on a variery of
// exciting
// new projects in the adult entertainment biz.

"We do p0rn"

// Candidate must have own equipment and be ok to work on his/her own and
// to strict deadlines.

"We're to cheap to equip you, or even have an office, but we're a
 sweatshop anyway".

// Good Fun Company and good rates of pay + bonuses.

Cliche. Show me a company that says they aren't fun, or that they
pay bad rates, and your statement might have some merit.



Abigail
-- 
perl -wlpe '}{$_=$.' file  # Count the number of lines.


  -----------== 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: Wed, 21 Jul 1999 10:30:12 -0400
From: toby <toby@venice.cas.utk.edu>
Subject: Re: Perl Programmer Wanted Urgently
Message-Id: <3795D973.3D29D89D@venice.cas.utk.edu>



Abigail tapped tersely:

>
> // Good Fun Company and good rates of pay + bonuses.
>
> Cliche. Show me a company that says they aren't fun, or that they
> pay bad rates, and your statement might have some merit.
>

That would be a state university in the South, Bob.

Toby



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

Date: 21 Jul 1999 09:12:10 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Q: getting the decimal portion of a floating point number
Message-Id: <slrn7pbl8m.oqh.abigail@alexandra.delanet.com>

anna@water.ca.gov (anna@water.ca.gov) wrote on MMCXLIX September MCMXCIII
in <URL:news:7n2n1s$7t0$1@nnrp1.deja.com>:
** Hi,
** 
** Is there a way in Perl or in a module of getting the decimal portion of
** a floating point number?  I have already tried using the format_picture
** method of Number::Format, but that doesn't work.
** 
** For example, if I have a number, 12345.6789 and I want to be able to
** return the portion .6789, how do I go about that?


sub decimal_fraction ($);
sub decimal_fraction ($) {
    my $number_I_want_the_fraction_of  =  shift;
       $number_I_want_the_fraction_of *= -1 if
       $number_I_want_the_fraction_of  <  0;
       $number_I_want_the_fraction_of  <  1 ?
       $number_I_want_the_fraction_of  :  decimal_fraction
       $number_I_want_the_fraction_of  -  1;
}


Abigail
-- 
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
                                      print } sub __PACKAGE__ { &
                                      print (     __PACKAGE__)} &
                                                  __PACKAGE__
                                            (                )


  -----------== 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: 21 Jul 1999 09:16:16 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: reading from a file and THEN!
Message-Id: <slrn7pblgc.oqh.abigail@alexandra.delanet.com>

K. Posern (posern@informatik.uni-marburg.de) wrote on MMCXLIX September
MCMXCIII in <URL:news:37948914.377A753F@informatik.uni-marburg.de>:
'' 
'' And at this point I wondered if it is SOMEHOW possible (in perl) to
'' NOTICE that the "old" logfile was zipped and moved away and to close and
'' reopen the filehandle, so that is now attached to the "new" logfile
'' (with the same name in the same directory, but starting at size 0).

Sure. Just before each write, seek to the beginning and read the first
bytes - look for the magic tokens.

Of course, that entirely defeats the purpose of having an always open
logfile.... but if this is really what you want, so be it.



Abigail
-- 
perl -wlpe '}$_=$.;{' file  # Count the number of lines.


  -----------== 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: 21 Jul 1999 09:25:02 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Regular expression question (Problems with parsing ascii go diagrams)
Message-Id: <slrn7pbm0q.oqh.abigail@alexandra.delanet.com>

toni@dse.nl (toni@dse.nl) wrote on MMCXLIX September MCMXCIII in
<URL:news:7n1acl$lpm$1@nnrp1.deja.com>:
`` 
`` A lot of people wrote me that I should use anchors. Unfortunately
`` I have been to brief about by problem. In rec.games.go people
`` reagulary quote board and put text behind it. So a line of a go
`` board may also look like this:
`` 
``   > > > >  3 . X . . 0 3   Black to play
`` 
`` Using . instead of \s between the anchor and the expression results in
`` the same problem again. If come up with the solution first to check
`` with coordinates, and then without. You can see the code at the end
`` of this post.


Well, since everyone can choose his/her own quoting prefix, a solution
that'll work 100% of the time is very hard. But it might be reasonable
to assume noone is using digits, X, O or . in his/her quote prefix.

Then you might start your regex with: /^[^\dXO.]*/ to skip over the quotes.


Abigail
-- 
perl -wleprint -eqq-@{[ -eqw\\- -eJust -eanother -ePerl -eHacker -e\\-]}-


  -----------== 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: 21 Jul 1999 09:28:33 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Script for e-mailing invoices, database ?
Message-Id: <slrn7pbm7d.oqh.abigail@alexandra.delanet.com>

Tony (tony@idws.com) wrote on MMCL September MCMXCIII in
<URL:news:7n3o30$m8$1@news3.saix.net>:
[] 
[] Does anybody know of a good cgi-scipt / perl script that can be used to
[] capture all clients and also be used to send invoices to them via e-mail. We
[] have several clients and currently e-mailing invoices out manually, we would
[] like to add them to an online database - add items to their invoices as they
[] request them - and then once a month - at the press of a button - all
[] invoices must get e-mailed out.


I suggest you post this in misc.jobs.offered.

This isn't a Perl question. It's a job posting.



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: 21 Jul 1999 09:33:07 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Subroutines in a deperate file
Message-Id: <slrn7pbmft.oqh.abigail@alexandra.delanet.com>

Kevin Bilbee (kbilbee@wgn.net) wrote on MMCXLIX September MCMXCIII in
<URL:news:37940e2e@news.wgn.net>:
;; I am trying to put my commonly used subroutines in a seperate file, but when
;; I run my script I get the following error message.
;; 
;; /home/kbilbee/public_html/cgi-bin/lib/subprint.pl did not return a true
;; value at main.pl line 4.
;; 
;; Does anybody know what I am doing incorrectly?

Yes. /home/kbilbee/public_html/cgi-bin/lib/subprint.pl didn't return a true
value. Isn't that obvious from the error message?

Now, if you want to know the details what this means, there's an entire
manpage dedicated to explaining error messages. Go read it.



Abigail
-- 
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'


  -----------== 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: Wed, 21 Jul 1999 07:25:08 -0700
From: Michael Peppler <mpeppler@peppler.org>
Subject: Re: Sybperl stored procedure output
Message-Id: <3795D844.775A400@peppler.org>

Nostradamus wrote:
> 
> I still have a problem getting output back from a stored procedure i
> wrote the following :
> 
> @rows= $dbh->ct_sql(<<'SQL_EOF');
> DECLARE @rtn_status            int
>       ,@rtn_code              smallint
>       ,@extra_text            varchar(30)
> 
> EXECUTE @rtn_status = <DATABASE>..process_record
>         @a    = 12
>        ,@b    = 'S'
>        ,@c    = '1234123456          '
>        ,@d    = 'A'
>        ,@e    = 'ABCDEF'
>        ,@f    = 'GHIJKL'
>        ,@g    = '19990331'
>        ,@h    = '        '
>        ,@i    = '        '
>        ,@j    = ' '
>        ,@k    = ' '
>        ,@l    = ' '
>        ,@m    = '0.84800 '
>        ,@n    = '0.84800 '
>        ,@o    = 'N'
>        ,@p    = 'C'
>        ,@q    = '3'
>        ,@rtn_code              = @rtn_code output
>        ,@extra_text            = @extra_text output
> SQL_EOF
> 
> I know @rows holds the output, but how can i get it???

foreach (@rows) {
   print "@$_\n";
}

will print each row of results that you get back.

Note that to easily access the OUTPUT params you should probably not use ct_sql()
but instead ct_execute()/ct_results()/ct_fetch().

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@peppler.org    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com


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

Date: 21 Jul 1999 09:35:24 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Sybperl stored procedure output
Message-Id: <slrn7pbmk8.oqh.abigail@alexandra.delanet.com>

Nostradamus (mboertien@my-deja.com) wrote on MMCL September MCMXCIII in
<URL:news:7n414c$moa$1@nnrp1.deja.com>:
;; 
;; @rows= $dbh->ct_sql(<<'SQL_EOF');
;; 
;; SQL_EOF
;; 
;; I know @rows holds the output, but how can i get it???


I don't understand. You already have it. And you know you have it.

What *is* your question?



Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\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: Wed, 21 Jul 1999 09:27:41 -0500
From: Bruno Pagis <pagib@aur.alcatel.com>
Subject: Testing for the existing of a key in a hash
Message-Id: <3795E6ED.6B86F137@aur.alcatel.com>

Is there a better way than
if ($hash{$key} eq ".")
to know that a key has no entry in a hash ?
I figured out that when a key does not exist, I get a dot returned for
the value, but I'm not even sure that it is "standard".

BRUNO.


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

Date: Wed, 21 Jul 1999 09:57:46 -0500
From: Marshall Culpepper <marshalc@americasm01.nt.com>
Subject: Re: Testing for the existing of a key in a hash
Message-Id: <3795DFEA.D21702A@americasm01.nt.com>

Bruno Pagis wrote:

> Is there a better way than
> if ($hash{$key} eq ".")
> to know that a key has no entry in a hash ?
> I figured out that when a key does not exist, I get a dot returned for
> the value, but I'm not even sure that it is "standard".
>
> BRUNO.

this may be what you're looking for:
if !defined($hash{$key})
and yes i did test it :)
~Marshall



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

Date: Wed, 21 Jul 1999 10:35:44 -0400
From: Andy Dougherty <doughera@lafayette.edu>
Subject: Re: Tiny error in perlfaq5
Message-Id: <Pine.GSU.4.05.9907210956150.1618-100000@newton.phys>

On 15 Jul 1999, Tom Christiansen wrote:

> In comp.lang.perl.misc, 
>     jobosw@unx.sas.com writes:
> :So, what could be done to ensure that rand(1000) never returns 0?

You could use

	1000 - rand(1000);

This uses the fact that rand(1000) returns a number in the range [0,1000),
so 1000 - rand(1000) returns a number in the range (0,1000].  However in
this case, you might actually get the 1000.  In the context of web page
counters in perlfaq5, this distinction probably isn't critical :-), but it
might matter in another situation.

> :Also, how often will rand(1000) actually return zero?  Is this a one
> :in sizeof double case?  If I could hazard a guess, I'd say that an
> :error occurs consistently over 2**16 (65536) iterations.

On average, this will be dependent on the value of $Config{randbits} (use
perl -V:randbits).  However, in any individual run, whether you get 0 or
not will also depend the value for the seed for srand() and the algorithm
used by your C library.  In short, it could happen on the first call.

    Andy Dougherty		doughera@lafayette.edu
    Dept. of Physics
    Lafayette College, Easton PA 18042




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

Date: Wed, 21 Jul 1999 10:49:28 -0400
From: Andy Dougherty <doughera@lafayette.edu>
Subject: Re: Tiny error in perlfaq5
Message-Id: <Pine.GSU.4.05.9907211039440.1618-100000@newton.phys>

On 15 Jul 1999, John Stanley wrote:

> >:ksh> perl -V:randbits             
> >:randbits='15';

> >    tchrist% perl -V:randbits
> >    randbits='48';
> 
> Although pp.c will allow the use of a function other than the system
> rand() function, Configure does not consider this. It tells the user
> what it thinks the answer to "randbits" is based on using rand(). I'm

This is not quite correct.  In 5.004_0x, the INSTALL file suggests you
can use -Drand=random, in which case Configure's program does, in fact,
use random() and does, in fact, get the right answer (provided there are
not prototype conflicts).  This is all spelled out in the INSTALL file.

> 								I'm
> sure there must be a way to procide the appropriate -D option to the
> build,

Yes, there is.  In fact, in 5.005 (and 5.005_01 and 5.005_02, but oddly
enough not in 5.005_03), the INSTALL file tells you precisely what those
-D options are.

> build, but perhaps Configure should look for drand48 and use it if it
> is there by default.

This is what the development track currently does.  It does have the down
side that the same program (which explicitly calls srand() with a specific
seed) will give different output in 5.005 and 5.006.

    Andy Dougherty		doughera@lafayette.edu
    Dept. of Physics
    Lafayette College, Easton PA 18042



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

Date: Wed, 21 Jul 1999 13:39:26 GMT
From: rook268@my-deja.com
Subject: Web page generator
Message-Id: <7n4iic$s6m$1@nnrp1.deja.com>

Here's the situation.  My site is getting set to launch a new design.
We'd like to have something on the front page that would show events
that are happening today that would be updated automatically.  SSI is
not an option, as is mod_perl and anything using python (Zope, HTMLGen).

Is there a program that does this?  I'm prepared to write this myself,
but if someone has made it already I'd rather give that a try.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 212
*************************************


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