[11274] in Perl-Users-Digest
Perl-Users Digest, Issue: 4874 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 11 20:07:18 1999
Date: Thu, 11 Feb 99 17:00:38 -0800
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, 11 Feb 1999 Volume: 8 Number: 4874
Today's topics:
(JOBS) Web/Perl Programming in Utah (Jason)
Re: a secure way to do a "rsh"? (I R A Aggie)
Re: Bug and cool debugging technique (5.004_04) (David Combs)
Re: change column of nmbers to 2 dim array <jglascoe@giss.nasa.gov>
Re: Comments in Perl code (Ilya Zakharevich)
Content-type: application/pdf breaks in MS IE3.02 Steve_Shriver@scp14.bcbsnc.com
Re: Content-type: application/pdf breaks in MS IE3.02 (Sam Holden)
cron <webdude@mcminn.net>
cut and paste between windows programs jhunpingco@my-dejanews.com
Re: Date problem (Larry Rosler)
Re: Get current URL <technet@cyberghost.org>
Re: How do I delete a hash element ?? (Sam Holden)
Re: Is there another way <rlally1@nycap.rr.com>
Re: Need Perl Tcl/Tk for Linux <palincss@his.com>
Re: newbie: hitcounter (I R A Aggie)
Re: newbie: hitcounter <flavell@mail.cern.ch>
Re: newbie: hitcounter (I R A Aggie)
No put my page in the cache... How? dragnovich@my-dejanews.com
Re: No put my page in the cache... How? (Sam Holden)
ODBC question <ramune@zarathustra.calstatela.edu>
Re: Parenthetical Expressions <jglascoe@giss.nasa.gov>
Re: Perl 'zine (Bart Lateur)
Perl function to reboot NT Server? <gbuehler@NOSPAMmed.unc.edu>
Re: Perl function to reboot NT Server? (Alastair)
Re: perl not always in /usr/bin/perl (David Combs)
PFR: Julian Date (Gregory Snow)
Re: Regexp Query <revjack@radix.net>
Re: Regular expressions and handleing new lines <jwarner@texas.net>
silly simple query <gavin@optus.net.au.dontspam.myass>
Re: silly simple query <jglascoe@giss.nasa.gov>
Socket issues with 5.005_2 on Solaris 2.7 ? <richard_england@mentorg.com>
Re: String splitting. <palincss@his.com>
True sysopen on Win32 for IOCTLs to disks? <sergey@boxhill.com>
unique hashnames <mgcook@ic.delcoelect.com>
Re: unique hashnames (Albert W. Dorrington)
Re: unique hashnames <ludlow@us.ibm.com>
Re: Unix to DOS linefeed conversion? scraig@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Feb 1999 23:20:30 GMT
From: robobob@blech.mindwell.com (Jason)
Subject: (JOBS) Web/Perl Programming in Utah
Message-Id: <slrn7c6pdt.ar7.robobob@blech.mindwell.com>
Perl Programmer Wanted
MediaBANG!, a rapidly growing Internet Publishing company, is looking to add
another perl hacker to our team. Required skills include a strong background
in perl, CGI, DBI, SQL, and related buzzwords. Prefer experience with
Roxen, Apache, MySQL, Linux, etc. Javascript/C/C++/Java a plus.
Email or fax resumes to Jason Kohles <jason@mediabang.com>.
MediaBANG! http://www.mediabang.com/
159 West Pierpont Avenue Phone: (801)364-0185
Salt Lake City, UT 84101 Fax: (801)364-0186
--
Jason Kohles -- jason@mediabang.com
http://www.mediabang.com/
"This is as bad as it can get, but don't bet on it."
------------------------------
Date: 11 Feb 1999 21:40:36 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: a secure way to do a "rsh"?
Message-Id: <slrn7c6jna.cgb.fl_aggie@enso.coaps.fsu.edu>
On Thu, 11 Feb 1999 13:56:04 GMT, wil <wmwilson1@go.com> wrote:
+ Additional info: Apache is on on box, I'd like to be able to dynamically get
+ the status of some backups on other boxes. Currently I have a script cron'd
+ once daily that runs on the remote box with output going into my NFS mounted
+ home directory which is then copied to the Apache directory, but this is time
+ consuming and not dynamic. Any suggestions would be appreciated.
You may want to consider writting a server to run on the box you'd
like to contact, then just make a connection to the port it listens
on, and transfer the information directly.
You'll want to take a look at Chapter 17 of the Perl Cookbook for
both the client and server parts.
James
------------------------------
Date: Thu, 11 Feb 1999 22:36:17 GMT
From: dkcombs@netcom.com (David Combs)
Subject: Re: Bug and cool debugging technique (5.004_04)
Message-Id: <dkcombsF70HGH.KyI@netcom.com>
In article <36C0307E.BCB3108A@tcon.net>,
Ken McNamara <conmara@tcon.net> wrote:
>AJS -
>
>I tried something similiar and it dumped me out of debugger on 5.005_54 - then I
>read the manual.
>
>"GOTO...may not be used to go inside any construct that requires initialization."
>
>I think that's the problem.
>
Good lord! Can't the COMPILER catch something like that?
(What a weird restriction to have to memorize!)
------------------------------
Date: Thu, 11 Feb 1999 17:42:36 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: change column of nmbers to 2 dim array
Message-Id: <36C35CDC.9BDB0EBC@giss.nasa.gov>
[courtesy cc of this posting sent to cited author, Bart]
Bart Lateur wrote:
>
> Besides, what do you find so attractive in:
>
> map BLOCK LIST;
>
> over:
>
> foreach (LIST) BLOCK
>
> ?
> Bart.
I hold this truth to be self-evident ;)
so-called "higher order" functions (aka functionals)
are fundamentally cooler than looping constructs.
I'm pretty sure Randal would agree with me on that.
map and grep (aka "filter") are standard fare for functional
languages.
But then, "foreach (LIST) { fun(shift()) }" is basically
similar to, say, Scheme's "for-each", "(for-each fun lst)"
In fact, with functionals and recursion, iterative constructs
(while, for, foreach, do...) only exist for the benefit of TMTOWTDI.
Jay Glascoe
--
hmm.
------------------------------
Date: 11 Feb 1999 23:00:30 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Comments in Perl code
Message-Id: <79vnee$nu$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Russ Allbery
<rra@stanford.edu>],
who wrote in article <ylsocc7kl2.fsf@windlord.stanford.edu>:
> >> % perl -pi.bak -e 's/\#.*$//' file.pl
> > ^ ^
> > Why?
>
> The trailing $ clearly isn't needed, true.
In this particular case, yes. But without -p it would changes the semantic.
> The backslash before the # is
> a habit I'm in as well since it unconfuses cperl-mode's syntax
> highlighting, which otherwise is under the impression the rest of the
> expression is a comment.
Only on primitive Emaxen. On RMS's Emacs 20.3 CPerl has no problem
with this.
>
> There are a few odd nits like that with cperl-mode (dealing with (\s|$) in
> a regex is another one), some of which may be related to the fact that I'm
> still using emacs 19.34 and therefore don't have the benefit of the new
> parsing code that's supposedly in emacs 20. (But for doubters, cperl-mode
> works wonderfully the vast majority of the time and makes writing and
> debugging Perl considerably faster.)
The patches for 19.34 are available (including CPAN). I use 19.33 myself.
Ilya
------------------------------
Date: Fri, 12 Feb 1999 00:22:35 GMT
From: Steve_Shriver@scp14.bcbsnc.com
Subject: Content-type: application/pdf breaks in MS IE3.02
Message-Id: <79vs80$set$1@nnrp1.dejanews.com>
Greetings, I wrote a program to securely provide access to PDF files on our
intranet. Basically, the user (a manager) deposits a token into a web page
that returns a PDF file of a resume. The cgi works wonderfully with NN4.0 but
intermittantly or not at all in IE3.02 (the corporate standard).
Any clues as to why this code wouldn't work with IE?
Thanks,
Steve
Here's the snipit:
elsif ( @results = &query_database($token) )
{
## if token does exist display the pdf file
$pdf_file = $g_res_fs_dir . "/" . "$results[2]";
## if ( open(IN, "< $pdf_file") )
if ( -s $pdf_file )
{
$bytes = (stat ($pdf_file))[7];
open(IN, "< $pdf_file") or die "Error opening file: $!\n ";
print "Content-type: application/pdf\n";
print "Content-length: $bytes\n\n";
while (read IN, $buf, 4096)
{
print $buf;
}
close(IN);
}
else
{
## print an error message, cannot open file
$errMsg = &errorText("The file $pdf_file could not be opened. Please
contact the Recruiter.");
&getTokenHTML($errMsg);
}
}
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 12 Feb 1999 00:35:43 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Content-type: application/pdf breaks in MS IE3.02
Message-Id: <slrn7c6tqv.nrc.sholden@pgrad.cs.usyd.edu.au>
Steve_Shriver@scp14.bcbsnc.com <Steve_Shriver@scp14.bcbsnc.com> wrote:
>Greetings, I wrote a program to securely provide access to PDF files on our
>intranet. Basically, the user (a manager) deposits a token into a web page
>that returns a PDF file of a resume. The cgi works wonderfully with NN4.0 but
>intermittantly or not at all in IE3.02 (the corporate standard).
>
>Any clues as to why this code wouldn't work with IE?
It's not a perl problem obviously. Maybe IE isn't set up correctly, maybe
your not following the protocol properly and Netscape is more forgiving
than IE.
It's got nothing to do with perl though, try asking in a newsgroup a bit
more related to web stuff...
--
Sam
There's no such thing as a simple cache bug.
--Rob Pike
------------------------------
Date: Thu, 11 Feb 1999 22:12:57 GMT
From: "JJ" <webdude@mcminn.net>
Subject: cron
Message-Id: <JBIw2.479$Al6.356946@news1.usit.net>
Does anyone know of a way to do a type of cron with cgi? I cant get my isp
to set up anything for me in cron..
what I want to do is update a page automatically every 3 days
------------------------------
Date: Thu, 11 Feb 1999 22:20:07 GMT
From: jhunpingco@my-dejanews.com
Subject: cut and paste between windows programs
Message-Id: <79vl2c$m1f$1@nnrp1.dejanews.com>
Hi,
I've used PERL on unix machines for some time. However, now that I have
to use winNT machines, I find myself cutting and pasting interactively
between two windows applications. I probably do this a hundred times a day or
more
and was wondering if there were a way to do this with PERL in winNT. Ideally,
I'd like to highlight the text in one application, hit a key, and have that
text pasted into the other application immediately.
There must be a way to do this, but I don't know how. Do you?
Thanks.
-jose
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 11 Feb 1999 13:23:23 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Date problem
Message-Id: <MPG.112cea26d1ab0a3e989a23@nntp.hpl.hp.com>
In article <Pine.A41.4.02.9902111537450.25262-
100000@ginger.libs.uga.edu> on Thu, 11 Feb 1999 15:48:20 -0500, Brad
Baxter <bmb@ginger.libs.uga.edu> says...
> On Thu, 11 Feb 1999, Jim Eichert wrote:
> > I am new to this group and relatively new to PERL. I was wondering if
> > anybody could tell me how to get "yesterday's date" in DMY format. I
> > know how to find "today's date" using the timelocal function. I simply
> > can't subtract 1 day from the current day because I need to take into
> > consideration leap seconds. If there was a Julian day function(s) which
> > could translate DMY into Julian day and another one to do the reverse
> > this would help since I could subtract 1 from Julian day. Any
> > suggestions?
>
> I love it.
>
> Jim, what I mean is, if you had been here yesterday, you'd have seen the
> answer! I know I'm not being helpful, but you'll get that once in a
> while. :-)
No he wouldn't, because he needs to take into consideration leap
seconds!
He might try a DejaNews search for 'leap second'. He would find that
the ISO date/time standard used by computers doesn't take them into
account at all. Every year has (365 or 366) * 24 * 60 * 60 seconds.
That way lies sanity for programmers, if not correctness.
So the Julian date scale used by astronomers and the Unix epoch are
inexorably drifting apart, and I know of no available code to correct
the problem. (It would have to be table-driven, because the leap
seconds are added occasionally, with no algorithm other than that they
occur only on six-month boundaries.)
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 11 Feb 1999 18:57:12 -0500
From: TechNET Staff <technet@cyberghost.org>
Subject: Re: Get current URL
Message-Id: <36C36E57.F6E91B4A@cyberghost.org>
I had a customer ask that last week so I wipped this up... You can't launch a
perl script (that I know of) by default when someone goes to your homepage, so
in the index.htm file, I used a meta tag redirecting them to the perl script
after 1 second. I hope this helps...
# Check $env (HTTP_HOST) for the domain name.
if ($ENV{HTTP_HOST} eq 'domain1.com') {
print "Location: /home1.htm\n\n";
}
elsif ($ENV{HTTP_HOST} eq 'domain2.org') {
print "Location: /home2.htm\n\n";
}
# If nothing matches, but they still ended up here, send them here:
else {
print "Location: http://www.domain.com\n\n";
}
* end
Tim Walker
Cyber Ghost Technet
http://www.cyberghost.org
Leslie Perjes wrote:
> Hello,
>
> I would like to point more than domain names to one IP number. After I would
> like to separate them to several starting pages. Is this possible by Perl?
> SERVER_NAME environent variabe will get correctly different domain names?
> Please help, and copy the answers to my e-mail address. PHP and Phyton
> availabe, but I would like to use Perl is possible.
>
> thanks,
> Leslie
>
> -------------------
> Message from:
> Leslie Perjes (Hungary)
> E-mail: lezli@lezlisoft.com
> URL: http://www.lezlisoft.com
------------------------------
Date: 12 Feb 1999 00:03:28 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: How do I delete a hash element ??
Message-Id: <slrn7c6rug.nrc.sholden@pgrad.cs.usyd.edu.au>
On Thu, 11 Feb 1999 12:56:02 -0800, Larry Rosler <lr@hpl.hp.com> wrote:
>In article <79vdhk$h4h$3@client2.news.psi.net> on 11 Feb 1999 20:11:32
>GMT, Abigail <abigail@fnx.com> says...
>> paulosa@gcm.com (paulosa@gcm.com) wrote on MCMLXXXIX September MCMXCIII
>> in <URL:news:79suim$acg$1@nnrp1.dejanews.com>:
>> || I tried "undef" does not work.
>> ||
>> || ex:
>> ||
>> || $hash{test} = "test";
>> || undef $hash{test};
>> ||
>> || does not remove 'test' from the hash?? any ideas!
>>
>> Did you search for 'delete' in the man page?
>
>The technical term for your response is 'begging the question'.
>
>He might have searched for 'undefine', 'remove', 'erase', 'expunge',
>'cancel', 'efface', or 'obliterate', and not found it. But 'delete'
>*would* have found it, because that's the answer.
Except that he used 'delete' in the question and thus should have at least
had a look for that. If he had used 'obliterate' in the question then, it
would be a little extreme to expect all the synonyms to be looked up.
Seeing that the poster considered it to be 'delete' surely it is valid to
expect them to at least search for that particular word.
The first thing I would have done is 'perldoc -q delete' which gives the
solution as the first hit. Not because I know delete is the answer, but
because that is obviously the word the poster uses to describe what they
want.
--
Sam
Can you sum up plan 9 in layman's terms? It does everything Unix does
only less reliably.
--Ken Thompson
------------------------------
Date: Thu, 11 Feb 1999 23:16:02 GMT
From: "Bob Lally" <rlally1@nycap.rr.com>
Subject: Re: Is there another way
Message-Id: <SwJw2.1891$Y_1.33657@typhoon.nycap.rr.com>
Hi:
I found the docs and got everything working. The script checks the last 3
characters. If a country code (with a prepended period -- .au) then display
a welcome message.
Of course, in the US you rarely find a Domain Name with the USA extension.
I had to ask some friends in foreign countries to test it out!
Bob
Abigail <abigail@fnx.com> wrote in message
news:79vdmd$h4h$5@client2.news.psi.net...
>Bob Lally (rlally1@nycap.rr.com) wrote on MCMLXXXIX September MCMXCIII in
><URL:news:N77w2.3491$YL3.211972@typhoon.nycap.rr.com>:
>() Hi:
>()
>() I have a variable that contains an ISO country code. I want to output
text
>() depending on which country is coming in. I realize that not all domain
names
>() conform. I have it currently designed with IF statements. Does perl
have a
>() "switch" type statement? Should I use else's for every statement after
the
>() first? What method would be best to save time?
>
>Did you search the documentation for 'switch'? Yes? Then what part
>of didn't you understand?
>
>
>
>
>Abigail
>--
>perl -wle '(1 x $_) !~ /^(11+)\1+$/ && print while ++ $_'
------------------------------
Date: Thu, 11 Feb 1999 19:54:28 -0500
From: Steve Palincsar <palincss@his.com>
Subject: Re: Need Perl Tcl/Tk for Linux
Message-Id: <36C37BC4.4C696C2C@his.com>
The latest available in an RPM format I could find the
other day was perl-Tk-800.010-3TL.i386.rpm, which I
found searching on google for "perl tk" - but it wouldn't
run with the 5.004 perl variant on my RH5.1 system; nor
could I build the source Tk800.012.tar.gz I found on CPAN.
So I had to build 5.005 from source, then install Tk.
The good news is, it built perfectly by accepting all the
defaults, and the Tk demo ran flawlessly.
KC wrote:
>
> Where can I download the Perl Tcl/Tk module for linux. I found it once
> but can't anymore.
> --
>
> KC
------------------------------
Date: 11 Feb 1999 21:46:50 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: newbie: hitcounter
Message-Id: <slrn7c6k33.cgb.fl_aggie@enso.coaps.fsu.edu>
On Thu, 11 Feb 1999 11:20:04 -0500, John <john@inetpres.com> wrote:
+ and/or show me what to look out for?
Hitcounters lie. They don't tell you what you think they do.
James
------------------------------
Date: Thu, 11 Feb 1999 23:17:58 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: newbie: hitcounter
Message-Id: <Pine.HPP.3.95a.990211231559.6790A-100000@hpplus01.cern.ch>
On 11 Feb 1999, I R A Aggie wrote:
> Hitcounters lie.
Nope, they count exactly what they count.
> They don't tell you what you think they do.
Ah, but that's different. If I tell you the truth, and you
misunderstand what I've told you, you can hardly claim that
I was lying.
------------------------------
Date: 11 Feb 1999 23:33:19 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: newbie: hitcounter
Message-Id: <slrn7c6qap.dtq.fl_aggie@enso.coaps.fsu.edu>
On Thu, 11 Feb 1999 23:17:58 +0100, Alan J. Flavell
<flavell@mail.cern.ch> wrote:
+ On 11 Feb 1999, I R A Aggie wrote:
+ > Hitcounters lie.
+ Nope, they count exactly what they count.
You're right. They're mis-named. "Number of requests for this page to this
web server" may be more descriptive?
+ > They don't tell you what you think they do.
+ Ah, but that's different. If I tell you the truth, and you
+ misunderstand what I've told you, you can hardly claim that
+ I was lying.
"Inconceivable!"
James
------------------------------
Date: Thu, 11 Feb 1999 23:51:26 GMT
From: dragnovich@my-dejanews.com
Subject: No put my page in the cache... How?
Message-Id: <79vqdq$qsd$1@nnrp1.dejanews.com>
Hello, I have a little problem I have a perl program that generates some pages
the problem is that I DONT WANT TO THAT PAGE be saved on the cache of the
visitor browser...
So how do I do this!
Some body tell me that I can do this...
print "Content-type: text/html\n\n";
print "<META HTTP-EQUIV=\"Cache-control\" CONTENT=\"no-cache\">\n"
But it dont works! or what Im doing wrong ?? thanks!
------------------------
Juan Carlos Lopez
QDesigns President & CEO
http://www.qdesigns.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 12 Feb 1999 00:25:25 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: No put my page in the cache... How?
Message-Id: <slrn7c6t7l.nrc.sholden@pgrad.cs.usyd.edu.au>
dragnovich@my-dejanews.com <dragnovich@my-dejanews.com> wrote:
>Hello, I have a little problem I have a perl program that generates some pages
>the problem is that I DONT WANT TO THAT PAGE be saved on the cache of the
>visitor browser...
>
>So how do I do this!
>
>Some body tell me that I can do this...
>print "Content-type: text/html\n\n";
>print "<META HTTP-EQUIV=\"Cache-control\" CONTENT=\"no-cache\">\n"
>
>But it dont works! or what Im doing wrong ?? thanks!
This has nothing to do with perl. I suggest you ask in a more appropriate
forum. Somewhere where they talk about web stuff would be useful...
Doing something along the lines fo what you have above will not prevent
proxies from caching the pages... There's a way to do that too, ask
somewhere where the answer might be known...
--
Sam
Another result of the tyranny of Pascal is that beginners don't use
function pointers.
--Rob Pike
------------------------------
Date: 11 Feb 1999 07:32:15 -0800
From: Graffiti <ramune@zarathustra.calstatela.edu>
Subject: ODBC question
Message-Id: <79ut60$23u$1@zarathustra.calstatela.edu>
Hi all,
I'm not sure where I'm supposed to post this question, so feel
free to flame me or point out faqs/howtos/newsgroups/etc that cover
this. :-)
I'm trying to connect to a M$ SQL server from Solaris, using
Perl's ODBC module and the iodbc server.
The ~/.odbc.ini file is set up as:
[ODBC Data Sources]
accounts
[accounts]
Driver = /opt/iodbc/lib/libiodbc.so
Description = Sample OpenLink MT DSN
Host = hostname
FetchBufferSize = 99
UserName = username
Password = password
Database = accounts
ServerOptions =
ConnectOptions =
Options =
ReadOnly = no
[Default]
Driver = /opt/iodbc/lib/libiodbc.so
Description = Sample OpenLink MT DSN
Host = hostname
FetchBufferSize = 99
UserName = username
Password = password
Database = accounts
ServerOptions =
ConnectOptions =
Options =
ReadOnly = no
But I can't connect. The $dbh = DBI->connect(...) statement
hangs with perl costantly stat()'ing the ~/.odbc.ini file over and
over until I kill it.
(brk/getcontext/etc snipped)
15641: open("/home/dnobuto/.odbc.ini", O_RDONLY) = 3
15641: fstat(3, 0xEFFFDF90) = 0
15641: ioctl(3, TCGETA, 0xEFFFDF1C) Err#25 ENOTTY
15641: read(3, " [ O D B C D a t a S".., 8192) = 636
15641: read(3, 0x000C140C, 8192) = 0
15641: lseek(3, 0, SEEK_CUR) = 636
15641: close(3) = 0
15641: open("/home/dnobuto/.odbc.ini", O_RDONLY) = 3
15641: fstat(3, 0xEFFFDF90) = 0
15641: ioctl(3, TCGETA, 0xEFFFDF1C) Err#25 ENOTTY
15641: read(3, " [ O D B C D a t a S".., 8192) = 636
15641: read(3, 0x000C140C, 8192) = 0
15641: lseek(3, 0, SEEK_CUR) = 636
15641: close(3) = 0
And repeats over and over. Is this:
1) A driver problem?
2) The ODBC module problem?
3) An act of God?
4) A conspiracy to drive me insane?
I tried using Intersov's ODBC driver, but that didn't work. It
simply told me no data source was defined, even though it was
(different .ini file).
-- DN
------------------------------
Date: Thu, 11 Feb 1999 19:21:11 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: Skip Hollowell <thollowe@opentext.com>
Subject: Re: Parenthetical Expressions
Message-Id: <36C373F7.F3C1BE85@giss.nasa.gov>
[courtesy cc of this posting sent to cited author, Skip]
Skip Hollowell wrote:
>
> I have some data that I am parsing, and have come upon a unique situation.
> I need to remove any parenthetical information from my data
>
> This is (a parenthetical expression) to be deleted
> would become
> This is to be deleted
>
s#\([^)]*\)##g;
I like this because the "[^)]*" can be as greedy as it likes.
Another thing, you may need to work on a giant string rather
than a list of lines:
echo '
blah blah ( bleah
bleh BLAH) bah bah.
' | perl -ne '
@all = <>;
$all = join "", @all;
$all =~ s#\([^)]*\)##g;
print $all;
'
$ perldoc perlre | Jay
--
sig.
------------------------------
Date: Thu, 11 Feb 1999 22:51:00 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl 'zine
Message-Id: <36c55eab.13661220@news.skynet.be>
John T. Jarrett wrote:
>It's unanimous - all voters agree - don't waste any $ on glossy!
I'd rephrase that as "Don't make *us* pay for the glossy!"
Bart.
------------------------------
Date: Thu, 11 Feb 1999 18:22:15 -0500
From: "Georg Buehler" <gbuehler@NOSPAMmed.unc.edu>
Subject: Perl function to reboot NT Server?
Message-Id: <79vp3j$uc9$1@camel18.mindspring.com>
I need to programmatically reboot a Windows NT 4.0 server using Perl.
I'm sure such a function exists, but I've poured over the module
documentation in vain.
I'm currently using ActiveState's 5.00502.
Thanks,
--Georg Buehler
Elsinore Technologies, Inc.
gbuehler@elsitech.com
------------------------------
Date: Fri, 12 Feb 1999 00:09:16 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Perl function to reboot NT Server?
Message-Id: <slrn7c6sbm.5b.alastair@calliope.demon.co.uk>
Georg Buehler <gbuehler@NOSPAMmed.unc.edu> wrote:
>I need to programmatically reboot a Windows NT 4.0 server using Perl.
>
>I'm sure such a function exists, but I've poured over the module
>documentation in vain.
I guess that if there's a way to do it from an NT command line, you could use
'system' to run that command. Maybe someone knows in an NT group?
Good luck.
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Thu, 11 Feb 1999 21:56:04 GMT
From: dkcombs@netcom.com (David Combs)
Subject: Re: perl not always in /usr/bin/perl
Message-Id: <dkcombsF70FLG.H1x@netcom.com>
In article <36BB51F8.42B749F4@giss.nasa.gov>,
Jay Glascoe <jglascoe@giss.nasa.gov> wrote:
>Alan Diercks wrote:
>>
>> Is there a clever way to avoid having to edit all of my scripts to fix
>> the
>> #!/usr/bin/perl
>> line at the top for each new installation?
>
>try
>
>#! /usr/bin/env perl
>
>as long as perl is somewhere in the luser's path,
>this will find it.
Is the above a mistake? What is that space before
the "perl" in the #! line?
Thanks
------------------------------
Date: 11 Feb 1999 21:56:28 GMT
From: snow@biostat.washington.edu (Gregory Snow)
Subject: PFR: Julian Date
Message-Id: <79vjmc$8lo$1@nntp6.u.washington.edu>
In article <m3d83g92nf.fsf_-_@moiraine.dimensional.com>,
Daniel Grisinger <dgris@moiraine.dimensional.com> wrote:
>
>The Perl Function Repository-
> http://moiraine.dimensional.com/~dgris/perl/pfr/
>
>If you need to CC me on posts about code that should be in the PFR,
>feel free, but it isn't necessary. I read clpm(od|isc) religiously
>and am not likely to miss any interesting discussion. If you'd like
>to prepend `PFR:' to the subject of articles to make sure that I don't
>miss them, that would be a good thing (plus it would allow people
>uninterested in the project to easily skip articles related to it).
I've thought about doing something like this myself, but don't have
the resources. There are a bunch of things that don't really need
modules to solve, just a good function or 2 to paste into the code.
Thanks for doing this. Here is my suggestion for the next addition:
This was posted by Jeff Godden a while back (I don't take any credit),
to compute julian dates:
# ----- this will return day number 719469 for 1970/1/1
sub jday {
# note screwed up american date element ordering
my($month,$day,$year) = @_;
my($y) = $year + ($month-3)/12;
int(367*$y+0.625)-2*int($y)+int($y/4)-int($y/100)+int($y/400)+$day;
}
Note, this is off from the "usual" definition of Julian days by a
constant, but if that is important to you, then just add the constant
back in. It also does not take into account the week that was lost
when most of the world switched to the Gregorian calender, but if all
you want to do is compute the number of days between 2 recent (100
years or so) to future dates, it works fine. If there is interest,
one of these days I'll try to write the routine to go from the Julian
day to month/day/year.
Thanks again for being the one to manage the PFR.
--
-------------------------------------------------------------------------------
Gregory L. Snow | Barth's Distinction:
(Greg) | There are two types of people: those who divide
snow@biostat.washington.edu | people into two types, and those who don't.
------------------------------
Date: 11 Feb 1999 22:47:03 GMT
From: Ed Hitler <revjack@radix.net>
Subject: Re: Regexp Query
Message-Id: <79vml7$k9l$4@news1.Radix.Net>
Keywords: Hexapodia as the key insight
James Frogel explains it all:
[ assuming s/.*// ]
Seems to have worked.
--
/~\ allotropic titanic concatenate fictitious Felix excruciate Dear
C oo tempt scratchy efferent dimple additive seaward eta maintain Me
_( ^) 1 , 0 0 0 , 0 0 0 m o n k e y s c a n ' t b e w r o n g
/___~\ http://3509641275/~revjack 02/11/99 17:47:01 revjack@radix.net
------------------------------
Date: Thu, 11 Feb 1999 17:24:26 -0600
From: John Warner <jwarner@texas.net>
Subject: Re: Regular expressions and handleing new lines
Message-Id: <36C366AA.DFB81810@texas.net>
Alternatively, he could check out perlfaq4....This topic is covered there.
John
Bart Lateur wrote:
> chris_bordeleau@lotus.com wrote:
>
> >I want to have a regular expression which can scan for C++ style /* Comments
> >*/ and am having a hard time dealing with newlines which ocour inside of
> >comments.
>
> Try using the //s modifier. It makes the regex treat newlines just like
> any ordinary character.
>
> /\/\*.*?\*\//s
>
> Bart.
------------------------------
Date: Thu, 11 Feb 1999 22:04:02 GMT
From: "Gavin Cato" <gavin@optus.net.au.dontspam.myass>
Subject: silly simple query
Message-Id: <mtIw2.1$gD5.272912@news0.optus.net.au>
What would be the perl equivalent of
cat $filename | grep $variable | wc -l
i.e. I want to slurp a entire file in, and count the amount of times that a
certain piece of text is matched in that file.
Maybe something roughly to do this? (warning perl newbie)
open (FILE, "$file") || die "can't open file";
while (<FILE>) {
($string) = (split/"string to match"/) [0];
$tally = $tally + 1;
}
print "For $file, the string $string was found $tally times\n";
-
--
Gavin Cato - Optus Network Engineer - gavin@optus.net.au
gawk; talk; date; wine; grep; touch; unzip; touch; gasp; finger; gasp;
mount; \
fsck; more; yes; gasp; umount; make clean; make mrproper; sleep
------------------------------
Date: Thu, 11 Feb 1999 18:42:29 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: Gavin Cato <gavin@optus.net.au.dontspam.myass>
Subject: Re: silly simple query
Message-Id: <36C36AE5.F70F2859@giss.nasa.gov>
[courtesy cc of this posting sent to cited author]
Gavin Cato wrote:
>
> What would be the perl equivalent of
>
> cat $filename | grep $variable | wc -l
>
> i.e. I want to slurp a entire file in, and count the amount of times that a
> certain piece of text is matched in that file.
>
("grep", feel the rush!)
open FH, "< $filename" or die "BIZ!: $!";
$tally = grep { /$variable/ } (<FH>);
> Maybe something roughly to do this? (warning perl newbie)
>
> open (FILE, "$file") || die "can't open file";
> while (<FILE>) {
> ($string) = (split/"string to match"/) [0];
> $tally = $tally + 1;
> }
oh, you're solution is better. It won't choke
one *huge* files... let's try it this way:
$tally = 0;
while (<FILE>) { ++$tally if /$string/ }
> print "For $file, the string $string was found $tally times\n";
>
Jay Glascoe
--
boing.
------------------------------
Date: Thu, 11 Feb 1999 15:33:42 -0800
From: "Richard L. England" <richard_england@mentorg.com>
Subject: Socket issues with 5.005_2 on Solaris 2.7 ?
Message-Id: <36C368D5.2A296E02@mentorg.com>
I have a perl script that ran fine under 5.001 on several platforms
which now fails under 5.005_02 on Solaris 2.7 but runs on HPUX 11.00.
The failure indication is:
Socket version 1.3 required--this is only version at
/usr/mgc/lib/perl5005_02/IO/Socket.pm line 118.
Has anyone successfully built this version on Solaris 2.7?
The installation tests run with no problems. I used the same Policy
file for the builds on Solaris and HPUX and attempted to make sure the
same options were available on both.
Can anyone send me in the right direction to reconcile this? I am a
complete novice in the Sockets use area so please be gentle.
--
// Richard L. England richard_england@mentorg.com
// Mentor Graphics Corp., Wilsonville, OR 97070-7777 503.685.1240
// "The lyf so short, the craft so long to lerne." - Chaucer
------------------------------
Date: Thu, 11 Feb 1999 19:48:06 -0500
From: Steve Palincsar <palincss@his.com>
Subject: Re: String splitting.
Message-Id: <36C37A46.FA42936F@his.com>
I'm pretty sure what Frank means by "full stop" is
the character we speak of as "period". In this case,
the point is the special meaning of . in a regexp,
if that is the chosen solution.
Scratchie wrote:
>
> Frank de Bot <debot@xs4all.nl> wrote:
> : Why you don't explain it?
>
> See my previous post.
>
> : It's simple
>
> : @array = split(/ /, $string);
>
> PS: This answer is wrong!
>
> :> om7@cyberdude.com wrote:
> :> : I've got a string, something like $string = abcd.efg, say. Can someone remind
> :> : me how I would get the part of of the string before the full stop.
>
> --Art
>
> --
> --------------------------------------------------------------------------
> National Ska & Reggae Calendar
> http://www.agitators.com/calendar/
> --------------------------------------------------------------------------
------------------------------
Date: Thu, 11 Feb 1999 18:21:06 -0500
From: "Sergey Gleizer" <sergey@boxhill.com>
Subject: True sysopen on Win32 for IOCTLs to disks?
Message-Id: <79vol8$8cb$1@spider.boxhill.com>
I am hacking a NT disk filter driver with some extra functionality, that I
need to test.
To that end I want to open the \\.\PhysicalDrive0, etc and be able to issue
many funny IOCTLs to it. In a C program I use CreateFile to get a disk
handle and DeviceIoControl to abuse it.
Both 'open' and 'sysopen' in perl are returning errors for the above device
path.
Am I going to have to embed CreateFile in my own extension or do my testing
via a C test driver, or am I missing something trivial?
---Sergey
------------------------------
Date: Thu, 11 Feb 1999 16:30:36 -0800
From: "Micah G. Cook" <mgcook@ic.delcoelect.com>
Subject: unique hashnames
Message-Id: <36C3762C.2D84@ic.delcoelect.com>
I am reading in hostnames, each on separate lines in a file.
how do i create a hash with the name of the hostname?
assume i am in the loop
$name = $line #read in the name to $name
$name{"name"} = "short name" ; #does this work?
#trying to create a hash for each name i run across.
#I tried to initiate the hash by:
print "$node231{"name"}" ; #theoretically this should print "short
name"
This is on advanced level, i cant find the answer in my O'Reilly
Learning Perl , 2nd edition book.
Do you understand what I am trying to do? node231 is a name of a node
in my node_list
------------------------------
Date: 11 Feb 1999 17:04:24 -0500
From: awdorrin@mail.delcoelect.com (Albert W. Dorrington)
To: "Micah G. Cook" <mgcook@ic.delcoelect.com>
Subject: Re: unique hashnames
Message-Id: <79vk58$hp@ws051eng.delcoelect.com>
In article <36C3762C.2D84@ic.delcoelect.com>, "Micah G. Cook" <mgcook@ic.delcoelect.com> writes:
:> I am reading in hostnames, each on separate lines in a file.
:>
:> how do i create a hash with the name of the hostname?
:>
:>
:> assume i am in the loop
:>
:>
:>
:> $name = $line #read in the name to $name
:>
:> $name{"name"} = "short name" ; #does this work?
:>
:> #trying to create a hash for each name i run across.
:>
:> #I tried to initiate the hash by:
:>
:> print "$node231{"name"}" ; #theoretically this should print "short
:> name"
:>
:> This is on advanced level, i cant find the answer in my O'Reilly
:> Learning Perl , 2nd edition book.
:>
:> Do you understand what I am trying to do? node231 is a name of a node
:> in my node_list
Micah,
I assume you are trying to store the short name as
the value to the hash, and use the fully qualified name as
the hash key? If so, you could do something like the following:
open(HOSTS, "$filename");
while ( <HOSTS> ) {
$fullName = $_;
($shortName, $remainder) = split(/./, $fullName);
$hash{$fullName} = $shortName;
}
This assumes that your file contains a list (one per line)
of fully qualified domain names. Ie: ws051eng.ic.delcoelect.com
You may or may not want to do a chop/chomp on $_ or $fullName to
remove the newline character.
- Al
--
Al Dorrington
FIRMS & Web Admin, Oracle DBA Phone: 765-451-9655
IC-DELCO CIM, Delphi Delco Electronics Systems Fax: 765-451-8230
------------------------------
Date: Thu, 11 Feb 1999 16:23:05 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: unique hashnames
Message-Id: <36C35849.9E5973FD@us.ibm.com>
Micah G. Cook wrote:
> I am reading in hostnames, each on separate lines in a file.
> how do i create a hash with the name of the hostname?
[snip]
> Do you understand what I am trying to do? node231 is a name of a node
> in my node_list
Yeah, I think I see what you're trying to do. I don't think you really
want to do that though. Assuming that your node names are unique, why
not just use the names as hash keys?
my %shortNames = ();
# ... read in your node name and short name
$shortNames{$nodeName} = $shortname;
--
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)
------------------------------
Date: Thu, 11 Feb 1999 23:11:26 GMT
From: scraig@my-dejanews.com
Subject: Re: Unix to DOS linefeed conversion?
Message-Id: <79vo2l$oqe$1@nnrp1.dejanews.com>
In article <36c258ee.0@news.cgocable.net>,
tekkin@hotmail.com (Ken Williams) wrote:
> I have some text coming from a unix server that is in normal linefeed format.
> How could I use perl to convert this text to have a linefeed & carrige return
> so when it is displayed on a windows95 computer it will look proper (text is
> in a variable called $string).
The line separator you want is \r\n, a carriage return and a linefeed. If the
script on the UNIX server is Perl, just have it print out the lines with this
ending instead of \n.
If you can't change the script on the server, you can change the string with
the substitution operator
$string =~ s#(\r\n)|\n#\r\n#g;
or more simply
$string =~ s#\n#\r\n#g;
if you know that none of the lines have \r\n already.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 4874
**************************************