[13970] in Perl-Users-Digest
Perl-Users Digest, Issue: 1379 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 15 10:05:30 1999
Date: Mon, 15 Nov 1999 03:05:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942663910-v9-i1379@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 15 Nov 1999 Volume: 9 Number: 1379
Today's topics:
break in the loop <hxshxs@my-deja.com>
Re: break in the loop (Mark W. Schumann)
Re: break in the loop (brian d foy)
Cannot compile under Emacs for WIndows 26red@my-deja.com
CGI Lock-down (IL)
Clarification of threads and locking <sisl@ihug.co.nz>
Re: Clarification of threads and locking (Abigail)
Re: Generating pi (Matt Dale)
Re: Generating pi (Anno Siegel)
Help (back for guru): using setsid() to invoke dissasso <zzrhear@pobox.winthrop.edu>
Re: Help needed fast please <mark.bluemelNOmaSPAM@siemens.co.uk.invalid>
How to Convert a string to a integer! <Benjamin_Gu@email.mot.com>
Re: how to use ODBC (or other) to determine data set fi <jeff@vpservices.com>
Re: how to use ODBC (or other) to determine data set fi <ron@savage.net.au>
IPC with Media Player? <nelander@ais.net>
Making http requests with extra headers <eh57@tid.es>
Re: Need ODBC Driver for Rdb 6.0 <eugen@svzserv.kemerovo.su>
Re: Newbee needs some date functions . . . (Eric Bohlman)
Re: Newbie: Secure DBI connection (Jani Lahti)
Problems with h2xs <r7768c@email.sps.mot.com>
Re: Range operators: two dots v.s. three dots (Michael Budash)
Re: sort lists together <lr@hpl.hp.com>
Re: sort lists together (Abigail)
SQL query problems (newbie) <E.Keilholz@BrightSite.nl>
Stripping off ^Ms from file <ronnie@post1.com>
Re: Stripping off ^Ms from file <zzrhear@pobox.winthrop.edu>
SYMLINK in a CGI program? (Kazz)
Re: Too much Perl? (hoz)
Re: Use perl with SAS and MS Access? <c4jgurney@my-deja.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 15 Nov 1999 06:30:17 GMT
From: Howard <hxshxs@my-deja.com>
Subject: break in the loop
Message-Id: <80o99q$era$1@nnrp1.deja.com>
how do I break out of the foreach loop?
foreach $tmp (@list)
{
...
$count++;
if($count>10)
{
break; (break is not correct, what is the syntax here? )
}
}
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 15 Nov 1999 01:42:13 -0500
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: break in the loop
Message-Id: <80oa05$doq@junior.apk.net>
In article <80o99q$era$1@nnrp1.deja.com>, Howard <hxshxs@my-deja.com> wrote:
>how do I break out of the foreach loop?
> break; (break is not correct, what is the syntax here? )
last;
------------------------------
Date: Mon, 15 Nov 1999 03:40:54 -0500
From: brian@smithrenaud.com (brian d foy)
Subject: Re: break in the loop
Message-Id: <brian-1511990340550001@sri.dialup.access.net>
In article <80o99q$era$1@nnrp1.deja.com>, Howard <hxshxs@my-deja.com> wrote:
>how do I break out of the foreach loop?
check the docs for next, last, and redo. one of those does
what you want, most likely.
--
brian d foy
Perl Mongers <URI:http://www.perl.org>
CGI MetaFAQ
<URI:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 15 Nov 1999 05:58:08 GMT
From: 26red@my-deja.com
Subject: Cannot compile under Emacs for WIndows
Message-Id: <80o7df$dmv$1@nnrp1.deja.com>
I am a new programmer and I just download
Emacs for Windows. I cannot compile so I am thinking that here is no
compiler under Windows. Does anybody recommend any compiler for
Windows. If there is, can you tell me what I am doing wrong.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 15 Nov 1999 05:06:43 GMT
From: "Andy (IL)" <akoszyk@flash.net>
Subject: CGI Lock-down
Message-Id: <DxMX3.1343$16.161599@news.flash.net>
I'm looking for a freeware script called CGI Lock-down. You call it from
any script you consider sensitive and CGI Lock-down supposedly checks for a
password.
Anyone seen it or heard of anything similar, but not a full-blown password
system?
--
Andy Koszyk
akoszyk@flash.net
------------------------------
Date: Mon, 15 Nov 1999 21:42:30 +1300
From: Grant McLean <sisl@ihug.co.nz>
Subject: Clarification of threads and locking
Message-Id: <382FC776.1D7A116B@ihug.co.nz>
In a recent discussion on P5P:
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1999-10/msg01202.html
Tuomas J. Lukka said:
>
> Maybe really emphasize the fact that unlike in other languages,
> you should get the lock EVEN IF MANY THREADS ONLY READ THE
> VARIABLE AND NO-ONE WRITES.
>
Is this correct? If so, can someone explain why?
It seems sensible that if another thread might be updating a
variable that you want to read, then you should lock it before
reading it. But if we know that a particular variable is never
updated, can't all threads safely read it without locking?
I'm trying to make sure that one of my modules is thread safe
and had assumed that making sure that all shared variables were
either read-only or locked during reads/writes would be enough.
Regards
Grant
--
------------------------------------- _____ _____ _____
Grant McLean | | | | Systems
| S ) I ( S | Integration
EMail: sisl@ihug.co.nz |_(~)_|__ __|_(~)_| Specialists
Phone: (64) (4) 232 3428 (_) Limited
------------------------------
Date: 15 Nov 1999 04:25:25 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Clarification of threads and locking
Message-Id: <slrn82vo37.cvu.abigail@alexandra.delanet.com>
Grant McLean (sisl@ihug.co.nz) wrote on MMCCLXVII September MCMXCIII in
<URL:news:382FC776.1D7A116B@ihug.co.nz>:
"" In a recent discussion on P5P:
""
"" http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1999-10/msg01202.html
""
"" Tuomas J. Lukka said:
"" >
"" > Maybe really emphasize the fact that unlike in other languages,
"" > you should get the lock EVEN IF MANY THREADS ONLY READ THE
"" > VARIABLE AND NO-ONE WRITES.
"" >
""
"" Is this correct? If so, can someone explain why?
Because reading a variable might change it.
Consider:
$foo = "3"; # $foo is a string.
print 4 + $foo; # $foo is used in numerical context.
When doing 4 + $foo, $foo is used in numerical context. However, all we
have is "3", a string. Perl makes a number out of "3" *AND UPDATES THE
VARIABLE BEHIND THE SCENES*. Now, $foo will have both "3" and 3 internally,
so the next time $foo is used in numerical context, Perl doesn't have to
turn a string into a number.
"" It seems sensible that if another thread might be updating a
"" variable that you want to read, then you should lock it before
"" reading it. But if we know that a particular variable is never
"" updated, can't all threads safely read it without locking?
As explained, reading variables might update it behind the scenes.
"" I'm trying to make sure that one of my modules is thread safe
"" and had assumed that making sure that all shared variables were
"" either read-only or locked during reads/writes would be enough.
No, that's not enough.
Abigail
--
perl -wle 'print "Prime" if (0 x shift) !~ m 0^\0?$|^(\0\0+?)\1+$0'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Mon, 15 Nov 1999 09:35:39 GMT
From: mad@cyberscience.com (Matt Dale)
Subject: Re: Generating pi
Message-Id: <80okc0$kom$1@linux.cybertek>
revjack <revjack@radix.net> wrote:
>revjack explains it all:
>:Anybody ever tool up an algorithm in perl to generate the
>:digits of pi?
>Um, I mean, an algorithm that will crank out the digits one
>after another, ad infinitum, without cheating like Abigail.
Try this
4/1 - 4/3 + 4/5 - 4/7 + 4/9 - 4/11....................and so on.
I leave you to work out the perl, this may take a while.
------------------------------
Date: 15 Nov 1999 10:28:52 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Generating pi
Message-Id: <80on94$usd$1@lublin.zrz.tu-berlin.de>
Abigail <abigail@delanet.com> wrote in comp.lang.perl.misc:
>David Cassell (cassell@mail.cor.epa.gov) wrote on MMCCLXV September
>MCMXCIII in <URL:news:382CBFF4.45075C8A@mail.cor.epa.gov>:
>&& revjack wrote:
>&& >
>&& > revjack explains it all:
>&& > :Anybody ever tool up an algorithm in perl to generate the
>&& > :digits of pi?
>&& >
>&& > Um, I mean, an algorithm that will crank out the digits one
>&& > after another, ad infinitum, without cheating like Abigail.
>&&
>&& If you don't like Yannick's algorithm, you can look up
>&& 'spigot algorithms' and code it up yourself. I think there
>&& was an article on them in the American Mathematical Monthly
>&& about four years ago.
>
>
>This one is quite fast, and will print out all the digits of pi:
>
>
> perl -we 'print "3."; {redo if print int rand 10}'
True if and only if pi contains infinitely many copies of each
possible digit. Is that known about pi?
>It doesn't necessarely print them in order though.
Minor detail.
Anno
------------------------------
Date: Mon, 15 Nov 1999 05:29:43 +0000
From: "Ryan T. Rhea" <zzrhear@pobox.winthrop.edu>
Subject: Help (back for guru): using setsid() to invoke dissassociated child - bash
Message-Id: <382F9A46.BA1A85D4@pobox.winthrop.edu>
Using setsid() worked wonderfully in getting ppp to run as a
disassociated "daemon" (Refer to previous post 'Help: Struggling with
fork'). I can now kill my invoking parent shell and have ppp continue
in a separate process.
However, the same process doesn't work when bash or sh is invoked as the
child. Killing the parent still kills the child if it is a shell.
What am I missing? I wonder if I could double fork bash instead... I
don't know how to do that, yet. }8>)
Also, why are certain environmental variables apparently not set under
the invoked shell? My path does not appear to be set, and there exist
some other, stranger effects.
As mentioned in the previous post, I am invoking my perl program from
the 'shell' field of '/etc/password'. When the specified users logon,
secure runs and is supposed to vanish and leave bash running (after
performing several other tasks).
Guidance needed.
Ryan
------------------------------
Date: Mon, 15 Nov 1999 01:30:42 -0800
From: Mark Bluemel <mark.bluemelNOmaSPAM@siemens.co.uk.invalid>
Subject: Re: Help needed fast please
Message-Id: <11f733ec.e3230b6d@usw-ex0101-006.remarq.com>
Has this thread convinced you that a newsgroup is not quite the best
place to get fast fixes to failing code?
Interesting discussion of quoting strategies though...
Regards
--
Mark Bluemel
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Mon, 15 Nov 1999 17:33:13 +0800
From: Benjamin Gu <Benjamin_Gu@email.mot.com>
Subject: How to Convert a string to a integer!
Message-Id: <382FD359.D050BB1A@email.mot.com>
Dear All,
I am implementing a permutation
algorithm with Perl, i got a trouble
when i was trying to sort one of my
arrays. Specifically i have an
array like this,
"m:x1_1:_vert#id",
Wm:x2_1:_vert#id" ....
"m:x1_12:_vert#id"), what i was
trying to do is to arrange these
strings according to the 2 numbers.
So i developed some code as below:
@sorted = sort {
@first =
split ( /\D/, $a );
@second =
split ( /\D, $b );
$first[0]
<=> $second[0] || $first[1] <=>
$second[1];
}
@original;
But when i was running this script,
the system alaways complained that
"it is not numeric". Pls. show me
how to convert a string to integer.
Thanks a lot.
Benjamin
------------------------------
Date: 15 Nov 1999 04:22:00 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: how to use ODBC (or other) to determine data set field types?
Message-Id: <382F8A20.63FA04F4@vpservices.com>
Dan Harasty wrote:
>
> I have a written a program that can select a SQL recordset then,
> ignoring the data, determine all the fieldnames, fieldtypes, and
> fieldsizes (e.g. INT or VARCHAR(12)). From that I can do a variety of
> fun things, like make an ad-hoc CREATE TABLE query to recreate the table
> in a different database...
>
> UNFORTUNTATELY, I did this in Visual Basic... and I would like to
> recreate it in a Perl script, using Win32::ODBC (or any other means).
I suggest you use DBI and DBD::ODBC because a) it will be much more
portable between databases than Win32::ODBC and b) there already exists
a recordset module for it -- DBIx::Recordset -- which may either save
you work or give you pointers.
--
Jeff
------------------------------
Date: Mon, 15 Nov 1999 20:35:16 +1100
From: "Ron Savage" <ron@savage.net.au>
Subject: Re: how to use ODBC (or other) to determine data set field types?
Message-Id: <eyQX3.2884$MZ.21101@ozemail.com.au>
email Dominique Cretel, Sema Group dominique.cretel@sema.be
for a copy of odbc2xml.pl.
--
Cheers
Ron & Pen Savage
ron@savage.net.au pen@savage.net.au
http://savage.net.au/index.html
Jeff Zucker <jeff@vpservices.com> wrote in message
news:382F8A20.63FA04F4@vpservices.com...
> Dan Harasty wrote:
> >
> > I have a written a program that can select a SQL recordset then,
> > ignoring the data, determine all the fieldnames, fieldtypes, and
> > fieldsizes (e.g. INT or VARCHAR(12)). From that I can do a variety of
> > fun things, like make an ad-hoc CREATE TABLE query to recreate the table
> > in a different database...
> >
> > UNFORTUNTATELY, I did this in Visual Basic... and I would like to
> > recreate it in a Perl script, using Win32::ODBC (or any other means).
>
> I suggest you use DBI and DBD::ODBC because a) it will be much more
> portable between databases than Win32::ODBC and b) there already exists
> a recordset module for it -- DBIx::Recordset -- which may either save
> you work or give you pointers.
>
> --
> Jeff
------------------------------
Date: Mon, 15 Nov 1999 03:50:12 -0600
From: "Robert D. Nelander" <nelander@ais.net>
Subject: IPC with Media Player?
Message-Id: <XHQX3.4$8n1.149@news.ais.net>
I want to set up interprocess communication between a Win32 app, like Media
Player, and a Tk-based GUI. Actually, all I really need is one-way
communication, sending ALT keystrokes to the app. Obviously, as you will see
from the code below, I do not know what I am doing. Feel free to flame me
for the heights of my stupidity.
#!/usr/bin/perl -w
use Tk;
use Win32;
use Win32::Process;
use FileHandle;
use IPC::Open2;
$TITLE = "CineSkin";
$QI=undef;
$QIDVD=undef;
$WMPCMD="C:\\Program Files\\Windows Media Player\\mplayer2.exe";
$QI_OPT="";
$QI_DIR="C:\\WINDOWS";
unless($QI_DIR){$QI_DIR=".";}
### Open IPC with WMP?
my($rdr, $wtr) = (FileHandle->new, FileHandle->new);
$pid = open2($rdr, $wtr, $WMPCMD) or die "No open2: $!\n";
### Create the widget
$SKIN = MainWindow->new(-title=>"$TITLE");
$SKIN->protocol('WM_DELETE_WINDOW', \&skin_exit);
$SKINFrame = $SKIN->Frame()->pack;
$PlayButton = $SKINFrame->Button(
-text=>Play,
-command=>\&QI_PLAY);
$PlayButton->configure(-width=>3,-relief=>"raised");
$PlayButton->pack;
MainLoop;
### the PLAY button
sub QI_PLAY {
### ??? how do I send simulated keystrokes
### ??? to the IPC'd WMP (like to send ALT?)
print $wtr "Alt-P\n";
}
### the exit routine
sub skin_exit {
if(defined $wtr) {undef $wtr;}
if(defined $rdr) {undef $rdr;}
exit;
}
------------------------------
Date: Mon, 15 Nov 1999 10:15:01 +0100
From: Eduardo =?iso-8859-1?Q?Hern=E1ndez?= Gil <eh57@tid.es>
Subject: Making http requests with extra headers
Message-Id: <382FCF15.D2613F89@tid.es>
Hi!
I want to make a request of some web pages and store then on the disk
using perl, but I don't know how. The main problem is that, apart from
the normal request header I have to send some extra info in the header:
cookies and some "post" information send by a form.
How can I do it? Is there any program around doing something similar?
Do I need any special module/s?
Thanks in advance!
Eduardo
--
+--------------------------------=/|=---------------------------------+
| Eduardo Hernández || TELEFONICA I + D |
| Pruebas de Sistemas Red IP || ================ |
| e-mail: eh57@tid.es (\||/) Emilio Vargas, 6 |
| Tlf: 34 91 3379878 )||( 28043 Madrid (Spain) |
+-------------------------------(____)--------------------------------+
------------------------------
Date: Mon, 15 Nov 1999 12:20:06 +0800
From: Eugene Grosbein <eugen@svzserv.kemerovo.su>
Subject: Re: Need ODBC Driver for Rdb 6.0
Message-Id: <382F89F6.270722AF@svzserv.kemerovo.su>
> The only way I can see you achieving this connectivity is via a Win32
> Gateway machine if you can obtain a Win32 ODBC Driver for RDB which I
> do believe is bundled with it.
Yes, it works. Really, I get data from Rdb exactly in this way now :)
But, my goal is to exclude that Windows NT machine from the chain.
>
> You could than use our FreeBSD ODBC client, ODBC agent for Win32 and
> Rdb Win32 ODBC Driver to connect to the Rdb server. Please view the
> folowing URL for details onhow to use our ODBC agent:
>
> http://www.openlinksw.com/info/docs/rel3doc/unix/odbcsdk.htm
I tried iODBC, OpenLink Request Broker - nothing supports Rdb 6.0.
OpenLink Request Broker is a great thing, it could be perfect solution.
Does anybody know, are there any plans to include Rdb support to
OpenLink Request Broker?
Cannot be true that there is no way to connect to VAX/Rdb from UNIX without
using WIN32!
Eugene Grosbein
------------------------------
Date: 15 Nov 1999 07:26:16 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Newbee needs some date functions . . .
Message-Id: <80ocio$5h6$1@nntp2.atl.mindspring.net>
Simon Brook (no@spam.com) wrote:
: (having also been asked whether I wanted it all in that format). Well I am
: also using Personal Web Server (damned annoying that it really doesn't seem
: to want to run cgi scripts etc - any suggestions?) and have been able to use
The best way to avoid problems with PWS is not to use it. I'd suggest
installing Apache, now that it's got a decent Win32 version; it installed
for me right out of the box, and most of the configuration time I spent
was just getting the directory structure to mirror the one on my Web host.
------------------------------
Date: 15 Nov 1999 09:48:40 GMT
From: ace@XX-iki.fi (Jani Lahti)
Subject: Re: Newbie: Secure DBI connection
Message-Id: <80okto$163$1@baker.cc.tut.fi>
"Craig Vincent" <webmaster@webdream.com> writes:
>Very sensitive information is to be passed between the two servers and I'm
>looking for a way to secure any information being passed from the webhost
> to the database and vice versa (on port 3306).
>Any suggestions of either securing the protocol or just the port itself
You could set up ip port forwarding by SSH between the hosts. It's
easily set up (no modifications to the code) and secure. You get
encryption, authentication and access restriction features.
//jani
--
jani.lahti@XX-iki.fi -- http://www.iki.fi/jani.lahti/ -- 050 345 0030
Todelliset kunniamerkit näkyvät vain saunassa. -- T.Rautavaara
------------------------------
Date: Mon, 15 Nov 1999 09:35:09 +0100
From: Thomas Benedek <r7768c@email.sps.mot.com>
Subject: Problems with h2xs
Message-Id: <382FC5BD.E56B1F02@email.sps.mot.com>
Hello, folks!
Last week I posted a question about the h2xs-command.
I wanted to make the first example of the h2xs manual. (Hello, World!)
I got the following error message :
thomasb_rawaki 97 perl hello
Can't load 'blib/arch/auto/hello/hello.so' for module hello: ld.so.1: perl: fatal: relocation error: file blib/arch/auto/hello/hello.so: : referenced symbol not found at
/tools/gnu/lib/perl5/DynaLoader.pm line 140.
at blib/lib/hello.pm line 19
BEGIN failed--compilation aborted at hello line 5.
I didnt quite understand this error message, because I wonder what a "symbol Perl_stack_sp" is looked for.
I got the tip to search in the wright path blib. But this didnt work. When someone could explain to me
what this error message means, it would be great.
What confuses me most is the fact that I tried the same procedure on the same system (Solaris) at the
University, and it worked without any errors. What could be the reason for such a behavior?
Thanx
Thomas
---------------------
Thomas Benedek
---------------------
------------------------------
Date: Sun, 14 Nov 1999 23:54:34 -0800
From: mbudash@wcws.com (Michael Budash)
Subject: Re: Range operators: two dots v.s. three dots
Message-Id: <mbudash-1411992354340001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>
In article <7vlnis$j0c@netnews.hinet.net>, "John Lin"
<johnlin@chttl.com.tw> wrote:
> Hi,
> I see the two dot operator '..' and three dot operator '...' in perlop.
> Without examples, I can't understand the difference.
>
> for(a..z) { print }
> for(a...z) { print } # the same!
>
> while(<>) { print if 1..5 }
> while(<>) { print if 1...5 } # the same!
>
> Would you help? Thanks.
'perldoc perlop' and scan for 'Range Operator'
hth-
--
Michael Budash ~~~~~~~~~~ mbudash@wcws.com
------------------------------
Date: Sun, 14 Nov 1999 21:54:50 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: sort lists together
Message-Id: <MPG.129940005ecc154498a201@nntp.hpl.hp.com>
In article <x73du8yatd.fsf@home.sysarch.com> on 14 Nov 1999 17:20:46 -
0500, Uri Guttman <uri@sysarch.com> says...
> >>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
>
> LR> In article <x7d7tdx8p0.fsf@home.sysarch.com> on 14 Nov 1999 12:51:55 -
> LR> 0500, Uri Guttman <uri@sysarch.com> says...
>
> >> also you should label that (and larry should too) as an index sort.
>
> LR> Er, um, I did. You must have seen my post of the code, or you wouldn't
> LR> have mentioned me. But this was there too:
>
> LR> That is good advice, applicable if you are willing and able to
> LR> manipulate two-level data structures. Nevertheless, there is a
> LR> simple solution to the problem as posed -- the index sort.
>
> musta missed it. good boy! :-)
Arf! Arf!
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 15 Nov 1999 01:23:55 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: sort lists together
Message-Id: <slrn82vdes.cvu.abigail@alexandra.delanet.com>
Uri Guttman (uri@sysarch.com) wrote on MMCCLXVII September MCMXCIII in
<URL:news:x7u2mowet3.fsf@home.sysarch.com>:
// >>>>> "A" == Abigail <abigail@delanet.com> writes:
//
// A> I'm not really happy with the name "index sort".
//
// index sort is the well known name for that variation/transform. the
// underlying sort algorithm gets its own name. you can do an index sort
// with quick, bubble, shell, etc., sorts. so take your complaint up with
// the sort algorithm textbooks and academia.
I must be reading different textbooks than you. Neither Knuth, Cormen,
Leiserson and Rivest, Harrel, or Orwant, Hietaniemi and Macdonald have
the term 'index sort' in their index. Nor can I remember stumbling upon
the name in the 10 years I spend at academic institutions.
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: Mon, 15 Nov 1999 10:56:13 +0100
From: Eduard Keilholz <E.Keilholz@BrightSite.nl>
Subject: SQL query problems (newbie)
Message-Id: <382FD8BD.D91BC5AD@BrightSite.nl>
Hello peeps,
Want to fill a database with information, but is doens't work... I
created a table calles ComUsers (see below)
$dbh = Mysql->Connect($host,$file,$user) or die "Can't connect to $file
: $Mysql::db_errstr\n";
$dbh->Query("\
create table ComUsers(
Key_no char(10) not null,
UIN char(10),
Pass char(10),
FirstName char(20),
LastName char(20),
Addres char(30),
HouseNr char(4),
E_Mail char(30),
Zip char(8),
City char(30),
Country char(20),
primary key (Key_no))") || die "query: create.. returned:
$Mysql::db_errstr\n";
It seems this works, now I want to fill this table with information.. I
used the next sub
sub PlaceInDB(){
&DoConnect("","DBName","root");
open (users, "users/userfile");
while ($Line = <users>){
chop $Line;
($Last, $First, $UIN, $Pass, $Address, $HouseNr, $ZIP,
$Country, $City, $Mailaddr) = split (/\:/, $Line);
if ($UUser eq $UIN){
$dbh->Query(insert into ComUsers values
('$UIN','$First','$Last','Address','$HouseNr',
'$Mailassr','ZIP','$City','$Country')) || die "query: InsertData
returned: $Mysql::db_errstr\n";
}
}
close users;
}
UserFile is just a textfile with information seperated by : signs. This
file is a kind of temporary file with some information about deactivated
users in it. Now when a user gets activated, I want the information out
of the textfile, and stored in a MySQL database. Everything runs fine,
but only the SQL Query doesn't work... Is there anybody who can tell me
what's wrong?
thnx Eduard
------------------------------
Date: Mon, 15 Nov 1999 15:35:55 +0800
From: Veronica <ronnie@post1.com>
Subject: Stripping off ^Ms from file
Message-Id: <382FB7DB.48396A27@post1.com>
Hi all,
I have an Oracle database on a Unix box. On it, I use the DBI module in
perl to SELECT an "address" field from the database, and write it to
file. For users who input the "address" field into the database via a
Windows machine, when the "address" field is saved to file, I get ^M
characters where the users had pressed "ENTER" on their Windows
machines.
I've tried to strip off these characters using "binmode" and
"tr/\015//d;", but was not successful. Does anyone know how to remove
the ^M characters?
TIA,
Veronica
------------------------------
Date: Mon, 15 Nov 1999 08:15:08 +0000
From: "Ryan T. Rhea" <zzrhear@pobox.winthrop.edu>
Subject: Re: Stripping off ^Ms from file
Message-Id: <382FC10C.4B023673@pobox.winthrop.edu>
Veronica wrote:
> Hi all,
>
> I have an Oracle database on a Unix box. On it, I use the DBI module in
> perl to SELECT an "address" field from the database, and write it to
> file. For users who input the "address" field into the database via a
> Windows machine, when the "address" field is saved to file, I get ^M
> characters where the users had pressed "ENTER" on their Windows
> machines.
>
> I've tried to strip off these characters using "binmode" and
> "tr/\015//d;", but was not successful. Does anyone know how to remove
> the ^M characters?
>
> TIA,
> Veronica
Veronica,
Maybe you can use the chop() function. For example if you had an open
file ADDRESSBOOK, with a variable $address:
open(ADDRESSBOOK, "/home/veronica/addressbook");
while ($address = <ADDRESSBOOK>) {
chop($address);
print ADDRESSBOOK $address;
}
Hope that helps,
Ryan
------------------------------
Date: Mon, 15 Nov 1999 10:37:51 GMT
From: kazz@ashernet.net (Kazz)
Subject: SYMLINK in a CGI program?
Message-Id: <382fe1ea.378310752@news.pajo.com>
Is it possible to create a symlink or hard link from within a cgi
program. I'm trying to make a separate /etc /bin and /lib directory
for new ftp users because of a chroot. But, some files in /lib are 3
meg and I would like to simply link to them if possible...
What code would be used to accomplish what seems so simple.
Thanx
------------------------------
Date: Mon, 15 Nov 1999 19:02:16 GMT
From: hoz@rocketmail.com (hoz)
Subject: Re: Too much Perl?
Message-Id: <383057e2.81008223@news.netvision.net.il>
I find its not so much what *I* want to do, its what the market wants.
I am trying to stay true to Perl, I like it, comes very natural to me
while I find when writing/learning C code I often smash my head
against the wall. However in my part of the world, perl has no
respect, everyone is looking for C/C++, or Java for system stuff, and
(gasp) ASP for web development, seems the cgi-bin has dropped off the
job map. What to do?
-hoz
On Sat, 13 Nov 1999 20:21:40 GMT, kragen@dnaco.net (Kragen Sitaker)
wrote:
>In article <slinberg-1211991404500001@bsg-ma2d-179.ix.netcom.com>,
>Steve Linberg <slinberg@crocker.com> wrote:
>>I still feel, though, that I need to get back to doing more C. C is the
>>mother tongue, after all, and I feel I'm being disloyal to the mother.
>>Perl is doing too much work for me, managing all my variables and memory,
>>giving me English-like constructs to manipulate text and language with.
>>It's gotten too easy. I've forgotten how to write a complete application
>>with an interface. In a way, I fear I'm losing my edge as a
>>once-hard-core, close-to-the-iron programmer. Perl lets me do wonderful
>>things, but I feel I'm a little too removed from the metal. I don't want
>>to wake up a script kiddie one day.
>>
>>Just wondering if any other Perl hackers experience this sensation. Maybe
>>it's the uptight blueblood Yankee in me, feeling that I'm not suffering
>>enough and that I need more penance, that I've got it too easy. :) Maybe
>>people in Californina don't experience this. I wonder.
>
>Yes, I feel this way sometimes. Occasionally, because of this feeling,
>I have done the following things:
>- walk from town to town instead of driving;
>- read my email with 'less' instead of using a mailreader;
>- buy Apple IIs with plans of writing assembly for them;
>- send email by editing a file with 'vi' and then handing it to
> sendmail instead of using a mailreader;
>- read HTML with 'less' instead of using a web browser;
>- use a Sun 3/60 running NetBSD as my desktop machine;
>- write programs in Forth;
>- build concrete molds to help friends pour their garage foundations;
>- bicycle to work;
>- use IRC via telnet ircserver 6667.
>
>But I generally go back to more convenient ways of doing things.
>
>I write things in C sometimes, but mostly when the problem isn't any
>better suited to Perl than to C.
>--
><kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
>The Internet stock bubble didn't burst on 1999-11-08. Hurrah!
><URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Mon, 15 Nov 1999 09:26:32 GMT
From: Jeremy Gurney <c4jgurney@my-deja.com>
Subject: Re: Use perl with SAS and MS Access?
Message-Id: <80ojk6$meb$1@nnrp1.deja.com>
In article <80fj5q$jn7$1@nnrp1.deja.com>,
jkort@wimberley-tx.com wrote:
> I need to compare SAS datasets to MS Access tables. Can't afford SAS
> license
The cheapest way to get at the data in the SAS data sets is to use the
SAS system viewer (free from SAS) which you can use to dump the data
out into text files. Doing the same from access doesn't look too
difficult. Once you have the data out in this way setting up something
to compare them in perl should be fairly straight forward.
Of course this is far from the easiest way, spending a little money on a
good data conversion utility would probably save you a lot of time and
effort.
Regards,
Jeremy Gurney
SAS Programmer | Proteus Molecular Design Ltd.
"If at first you don't succeed - use a bigger hammer"
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 1379
**************************************