[6859] in Perl-Users-Digest
Perl-Users Digest, Issue: 484 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 15 18:07:16 1997
Date: Thu, 15 May 97 15:00:21 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 15 May 1997 Volume: 8 Number: 484
Today's topics:
Re: 'seek'ing in a file before writing <rootbeer@teleport.com>
Re: [Q]Why does this happen? (....What Is?....)
Re: Beta Testers for PMS <usenet-tag@qz.little-neck.ny.us>
Can you help with a perl module? <mark@sierra-inc.com>
Creating Complex Data Structure <karlv@wayback.er.usgs.gov>
Re: ftp.pl <rootbeer@teleport.com>
Re: gzip/zmore in perl? <jong@mrc-lmb.cam.ac.uk>
How to put an normal array into an associative one <houde@fox.cisti.nrc.ca>
Re: Is it allowed to change Config.pm? <rootbeer@teleport.com>
Re: Is there a port for NT <allenjs@nic.techops.lmco.com>
localize? (Justin C Lloyd)
Re: Module problems. <rootbeer@teleport.com>
Re: Perl Neophyte has a Question <rootbeer@teleport.com>
Re: Please help!! (Chipmunk)
search and replace <hansg@escape.com>
Re: setuid & setgid scripts executed via cgi/internet <rootbeer@teleport.com>
Re: Sorting Records <rootbeer@teleport.com>
Re: Sorting Records (....What Is?....)
Re: swallowing whitespace (Tad McClellan)
Re: type casting <rootbeer@teleport.com>
Re: VORTEXodbc <boei@trifox.com>
Re: What's the quickest way in perl to determine if a s <dbenhur@egames.com>
Why is Perl doing this?! (Problem w/references to hashe (....What Is?....)
Re: Year 2000 Issues with Perl5 <rootbeer@teleport.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 15 May 1997 13:47:09 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Nessim Kisserli <kisserli@cs.uni.edu>
Subject: Re: 'seek'ing in a file before writing
Message-Id: <Pine.GSO.3.96.970515134307.29695M-100000@kelly.teleport.com>
On 14 May 1997, Nessim Kisserli wrote:
> Can anyone tell me why this isn't working?
Nope. :-) But keep reading.
> seek (FILE,0,0) || die "can't seek: $!\n"; #I also tried seek(FILE,1,0)
What error message do you get from that error message? Or does it not give
you an error message?
> print FILE "this string should appear at the top of the file..but doesn't!\n";
> close(FILE) #it has already been opened!
"it has already been opened"? I certainly hope that you opened the file
before you printed to it. How did you open it? That is, did you open it
for read-write access, or to append, or something else? Are you seeking
the beginning of the file immediately after opening it?
> I use tell(FILE) and it tells me that I'm at the top of the file yet the
> print statement never prepends the file, it always appends it. Help??
You're not trying to insert text at the beginning of a text file, are you?
There's information in the FAQ about that.
If you can include a complete, but short, program which illustrates your
problem, that might be helpful. Good luck!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 15 May 1997 20:55:03 GMT
From: whatis@nic.cerf.net (....What Is?....)
Subject: Re: [Q]Why does this happen?
Message-Id: <5lft77$i3k@news.cerf.net>
Looks like a couple of typos to me.
In article <5ldhp4$6hp@hpcvsnz.cv.hp.com> maitkin@cv.hp.com (Marc Aitkin) writes:
>foreach $thing1 (keys(%LT))
> {
>
> foreach $thing2 (sort (keys %{$LT{$thing2}}))
^^^^^^^
$thing1
> {
>
> foreach thing3 (sort (keys %{$LT{$thing3}{$thing2}}))
^^^^^^ ^^^^^^^ ^^^^^^^
$thing3 $thing1 $thing2
> {
> $quantity = $LT{$thing1}{$thing2}{$thing3};
> write;
> }
> }
> }
Steven Boswell
whatis@yyz.com
<http://www.cerfnet.com/~whatis/>
------------------------------
Date: 15 May 1997 20:45:05 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: Beta Testers for PMS
Message-Id: <5lfskh$ghi$1@news.netusa.net>
Eric D. Friedman <friedman@uci.edu> wrote:
>Stephen Hill <buck@huron.net> wrote:
>>Beta testers Needed for my messaging system, It is all written in perl.
>Has it occured to you that `PMS' might not be the greatest name for
>your system? That particular acronym is already in widespread use....
Yes but I doubt there will be any confusion between this and the Pantone
Matching System. Unless maybe the messages require very specific colors,
of course.
Elijah
------
TAF: TLAs are *fun*
------------------------------
Date: Thu, 15 May 1997 15:42:35 -0400
From: mark <mark@sierra-inc.com>
Subject: Can you help with a perl module?
Message-Id: <337B672B.4BF5@sierra-inc.com>
I've written a pretty extensive program using perl modules for the first
time. At first everything was running well, but then I tried running my
program from a shell script. Turns out the 'use' command will only work
for modules if they're located in one of the 'official' directories
(listed in @INC) or the local directory. Is there any way I can include
a '.pm' file located in an arbitrary directory?
I've already tried:
>use lib ("/path/to/my/lib");
and
>push (@INC, "/path/to/my/lib");
to no avail. I still get errors that the modules cannot be found.
Also, could you possibly email me the response in addition to posting
it?
------------------------------
Date: Thu, 15 May 1997 14:47:35 -0500
From: Karl Vietmeier <karlv@wayback.er.usgs.gov>
Subject: Creating Complex Data Structure
Message-Id: <337B6857.6FE4@wayback.er.usgs.gov>
I have been struggling over this for a few days now. I've looked at all
the man pages, I have at least 4 books on my desk (including the Oreilly
books) and all I've found is one vague reference:
**--------------**
Generation of a HASH OF COMPLEX RECORDS:
# reading from file
# this is most easily done by having the file itself be
# in the raw data format as shown above. perl is happy
# to parse complex datastructures if declared as data, so
# sometimes it's easiest to do that
**---------------**
and rather obtuse example to do what I'm trying to do. Namely, create a
data structure of quiz questions for use in a CGI generated quiz.
The author here says it is usually "easiest" to create the source file
with a raw data structure. no problem, I think I have that. The
instructions on how to read it in and create the actual structure are
confusing though.
Here is the desired format for my data file....
%quiz_items =
(
"questions" =>
{
question1 => 'text',
url => 'http://...',
correct => 'text',
difficult => 'level',
answers =>
[
'a',
'b',
'c',
'd'
],
},
{
question2 => 'text',
url => 'http://...',
correct => 'text',
difficult => 'level',
answers =>
[
'a',
'b',
'c',
'd'
],
}
)
Thanks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl S. Vietmeier karlv@wayback.er.usgs.gov
Web Development http://cfcg.er.usgs.gov
USGS Center For Coastal Geology voice: (813)-893-3100 x3081
Saint Petersburg, Forida fax : (813)-893-3333
------------------------------
Date: Thu, 15 May 1997 13:23:28 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Mike Vallabh <mike@cs.waikato.ac.nz>
Subject: Re: ftp.pl
Message-Id: <Pine.GSO.3.96.970515131741.29695I-100000@kelly.teleport.com>
On 14 May 1997, Mike Vallabh wrote:
> I am currently using perl 5.001 patchlevel 1m on a Dec 2000/300 running
> Digital Unix v3.2C.
You may wish to get a newer version of Perl installed; many bugs have been
fixed since 5.001m. If you can wait for just a little longer, you should
be able to install 5.004 soon.
> However, if I connect to an FTP server running Netware version 3 or 4 I
> am unable to perform the "Change directory".
I presume that you can use other FTP clients to do that successfully, but
that you can't do so with ftp.pl. That sounds like an incompatibility
between that library and ftp.pl. You would almost certainly be better off
with a one of the modules which (I believe) will be supplied with 5.004,
or available elsewhere on CPAN.
Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Thu, 15 May 1997 21:53:06 +0100
From: Jong <jong@mrc-lmb.cam.ac.uk>
Subject: Re: gzip/zmore in perl?
Message-Id: <337B77B2.2F1C@mrc-lmb.cam.ac.uk>
GuideQueue Master wrote:
>
Good question.
Will it be difficult to put perl internal function which
can produce gzip compatible files.
like
zip()
unzip()
as native perl functions. I guess it would not be difficult
to do so.
Jong
> I have a few logs that are in gzip format to keep the size down. In korn
> scripts, I've always used "zgrep" to find what I need, and "echo "stuff" |
> gzip >> file.log" to add stuff.
>
> Is there any way to read and write to a gzip file in PERL w/o
> using an external command? (I'd really hate to fork a shell for this, I
> just re-wrote my log manager in PERL to avoid the extra processes).
>
> ````'
> O O
> . . . . . . . . oOOo . . U . . oOOo . . . . . . . . . . . . . . . . .
> . .
> . Dean J. Brissinger .
> . - BVSD GuideQueue/GuideWeb Master (volunteer) .
> . .
> . "Here's five bucks. Go see the movie, and if you don't like it, .
> . I'll take the money back." -- Taxi .
> . .
> . . . . . . . . . ooo . . . . ooo . . . . . . . . . . . . . . . . . .
--
I support Perl, Linux ...
With OVER SIX MILLION USERS, up from only ten or so a very few years
ago, Linux has taken it's place as the world's #3 computer operating
system overall. And Linux is breathing down the neck of #2 for very good
reasons. If growth rate to date continues, Linux will be the #1 computer
operating system by late '98 or '99. Are YOU ready?
) Linux Newsletter
http://www.smli.com/people/john.ousterhout/scripting.html
------------------------------
Date: Thu, 15 May 1997 17:10:34 -0400
From: Pascal Houde <houde@fox.cisti.nrc.ca>
Subject: How to put an normal array into an associative one
Message-Id: <337B7BCA.5A1BC7A3@fox.cisti.nrc.ca>
That's what I want to do:
$a{'array1'} = @somearray;
Actually, it puts the number of element of @somearray into $a{'array1'}.
I want perhaps the array itself to be put instead.
I found a way to do it but I think it's not clean!
$a{'array'} = \@somearray;
later...
@getbackthearray = @{$a{'array'}}
The problem is that @somearray is a LOCAL array returned by a
subroutine.
$a{'array'} = &returnAnArray(param); # @somearray is used only whitin
that subr.
So what happen after the exit of the subroutine. Does the space memory
of @somearray deallocated?
In other words: Do perl will use that memory space to allocate other
things in it?
If so my \@ trick won't work or I may get wrong data!
Any Perl specialist out there?
Thanks in advance!
Please email me.
------------------------------
Date: Thu, 15 May 1997 14:07:12 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Honza Pazdziora <adelton@fi.muni.cz>
Subject: Re: Is it allowed to change Config.pm?
Message-Id: <Pine.GSO.3.96.970515140340.29695O-100000@kelly.teleport.com>
On Thu, 15 May 1997, Honza Pazdziora wrote:
> From man pages and READMEs I realize that Config.pm holds the
> content of the config.sh from the compile time. Is this file read
> only or can I change some of the variables and change the behaviour
> of my Perl instalation?
The values in Config.pm are, for the most part, compiled into your perl
binary. Although there are a couple of (mostly trivial) exceptions, you
should recompile perl (and generate a new Config.pm) if you need to change
any of them.
If you'll be compiling modules which need to be installed on other
machines, you may be able to change some values when you create the
makefile. If that will do what you need, you should be able to find
information about it in the MakeMaker documentation.
Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Thu, 15 May 1997 13:10:32 -0700
From: Jay Allen <allenjs@nic.techops.lmco.com>
Subject: Re: Is there a port for NT
Message-Id: <337B6DB8.65A1@nic.techops.lmco.com>
John Speight wrote:
>
> Could anyone out there tell me if there is a port of Perl to Windows NT?
Yes, we could tell you. Of course, if you had read the nine posts in
the last 24 hours on where to find such an animal (granted only 5 of the
9 contained the words: Perl for NT), we wouldn't need to.
> If so who sells it is there one from Gnu?
It's free. No.
> Thanks in advance
In advance of you asking the question. You're welcome.
Saving Petri the work....: ;)
Bookmark these (the first one is the kit, the second one has what you
need to know in addition, and the other pointers will also lead you to
useful information):
Perl for Win32:
http://www.activeware.com
Perl for Win32 Frequently Asked Questions (FAQ):
http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html
The Perl Language Home Page:
http://www.perl.com/perl/
Perl FAQ:
http://www.perl.com/perl/faq/index.html
Perl Reference:
http://www.panix.com/~clay/perl/
Comprehensive Perl Archive Network (CPAN):
http://www.perl.com/CPAN/
-j-
---------
Jay Allen
allenjs@nic.techops.lmco.com
ICYRA-Internet Coordinator
Lockheed-Martin - Web Page Lead
The Maxim Group - Sr. Programmer/Analyst
(w) (310) 727-1086
(h) (562) 433-7727
------------------------------
Date: 15 May 1997 19:55:45 GMT
From: lloyd@cs.fsu.edu (Justin C Lloyd)
Subject: localize?
Message-Id: <5lfpo1$7im$1@news.fsu.edu>
Just a thought I had...seeing as how I've gone through the pains of
understanding Perl's scoping rules with 'my' and 'local', what about adding a
new reserved word 'localize' (while keeping 'local' for backward
compatibility) to help people learn, understand, and remember just what is
going on there? It sure would have helped me understand a lot quicker.
JcL::Insert(0.02)
--
Justin C. Lloyd ______________________________________________________________
Graduate Teaching Assistant phone: 904/644-0559
Department of Computer Science email: lloyd@cs.fsu.edu
Florida State University www: http://www.cs.fsu.edu/~lloyd
P + L = :)
------------------------------
Date: Thu, 15 May 1997 13:42:35 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: GuideQueue Master <quemast@bvsd.k12.co.us>
Subject: Re: Module problems.
Message-Id: <Pine.GSO.3.96.970515134055.29695L-100000@kelly.teleport.com>
On Wed, 14 May 1997, GuideQueue Master wrote:
> I have two versions of Ping.pm installed.
> Problem is, I can't find anywhere how to access the new
> module vs. the old.
You probably want 'use lib' to specify which path to use to find the
module you want. Try the command "perldoc lib" and see whether it helps.
Good luck!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Thu, 15 May 1997 13:34:35 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Rudy Richter <rudy@mitec.net>
Subject: Re: Perl Neophyte has a Question
Message-Id: <Pine.GSO.3.96.970515132547.29695J-100000@kelly.teleport.com>
On Wed, 14 May 1997, Rudy Richter wrote:
> I'm using a basic sort sequence to sort by fields of my data, however,
> when it returns I find that Perl thinks BLANK fields come before data
> filled fields. Right or wrong this doesn't work for me. I need to put
> the BLANK fields behind the FILLED fields.
You want a custom sort routine which will put things in the order you
want, possibly something like this.
sub blanks_last {
!length($a) <=> !length($b) # non-blanks first
or $a cmp $b # then in alphabetical
}
There's more information on multi-level sorts in the perlfunc(1) entry for
sort. Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 15 May 1997 19:02:22 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: Please help!!
Message-Id: <5lfmju$atm$1@dartvax.dartmouth.edu>
In article <Pine.SGI.3.95.970512145115.13751A-100000@world.std.com>
James B Rush <jrush@world.std.com> writes:
> printf "in while, general \n" if $line =~ m/\/*\.html:/; #this works
> printf "in while, more specific\n" if $line =~ m/\/articles\/*.html/;
> ...
> @dummy= grep /*.html/, $line;
You seem to be using * as it is used on the command line, rather than
how it is used in regexps. In regexps, * means match 0 or more
occurences of the preceeding pattern. (i.e. a* matches one or more a's
in a row.) Likewise, in a regexp, . matches any character except a
newline (in general). \. matches a period.
Try these instead:
(m## instead of // to make your patterns clearer)
m#/.*\.html:#
m#/articles/.*\.html#
...
/.*\.html/
Chipmunk
------------------------------
Date: Thu, 15 May 1997 16:50:55 -0400
From: Hans Gilde <hansg@escape.com>
Subject: search and replace
Message-Id: <337B771B.5C9C@escape.com>
Howdy all,
So, I'm doing a script which includes a function to recurse directories
searching in the files, replaceing one string for another through out
the whole file.
It's no problem but I'm looking for The Wheel(so that I don't have to
reinvent it). I'm sure that someone has done this before but it's not
on CPAN or any other archives on which I've looked. I'm probably just
overlooking it, pointers anyone?
thanks much,
Hans Gilde
hgilde@environments.com
------------------------------
Date: Thu, 15 May 1997 14:09:11 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Bob <xxbbell@voicenet.com>, "Christopher S. Reickenbacker" <chrisre@medianet.com>
Subject: Re: setuid & setgid scripts executed via cgi/internet
Message-Id: <Pine.GSO.3.96.970515140730.29695P-100000@kelly.teleport.com>
On Thu, 15 May 1997, Bob wrote:
> Have you tried just putting a line in the script that does a
> "whoami" or something similar to find out who the script runs at?
It would be better to use perl's internal variables, and possibly
getpwuid, if that's what you need. Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Thu, 15 May 1997 14:00:16 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: James Ringrose <Jamesr@tiac.net>
Subject: Re: Sorting Records
Message-Id: <Pine.GSO.3.96.970515134912.29695N-100000@kelly.teleport.com>
On Thu, 15 May 1997, James Ringrose wrote:
> My problem is in getting the sort function to work on the data. I
> previously stored the data in an array and then sorted that array.
> However no matter how I fiddle I can not get 'sort' to return a sorted
> set of records i.e.
[ Snipped code which fills @database with refs to anon hashes. ]
That's an odd way to populate @database, but okay.... :-) (Did you
realize that you're wiping out the initial entry?)
> sub byalpha {
> %{$database[$a]}->{"Time"} cmp %{$database[$b]}->{"Time"}
> };
>
> @sorteddatabase = sort byalpha @database;
That sort sub is the problem. Within it, $a and $b are elements of
@database (which is to say, each one is a pointer to an anonymous hash),
so you probably want something like this. (Or do you want to use <=>
instead of cmp to do the comparison?)
sub byalpha {
$a->{Time} cmp $b->{Time}
}
(Alternatively, you could sort the array indices, but that's getting too
confusing.) Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 15 May 1997 21:07:39 GMT
From: whatis@nic.cerf.net (....What Is?....)
Subject: Re: Sorting Records
Message-Id: <5lftur$ill@news.cerf.net>
In article <337a6cf1.2364363@news.tiac.net> Jamesr@tiac.net writes:
> $database[$temp] = {
> "Time" => $logdata[($temp*5)+0],
> "l1" => $logdata[($temp*5)+1],
> "l2" => $logdata[($temp*5)+2],
> "l3" => $logdata[($temp*5)+3],
> "l4" => $logdata[($temp*5)+4],
> "l5" => $logdata[($temp*5)+5]
> };
Shouldn't you be multiplying by 6?
Steven Boswell
whatis@yyz.com
<http://www.cerfnet.com/~whatis/>
------------------------------
Date: Thu, 15 May 1997 15:04:47 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: swallowing whitespace
Message-Id: <v8qfl5.9l.ln@localhost>
Venkat Jagadish (venkat@bbb.caltech.edu) wrote:
: Hello Perl Wizards,
: I am trying to eat up any whitespaces (ws) from every line (excluding
: line-breaks) of a file that contains a list of mistyped
: e-mail addresses.
: I tried the following :
:
: s/(\s+)(^[\n])(.*)/$2$3/g ;
^
^ this matches the _beginning_ of a line!
are you matching against a multiline string?
if so you need s///m
^
or did you mean ([^\n]) ie: not a newline?
s/[ \t]//g; # this should be enough to do it...
: but when the default pattern space ($_) encounters a line
: such as
: "login name@host. network.domain"
: ^ ^
: | |
: (single ws) (3 successive ws)
:
: the above substitution yields
: "loginname@host. network.domain"
It does not yield that for me.
I bet that is not your real code, is it?
I will assume that your real code put the ^ inside of the char class.
: Apparently, it matches a single whitespace followed by a
^^^^^^^^^^
Appearances can be decieving, especially when it is the appearance
of a regex ;-)
It appears to me to match:
1) one or more white spaces (including newlines), followed by:
2) the beginning of a line, followed by:
3) a newline, followed by:
4) zero or more characters that are not a newlines.
: non-whitespace character but not successive whitespace (excluding
: line-break) characters.
: The surprising thing is that it works when I rerun the script
^^^^^^^^^^^^^^^^
Not surprising if you understand what the regex (corrected to have
the ^ inside the char class) is doing (though I'm not too sure what
you meant for that regex to do...).
: on this modified file once more.
: I thought the /g modifier should take care of matching all
: the occurrences in one shot.
I does. But the 'one shot' (ie. the first match) matches the entire
string!
"login name@host. network.domain"
^ /s+ matches this
"login name@host. network.domain"
^ ([^\n]) matches this, you put it back in via $2
"login name@host. network.domain"
^^^^^^^^^^^^^^^^^^^^^^^^^^^ (.*) matches all of this...
you put it all back in via $3
: What am I odoing wrong?
Working too hard ;-)
That simple regex I suggested should do the trick.
: Also is there a way
: to do modifications in place in PERL ?
Yes. See the perlrun man page ( -i switch).
: Thanks.
You're welcome.
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Thu, 15 May 1997 13:15:36 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: John Doe <doe#m#_john@mmac.is.lmsc.lockheed.com>
Subject: Re: type casting
Message-Id: <Pine.GSO.3.96.970515131307.29695H-100000@kelly.teleport.com>
On Wed, 14 May 1997, John Doe wrote:
> Is there any way to type cast a variable as double precision? - not
> "bigflaot".
In Perl, you never have to do that. But tell us why you think you need to,
and we'll help you to do what you really need. :-)
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Thu, 15 May 1997 14:11:17 -0700
From: Bob Eisner <boei@trifox.com>
To: "Paul Vermette [NiD/BiM]" <e5ir@jupiter.sun.csd.unb.ca>
Subject: Re: VORTEXodbc
Message-Id: <337B7BF5.4D92@trifox.com>
Paul Vermette [NiD/BiM] wrote:
>
> I was just curious on what VORTEXodbc is. I checked out the web site
> (Trifox's) but could not get alot of information from it about the
> VORTEXodbc. Will this work with ANY odbc driver? for any database?
>
Hi Paul,
VORTEXodbc is an alternative to VORTEXcli for applications that
have been written to ODBC standards. It provides transparent
concurrent access to Oracle, RdB, Ingres, Sybase, Informix,
ADABAS, ODBC, DB2 and allBase across multiple hardware platforms.
VORTEXcli is the VORTEXchannel call-level interface. Using the
supplied routines, all industry standard SQLCA/SQLDA structures,
you can access any VORTEXchannel-supported database. In addition
to the elegant access, VORTEXcli supports automatic datatype
conversion as well as bulk interface, making your existing C and
COBOL applications efficient in a multi-tier, distributed
environment.
VORTEXchannel is the virtual database interface, and the backbone
of the VORTEX family of products, that provides access to multiple
data managers. VORTEXchannel connects your ODBC, JDBC, Java, C++,
and Perl applications to a huge array of relational and
object-oriented data managers, as well as legacy data structures.
Programs generated via VORTEXc and VORTEXcobol interface to the
VORTEXchannel via the VORTEXcli.
VORTEX++, VORTEXJava(tm) Edition, VORTEXjdbc, and VORTEXperl are
thin class libraries that function as the on-ramps to the
VORTEXchannel.
Information on the VORTEX family line of products can
be obtain from our WEB page at http://www.trifox.com
If you any question, please give me a call at 408 369-2392.
Ragards,
Bob Eisner
------------------------------
Date: Thu, 15 May 1997 13:23:03 -0700
From: Devin Ben-Hur <dbenhur@egames.com>
To: Mark Daku <daku@nortel.ca>
Subject: Re: What's the quickest way in perl to determine if a scalar is a list?
Message-Id: <337B70A7.27D1@egames.com>
[mail&post]
Mark Daku wrote:
> I'm looking for the FASTEST way to locate a string in an array. By
> fastest I mean in cpu not in code style. I have a lot of arrays
> in my code I just want to speed up the validation.
> ----------
> @array = ("a","b","c","d","e","f");
> $string = "a";
> # were "isin" is my really fast look up code, I've used it like an operator.
> # but it doesn't have to be a code block will do.
> if ( $string isin @array ) {
> print "found it\n";
> } else {
> print "Ah sucks it's not there!\n";
> }
Turn your array into a hash and use exists() to test:
@array = ("a","b","c","d","e","f");
@in_array{@array} = (1) x @array;
$string = "a";
if ( exists($in_array{$string}) ) {
print "found it\n";
}
(BTW, this question doesn't have anything to do with Perl
modules, so the cross-posting has been removed)
HTH
--
Devin Ben-Hur <dbenhur@egames.com>
eGames.com, Inc. http://www.egames.com/
eMarketing, Inc. http://www.emarket.com/
"A lunatic is easily recognized. He is a moron who
doesn't know the ropes." -- Jacopo Belbo
------------------------------
Date: 15 May 1997 20:32:20 GMT
From: whatis@nic.cerf.net (....What Is?....)
Subject: Why is Perl doing this?! (Problem w/references to hashes)
Message-Id: <5lfrsk$hb4@news.cerf.net>
The output of the below program is:
-----
Value of One set through $selfDB
Value of Two set through $selfDB
-----
but I expected it to be
-----
Value of One set through $selfDB
Value of Two set through $self
-----
What's going on? Why does setting values through $selfDB work, but not
through $self{'db'}?
Incidentally, if I curly-bracket all occurrences of "$self{'db'}", i.e.
making it "{$self{'db'}}", it works as expected. If it's a simple
operator precedence problem, that's fine, but why do both types of "set"
operations compile and run, but only one has any effect?
------------------------------------------------------------------------
#!/usr/local/bin/perl5 -w
use POSIX;
use NDBM_File;
# Set up the outer hash.
$self = {};
# Set up the inner hash.
$$self{'db'} = {};
# Tie the inner hash.
tie (%{$self{'db'}}, 'NDBM_File', './bug-db', O_RDWR|O_CREAT, 0600)
or die "tie #1 failed: $!";
# Now, set some values inside the tied DB, using two different ways:
# one using a reference to the tied hash, another going through $self.
$selfDB = \%{$self{'db'}};
$$self{'db'}{'One'} = 'Through $self';
$$selfDB{'One'} = 'through $selfDB';
$$selfDB{'Two'} = 'through $selfDB';
$$self{'db'}{'Two'} = 'Through $self';
# Now untie, retie, and see what happened.
untie %{$self{'db'}}
or die "untie failed: $!";
%db = ();
tie (%db, 'NDBM_File', './bug-db', O_RDONLY, 0400)
or die "tie #2 failed: $!";
print "Value of One set $db{'One'}\n";
print "Value of Two set $db{'Two'}\n";
------------------------------------------------------------------------
Steven Boswell
whatis@cerf.net
------------------------------
Date: Thu, 15 May 1997 14:10:46 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Tony Zaki <sukhr@bu.edu>
Subject: Re: Year 2000 Issues with Perl5
Message-Id: <Pine.GSO.3.96.970515140943.29695Q-100000@kelly.teleport.com>
On 15 May 1997, Tony Zaki wrote:
> Could someone please direct me to any site that has more information
> regarding Perl5 and problems with the year 2000 ???
You mean www.dev.null? :-)
Or maybe you want the Perl FAQ, which is on CPAN.
http://www.perl.org/CPAN/
http://www.perl.com/CPAN/
Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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 V8 Issue 484
*************************************