[12798] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 208 Volume: 9

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

Date: Wed, 21 Jul 1999 03:05:09 -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: 208

Today's topics:
    Re: basename regexp? <aperrin@mcmahon.qal.berkeley.edu>
    Re: basename regexp? <gellyfish@gellyfish.com>
    Re: basename regexp? (elephant)
    Re: basename regexp? (Bart Lateur)
        Copying directories <kims@emmerce.com.au>
        Difference between Win32::ODBC and Win32::OLE <alain.borgo@ratp.fr>
    Re: flock() replacement in Win32 ? <gellyfish@gellyfish.com>
    Re: hashes and arrays... (Abigail)
    Re: Hashes <thomas@bibsyst.no>
    Re: Help,.,,, money expression.. (Abigail)
    Re: How to compare fields (Bart Lateur)
        How to give Passwords on STDIN <osman@focomedia.de>
    Re: How to open database just once? <swiftkid@bigfoot.com>
    Re: lexical $_ with threads question? <dehon_olivier@jpmorgan.com>
    Re: Microsoft Word -> TXT? <simon@profero.com>
        open3 on Win32? <pkotala@logis.cz>
    Re: Perl and Personal Web Server (Win98) (Abigail)
        Perl for NT <pdthomas@post.interalpha.co.uk>
    Re: Perl for NT <alain.borgo@ratp.fr>
        pipe "|" functionality: ksh can easily do, perl can har (Michael Wang)
    Re: Reading binary files (elephant)
    Re: recursive anonymous functions -- problem (Rachael Ludwick)
        Script for e-mailing invoices, database ? <tony@idws.com>
    Re: Skipping to next file using angle operator (Tad McClellan)
        Sybperl stored procedure output <mboertien@my-deja.com>
        Sybperl stored procedure output <mboertien@my-deja.com>
        Using only one ODBC with several cgis, at the same time feketeroland11@my-deja.com
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Wed, 21 Jul 1999 00:11:13 -0700
From: Andrew J Perrin <aperrin@mcmahon.qal.berkeley.edu>
Subject: Re: basename regexp?
Message-Id: <37957291.43C583FD@mcmahon.qal.berkeley.edu>

Jona Andersen wrote:

> Hi,
>
> I need to know the name of my script.
>

Well, here's what I usually use, which has the advantage of being
relatively OS-independent, e.g., any OS that uses either / or \ as path
delimiter, and any that either does or doesn't report the full path in $0.

$me = $0;
if ($me =~ qr|[/\\]*(.+)$|) {
    $me = $1;
}


--
-------------------------------------------------------------
Andrew Perrin - NT/Unix/Access Consulting -
aperrin@mcmahon.qal.berkeley.edu
        http://www.geocities.com/SiliconValley/Grid/7544/
-------------------------------------------------------------




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

Date: 21 Jul 1999 09:13:22 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: basename regexp?
Message-Id: <37958122@newsread3.dircon.co.uk>

Lauren Smith <laurens@bsqaure.com> wrote:
> 
> Randal L. Schwartz wrote in message ...
>>>>>>> "Lauren" == Lauren Smith <laurens@bsqaure.com> writes:
>>
>>Lauren> /([^\\]+)$/; #
>>
> 
>> $scriptname = $1;
> 
> 
>>No.  Never use $1 unless you've also checked the success or failure of
>>the match that you think is matching.
> 
> 
> Perhaps it could be better said:
> $0 =~ /([^\\]+)$/;
> $scriptname = $1;
> print scriptname;
> 

Perhaps then that would be better said:

$scriptname = $1 if ($0 =~ /([^\\]+)$/ );

That would address Randal's original point ...

> Checked and tested and double checked and tested again.  (And soon I'll have
> a foot in my mouth, I'm sure.  :-)
> 

Hmm ...

/J\
-- 
"Virtual reality wouldn't be this wet" - Lucas, Seaquest DSV


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

Date: Wed, 21 Jul 1999 18:32:05 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: basename regexp?
Message-Id: <MPG.1200308ce27ad07f989b5f@news-server>

Andrew J Perrin writes ..
>Well, here's what I usually use, which has the advantage of being
>relatively OS-independent, e.g., any OS that uses either / or \ as path
>delimiter, and any that either does or doesn't report the full path in $0.
>
>$me = $0;
>if ($me =~ qr|[/\\]*(.+)$|) {
>    $me = $1;
>}

that's what you 'usually' use is it ? .. try testing it - I think you'll 
find that you don't use it all that usually after all

not to mention the fact that the '\' is a valid UNIX filename character 
 .. so even if it did work .. it aint OS-independent

-- 
 jason - remove all hyphens for email reply -


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

Date: Wed, 21 Jul 1999 09:54:24 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: basename regexp?
Message-Id: <379796b1.1421733@news.skynet.be>

elephant wrote:

>my Linux perl gives just the script name (the basename) with $0 .. my 
>ActiveState perl on NT gives me the whole filename
>
>is this just an ActiveState thing .. anyone else ? .. should we be 
>reporting a bug ?

No, I think it's even worse than that. It depends on how you called the
script, andI think this is the general rule. If you use a relative path
when invoking the script, $0 will probably contain a relative path.

script:
	print "My name is $0\n";
invocation (DOS):
	perl ..\temp\mnm.pl
result:
	My name is ..\temp\mnm.pl

	Bart.


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

Date: Wed, 21 Jul 1999 16:53:17 +1000
From: "Kim Saunders" <kims@emmerce.com.au>
Subject: Copying directories
Message-Id: <932540002.617800@draal.apex.net.au>

Hello again,

Can someone pls give me an example of how to copy DIRECTORIES recursively
(ie a 'cp -r dir'). The File::Copy module only seems to do files, and I need
to do directories portably

Thanks,

KimS





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

Date: Wed, 21 Jul 1999 09:02:28 +0100
From: Alain BORGO <alain.borgo@ratp.fr>
Subject: Difference between Win32::ODBC and Win32::OLE
Message-Id: <37957E94.9DD683AC@ratp.fr>

Hello,

I have a field LONG in a oracle database.

When I use Win32::ODBC, I can correctly retrieve this field and print
it in an ASP page.

BUT, when I use Win32::OLE, I get this error :

Microsoft OLE DB Provider for ODBC Drivers error '80040e21' 
Des erreurs sont survenues. 

Can someone tell me why ?
-- 
A bientôt.
---------------------------------------------------------------------------------
Je ne suis pas sûr d'avoir raison mais je suis sûr d'avoir essayé
d'avoir raison.


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

Date: 21 Jul 1999 09:56:00 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: flock() replacement in Win32 ?
Message-Id: <37958b20@newsread3.dircon.co.uk>

arpith@hotmail.com wrote:
> 
>> It won't work reliably.  There are icky, non-atomic kludges to try
>> to get around this [like creating a lock file when you want the file
>> to be locked, and deleting it when your process is finished writing -
>> note
>> that this is generally considered A Bad Idea (tm) and can cause
>> annoying failures when the lock file doesn't get deleted].  But if
>> your website is going to be fairly low-traffic, you should be able to
>> get away with this for the most part.
>>
> 
> I'm really only learning it on win95. So i guess, finally it will be on
> a Unix system. But till then I am using all the scripts as CGIs on a
> win95 platform.. on my computer using a Free server. But I may get a few
> people to test it, and they may be on simultaneously.. so...
> 

My original point was that Windows 95 is not designed to be a server
operating system and despite that fact that you can run sundry HTTP
servers on it I would not recommend doing anything other than testing and
developing on it.

> I guess, I will try the lock file.. how does it work ? Just create a
> lock file OR create a lock file and keep changing a value inside:
> 1/0/1/0 etc.. ??

If you are going to move the program to Unix eventually I would place all
of the uses of flock in an eval() so that the program will still run
on Win95.  Using a lock file is not really the best thing to use and for
the reasons I state above its not really going to help on Win95 anyhow.

/J\
-- 
"In last week's show Lee Mack suggested that David Copperfield was a
smarmy fucking twat. Well done Lee" - Channel 4 Continuity Announcer


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

Date: 21 Jul 1999 01:43:19 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: hashes and arrays...
Message-Id: <slrn7paqv3.oqh.abigail@alexandra.delanet.com>

Gary O'Keefe (gary@onegoodidea.com) wrote on MMCXLIV September MCMXCIII
in <URL:news:378b1386.438787879@news.hydro.co.uk>:
\\ On Fri, 09 Jul 1999 18:35:56 -0400, James Lovette
\\ <jlovette@ic.sunysb.edu> wrote:
\\ 
\\ >how would I compare each element in an array to see if it matched any
\\ >hash key?
\\ >
\\ >%dates = ("time1", "June 3 - June 10",
\\ >          "time2", "June 10 - June 17",
\\ >          "time3", "June 17 - June 24",
\\ >          "time4", "June 24 - July 1",	
\\ >          "time5", "June 1 - July 8",
\\ >          "time6", "July 8 - July 15",
\\ >          "time7", "July 18 - July 22",
\\ >          "time8", "July 22 - July 29",
\\ >          "time9", "July 29 - August 5",
\\ >          "time10", "August 5 - August 12",
\\ >          "time11", "August 12 - August 19",
\\ >          "time12", "August 19 - August 26",
\\ >          "time13", "August 26 - September 2");
\\ >
\\ >is my hash, and the keys are possible values in an array (depending on
\\ >what the user choses). how can I compare the two, so that i can
\\ >tell if $value[5] = "time11" that $value[5] is also equal to "August 12
\\ >- August 19"? thanks for the help.
\\ 
\\ A bit more help is needed with problem definition here. If $value[5]
\\ equals "time11" then it can't also equal "August 12 - August 19", can
\\ it? Also, try "perldoc -f grep". The answers are in the documentation.
\\ 
\\ Assuming there is a list, @foo, that contains the array values and the
\\ results of the search are going into @bar then
\\ 
\\ foreach $key ( keys ( %dates ) ) {
\\ 	@bar = ();
\\ 	@bar = grep ( /$key/, @foo );
\\ 	if ( @bar ) {
\\ 		# do stuff...
\\ 	} else {
\\ 		# do something else...
\\ 	}
\\ }
\\ 
\\ Hope this helps

Well, that doesn't seem to be right to me. First of all, you want to
compare for equality, not some pattern matching. Second, this looks
quadratic to me.

Assuming the array of values is @array, and the hash to match against
is %hash, then the elements of @array that appear as a key in %hash
is simple found with:

   @matched = grep {exists $hash {$_}} @array;

\\ p.s. I hope Abigail posts one of her brain-twisting little snippets of
\\ code. Try to figure out how it works as a penance for your sins and
\\ read the docs the next time.


Sorry, I don't think there's much to obfuscate in such a simple thing.



Abigail
-- 
perl -wlne '}for($.){print' 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 12:05:33 +0200
From: Thomas Weholt <thomas@bibsyst.no>
Subject: Re: Hashes
Message-Id: <37959B6D.85C24832@bibsyst.no>

David Cassell wrote:
> 
> [courtesy cc emailed, assuming this is a legit return address]
> 
> 05317@stblaw.com wrote:
> >
> > In using Hashes, every once in a while I get, Odd number of elements in
> > hash.  What am I doing wrong ?
> >
> > these hashes have at least 4500 items in them.
> 
> Well, 4500 isn't an odd number of elements for a hash.  But 4501
> would be.  This error message typically means that you managed to
> give a hash a bunch of key-value pairs, plus one.  Arrays don't
> care about their size, but hashes ought to come in key-value
> pairs.
> 
> One way to avoid this if you're just typing stuff in, is to use
> the arrow => instead of the comma between the key and the value.
> That way you can see how things line up.
> 
> HTH,
> David
> --
> David Cassell, OAO                     cassell@mail.cor.epa.gov
> Senior computing specialist
> mathematical statistician

In fact, I`ve managed to get the 'odd number of elements'-error/warning
using the -> method as well. I stored something like

	$rec = {
		name 	=> $name,
		age	=> $age,
		phone 	=> $phone,
		};

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 ) ?

PS! Written in a confused state of mind after installing Windows98 Sucky
Edition for the nth-time. Excuse the ... eh ... like stupid language ...
kinda.

Thomas W.


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

Date: 21 Jul 1999 01:43:51 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Help,.,,, money expression..
Message-Id: <slrn7par04.oqh.abigail@alexandra.delanet.com>

Myoungki Kim (hanwool@miraeventure.venb.co.kr) wrote on MMCL September
MCMXCIII in <URL:news:slrn7pa8l0.iqo.hanwool@miraeventure.venb.co.kr>:
// hi, 
// 
// I need your help ^_^;
// 
// i want to convert int string to money expression. 
// in example, 4000 -> 4,000   5000000 -> 5,000,000
// 
// do you have a good code?


RTFFAQ


Abigail
-- 
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
 |perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
 |perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
 |perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;


  -----------== 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:56:34 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: How to compare fields
Message-Id: <37989914.2032829@news.skynet.be>

Abigail wrote:

>What is the difference between "a blue fish" and "19.2857" ?

That one is "a blue fish", and the other "19.2857". And not vice versa.

	Bart.


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

Date: Wed, 21 Jul 1999 11:06:20 +0200
From: "osman durrani" <osman@focomedia.de>
Subject: How to give Passwords on STDIN
Message-Id: <37958a47.0@news.arcor-ip.de>

Hi ,
 Does anyone know how to get passwords from a user from the STDIN without
using the ReadKey.pm.

Thanx
Osman




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

Date: Wed, 21 Jul 1999 11:23:21 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: How to open database just once?
Message-Id: <7n4sao$csh2@news.cyber.net.pk>

: mod_perl is an Apache thing, and has little to do with Perl, or even
: perl.  If the original questioner had specified a web-based solution, or
: even problem, it's one thing to look for.  But it doesn't seem to make
: sense to me to recommend a mod_perl-based solution for a problem that
: hadn't even had the magic phrase "CGI" mentioned.

Sorry, my fault!

:
: Perl != CGI.
: Perl != WWW.
: Perl == Perl.

0 != 0
0 != 0
0 == 0

:P





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

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

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

> :If lexicals don't do anything special when a new thread is created,
> :what was the reason for turning $_ and @_ into lexicals
> Certainly without per-thread versions, things like grep/sort/foreach
> would interfere with other threads in a very nasty way.  Imagine 
> one thread changing them out from under another thread's execution.

As $_ is turned into a lexical, does that mean that one can create
closures using $_ (eg. in a foreach loop), or are there
restrictions?

-Olivier


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

Date: Wed, 21 Jul 1999 09:46:42 +0100
From: Simon Wistow <simon@profero.com>
Subject: Re: Microsoft Word -> TXT?
Message-Id: <379588F2.CF7AAEE7@profero.com>



GJ wrote:
> 
>      Is there anyway to open a Microsoft Word document in a perl script
> and be able to get out just the text (and possibly the formating) so
> that it can be formated into HTML?


I've been using a set of perl scripts called Laola by Martin Schwartz
<Martin_Schwartz@cs.tu-berlin.de>. From his DOCs

Laola distribution ...
is a collection of documentations and perl programs dealing with binary file
formats of Windows program documents.
LAOLA is giving access to the raw document streams of any program using
"structured storage" technology to save its documents.
ELSER is dealing especially with these streams as they are present in Word 6 and
Word 7 documents. 

laola.pl (Quick Reference) 
A perl 4 library giving access to Laola files. This library is founding the rest
of this distribution. 

lclean, Laola Clean (Sample output, doc) 
Saves the trash sections of e.g. Word 6, Word 7 or Excel documents to own files,
or cleans this trash sections. To demonstrate the free space in such documents,
you can insert some file into them. 

ldat, Laola Display Authress Title (Sample output) 
Lists author, title, creation date and some other information sticked in a laola
file. Gets printer information from Excel and Word files. Demonstrates how to
read "property sets". 

lls, Laola List (Sample output) 
Lists the structure of a Laola document. 

lhalw, Laola Have A Look at Word 
Shows text of Word 6 and Word 7 documents.
Word 8 is a little bit supported, too. 


They are avalailable from
http://wwwwbs.cs.tu-berlin.de/~schwartz/pmh/


-- 

Simon Wistow                       Development
simon@profero.com                  Profero Ltd
Phone : 0171 700 9960      Fax : 0171 700 9961


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

Date: Wed, 21 Jul 1999 10:11:08 +0200
From: "Pavel Kotala" <pkotala@logis.cz>
Subject: open3 on Win32?
Message-Id: <932544745.552275@gate.logis.cz>

I need use pgp on Windows NT. I tried to use open3 similar to this one:

use FileHandle;
use IPC::Open3;
use strict;

my ( $pid, $got, $save, $errortext);

undef $/;
open3(\*IN, \*OUT, \*ERR, 'cmd');
print IN "dir c:\\\n";
close(IN);
$got = <OUT>;
close(OUT);
$errortext = <ERR>;
close(ERR);

open FILE, '>test2.txt';
print FILE $got;
close FILE;

However, this scripts stands frozen at line $got = <OUT>;

Does open3 work on Win32? If not, has anybody experience how to accomplish
this task?

Thank You

Pavel Kotala




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

Date: 21 Jul 1999 01:56:25 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl and Personal Web Server (Win98)
Message-Id: <slrn7parnl.oqh.abigail@alexandra.delanet.com>

Alan J. Flavell (flavell@mail.cern.ch) wrote on MMCXLIX September
MCMXCIII in <URL:news:Pine.HPP.3.95a.990721013921.25705B-100000@hpplus03.cern.ch>:
// On Tue, 20 Jul 1999, David Cassell wrote:
// 
// > > Thank you. I have done numerous searches and never saw that group. I
// > > wish more people were as helpful as you.
// > 
// > Uh-oh.  A *helpful* response.  I guess we'll have to send Kent back
// > to the Abigail School For Abrupt And Obfuscated Replies.
// 
// ;-)
// 
// But this leaves open the question: what the heck are newbies doing wrong
// that they can't find their way around usenet groups???
// 
// PINE isn't exactly the world's most accomplished newsreader (that's
// meant as an understatement), but I only have to go into the "add group"
// dialog and type "browsers" to get a list of the relevant newsgroups that
// are carried on this server.  Or indeed I could type "www" and get a list
// of all the WWW-related groups that it carries.  Is it really so hard?


That would still require them to understand the concept of Usenet.

Most people "on the net", are mostly familiar with "the Web". And while
for us "oldies", Usenet is a working anarchy, the rest just expects
Usenet to be as chaotic as "the Web". The fact there are standards, rules,
styles and etiquette on Usenet totally baffles them. Just going to "add
group" and typing "browsers" requires the user from understanding there
is logic on Usenet; for a web wussie, that's a big jump to make.



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: Wed, 21 Jul 1999 10:13:36 +0100
From: "InterAlpha" <pdthomas@post.interalpha.co.uk>
Subject: Perl for NT
Message-Id: <37958d6a.0@interalpha.net>

Where can I get a perl interp. for NT 4.0 ?




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

Date: Wed, 21 Jul 1999 11:15:13 +0100
From: Alain BORGO <alain.borgo@ratp.fr>
To: InterAlpha <pdthomas@post.interalpha.co.uk>
Subject: Re: Perl for NT
Message-Id: <37959DB1.B57907D0@ratp.fr>

Hello,

http://www.activestate.com/



InterAlpha a écrit:
> 
> Where can I get a perl interp. for NT 4.0 ?

-- 
A bientôt.
---------------------------------------------------------------------------------
Je ne suis pas sûr d'avoir raison mais je suis sûr d'avoir essayé
d'avoir raison.


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

Date: 21 Jul 1999 07:57:36 GMT
From: mwang@tech.cicg.ml.com (Michael Wang)
Subject: pipe "|" functionality: ksh can easily do, perl can hardly do?
Message-Id: <7n3uhg$bdk$1@news.ml.com>

The following Perl script (not working) and Shell script (working)
illustrate what I want to do:

For differnet situations, I want to generate two LISTS.
And depending on the existence/order of situation, I want the
"COMBINATION" of the LISTS, and then I want to traverse the COMBINED LIST.
I want to do this without having to save anything in @VARIABLES. 
This is because the LIST maybe LONG, and doing so will use a lot
of memory. By using PIPE type of thing, memory gets used and then released,
used again, released again. Any help to make the following Perl script
working is greatly appreciated. Thanks. 

#!/usr/local/bin/perl -w

use strict;

my $i;
my $j;
my @i=();
my @j=("a", "b");    # @j could be ("a"), ("b"), ("b", "a")

foreach $j ( do {                   # hope to get either (1..5), (6..10),
               foreach $i (@j) {    # (1..10), (6..10 1..5) depending @j
                 if ( $i eq "a" ) {        # generate long list, do not want 
                   map { $_ } (1 .. 5);    # to put in variable to save 
                 } else {                  # memory, in each of the if-else
                   map { $_ } (6 .. 10);   # branch.
                 }
               }
             }
) {
  print $j;
}

#!/bin/ksh

j="a b"    # j could be "a", "b", "a b", "b a"

for i in $j
do
  if [[ $i == "a" ]]; then
    echo "1\n 2\n 3\n 4\n 5"    # this stream may comes from cat file,
  else                          # long list, so it is not good to save to
    echo "6\n 7\n 8\n 9\n 10"   # variable, better let pipe handle it
  fi                            # which uses memory i/o
done | while read k
       do
         echo $k
       done
-- 
Michael Wang
http://www.mindspring.com/~mwang


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

Date: Wed, 21 Jul 1999 16:19:29 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: Reading binary files
Message-Id: <MPG.1200117d68a7c6e4989b5e@news-server>

Abigail writes ..
>And I'm not even dead yet!

this JAPH gave me a few syntax errors

-- 
 jason - remove all hyphens for email reply -


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

Date: Wed, 21 Jul 1999 06:24:59 GMT
From: raludwicREMOVETHIS@u.arizona.edu (Rachael Ludwick)
Subject: Re: recursive anonymous functions -- problem
Message-Id: <37956753.17095996@news.arizona.edu>

Ahh!!  Thanks!  I guess I do need to go back and read things again.

Rachael

>you need to learn more about 'my' and how it is scoped in this instance 
>.. the following will work
>
>#--begin
>my $func;
>$func = sub {
>    my $param = shift;
>    if($param > 1) { 
>        return $param * &$func($param - 1);
>    }
>    else {
>        return 1;
>    }
>}
>#--end
>
>-- 
> jason - remove all hyphens for email reply -

--
raludwic@REMOVEu.arizona.edu
http://www.u.arizona.edu/~raludwic


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

Date: Wed, 21 Jul 1999 08:06:03 +0200
From: "Tony" <tony@idws.com>
Subject: Script for e-mailing invoices, database ?
Message-Id: <7n3o30$m8$1@news3.saix.net>

Hi there,

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.

Any help - direction would be appreciated.

Regards
Tony




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

Date: Tue, 20 Jul 1999 21:04:45 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Skipping to next file using angle operator
Message-Id: <db63n7.m47.ln@magna.metronet.com>

Stephen Rasku (srasku@my-deja.com) wrote:

: Is there a way to skip to the next file using the angle operator.  


   You can close the ARGV special filehandle.


: This is what
: I am looking for:

: while( <> )
: {
:     next FILE if ( m/keyword/ )

      close ARGV if m/keyword/;


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


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

Date: Wed, 21 Jul 1999 08:41:49 GMT
From: Nostradamus <mboertien@my-deja.com>
Subject: Sybperl stored procedure output
Message-Id: <7n414c$moa$1@nnrp1.deja.com>

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???



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


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

Date: Wed, 21 Jul 1999 08:41:52 GMT
From: Nostradamus <mboertien@my-deja.com>
Subject: Sybperl stored procedure output
Message-Id: <7n414f$mob$1@nnrp1.deja.com>

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???



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


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

Date: Wed, 21 Jul 1999 07:06:28 GMT
From: feketeroland11@my-deja.com
Subject: Using only one ODBC with several cgis, at the same time
Message-Id: <7n3rhg$k6b$1@nnrp1.deja.com>

Hello!
I want to use an odbc database -in Win NT- with several scripts at the
same time, with IIS. I don't want open several odbc channel, but only
one! How can I solve this problem ?
Thanks for the time,
Roland


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


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