[11109] in Perl-Users-Digest
Perl-Users Digest, Issue: 4709 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 21 09:06:01 1999
Date: Thu, 21 Jan 99 06:00:23 -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, 21 Jan 1999 Volume: 8 Number: 4709
Today's topics:
Re: ancestry of perl features <cdkaiser@delete.these.four.words.concentric.net>
Re: ancestry of perl features <roman.stawski@synersoft.fr>
Re: arbitrary precision arithmetic (Steffen Beyer)
Calculating time() from date. <r2-d2@REMOVEbigfoot.com>
Re: Calculating time() from date. <partha@mihy.mot.com>
Re: email a form <bsherry@lucent.com>
Re: File Upload. <ghulam@khayal.com>
Re: Help with regular expression (Bart Lateur)
Re: Help: need to check file not being written (Bart Lateur)
Re: Help: need to check file not being written <partha@mihy.mot.com>
How long would the Unixes last without Perl? <address@web.page>
Re: How long would the Unixes last without Perl? <flavell@mail.cern.ch>
IS THIS POSSIBLE?? <ablasco@mad.servicom.es>
Re: IS THIS POSSIBLE?? <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: location of the faq (was append to beginning) <bm@howcoolaremp3s.com>
Re: Matching Numbers from a string. (Alastair)
Re: Matching Numbers from a string. <partha@mihy.mot.com>
Re: minus a pound she exclaimed! <andrew@foo.cc.nospam>
Re: newbie - endless loop on simple program. (M.J.T. Guy)
Re: Newbie string question, please help :) (M.J.T. Guy)
Re: Newbie-Looking for Network Monitoring scripts <MWeber@hdpp.de>
Re: Open File Detect <richardsonja@logica.com>
pattern matching trouble <cousin@ensam.inra.fr>
Re: Perl Criticism (Bart Lateur)
Re: Perl Y2K compliance (Tad McClellan)
Re: problem with: use module; (M.J.T. Guy)
Re: Regex challenge (Dean Inada)
Re: script outputting file instead of html page <STEVENHENDERSON@prodigy.net>
URGENT Perl Programmer needed (Intervid)
Yet another basic question. <no_spam@no_spam.com>
Re: Yet another basic question. <abey@hill.ucr.edu>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 20 Jan 1999 19:06:19 PST
From: Cameron Kaiser <cdkaiser@delete.these.four.words.concentric.net>
Subject: Re: ancestry of perl features
Message-Id: <7865jb$p4d@chronicle.concentric.net>
mcafee@waits.facilities.med.umich.edu (Sean McAfee) writes:
>More specifically, in at least one variety of BASIC, you could set up a
>hook to an assembly-language routine, and then call the routine from BASIC
>using a syntax like &FOO, &BAR, etc. The routine could determine the name
>that was used to call it, and process the rest of the tokens accordingly.
>Anyone else remember keying in long hexadecimal listings from Nibble
>Magazine into your Apple II, and then magically being able to do things
>like this in BASIC?
Oh yeah, the Applesoft ampersand vector. All kinds of programs wedged their
way into there. The Beagle Bros. products particularly abused it. :-)
--
Cameron Kaiser * cdkaiser.cris@com * powered by eight bits * operating on faith
-- supporting the Commodore 64/128: http://www.armory.com/~spectre/cwi/ --
head moderator comp.binaries.cbm * cbm special forces unit $ea31 (tincsf)
personal page http://calvin.ptloma.edu/~spectre/ * "when in doubt, take a pawn"
------------------------------
Date: Thu, 21 Jan 1999 13:48:59 +0100
From: Roman Stawski <roman.stawski@synersoft.fr>
Subject: Re: ancestry of perl features
Message-Id: <36A7223B.DE14E736@synersoft.fr>
Sean McAfee wrote:
>
> In article <393e5531xn.fsf@ibnets.com>, Uri Guttman <uri@ibnets.com> wrote:
>
> [snip]
>
> ampersand function call syntax -- BASIC (specific variety unknown to me
> personally, although the perl man page refers to a "BASIC-PLUS")
>
Try Digital's Basic+ and Basic+2 that used to run on PDP (RSTS and RSX)
and early VAXes.
I believe that this is where the statement qualifier
[expr] if|unless [condition]
syntax came from too
--
Roman.Stawski@Synersoft.fr
------------------------------
Date: 21 Jan 1999 09:50:10 GMT
From: sb@engelschall.com (Steffen Beyer)
Subject: Re: arbitrary precision arithmetic
Message-Id: <786t8i$n1l$1@en1.engelschall.com>
Larry Rosler <lr@hpl.hp.com> wrote:
> In article <785j38$bff$1@uranium.btinternet.com> on Wed, 20 Jan 1999
> 21:53:22 -0000, Denny John <denny.john@btinternet.com> says...
>> I was checking out the arbitrary precision boast of perl by doing 100
>> factorial and noticed that this calculation goes awry after 22!
>> ie this
>>
>> printf "%f\n" , 1124000727777607680000*23 ;
>>
>> returns :
>>
>> 25852016738884978212864.000000
>>
>> which is sort of fine except its missing four zeroes before the decimal
>> point. I was using perl 4 and 5.004.
>>
>> Any ideas ? Can someone try this with perl 5.005xxx and tell me if it works
>> ?
> I got this on 5.005_02:
> 25852016738884978000000.000000
> But it's the *same* result! You are past the precision of a double-
> precision floating-point number, which is what perl uses by default for
> arithmetic on integers that are larger than 2**32 - 1 (on a 32-bit
> machine).
> There are a few modules in CPAN that do arbitrary-precision arithmetic
> on integers. I know of Math:BigInt (sp?), but I believe other modules
> may be more current.
Bit::Vector is written in C (i.e., it's FAST) and offers arbitrary
precision integer arithmetic.
Large factorials should be no problem at all.
See my signature below for URLs where to find this module.
Hope this helps.
Yours,
--
Steffen Beyer <sb@engelschall.com>
http://www.engelschall.com/u/sb/download/ (Free Perl and C Software
http://www.perl.com/CPAN/authors/id/STBEY/ for Download)
New: Build'n'Play 2.1.0 (all-purpose Unix batch installation tool)
http://www.oreilly.de/catalog/perlmodger/bnp.html
------------------------------
Date: Thu, 21 Jan 1999 12:26:21 -0000
From: "Artoo" <r2-d2@REMOVEbigfoot.com>
Subject: Calculating time() from date.
Message-Id: <7876ha$opi$1@plug.news.pipex.net>
Hi All
How can you calculate time() (non-leap seconds since Jan 1970) from a date
and time or the out put of localtime().
Thanks for any help
Artoo
------------------------------
Date: Thu, 21 Jan 1999 18:13:00 +0530
From: Ramanujam Parthasarathi <partha@mihy.mot.com>
To: Artoo <r2-d2@REMOVEbigfoot.com>
Subject: Re: Calculating time() from date.
Message-Id: <36A720D4.409D56EC@mihy.mot.com>
Check if Time::Local is of any help to you - try
%man Time::Local
HTH
-Partha
Artoo wrote:
> How can you calculate time() (non-leap seconds since Jan 1970) from a date
> and time or the out put of localtime().
------------------------------
Date: Thu, 21 Jan 1999 08:42:23 -0600
From: "Bill Sherry" <bsherry@lucent.com>
Subject: Re: email a form
Message-Id: <787apu$8ns@nntpa.cb.lucent.com>
Thats what my problem is. I am not a programmer. I understand what CGI is I
just do not understand what I'm getting into. Is this a huge script that
needs to be written to extract each field or is this a small script I can
muddle thru to send the page as is.
I was hoping that there was a software package out that would create the
form and biuld the CGI script as you created the form. Have you heard of
any?
Thanks for taking the time to reply..
Bill
Abigail wrote in message <7865gu$ls8$5@client2.news.psi.net>...
>Bill Sherry (bsherry@lucent.com) wrote on MCMLXVIII September MCMXCIII in
><URL:news:785l0j$36@nntpb.cb.lucent.com>:
>``
>`` I know how to create the form with HTML, I do not know how to write a
script
>`` that will extract the data from the form so that it can be emailed to
>`` another person.
>
>use CGI;
>use Mail::Send;
>
>
>
>Abigail
>--
>perl -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
> for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
> print chr 0x$& and q
> qq}*excess********}'
------------------------------
Date: Thu, 21 Jan 1999 12:04:19 +0300
From: Ghulam Hussein Kara <ghulam@khayal.com>
Subject: Re: File Upload.
Message-Id: <36A6ED92.7EC03B43@khayal.com>
Assuming that your file input variable is "cv" , the following should
suffice :
#-------Beginning Code----------
#!/usr/bin/perl
require "cgi-lib.pl";
&ReadParse;
open (F, ">uploaded.dat");
print F "$in{'cv'}\n";
close (F);
#-------End of Code-------------
Note : You can name the new file to whatever you want instead of
"uploaded.dat" depending on type.e.g "wordfile.doc"
piece of cake, huh?
Alex Blyumenkrants wrote:
> Hi!
>
> I have the following problem:
>
> i need to upload a file from an Html,
> if i use type="file"
> what should i do to save this file in my Cgi?
>
> Thank You,
> Alex
------------------------------
Date: Thu, 21 Jan 1999 10:14:49 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Help with regular expression
Message-Id: <36aef9f6.7863447@news.skynet.be>
Greg Ward wrote:
>Network Operations <root@coredcs.com> wrote:
>> I have the following regexp that I'm attempting to decipher. The
>> input variable is text(a paragraph of regular words).
>>
>> $text =~ s/([^\012]{1,90})\s/$1\012/sg;
>I'll see if I can't decipher that regexp for you: [^\012] means any
>character *except* linefeed, and {1,90} means "repeated 1 .. 90 times".
>\s is any whitespace character (a single space, tab, newline, etc.)
>
>Thus, this regex finds strings of up to 90 characters (except linefeed)
>followed by a space, and changes the space to a linefeed.
You mean, "followed by a whitespace". That may even be "\n". The net
affect is nil, if that final whitespace was indeed a newline, i.e. lines
of at most 90 characters plus newline, are changed to what they were
before.
Of longer lines, chunks as long as at most 90 characters and ending with
a space are spitted out with the space replaced with a newline, and the
final chunk with newline is unaltered, as before.
Also, note that if a line contains "words" longer than 90 characters,
this word is passed as a whole, on it's own line.
> If it's only
>going to run on a Unix platform, it can be rewritten as follows:
>
> s/(.{1,90})\s/$1\012/g;
If it's going to run on ANY platform, and the text files it's working on
are in the platform's native format, it is safer to do:
s/(.{1,90})\s/$1\n/g;
It will only do the same thing as the original on Unix (and PC too, I
think; on PC, CRLF is converted to "\n" when reading, and converted back
when writing text files), but now it will always do what it was set out
to do. Even if "\n" is not "\012".
Bart.
------------------------------
Date: Thu, 21 Jan 1999 09:50:11 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Help: need to check file not being written
Message-Id: <36adf1f2.5811284@news.skynet.be>
[mailed and posted]
Dave Crawford wrote:
>need to check a file which to see whether or not it is still bening written to
>by a remote application ie ISDN transmission.
>
>Needd to copy file once file is stable!! for 15 seconds.
>
>have loop to check for files and folders, and copy etc, but am unable to check
>for stable condition.
>
>Files currently on Mac, mounted by NT perl on NT pulling file from Mac to NT drive.
Urm... Is your Perl on a Mac or on NT? I'm not sure it really matters.
Macs and NT both do an implicit file locking when trying to open files
for writing. That means that you CAN'T open a file with write access, as
long as another app is writing to it. That program has to close the
file, or quit, first.
So, if I were you, this would be my first attempt (non-desctructive
opening files):
until(open(FILE,"+<$file")) {
die $! if $!=~/not found/;
# or whatever the exact message
# busy
# waste some time... sleep()?
# and try again!
}
close(FILE);
HTH,
Bart.
------------------------------
Date: Thu, 21 Jan 1999 15:23:10 +0530
From: Ramanujam Parthasarathi <partha@mihy.mot.com>
To: Dave Crawford <djc@ppp.co.uk>
Subject: Re: Help: need to check file not being written
Message-Id: <36A6F906.258B2FA0@mihy.mot.com>
Hi,
You seem to say that you have a loop for checking whether the file has been written for
the last 15 seconds - right?
In that case try using stat() - it gives among other parameters, the last access time
and modification time of a file. You can then compare it with the current time. Check
out the function stat() from the perldoc
HTH
-Partha
Dave Crawford wrote:
> need to check a file which to see whether or not it is still bening written to
> by a remote application ie ISDN transmission.
> Needd to copy file once file is stable!! for 15 seconds.
>
> have loop to check for files and folders, and copy etc, but am unable to check
> for stable condition.
>
> Dave Crawford
------------------------------
Date: 20 Jan 1999 15:38:43 PST
From: "Phlip" <address@web.page>
Subject: How long would the Unixes last without Perl?
Message-Id: <785pe3$ajn@chronicle.concentric.net>
Newsgroupies
Ever since Linux got me (not the other way around), I have observed
that
Perl is as close to an OS component as makes no difference.
Is anyone out there running a Unix with no Perl installed?
-- Phlip at politizen dot com (address munged)
======= http://users.deltanet.com/~tegan/home.html =======
------------------------------
Date: Thu, 21 Jan 1999 13:39:12 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: How long would the Unixes last without Perl?
Message-Id: <Pine.HPP.3.95a.990121133848.10256C-100000@hpplus01.cern.ch>
On 20 Jan 1999, Phlip wrote:
> Is anyone out there running a Unix with no Perl installed?
I often run Perl with no Unix installed ;-)
------------------------------
Date: Thu, 21 Jan 1999 13:57:01 +0100
From: "Administrador" <ablasco@mad.servicom.es>
Subject: IS THIS POSSIBLE??
Message-Id: <7878ec$pn5@wendy.mad.servicom.es>
Hi there,
I need a script that runs from our server and that script should load a
remote page from another site every 5 seconds. I think it is easy to
program. It should have a configuration screen to start the robot, stop
the robot, and a put the url of the page to load every xx seconds. This
robot should work on the server, and if I cut the connection it will
still log every 5 seconds until i stopit.
Is this possible? Can anyone help me!
Regards,
Amando
------------------------------
Date: 21 Jan 1999 14:30:49 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: IS THIS POSSIBLE??
Message-Id: <83pv88ah2u.fsf@vcpc.univie.ac.at>
Re: IS THIS POSSIBLE??, Administrador
<ablasco@mad.servicom.es> said:
Administrador> Hi there, I need a script that runs
Administrador> from our server and that script
Administrador> should load a remote page from
Administrador> another site every 5 seconds. I think
Administrador> it is easy to program. It should have
Administrador> a configuration screen to start the
curses would be good for that
Administrador> robot, stop the robot, and a put the
Administrador> url of the page to load every xx
Administrador> seconds. This robot should work on
Administrador> the server, and if I cut the
Administrador> connection it will still log every 5
Administrador> seconds until i stopit.
perldoc Curses
perldoc LWP
perldoc -f sleep
perldoc perlipc
perldoc perlvar
should be a good start
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien. | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: Fri, 22 Jan 1999 02:40:28 +1100
From: "bill" <bm@howcoolaremp3s.com>
Subject: Re: location of the faq (was append to beginning)
Message-Id: <786ul7$6t5$1@reader1.reader.news.ozemail.net>
wow two responses and not one answers the question that the guy was looking
for.......
I dont know where it is myself, so sorry cant help you although I do know
its somewhere on the internet....... :-)
Erik van Roode wrote in message <36A6032B.C76F4D06@cthulhu.demon.nl>...
>"Ronnie D. Jewell" wrote:
>
>> For future reference; where do I find a copy of the FAQ everyone
>> mentioned?
>
>Read the '[Perl] How to find the Perl FAQ' message that gets posted
>regularly.
>
>Erik
------------------------------
Date: Thu, 21 Jan 1999 09:47:18 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Matching Numbers from a string.
Message-Id: <slrn7adtui.ed.alastair@calliope.demon.co.uk>
Darko Tunukovic <darko.tunukovic@debis.com> wrote:
>Hallo all,
>
>I have a little problem with matching number from a string.
>
> Like this: $pattern = "Test Number: 1";
>
>How can I get only the number from this string ?
That's a very basic question. You really should try to learn Perl you know. If
people don't try then why bother?
man perlre
would be a good place to start.
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Thu, 21 Jan 1999 15:17:13 +0530
From: Ramanujam Parthasarathi <partha@mihy.mot.com>
To: Darko Tunukovic <darko.tunukovic@debis.com>
Subject: Re: Matching Numbers from a string.
Message-Id: <36A6F7A1.640DAC6B@mihy.mot.com>
Hi,
You can match a number by using '\d'.
Darko Tunukovic wrote:
> I have a little problem with matching number from a string.
> Like this: $pattern = "Test Number: 1";
> How can I get only the number from this string ?
$pattern =~ /(\d*)/;
$numbers = $1;
HTH
-Partha
------------------------------
Date: Wed, 20 Jan 1999 22:15:35 +1100
From: "Andrew" <andrew@foo.cc.nospam>
Subject: Re: minus a pound she exclaimed!
Message-Id: <78722s$ovs$1@bomb.dynamite.com.au>
OK, I'm keen for a crack at this...
$base is the variable you're working with (instead of $_ - the default). =~
allows you to operate on it in this way.
The s/foo/blah/gi syntax is a single line (s), case insensitive (i) search
for foo, global replace (g) with blah
For the search, [asdf] will look for any of those letters, in this case it's
looking for &() and whitespace (\s) OR (|) the phrase .html (\.html)
For the replace (//) it'll replace occurances with nothing.
>From what I can tell (and have tested), it'll just remove instances of &()
whitespace and ".html"
I think you need:
$base =~ s/[-#!+]|\.cgi//gi;
it seems to work for me.
Regards
Andrew
Mark wrote in message <36a7901a.150106637@news.supernews.com>...
>Howdy;
>
>Some people just aren't genetically predisposed for writing code- I
>know, I'm one of them. :)
>
>I did the faq, did perl for dummies. I still can't get this line:
>
>$base =~ s/[&()\s]|\.html//gi;
>
>to filter out the following from a given string:
>
>- (minus sign)
># (pound)
>! (exclamation)
>+ (plus sign)
>.cgi
>
>
>I am therefore offering a box of choice donuts* to the individual who
>has some insight for me.
>
>Mark
>
>
>
>*Donuts may be store bought or fresh, at the discretion of the poster.
>Diabetics please inquire about alternative rewards. Does not include
>chocolate frosting or premium fillings. Content may shift during
>transport, freshness is relative and therefore not guaranteed.
------------------------------
Date: 21 Jan 1999 11:52:02 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: newbie - endless loop on simple program.
Message-Id: <7874d2$s4q$1@pegasus.csx.cam.ac.uk>
Greg Ward <gward@cnri.reston.va.us> wrote:
>
>In general, never assume that "x == y" will be true for floating point
>numbers. You just can't compare them for equality. Use a relative
>comparison, eg. recode your loop as
>
> until ($num > 1.0) {
> print "$num ";
> $num += $increment;
> }
You've got half of it. But in addition to avoiding == tests, you
must also avoid comparing to the exact limit value - is the above
loop obeyed when $num == 1.0 (approximately)? It'll depend on
the rounding.
So compare to an intermediate value instead, e.g. 0.95 or 1.05,
depending on the desired behaviour.
Mike Guy
------------------------------
Date: 21 Jan 1999 13:42:42 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Newbie string question, please help :)
Message-Id: <787asi$4t7$1@pegasus.csx.cam.ac.uk>
Larry Rosler <lr@hpl.hp.com> wrote:
>In article <7867hc$meu$3@client2.news.psi.net>, Abigail <abigail@fnx.com>
>says...
>+ while ($string =~ /(.)/g) {
>+ no strict;
>+ &{"do_something_with_$1"} (@args) if
>+ defined &{"do_something_with_$1"};
>+ }
>
>That doesn't do very well if $string contains '*' or any other \W,
>though. The names of functions have to be identifiers.
Not strictly true. (Almost) arbitrary strings can be used as names of
functions. But the syntactic contortions are sufficiently grotesque
to discourage such things. And anyone using "no strict" is already
in bandit country.
Mike Guy
------------------------------
Date: Thu, 21 Jan 1999 11:16:17 +0100
From: "Mathias-H. Weber" <MWeber@hdpp.de>
Subject: Re: Newbie-Looking for Network Monitoring scripts
Message-Id: <36A6FE71.AC676DDA@hdpp.de>
Michael J. Bahr wrote:
>
> Hello all,
>
> Im trying to find some scripts or pointers for help to do the following:
>
> I need to produce a network map in html format, indicating which of my
> nodes are up and which are down. Im using active perl on a Win32
> platform. I found an article
> (http://www.webdeveloper.com/categories/management/management_network_mapping.html)
> on doing this using fping and gd.pm but I couldn't find a compatible
> win32 based ping program - (or rather dont know how to implement it.)
>
I don't know 'fping' but as the article gives a location to get the
source code it should be possible to install it on a win32 based system.
It is also mentioned in the article that perl comes with its own ping
module (Net::Ping - CPAN/doc/manual/html/lib/Net/Ping.html). But the
paragraph about the module's capabilities concerning the protocol is not
correct:
Another kind of ping you could rig to this project is available as
a module with Perl 5. But this version is not a true ping; instead,
it opens a TCP echo port connection to a host. Many routers
and other low-level network devices don't implement TCP echo
services, so this may not be generally applicable to a procedure
like WebView.
Actually using Net::Ping you can select the protocol to be UDP, TCP, or
ICMP, respectively. UDP is the default (not TCP) and selecting ICMP
requires special privileges on the host (this also holds true for
'fping'). Also keep in mind that using the ICMP protocol can introduce
some danger.
HTH, Mathias
------------------------------
Date: Thu, 21 Jan 1999 11:42:10 -0000
From: "James Richardson" <richardsonja@logica.com>
Subject: Re: Open File Detect
Message-Id: <7873r7$mjc@romeo.logica.co.uk>
Alan Barclay wrote in message <916893666.579699@elaine.drink.com>...
>In article <785h55$a$1@news0-alterdial.uu.net>,
>Greg Ward <gward@cnri.reston.va.us> wrote:
>>There must be some way under Unix to find out if a file is open; after
>>all, the 'fuser' command does it. But I don't know what it is, and I
>>don't know if it's easily accessible through Perl. If you're *really*
>
>Under Linux, it's relativly easy.
>
[system specific stuff deleted]
Heres a simple solution (if you can get it done)
If the sending program can change the name of the file when it has finished
sending it, then you can do the following...
1) Remote FTP process sends file .xxxyyyzzz
2) Remote FTP proces verifies that file has been transferred correctly
3) Remote FTP process renames file from .xxxyyyzzz to xxxyyyzz
4) Meanwhile you are checking for files that look like xxxyyzzz, which then
magically appears, complete, and verified.
HTH
James
------------------------------
Date: Thu, 21 Jan 1999 11:42:00 +0000
From: Xavier Cousin <cousin@ensam.inra.fr>
Subject: pattern matching trouble
Message-Id: <36A71288.681710B7@ensam.inra.fr>
Hello, i've got a pattern matching trouble in a perl script, here is an
piece of the code dealing with the pattern matching :
open (MUTSUB,tkkkout) or print "cant open tkkkout";
while (<MUTSUB>){
($mutation,$reste) = split / /,$_,2;
if ($kksub{$mutation} !~ /$reste/){
$kksub{$mutation} .= $reste;
}
}
here is an example of data found in 'tkkkout' file :
bunfa-acche_M70Y+K285D
<TR><TH><PRE>Acetylthiocholine</TH><TD><PRE>95.3 & 5.9 uM</TD><TD><PRE>-</TD><TD><PRE>
T25C IS 50 mM phosphate</TD><TD><PRE><A
href=/chol.cgi-bin/webace?db=achedb&class=Paper&object=
Cousin_1996_J.Biol.Chem_271_15099>
Cousin_1996_J.Biol.Chem_271_15099</A></TD></TR>
They are one line elements which can be repeted several times in the
file (this why i try to exclude doublets).
I don't know how solve this problem. Thanks for your help.
Xavier
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Xavier Cousin cousin@ensam.inra.fr
INRA - DCC tel. (33) 04 99 61 28 14
2, place Pierre Viala fax (33) 04 67 54 56 94
34060 Montpellier Cedex 1
ESTHER URL http://www.ensam.inra.fr/cholinesterase/
------------------------------
Date: Thu, 21 Jan 1999 09:50:09 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl Criticism
Message-Id: <36abea3f.3841399@news.skynet.be>
topmind@technologist.com wrote:
>It is easier to introduce a new language than introduce
>a new culture.
But there are already hundreds of free alternatives available! But
noooooo, you don't want to waste your time looking into those.
You don't really think that your ideas are *new*, do you? Every single
thing you came up with has been thought of, and hjave been
*implemented*, before.
Programming languages did not start with Basic, Pascal or C. Algol was a
pretty sofisticated programming language. And it dates back to the early
*sixties*.
Bart.
------------------------------
Date: Thu, 21 Jan 1999 06:52:53 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Perl Y2K compliance
Message-Id: <5v7787.t4r.ln@magna.metronet.com>
Ted Hajduk (thajduk@starnetinc.com) wrote:
: Excuse me if this has already been discussed elsewhere,
Why would we be upset if it was discussed elsewhere?
We might be upset if it was discussed here though ;-)
A search of this newsgroup for "Y2K" on www.dejanews.com
finds one thousand four hundred hits.
Happy reading ;-)
: but can anyone
: point me to information on Perl Y2K compliance - interpreter, modules,
: etc?
A simple word search for "2000" in the Perl FAQs yields:
"Does Perl have a year 2000 problem? Is Perl Y2K compliant?"
: I was asked this by the Y2K coordinators at our company and I have been
: unable to find any information in the usual places.
I think you have some unusual usual places as the FAQs and a
Usenet archive are 2 of the top three usual places...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 21 Jan 1999 11:54:50 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: problem with: use module;
Message-Id: <7874ia$s7h$1@pegasus.csx.cam.ac.uk>
Bart Lateur <bart.lateur@skynet.be> wrote:
>M.J.T. Guy wrote:
>
>>But 'meow' does have the minor disadvantage that if you check your
>>module with perl -wc, you'll get an error
>>
>>Useless use of a constant in void context at ...
>
>It doesn't happen in an eval "'meow'", so I don't expect it in a normal
>require or use either.
Quite. That's why it's only a "minor disadvantage".
Mike Guy
------------------------------
Date: 20 Jan 1999 16:34:49 PST
From: dmi@delta1.deltanet.com (Dean Inada)
Subject: Re: Regex challenge
Message-Id: <785sn9$ccf@chronicle.concentric.net>
In article <slrn79ueln.2m2.eric@eric.nafex.com>, Eric Smith <eric@nafex.com> wrote:
>2) I want to march a lower case, upper case or mixed word and _replace_ it
>with the same case layout in the new word
>
>so
>Table becomes Chair
>TABLE becomes CHAIR
>table becomes chair
s/(table)/'chair' ^ lc($1) ^ $1/ie;
------------------------------
Date: Thu, 21 Jan 1999 04:38:19 -0800
From: "steven t henderson" <STEVENHENDERSON@prodigy.net>
Subject: Re: script outputting file instead of html page
Message-Id: <7877ku$77i2$1@newssvr03-int.news.prodigy.com>
if at all possible, set up the program to run from the command line and
redirect the output to a html file, like:
perl blah.pl > blah.htm
and check out the resulting htm file. your problem should be either present
or absent from this file since it represents what nav will see. just a
thought.
23_skidoo <23_skidoo@geocities.com> wrote in message
<36A61CC1.5375@geocities.com>...
>can anyone offer any explanations as to why a cgi script on an apache
>server would output as a file (which netscape doesn't recognise and
>saves as a text file) rather than as a page of html?
>
>i have checked the content header, it seems fine. i have also put
>
>print "Content-type: text/html\n\ntest?";
>
>and the text file that is output starts 'test?' so i know that the print
>command is being executed. it just seems to be ignored somewhere along
>the line.
>
>i put up a "hello world" script which worked fine, checked all the
>permissions, they were all the same... can anyone suggest directions i
>could check next?
>
>thanks very much for any suggestions.
>
>-23
------------------------------
Date: Thu, 21 Jan 1999 12:19:18 -0000
From: "webmaster (Intervid)" <webmaster@intervid.co.uk>
Subject: URGENT Perl Programmer needed
Message-Id: <36a71b41.0@nnrp1.news.uk.psi.net>
Rescue job required to correct object oriented perl program urgently (48
Hrs).
One off job, but may be more in future, for top web design company.
Please contact:
webmaster@intervid.co.uk
------------------------------
Date: Thu, 21 Jan 1999 06:11:48 -0600
From: "Ban Spam Now" <no_spam@no_spam.com>
Subject: Yet another basic question.
Message-Id: <7875kd$7hp@dfw-ixnews10.ix.netcom.com>
Is there any way to run an external ksh script, store the output in one Perl
variable and the return code in another Perl variable. Does Perl work in
such a way that the return code you get back will be the same as $? ?
Thanks again.
------------------------------
Date: Thu, 21 Jan 1999 05:29:34 -0800
From: Abraham Grief <abey@hill.ucr.edu>
To: Ban Spam Now <no_spam@no_spam.com>
Subject: Re: Yet another basic question.
Message-Id: <Pine.LNX.4.05.9901210502050.5810-100000@hill.ucr.edu>
The following program stores the output of another program named
'kshscript' and then prints the output and the exit status.
According to the camel book, the exit status of a child process
is $? >> 8 because the lower order bits contain other info, in the
same format as the status returned by wait(2).
!/usr/bin/perl -w
open(INPUT, 'kshscript |');
my @kshOutput = <INPUT>;
close(INPUT);
print @kshOutput;
printf "exit status: %i\n", $? >> 8;
- abey@cs.ucr.edu
On Thu, 21 Jan 1999, Ban Spam Now wrote:
> Is there any way to run an external ksh script, store the output in one Perl
> variable and the return code in another Perl variable. Does Perl work in
> such a way that the return code you get back will be the same as $? ?
>
>
> Thanks again.
>
>
>
>
>
>
------------------------------
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 4709
**************************************