[6413] in Perl-Users-Digest
Perl-Users Digest, Issue: 38 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 2 22:10:55 1997
Date: Sun, 2 Mar 97 19:00:22 -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 Sun, 2 Mar 1997 Volume: 8 Number: 38
Today's topics:
'make install' never stops: Pl. Help on solaris 2.4 <kumar@getnet.com>
Re: [Q] Perl in win3.11? (Ric Harwood)
Re: `FILNAME` accesses floppy drive before current driv <dbenhur@egames.com>
Calling a Perl Program from within HTML <thorsoft@cdsnet.net>
Re: can $_ be dissociated from its contents? <dbenhur@egames.com>
Re: Can you create file on the fly with perl? (Christopher Masto)
Re: File Upload on WEB (Raul Almquist)
Re: Help! Testing Perl CGI scripts on local Windows/DO (Tad McClellan)
How can I get colored screen text using perl5? (revjack@radix.net)
Re: Interview With The Internet's Wise Guys Of Perl - W <dbenhur@egames.com>
Re: Interview With The Internet's Wise Guys Of Perl - W (Dave Thomas)
Looking for a script <rhull@ozbuild.com.au>
Modems & Perl -- examples wanted <philipp@ntex.com>
Re: parsing? <eryq@enteract.com>
Perl and Xform <brault@info.unicaen.fr>
Perl on NT 4.0 - HOW? <Jim@pbs1.com>
Re: PerlIS+Win32::ODBC - Can't call method "Sql"... <billc@tibinc.com>
redirecting STDERR <dfox@pobox.com>
Regex and Greedy for words (Yoo-Shin Lee)
Re: Regex and Greedy for words <sadd@msc.cornell.edu>
Rookie Blues:format not terminating S_Stefanis@msn.com
What's HTTP/1.0 501 Not Supported ?Run PERL In Win95 PW (C.Y. Chen)
Re: What's wrong with this Perl? <rootbeer@teleport.com>
Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 28 Feb 1997 03:02:48 GMT
From: Kumar Kakumanu <kumar@getnet.com>
Subject: 'make install' never stops: Pl. Help on solaris 2.4
Message-Id: <01bc2525.95d34580$648055ce@kakumanu.getnet.com>
Hello:
I am new to Perl; I tried to install Perl 5.002 on Sparc solaris 2.4, the
'make install'
went into some 'recursive' mode and it never stopped. I had to control-c
it.
It started creating *very* deep directories under /usr/local/lib/perl5,
some of them
had funny names like '[/'.
I had done the following.
sh Configure /* I accepted all the defaults */
make depend /* worked fine */
make /* complained about Config.pm, but when I ran it again
it indicated no errors */
make test /* worked fine */
My question is why 'make install' never stopped creating directories? Is
there something
wrong I am doing? Is Perl 5.002 a Beta?
------------------------------
Date: Mon, 03 Mar 1997 02:37:09 GMT
From: ric@discoveryinternational.com (Ric Harwood)
Subject: Re: [Q] Perl in win3.11?
Message-Id: <331a2c0b.10087964@news.demon.co.uk>
Still struggling. Some things make sense and seem to happen according
to plan, but others leave me bewildered.
In comp.lang.perl.misc, on 18 Feb 1997 18:27:55 -0500 Dean Pentcheff
<dean@tbone.biol.sc.edu>, wrote:
>Now, based on addresses in Ilya's documentation, go out and grab the
>latest versions of the "emxrt" package and the "rsx" package. Unpack
>them under a temporary directory. Copy the following files to
>c:\perl\bin:
>
> from the emx package:
> emx.exe [VCPI DOS extender for DOS]
> emxfpemu [coprocessor emulator for 386sx machines]
> emxbind.exe [emx executable load-format twiddling program]
> emxl.exe [emx stub loader module]
All of.
> from the rsx package:
> rsx.exe [DPMI DOS extender for Windows]
I have a rsx.exe and rsxwin.exe
>Now drop out into DOS if you're running under Windows (not a DOS
>shell: if you're in Windows, kill Windows and drop to plain DOS).
>
>Go to the c:\perl\bin directory and use emxbind to extract the a.out
>module from perl_.exe, something like:
>
> emx emxbind.exe -x perl_.exe perl.out
>
>Use emxbind to bind the a.out module with the emxl.exe stub:
>
> emx emxbind.exe emxl.exe perl.out perl.exe
>
>Assuming that worked, you can now delete the following files:
All seemed to go well.
> emxbind.exe
> emxl.exe
> perl.out
> perl_.exe
> perl5_00.exe
Done.
>Reboot your machine to let the c:\autoexec.bat changes take effect.
>
>
>What have you achieved by this? The OS/2 version will run using
>either the emx.exe DOS extender (using the VCPI protocol, suitable for
>"naked" DOS) or the rsx.exe extender (using the DPMI protocol,
>compatible with Windows 3.x, 95 (and NT?)). The rigamarole with
>emxbind pulled out the core executable and rebound it with a stub
>loader that will automatically and transparently find and use the
>emx.exe extender in plain DOS, and the rsx.exe extender under Windows
>(as long as they're in a directory on the PATH). Setting the
>emxlib_prefix variable properly sets Perl's @INC list of where to
>search for Perl libraries.
When I try to run perl5003.exe I just get:
process 2 get hardware fault 13 (general protection) at 1
writing core file
Process terminated by SIGSEGV
This does not tell me anything. Do you have any ideas?
>The "utility" programs in \perl\bin are set up as OS/2 "cmd" files.
>You'll need to trim off the top few lines that get them to execute
>under the OS/2 command interpreter. There are magical incantations
>you can do to turn them into automatically executing DOS batch files
>(which I don't know), or you can create a batch file for each of them
>(in the same directory) that looks something like the following (for
>an example "utility.cmd" file):
>
>@perl -S utility.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9
>
>in the file "\perl\bin\utility.bat".
Is this instead of or as well as trimming the top 'few' lines?
I do have a number of .cmd's but not utility.cmd, so I don't know how
much else I may be missing.
Any ideas gratefully received.
I still do not know whether when I have worked this out I will have
POSIX, which I _do_ need.
MTIA
Ric.
--
"Big whorls have little whorls that feed on their velocity,
and little whorls have lesser whorls and so on to viscosity."
-- L.F.Richardson
PGP id:0766ABE5 http://www.discoveryinternational.com/ric/
------------------------------
Date: Sun, 02 Mar 1997 13:14:57 -0800
From: Devin Ben-Hur <dbenhur@egames.com>
To: posenj@lancet.co.za
Subject: Re: `FILNAME` accesses floppy drive before current drive
Message-Id: <3319EDD1.7486@egames.com>
[courtesy reply emailed]
Kevin Posen wrote:
> print `type poll.dat`;
>
> through an MS-DOS shell on a Windows '95 platform PC
> to display the contents of the file 'poll.dat'.
>
> When the program is run, it accesses the floppy drive
> and then displays the output, even though my current
> drive is my hard disk drive.
>
> How do I prevent the floppy disk access?
I saw an answer to this on the perl-win32-users mailing list
(which I recommend all you activeware Perl for Win32 users should
be subscribed to -- see <URL:http://www.activeware.com/>)
a few weeks ago.
This is a problem only with Win95 and occurs whenever you
execute an external program (system, backticks, etc.) if you
have any references to the floppy drive in your /Start/Run
history list. You can clear those entries using regedit, or
the TweakUI control panel widget from the MS Win95 PowerToys
freeware.
But, the next question is why, oh, why are you doing:
> print `type poll.dat`;
instead of:
open(FILE,"poll.dat") or die(...);
print <FILE>;
and avoiding the extra shell execution?
HTH
--
Devin Ben-Hur <dbenhur@egames.com>
eGames.com, Inc. http://www.egames.com/
eMarketing, Inc. http://www.emarket.com/
"Sometimes you just have to step in it and see if it stinks" O-
-- Sonia Orin Lyris
------------------------------
Date: Sun, 02 Mar 1997 16:36:35 -0800
From: Rick Thornley <thorsoft@cdsnet.net>
Subject: Calling a Perl Program from within HTML
Message-Id: <331A1D13.6F42@cdsnet.net>
I need to include about 50 lines of html code into 10 sites. I also
need to pass a parameter to the cgi code so I know which 50 lines of
code that is needed. There are 4 different snippets of code each with a
different graphic. The cgi code would then look at the parameter and
then generate the proper html code for inclusion into the page that
called the cgi program.
Can I call a cgi program from an html page while the html page is
loaded? This is similar to a server side include, but some of the sites
do not want to make their "html" files "shtml" for the server side
includes to work.
Thanks,
Rick
------------------------------
Date: Sun, 02 Mar 1997 13:38:36 -0800
From: Devin Ben-Hur <dbenhur@egames.com>
To: "Brian L. Matthews" <blm@halcyon.com>
Subject: Re: can $_ be dissociated from its contents?
Message-Id: <3319F35C.6545@egames.com>
Brian L. Matthews wrote:
> No. Your code is fundamentally different from Rahul's in that it is
> pushing a reference to a $_ implicitly localized by the foreach.
> Try replacing the foreach with:
> $_ = 'one'; push @a, \$_;
> $_ = 'two'; push @a, \$_;
> $_ = 'three'; push @a, \$_;
Hmmm. Right you are
> Of course, this may suggest a solution to Rahul's problem--push a
> reference to a lexically scoped variable (my $x) instead of a global
> one ($_). Or maybe not.
No, my $x doesn't seem to help either.
It seems that the variable reference is always the same for
the scoped life of the variable (which rather makes sense),
even if its value changes, except in that implicitely localized
foreach context which seems to re-localize the control variable
for each iteration of the loop rather than once for the
whole loop.
$_ = 'one'; push @a, \$_;
$_ = 'two'; push @a, \$_;
{ local ($_);
$_ = 'one'; push @a, \$_;
$_ = 'two'; push @a, \$_; }
{ my $t;
$t = 'one'; push @a, \$t;
$t = 'two'; push @a, \$t; }
foreach (qw(one two)) { push @a, \$_; }
my $t; foreach $t (qw(one two)) { push @a, \$t; }
$_ = "junk";
print join(':', map($$_,@a)), "\n";
prints: junk:junk:two:two:two:two:one:two:one:two
Looks like we need a anonymous scalar construct
anologous to the anonymous array [...] and hash {...}
construct.
--
Devin Ben-Hur <dbenhur@egames.com>
eGames.com, Inc. http://www.egames.com/
eMarketing, Inc. http://www.emarket.com/
"Sometimes you just have to step in it and see if it stinks" O-
-- Sonia Orin Lyris
------------------------------
Date: 2 Mar 1997 21:40:57 GMT
From: exidor@nimbus.superior.net (Christopher Masto)
Subject: Re: Can you create file on the fly with perl?
Message-Id: <5fcs59$etv@news.webspan.net>
In article <33135689.FFC67E3@uconect.net>,
Bill Kuhn <wkuhn@uconect.net> wrote:
>You can open it for writing and close it using
>open(FILE,">$filename") ;
>close(FILE) ;
>of use the unix touch command (if you are on unix) using
>system("touch $filename")
$filename = "harmless; rm -rf /";
--
Christopher Masto . . . . NetMonger Communications
chris@masto.com . . . . . Masto Consulting: info@masto.com
------------------------------
Date: 28 Feb 1997 05:10:38 GMT
From: strider@shadowmac.org (Raul Almquist)
Subject: Re: File Upload on WEB
Message-Id: <5f5pce$j8f$3@blackice.winternet.com>
Nathan V. Patwardhan (nvp@shore.net) wrote:
: Yun-ho Chung (nedoli@csailab.kookmin.ac.kr) wrote:
:
: : I want to file upload on WEB.
: : How use CGI with Perl???
Hey Yun-ho, the following are my notes on what is currently available for
file upload processing via perl cgi & pl & pm...
-------------------
I have looked at many scripts and modules that claim file upload
functionality, with most of their implimentations being only partial or
half-assed or even in a couple of cases total vapor.
Below are my notes that I have to date, I did not keep a list of
vaporous claimed file upload capabilities as I keep each of those in a
holding dir to assure myself to not DL yet another wasted copy of those
worthless things.
Many authors of scripts or modules obviously make an assuption that
file uploads will only be made between machines of the SAME platforms, so
if you are like our archive site which stores Mac archives in the textual
encoded format known as hqx (binhex) and makes the archives available for
downloading from a unix box, then you are SOL. Even those who include a
platform setting appear to be utterl blind to this deficiency.
I have been searching for an integrated file upload and file
descriptives questionnaire processor, which 1st requests descriptives
data from the uploader, then after the uploader fills in the descriptives
requested (with a few of the descriptives be mandatory), the uploader is
then presented with a standard file select area in the form where the
uploader chooses a file from their hard drive or CD-ROM or whatever,
after clicking on the send button the descriptives (in a specific order,
one line with a LF ending each line per descriptive) are sent to be
written to a file of the same name as the uploaded file and then the
actual file upload is appended below the descriptives... you may be
wondering why we would need to do this appending bit, it is because file
uploads to our filesite are binhex encoded binaries which turns binaries
into the text format known as binhex ".hqx" which is quite similiar to
the uuencoded ".uue" format.
To date CGI_Lite.pm comes close, but no cigar on several points... sigh
I have looked at
CGI_Lite.pm (and its file upload examples)
Examples work pretty well, except for the
following: if you set "set_platform" to your
machine's platform, it WILL convert any
textfiles uploaded to the site with filename
extensions of ".txt" but no other textfile
extensions, it looks for that one extension
and that is all. Does not filter filenames
at all, which is too bad as the routine for
telling the package which OS it is being used
on is there with the "set_platform" fuction, so
files CAN and WILL upload to the site with
filenames which cause problems. Currently there
appears to be no way to turn off auto-line
wrapping, which can cause problems.
Currently provides no functionality to process
form fields AND form file upload.
All that aside, this has the best chance of
actually providing proper file upload processing.
cgi_lib.pl (and its file upload examples)
Examples work, but none provide platform
textfile conversion AND filename filtering
to platform requirements for filenames, and none
utilize or provide form field processing AND file
upload processing from the same form.
CGI.pm (and its file upload examples)
CGI.pm provides supposed file upload examples,
but the examples given do not result in files
being saved into any specified dir, thus I was
not able to use it's examples, however, there
are third party scripts that use this module
which provide a saved file being found in the
destination dir, although none of the third
party scripts (or CGI.pm) provide platform
specific text formatting or filename filtering.
While CGI.pm does provide an OS switch via it's
"$OS = '????'" setting, this setting only tells
CGI.pm the required format of directory path
seperators for the OS the pm is on, it performs
no other function. Which is really too bad, as
the $OS switch is the ideal place to tell the pm
what the required and legal formats are for both
textfiles and filenames for the OS it is set to,
as well as the ideal place to tell the pm
what/how to convert other platforms text EOLs to
the EOL format of the OS the $OS switch is set
to, and the ideal place tell the pm what/how to
convert/filter other platforms filenames to the
character format of the OS the $OS is set to.
CGI.pm apparently does not provide support for
other form elements to be processed with its
related form function of file uploading, which
is not very logical, but is the way things are.
CGI.pm may be ok for transfers between
machines/OSs of the same platform, but not
between different platforms/OSs.
So far this one fails to provide true file
upload processing.
ftp.pl Does very well as providing basic file uploading,
with routines in place for some filename filtering
and textfile EOL platform conversion, provides
nothing beyond this however. html forms are
integrated inside the ftp.pl, so you must call
this from another html page.
new_upload.cgi (uses CGI.pm)
file_upload.cgi (uses CGI.pm)
upload.pl (uses CGI.pm)
fup.cgi (uses cgi_lib.pl)
upload.cgi (uses cgi_lib.pl)
files_up.cgi (uses cgi_lib.pl)
resulting in that all of them provide partial file upload
processing, none of them provide complete file upload
functionality, and none of them providing anything for integrated file
upload descriptives processing capabilities.
When looking for an upload capable script or module, be sure that they
address
01. Platform setting which converts textfile EOL (end of line) from
the uploader's platform EOL to the upload receiving site's EOL, AND,
filters/converts uploader's platform filenames to filenames legit on the
upload receiving site's OS (operating system).
02. Either a modifiable list of extensions that the script or module
uses to know if a received file is a textfile or some other format, OR,
it provides a function that checks the content to see if it is a textfile
or not. It would appear that most if not all upload processors use either
the web server's mime.types or the browser's mime info, either of which
only partially fulfills the processor's need to determine file text file
type, there are file types galore in the mime.types that are not listed
as being textfile formats, yet they are in fact text formats, for example
".uue" & ".hqx" are both textfiles that are the result of an encoding
process which turns platform's binary files into text formatted files for
easy storage (and transfer) on non-native platforms, upload .uue or .hqx
files with any of the available upload processors and you do not result
in files being saved that are regular converted text formats... ie. CR
being converted to LF and the like.
03. If it has any auto-wrapping function for textfiles, the ability to
change the wrapping line length AND the ability to disable wrapping.
04. Provides a saved file from any examples given, too many state they
process file uploads yet they do not provide proofs of such claims in the
examples they give.
05. If you are a file site, then file upload descriptives processing is
also needed, and in this regards all of the above currently provide
nothing in either functionality or examples.
Most of these are available at a CPAN site, or use a web search engine
to locate them.
Good luck, as from my experience, you WILL need it :(
-----------------------
Nathan V. Patwardhan (nvp@shore.net) wrote:
: This group has nothing to do with CGI. This is comp.lang.perl.misc.
Amazing most amazing... do you REALLY wish everyone to believe what you
wrote... nahhh you MUST have been kidding.
If it is programmed or developed with 'perl' then please explain how it
can not be legit for a 'perl' group... or better yet don't bother; as we
both know what you wrote is not true.... nextthing we know you might say
something along the lines of "sorry, but this group has nothing to do
with scripts or applications, this is a perl only group. This is
comp.lang.perl.misc.
Sorry for sounding annoyed, but the guy responded to an honest request
for basic info with an inane (I use inane to be kind) response.
------------------------------
Date: Sun, 2 Mar 1997 19:18:58 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Help! Testing Perl CGI scripts on local Windows/DOS system
Message-Id: <2u8df5.122.ln@localhost>
Geoff Wilkins (GeoffW@wordsmith.demon.co.uk) wrote:
: I don't at present have access to web-space with permission to run CGI
: scripts.
: I've been trying without success to figure out a way to test Perl CGI
: scripts by running them, called from <FORM action=...> tags in HTML
: files, on my local Windows95/DOS system. (I have of course got Perl
: installed on the system.)
: Is there a way to do this? If so, I'd be grateful for advice, either
: here or by e-mail to GeoffW@wordsmith.demon.co.uk.
You need to install an HTTP server on your PeeCee to run CGI scripts.
: (And if this is the wrong newsgroup for such a query, I'd be grateful
: for redirection.)
You are right, it's the wrong newsgroup. Try:
comp.infosystems.www.servers.ms-windows
comp.infosystems.www.authoring.cgi
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Mon, 03 Mar 1997 03:14:43 GMT
From: revjack@radix.net (revjack@radix.net)
Subject: How can I get colored screen text using perl5?
Message-Id: <331c3d5f.11829197@news1.radix.net>
Keywords: Hexapodia as the key insight
Hello,
I've searched the perl man pages, the FAQ at
ftp://uiarchive.cso.uiuc.edu, and the camel book, to no avail. Can
anyone tell me how to change the text color when I output to the
screen under unix SunOS5? I am hoping to do this with escape codes
like in other languages.
(And did I get the Subject: line right?)
Thank you,
RJ
_________________
revjack@radix.net
------------------------------
Date: Sun, 02 Mar 1997 14:09:49 -0800
From: Devin Ben-Hur <dbenhur@egames.com>
To: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Interview With The Internet's Wise Guys Of Perl - Web Week
Message-Id: <3319FAAD.5C74@egames.com>
[courtesy reply emailed]
Randal Schwartz wrote:
> >>>>> "inforch" == inforch <inforch@cris.com> writes:
> inforch> Interview With The Internet's Wise Guys Of Perl - Web Week
> inforch> Find this article at:
> inforch> NewsLinx Daily Web News (2/28/97)
> inforch> http://www.newslinx.com/
>
> I rejected this article from comp.lang.perl.announce for two reasons:
> (1) the return address is BOGUS. Why?
> (2) the web address leads to a page that is hostile for non-frames browsers.
> And this is a magazine that is meant for *web* readers? Ouch!
>
> And, I would have said both of these in private, but #1 makes it hard.
> Hopefully, the poster is also reading the group. (But if not, that'd
> be complaint number 3.)
>
> So, this smells like spam, even if it was intended to be something
> good. Ahhh, kids. :-(
Well, this was the third time I got sucked into trying their
web-page in responce to a "spam" posting here and it was the
third time I couldn't find any reference to the interesting
article title they advertised.
So, it appears that these people are either:
1) incompetant.
2) out to make a buck selling banner ad eyeballs and unconcerned
who they annoy attempting to attract those all important page hits.
Interestingly enough, when I tried to search for the article
mentioned above, of course one of my keywords was "perl". This
search turned up a document which happened to be a mass-mailer
perl script they'd snatched from somewhere else which just happened
to be public readable in their web-accessible directories.
If the poster is reading the group, I have a couple
suggestions for hir:
1) lose the bogus return address.
2) make the URL go directly to the article you're announcing,
not to your front page or index from which we have to search
for whatever you used to draw us. If your content is interesting,
we might just look around at the rest of your site, but don't
force us to browse your aisles if we just want one thing or
we'll be much less likely to come back.
--
Devin Ben-Hur <dbenhur@egames.com>
eGames.com, Inc. http://www.egames.com/
eMarketing, Inc. http://www.emarket.com/
"Sometimes you just have to step in it and see if it stinks" O-
-- Sonia Orin Lyris
------------------------------
Date: 3 Mar 1997 00:55:20 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Interview With The Internet's Wise Guys Of Perl - Web Week
Message-Id: <slrn5hk857.r1n.dave@fast.thomases.com>
On Sun, 02 Mar 1997 14:09:49 -0800, Devin Ben-Hur <dbenhur@egames.com> wrote:
> Well, this was the third time I got sucked into trying their
> web-page in responce to a "spam" posting here and it was the
> third time I couldn't find any reference to the interesting
> article title they advertised.
To be fair, it was there, and when you followed the link there was the
interview, both in text and RealAudio.
Dave
--
_________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: 3 Mar 1997 01:10:17 GMT
From: "Robert W Hull" <rhull@ozbuild.com.au>
Subject: Looking for a script
Message-Id: <01bc27d3$fb941560$14ee17cb@rhull>
I am at my wits end....
I need a script which will log a clickthru to a link and will return a log
file
which can tell me
1.how many clicks
2. to what link
etc..
I run a large directory and need to know statistics on clickthru's
Help!!
Rob
------------------------------
Date: Sun, 02 Mar 1997 18:11:00 -0800
From: "Philip A. Prindeville" <philipp@ntex.com>
Subject: Modems & Perl -- examples wanted
Message-Id: <331A3334.8A4@ntex.com>
Anyone have any Posix code to handle manipulating a modem
and/or serial line to set parity, baud rate, databits, etc.
and eventually dialing? The initializing strings for the
modems themselves aren't a problem.
I need this code to integrate into an alpha-numeric paging
library, which I will release.
Thanks,
-Philip
P.S. Please reply directly if possible.
------------------------------
Date: Sun, 02 Mar 1997 15:04:44 -0600
From: Eryq <eryq@enteract.com>
To: Matthew John Webster <mattw@engr.CSUFresno.EDU>
Subject: Re: parsing?
Message-Id: <3319EB6C.60BF5390@enteract.com>
Matthew John Webster wrote:
>
> I have a bit pattern like:
> 0001111000001000
>
> and would like to find all instances
> of four '1's and one '1' separated by
> four '0's on the range:
> 0000000000000000
> 1111111111111111
>
> I can muscle out all the exceptions but
> look to emulate the ideal programmer am
> searching for a short cut.
>
> The biggest headache of involves lines
> like this:
> 1100000010000011 -and this
> 0111100000000001
>
> the first one's valid, the second isn't
> (because of wrap around)
>
> suggestions?
I can't follow your question, but I have a suggestion for
dealing with wraparound: if you're searching in a string
XYZ, concatenate it with itself to produce XYZXYZ, and
then search in *that* string instead. In your 'and this'
case, you'd search in the string:
11000000100000111100000010000011
Hope that helps,
--
___ _ _ _ _ ___ _ Eryq (eryq@enteract.com)
/ _ \| '_| | | |/ _ ' / Hughes STX, NASA/Goddard Space Flight Cntr.
| __/| | | |_| | |_| | http://www.enteract.com/~eryq
\___||_| \__, |\__, |__
|___/ |___/ UNIX-FM: more talk ; less yacc yacc yacc
------------------------------
Date: Sun, 02 Mar 1997 23:34:55 +0000
From: Sibastien Brault <brault@info.unicaen.fr>
Subject: Perl and Xform
Message-Id: <331A0E9F.4456E601@info.unicaen.fr>
Hello.
I'd like to konow if there is a module (or ..)
to interface perl and the Xform lib.
Thanks a lot.
Sebastien.
------------------------------
Date: Mon, 03 Mar 1997 01:30:48 GMT
From: "Jim" <Jim@pbs1.com>
Subject: Perl on NT 4.0 - HOW?
Message-Id: <01bc2772$e6d7f940$658771cf@Pentium.pbs1.com>
I have just loaded perl 5 on my NT server. I seems as if I can run perl
scripts from the dos prompt, but I cannot run them from the web browser.
Does anyone have any insight on how to get perl working properly on NT 4.
Thank You,
Jim@pbs1.com
------------------------------
Date: Sun, 02 Mar 1997 19:13:42 -0500
From: Bill Cowan <billc@tibinc.com>
To: Dirk Leas <dirkl@midak.com>
Subject: Re: PerlIS+Win32::ODBC - Can't call method "Sql"...
Message-Id: <331A17B6.251B@tibinc.com>
Dirk Leas wrote:
>
> On Sun, 02 Mar 1997 05:16:46 GMT, dirkl@midak.com (Dirk Leas) wrote:
>
> >I have a simple script that executes fine under perl.exe, but under
> >perlIS I get the error: "Can't call method "Sql" without a package or
> >object reference at c:\work\scripts\getCourseList.pl line 15.".
> >
> >I've checked the FAQ, but still a newbie, so be gentle ; - )
> >
> >Adios,
> >Dirk
>
> DOOOOOOOOOOOHHHHHHHHHH...
>
> Here's sample source code (again, works great with perl, not with
> perlis):
>
> use Win32::ODBC; # odbc services
>
> $html = '';
> $prereqs = '';
> $outline = '';
> $cid = $ENV{'QUERY_STRING'};
> $template = 'course.htm';
>
> # load standard template
> open(FP, $template);
> @templateStream = <FP>;
> $_ = "@templateStream";
> close(FP);
>
> # grab course info
> $data = new Win32::ODBC("midak");
[Start cruel action]
Where is your error checking? Was there an error here?
[End of cruel action]
Line 15 below appears to be failing due to $data not having valid
reference. So my guess is that, when you see an error message, you will
have the info as to what is happening under PerlIS.
Is this a difference in the user-id (and the user or system DSN
selected) when running from command line vs under PerlIS???
Bill
>
> # ********** Next line is 15, I cut this code ************
> $data->Sql("select * from vCourseLogo where cid=$cid");
> $data->FetchRow();
> undef %rows;
> %rows = $data->DataHash();
> $prereqs = "$rows{prereq}<br><ul>"; # save prereq/outline
> descr.
> $outline = "$rows{outline}<br><ul>";
> s/%%courseSpec/$rows{name}/;
> s/%%courseDesc/$rows{desc}/;
> s/%%who/$rows{who}/;
> s/%%coursePrice/\$$rows{price}/;
> s/%%courseDays/$rows{days}/;
> s/%%courseLocation/$rows{location}/;
> s/%%logo/$rows{logo}/;
> ...
>
> Thanks again...
>
> Adios,
> Dirk
-- Bill
-----------------------------------------------------------------------
Bill Cowan <billc@tibinc.com> Voice:919-490-0034 Fax:919-490-0143
Tiburon, Inc./3333 Durham-Chapel Hill Blvd Suite E-100/Durham, NC 27707
------------------------------
Date: Sun, 02 Mar 1997 21:34:50 -0500
From: Daniel Fox <dfox@pobox.com>
Subject: redirecting STDERR
Message-Id: <331A38C9.2E3A46BA@pobox.com>
Is there a way to do something like
$var = `/usr/bin/program`;
but have STDERR and STDOUT put into $var?
Thanks..
--
Daniel Fox
dfox@pobox.com
------------------------------
Date: 2 Mar 1997 20:07:41 GMT
From: yoosh@cs.UAlberta.CA (Yoo-Shin Lee)
Subject: Regex and Greedy for words
Message-Id: <5fcmmd$9am@pulp.ucs.ualberta.ca>
Hello, can anyone help me solve this regex problem:
$a="from the text book and from bill smith v. woolco where";
I want to replace:
"bill smith v. woolco"
with:
"<>bill smith v. woolco<>".
Using:
"s/(from|in)\s+(.*?) v. (.*?) where/\1 <>\2 v. \3<> where/g;
Unfortunately, I'm getting:
"<>the text book and from bill smith v. woolco<>"
How do I match from the 2nd "from" ?
please email answers to me yoosh@cs.ualberta.ca
thank you.
Y.
--
Yoo-Shin Lee
yoosh@cs.ualberta.ca
http://www.cs.ualberta.ca/~yoosh
------------------------------
Date: Sun, 02 Mar 1997 17:53:26 -0500
From: Michael Sadd <sadd@msc.cornell.edu>
To: Yoo-Shin Lee <yoosh@cs.UAlberta.CA>
Subject: Re: Regex and Greedy for words
Message-Id: <331A04E6.29F1B565@msc.cornell.edu>
Mr. Lee, ( :) )
You could try matching as many froms as you can:
~@athens% perl -px
#!/usr/bin/perl
s/(.*from)+\s(.+\sv\.\s.+)\swhere/$1 <>$2<> where/
__END__
from the text book and from bill smith v. woolco where
from the text book and from <>bill smith v. woolco<> where
Mike
Yoo-Shin Lee wrote:
>
> Hello, can anyone help me solve this regex problem:
>
> $a="from the text book and from bill smith v. woolco where";
>
> I want to replace:
>
> "bill smith v. woolco"
>
> with:
>
> "<>bill smith v. woolco<>".
>
> Using:
> "s/(from|in)\s+(.*?) v. (.*?) where/\1 <>\2 v. \3<> where/g;
>
> Unfortunately, I'm getting:
>
> "<>the text book and from bill smith v. woolco<>"
>
> How do I match from the 2nd "from" ?
>
> please email answers to me yoosh@cs.ualberta.ca
>
> thank you.
> Y.
>
> --
> Yoo-Shin Lee
> yoosh@cs.ualberta.ca
> http://www.cs.ualberta.ca/~yoosh
--
| Michael Sadd | Cornell Univerisity |
| Department of Physics and | Ithaca, NY 14850 |
| Lab of Atomic and Solid State Physics | www.msc.cornell.edu/~sadd/ |
------------------------------
Date: Sun, 02 Mar 1997 16:11:23 -0600
From: S_Stefanis@msn.com
To: S_Stefanis@msn.com
Subject: Rookie Blues:format not terminating
Message-Id: <857159166.18639@dejanews.com>
I am trying to force out put with the format command
I keep getting the following message:
format not terminated in file. My code is as follows:
format out_put =
@<<<<<<<<<<< @<<<<<<<<<
$one, $two[$i]
.
write out_put;
perhaps Im missing something? Thanks for your help!
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Mon, 03 Mar 1997 02:44:48 GMT
From: anne@ms1.hinet.net (C.Y. Chen)
Subject: What's HTTP/1.0 501 Not Supported ?Run PERL In Win95 PWS.
Message-Id: <5fddsr$o3i@reader.seed.net.tw>
I wrote a siample scrip and use GET method in browser but return
message was "HTTP/1.0 501 Not Supported " .Could someone tell me what
happened?
------------------------------
Date: Sun, 2 Mar 1997 13:53:31 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Tim Dierks <tim@dierks.org>
Subject: Re: What's wrong with this Perl?
Message-Id: <Pine.GSO.3.95q.970302135213.23058N-100000@kelly.teleport.com>
On Sun, 2 Mar 1997, Tim Dierks wrote:
> $#a = 5;
> foreach $v (@a) {
> $v = 1;
> }
>
> Emits the error message:
> Modification of a read-only value attempted at test.pl line 3.
It's a bug in Perl, fixed in the upcoming version 5.004, which will be
available in beta form soon at a server near you. 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 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Jan 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.
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 38
************************************