[17150] in Perl-Users-Digest
Perl-Users Digest, Issue: 4562 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 9 14:10:33 2000
Date: Mon, 9 Oct 2000 11:10:18 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <971115018-v9-i4562@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 9 Oct 2000 Volume: 9 Number: 4562
Today's topics:
Help about h2xs <osipra@opendata.fr>
Re: Help about h2xs (Ilya Zakharevich)
Help in error handling nikitakin@yahoo.com
Re: How can I set and read a variable like the session- <julien@stokkink.com>
How to check if a value is a number or a string? <none@none.ca>
Re: How to check if a value is a number or a string? <sariq@texas.net>
Re: How to check if a value is a number or a string? (Honza Pazdziora)
Re: integer length limitation <greg.lindsay@level3.com>
IRC::Net stuff... <blackmail@camelot.de>
Re: Newbie -> ini file to hash table? <edmond.nolan@debitel.net>
Re: Numeric processing problem. (Gwyn Judd)
Re: Numeric processing problem. <jondecamp@home.com>
Re: Perl Books! (Ben Coleman)
Re: Perl Books! (Clinton A. Pierce)
Perl question with Apache web server thundaar54@my-deja.com
Re: Perl question with Apache web server <newsposter@cthulhu.demon.nl>
Perl with Apache - Several questions for you thundaar54@my-deja.com
Re: PP, 3rd ed.??? (Ben Coleman)
Re: PP, 3rd ed.??? <nospam@david-steuber.com>
Re: PP, 3rd ed.??? <nospam@david-steuber.com>
Quick form variable question damian_taylor@my-deja.com
Re: Quick form variable question <bmb@ginger.libs.uga.edu>
Re: Rounding Integers <dperham@dperham.eng.tvol.net>
Re: string substitution <celliot@tartarus.uwa.edu.au>
Re: string substitution <anmcguire@ce.mediaone.net>
symlink utime and chown <steeve@pebbles.eps.mcgill.ca>
system command <john@eagleinfosystems.com>
Re: system command <steeve@pebbles.eps.mcgill.ca>
Re: system command <john@eagleinfosystems.com>
Re: system command <tony_curtis32@yahoo.com>
the fastest way to test String A included by String B <wstsoi@hongkong.com>
Re: the fastest way to test String A included by String <sariq@texas.net>
Re: the fastest way to test String A included by String (Rafael Garcia-Suarez)
use of "suidperl" <cpegbeggar@mail.com>
Re: What does $++ mean? (Gwyn Judd)
Re: What does $++ mean? <gmiller@gregmiller.net>
Re: What does $++ mean? <bmb@ginger.libs.uga.edu>
Re: Where can I find more information of perldoc HTML:: <carfield@programmer.net>
Windows system tray <amir_e_a@netvision.net.il>
XSL (from CGI) not kept on server? spwnet@mailcity.com
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 09 Oct 2000 17:02:17 GMT
From: "Olivier Sipra" <osipra@opendata.fr>
Subject: Help about h2xs
Message-Id: <tSmE5.1160$4K1.5474494@nnrp3.proxad.net>
Hi,
I 'm trying to use h2xs to generate an interface for a specific DLL under
Win32
but when I call h2xs with the apparently correct options, I get an error
message :
Command Line Error D2003: missing source filename
The syntax I use to call h2xs is : h2xs -OCxn module_name include_file_name
I tried to trace the sources of h2xs.bat, Scan.pm & Flow.pm but I found
nothing.
Is there someone that allready used h2xs and have a solution for me.
I would appreciate help.
Olivier Sipra
osipra@free.fr
------------------------------
Date: 9 Oct 2000 17:23:24 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Help about h2xs
Message-Id: <8rsuuc$ml1$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Olivier Sipra
<osipra@opendata.fr>],
who wrote in article <tSmE5.1160$4K1.5474494@nnrp3.proxad.net>:
> Hi,
>
> I 'm trying to use h2xs to generate an interface for a specific DLL under
> Win32
> but when I call h2xs with the apparently correct options, I get an error
> message :
> Command Line Error D2003: missing source filename
>
> The syntax I use to call h2xs is : h2xs -OCxn module_name include_file_name
> I tried to trace the sources of h2xs.bat, Scan.pm & Flow.pm but I found
> nothing.
What is your
perl "-V:.*cpp.*"
? Apparently, you preprocessor does not understand "-" given as the
file name... I thought people who took maintainance of C::Scan took
care of this limitation of MS products, but maybe your Config.pm is
misleading...
Ilya
------------------------------
Date: Mon, 09 Oct 2000 14:51:20 GMT
From: nikitakin@yahoo.com
Subject: Help in error handling
Message-Id: <8rsm15$137$1@nnrp1.deja.com>
Hi,
I have been trying to use try - catch in my scripts for which I have
used the Error module from cpan.
I am struggling to use it.
Can anybody help me as to how to throw new error or sub classes of
errors?
Has anybody used this module?
Thanks,
Nikita K
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 09 Oct 2000 16:29:33 GMT
From: "Julien Stokkink" <julien@stokkink.com>
Subject: Re: How can I set and read a variable like the session-variable in ASP ?
Message-Id: <NnmE5.717891$Kw2.6498955@flipper>
Oke, thanks for your info.
Julien
------------------------------
Date: Mon, 9 Oct 2000 13:37:04 -0300
From: "k" <none@none.ca>
Subject: How to check if a value is a number or a string?
Message-Id: <1xmE5.43053$YG5.38330@tor-nn1.netcom.ca>
Is there any way to test if a value is a number?
Something like:
$num = 59.95;
print "This is a number" if &Value_Is_A_Number($num);
In the above situation, it wouldn't print if $num was a string (ex: $num =
"abc";).
I though checking for Non-Digit characters would work:
print "This is a number" unless $num =~ m/\D/;
but it doesn't since decimals are seems as "Word" characters.
Is there an easier way to do this???
Thanks,
kh
------------------------------
Date: Mon, 09 Oct 2000 16:45:22 GMT
From: Tom Briles <sariq@texas.net>
Subject: Re: How to check if a value is a number or a string?
Message-Id: <39E1F622.5FE3D21C@texas.net>
k wrote:
>
> Is there any way to test if a value is a number?
RTFFAQ.
perldoc -q number
- Tom
------------------------------
Date: Mon, 9 Oct 2000 16:45:55 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: How to check if a value is a number or a string?
Message-Id: <G2698J.3EH@news.muni.cz>
On Mon, 9 Oct 2000 13:37:04 -0300, k <none@none.ca> wrote:
>
> Something like:
>
> $num = 59.95;
> print "This is a number" if &Value_Is_A_Number($num);
>
> In the above situation, it wouldn't print if $num was a string (ex: $num =
> "abc";).
>
> I though checking for Non-Digit characters would work:
>
> print "This is a number" unless $num =~ m/\D/;
>
> but it doesn't since decimals are seems as "Word" characters.
>
> Is there an easier way to do this???
The perlfaq4 has a nice section about the topic, titled
How do I determine whether a scalar is a number/whole/integer/float?
Hope this helps,
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
.project: Perl, DBI, Oracle, MySQL, auth. WWW servers, MTB, Spain.
Petition for a Software Patent Free Europe http://petition.eurolinux.org
------------------------------------------------------------------------
------------------------------
Date: Mon, 9 Oct 2000 09:31:46 -0600
From: "Greg Lindsay" <greg.lindsay@level3.com>
Subject: Re: integer length limitation
Message-Id: <39e1e4f7$0$20336@news.denver1.Level3.net>
Thanks Anno & Logan, I appreciate the help! Both solutions worked for me.
-Greg
"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
news:8rs6nd$j7e$1@lublin.zrz.tu-berlin.de...
> Logan Shaw <logan@cs.utexas.edu> wrote in comp.lang.perl.misc:
> >In article <39de57cb$0$25501@news.denver1.Level3.net>,
> >Greg Lindsay <greg.lindsay@level3.com> wrote:
> >>I'm trying to execute a modulus on a number, but keep coming up with the
> >>wrong answer. The only thing I can think of is that the number is being
> >>truncated because it's too big. How do I tell perl to keep the entire
> >>number instead of expressing it as 3.37587917446654e+35?
> >
> >Perl is using your system's built-in floating point type. Floating
> >point types store numbers as a mantissa and an exponent, with a fixed
> >precision for each one. They do this so you can store large numbers
> >without needing to use more than a fixed number of bits (32 or 64,
> >usually).
> >
> >What you want is some sort of "bignum" package, i.e. a way to make Perl
> >know how to deal with numbers that have arbitrarily large precision. I
>
> It's probably advisable to use arbitrary precision with a problem
> like this. However, if the modulus is small enough (its square fitting
> into an integer), the desired result can be obtained with native integer
> arithmetic, and quite efficient at that.
>
> sub expmod {
> use integer;
> my ( $x, $e, $m) = @_;
> my $res = 1;
> while ( $e ) {
> if ( $e % 2 ) {
> $res *= $x;
> $res %= $m;
> }
> $x *= $x;
> $x %= $m;
> $e /= 2;
> }
> return $res;
> }
>
> This calculates $x**$e % $m in time proportional to log $e. The same
> algorithm would be used with arbitrary precision arithmetic to keep
> the intermediate results manageable.
>
> Anno
------------------------------
Date: Mon, 09 Oct 2000 19:13:52 +0200
From: Blackmail <blackmail@camelot.de>
Subject: IRC::Net stuff...
Message-Id: <39E1FCD0.B8CB0BF4@camelot.de>
Hi!
I'd like to implement a bot on a IRC channel. Since I'm not so good in
Perl, I'd like to know how to make the bot "speak" to the public in a
channel.
I've already made it connect to the server, join a channel, but it can't
speak...
TIA,
Laumann.
------------------------------
Date: Mon, 09 Oct 2000 19:27:30 +0200
From: Edmond Nolan <edmond.nolan@debitel.net>
Subject: Re: Newbie -> ini file to hash table?
Message-Id: <39E20002.3818F93D@debitel.net>
Hi Gwyn,
thanks for the reply, that's exactly what I was looking for!
I just have one question though, it seems from the first you wrote
"I was shocked! How could Edmond Nolan <edmond.nolan@debitel.net>
say such a terrible thing:" that you were making a joke, but I didn't get it
:(
Could you clear me up?
In any case thanks very much for the code snippet!
Regards
Eddie
Gwyn Judd wrote:
> I was shocked! How could Edmond Nolan <edmond.nolan@debitel.net>
> say such a terrible thing:
> >Hi,
> >
> >how do I add entries from an INI file to a hash table?
> >
> >My INI file would look like this ...
> >
> >debug = true
> >debug_level = ff
> >comm = http
> >
> >I'd like to read each line and split it at the "=" sign into
> >a key and value, for insertion into a hash table.
>
> Sounds like a good overall plan to me. I would do something like:
>
> #!/usr/bin/perl -w
> use strict;
>
> open INI, "inifile.ini" or die $!;
>
> my %hash;
>
> while (<INI>)
> {
> chomp;
> my ($key, $value) = split /\s+=\s+/;
> $hash{$key} = $value;
> }
>
> # print the hash out
> use Data::Dumper;
>
> print Dumper \%hash;
>
> __END__
>
> Note that this doesn't do anything in the situation where one key is
> mentioned more than once (correction: it overwrites the original value).
> This may or may not be correct :)
>
> Here is a pointer to some documentation so you can figure out some of
> this stuff. I've included a fair amount here since I'm guessing from one
> of your other responses that you are fairly new to this:
>
> perldoc -f open
> perldoc perldata # see the stuff on hashes
> perldoc perlop # see the stuff on I/O operators
> perldoc -f split
> perldoc -f chomp # leave the 'chomp' line out and run the program again
> # to see what it actually does
> perldoc -f my
> perldoc strict
>
> I'm not sure if the 'perldoc' command is available on windows, however
> whatever distribution of perl you have should have this documentation in
> there in some form or other.
>
> --
> Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
> Don't tell any big lies today. Small ones can be just as effective.
>
> -- Unknown
------------------------------
Date: Mon, 09 Oct 2000 13:11:05 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Numeric processing problem.
Message-Id: <slrn8u3dmb.29r.tjla@thislove.dyndns.org>
I was shocked! How could Bart Lateur <bart.lateur@skynet.be>
say such a terrible thing:
>Jon DeCamp wrote:
>
>> All I can offer further are more 11/6 digit pairs, because I have
>>plenty.
>
>Do you have *all* of them? Because, then, all you need is a lookup
>table.
Or a really big regex substitution.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Numbers are like people; torture them enough and they'll tell you
anything. (contributed by Chris Johnston)
------------------------------
Date: Mon, 09 Oct 2000 16:18:42 GMT
From: Jon DeCamp <jondecamp@home.com>
Subject: Re: Numeric processing problem.
Message-Id: <39E1F0DE.F8B3D614@home.com>
I have 99 11/6 digit pairs. I was not given the entire list of 11 digit
numbers that need to be converted until I say it can be done. There are
well over 3000 of them (That's why Perl comes in handy.)
-Jon DeCamp
Bart Lateur wrote:
> Jon DeCamp wrote:
>
> > All I can offer further are more 11/6 digit pairs, because I have
> >plenty.
>
> Do you have *all* of them? Because, then, all you need is a lookup
> table.
>
> --
> Bart.
------------------------------
Date: Mon, 09 Oct 2000 15:48:05 GMT
From: oloryn@mindspring.com (Ben Coleman)
Subject: Re: Perl Books!
Message-Id: <39e1e827.411347526@localhost>
On Mon, 09 Oct 2000 02:23:57 GMT, Elaine Ashton
<elaine@chaos.wustl.edu> wrote:
>Piracy is not about Captain Hook :)
I'm going to have to agree with RMS on this one. Piracy *is* about
Captain Hook. Copyright infringement has nothing to do with piracy.
Ben
------------------------------
Date: Mon, 09 Oct 2000 16:54:46 GMT
From: clintp_cl@geeksalad.org (Clinton A. Pierce)
Subject: Re: Perl Books!
Message-Id: <qLmE5.32486$hD4.7735681@news1.rdc1.mi.home.com>
In article <39E0E0A3.95E5F2DC@hotmail.com>,
YMEY <ymeydotcom@hotmail.com> writes:
>
> LOL, I guess checking the same books out from the library and scanning
> pages through "Text Bridge" for later reference is pirating to... LMAO I
> think you need to look up the definition of "Piracy" as the law sees
> it...
I doubt you could convince a jury in a civil trial that reprinting
copyrighted texts and publishing them on the web and advertizing them
in a newsgroup could be considered "fair use".
Note to the publishers sent. Good luck. And *plonk*.
------------------------------
Date: Mon, 09 Oct 2000 17:06:38 GMT
From: thundaar54@my-deja.com
Subject: Perl question with Apache web server
Message-Id: <8rstup$82o$1@nnrp1.deja.com>
Greetings all.
Bear with me as I'm a newbie to perl and apache
but I'm learning!
I'm running Apache 1.3.12 for Windows, running it
on a Windows NT server. I am also running
ActiveState Perl, latest build of perl. Here's
the nuff:
I have a form that the web user will fill out,
click the submit button, and then execute my
script. The script is designed to search a MS
Access database and then return the results.
However, when I click on the button, the server
just returns the text of my code, nothing else.
I've made sure that the first line of my code is
the path to my perl.exe, double-checked the ODBC
driver for the database and that is correct. I
think that I have the httpd.conf file for the
server correct but am unsure. Any thoughts or
should I just give up and have a beer?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 9 Oct 2000 17:23:06 GMT
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: Perl question with Apache web server
Message-Id: <8rsutq$dvh$1@internal-news.uu.net>
thundaar54@my-deja.com wrote:
> I think that I have the httpd.conf file for the
> server correct but am unsure. Any thoughts or
> should I just give up and have a beer?
Get yourself a beer, sit down in a comfortable chair
and relax. Then check the documentation that comes with
apache. And check www.apache.org, and if that still doesn't
help, find a newsgroups discussing the configuration of
webservers/apache.
Erik
------------------------------
Date: Mon, 09 Oct 2000 17:08:16 GMT
From: thundaar54@my-deja.com
Subject: Perl with Apache - Several questions for you
Message-Id: <8rsu1q$847$1@nnrp1.deja.com>
Greetings all.
Bear with me as I'm a newbie to perl and apache but I'm learning!
I'm running Apache 1.3.12 for Windows, running it on a Windows NT
server. I am also running ActiveState Perl, latest build of perl.
Here's the nuff:
I have a form that the web user will fill out, click the submit button,
and then execute my script. The script is designed to search a MS
Access database and then return the results. However, when I click on
the button, the server just returns the text of my code, nothing else.
I've made sure that the first line of my code is the path to my
perl.exe, double-checked the ODBC driver for the database and that is
correct. I think that I have the httpd.conf file for the server
correct but am unsure. Any thoughts or should I just give up and have
a beer?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 09 Oct 2000 14:36:42 GMT
From: oloryn@mindspring.com (Ben Coleman)
Subject: Re: PP, 3rd ed.???
Message-Id: <39e1d7b5.407137332@localhost>
On Sun, 08 Oct 2000 10:46:25 -0700, "Godzilla!"
<godzilla@stomp.stomp.tokyo> wrote:
>Would you have me say "intent malice" ?
I'd expect someone with a knowledge of correct English to say
"malicious intent". What was your background again?
Ben
------------------------------
Date: Mon, 09 Oct 2000 16:48:25 GMT
From: David Steuber <nospam@david-steuber.com>
Subject: Re: PP, 3rd ed.???
Message-Id: <m31yxqezaf.fsf@solo.david-steuber.com>
ebohlman@omsdev.com (Eric Bohlman) writes:
' David Steuber <nospam@david-steuber.com> wrote:
' > Isn't 'malice' a noun? Oh, but I forget. We in the computer business
' > turn nouns into verbs or adjectives all day long. That's what we do.
'
' YM "We in the computer business verb nouns and adjective them all day
' long."
But with no intent malice.
Have you paradigmed a process today?
--
David Steuber | Perl apprentice, Apache/mod_perl user,
NRA Member | and general Internet web wannabe.
ICQ# 91465842
*** http://www.david-steuber.com/ ***
------------------------------
Date: Mon, 09 Oct 2000 16:50:38 GMT
From: David Steuber <nospam@david-steuber.com>
Subject: Re: PP, 3rd ed.???
Message-Id: <m3wvfidkma.fsf@solo.david-steuber.com>
"Godzilla!" <godzilla@stomp.stomp.tokyo> writes:
' > No malice intended, 'Godzilla'. ;-)
'
' Right. You are a lying pile of mule manure.
You must be a joy to work with in the office. Can I get the cubical
next to yours?
--
David Steuber | Perl apprentice, Apache/mod_perl user,
NRA Member | and general Internet web wannabe.
ICQ# 91465842
*** http://www.david-steuber.com/ ***
------------------------------
Date: Mon, 09 Oct 2000 15:00:05 GMT
From: damian_taylor@my-deja.com
Subject: Quick form variable question
Message-Id: <8rsmhh$1h8$1@nnrp1.deja.com>
Hi everyone.
I have a quick newbie question for you.
I have a form with a drop down list.
The list name is "door" and can have 2 values - "None" and "Solid".
My question - how do I test what selection the user made in the CGI
program?
I am writing my CGI in Perl.
Thanks in advance for your help.
Regards.
Damian.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 9 Oct 2000 11:35:38 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Quick form variable question
Message-Id: <Pine.A41.4.21.0010091133490.11514-100000@ginger.libs.uga.edu>
On Mon, 9 Oct 2000 damian_taylor@my-deja.com wrote:
> Hi everyone.
> I have a quick newbie question for you.
> I have a form with a drop down list.
> The list name is "door" and can have 2 values - "None" and "Solid".
>
> My question - how do I test what selection the user made in the CGI
> program?
> I am writing my CGI in Perl.
>
See
perldoc CGI
If you use CGI; (highly recommended), the param() routine can give you
that information.
Brad
------------------------------
Date: 09 Oct 2000 10:31:43 -0400
From: Doug Perham <dperham@dperham.eng.tvol.net>
Subject: Re: Rounding Integers
Message-Id: <81g0m69jcg.fsf@wgate.com>
"Godzilla!" <godzilla@stomp.stomp.tokyo> writes:
>
>
> sub Do_It
> {
> if ($number == 0)
> { print "You are an idiot.\n"; }
> elsif (index ($number, ".") > -1)
> { print "You are an idiot.\n"; }
> elsif (length ($number) < 3)
> { print "You are an idiot.\n"; }
> else
> {
> print "Input: $number\n";
>
> if (substr ($number, -2, 2) <= 50)
> { $round = substr ($number, -2, 2, "00"); }
> else
> {
> $round = substr ($number, -2, 2, "00");
> $round = substr ($number, -3, 1, substr ($number, -3, 1) + 1);
> }
> }
> if (length ($number) > 0)
> { print "Output: $number\n\n"; }
> else
> { print "There is no number.\n\n"; }
> }
>
> exit;
>
This is the ugliest piece of rounding code I've ever seen.
--
Doug Perham o{..}o
moo! (oo)___
(______)\
/ \ / \
------------------------------
Date: Mon, 9 Oct 2000 21:06:49 +0800
From: "Cameron Elliott" <celliot@tartarus.uwa.edu.au>
Subject: Re: string substitution
Message-Id: <39e1c33d$0$27596@echo-01.iinet.net.au>
That would be all and well if there was an appropriate RTF module that was
complete. I have searched and there isn't... Anyway, this is a specific
application to an RTF style document, not a general parsing which is all an
RTF module would do anyway..
Anders Lund <anders@wall.alweb.dk> wrote in message
news:jdiE5.7029$u23.192085@news000.worldonline.dk...
| Cameron Elliott wrote:
|
| > |
| > | it would be easier to do this with some sample input :)
| >
| > well this is what I am dealing with (RTF)
|
| So, you go to http://search.cpan.org and look for RTF...
|
| -anders
|
| --
| [ the word wall - and the trailing dot - in my email address
| is my _fire_wall - protecting me from the criminals abusing usenet]
------------------------------
Date: Mon, 9 Oct 2000 10:32:17 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: string substitution
Message-Id: <Pine.LNX.4.21.0010091026380.16643-100000@hawk.ce.mediaone.net>
On Mon, 9 Oct 2000, brian d foy quoth:
bdf> In article <Pine.LNX.4.21.0010090004540.16178-100000@hawk.ce.mediaone.net>, "Andrew N. McGuire " <anmcguire@ce.mediaone.net> posted:
bdf>
bdf> > On Mon, 9 Oct 2000, Cameron Elliott quoth:
bdf>
bdf> > CE> I want to be able to remove the following from a string:
bdf> > CE>
bdf> > CE> all { and }'s
bdf> > CE>
bdf> > CE> any \ followed by any chars or numbers except
bdf> > CE>
bdf> > CE> \ followed by s followed by numbers and ie. \s23 \s43
bdf> > CE> \ followed by cell ie. \cell
bdf> > CE>
bdf> > CE> basically I have a string and want only the words without \ infront of them
bdf> > CE> plus \cell and \s23 (any number) and also want to remove all { and }'s.
bdf>
bdf> > tr/}{//d;
bdf> > s/\\(?!s\d+|cell)\w+//g;
bdf>
bdf> that \w won't do the trick. it only matches word characters, but you
bdf> need to match more than that. remember the the definition of "word"
bdf> is a bit fuzzy being that it is a common, um, word.
s/\\(?!s\d+|cell).+?(?=\s+)|[}{]//g;
Again, I am not a regex guru, so your solution is probably better.
anm
--
perl -wMstrict -e '
$a=[[qw[J u s t]],[qw[A n o t h e r]],[qw[P e r l]],[qw[H a c k e r]]];$.++
;$@=$#$a;$$=[reverse sort map$#$_=>@$a]->[$|];for$](--$...$$){for$}($|..$@)
{$$[$]][$}]=$a->[$}][$]]}}$,=$";$\=$/;print map defined()?$_:$,,@$_ for @$;
'
------------------------------
Date: Mon, 09 Oct 2000 13:57:59 GMT
From: Steeve McCauley <steeve@pebbles.eps.mcgill.ca>
Subject: symlink utime and chown
Message-Id: <H9kE5.1296$X76.39282@carnaval.risq.qc.ca>
How can I set atime, mtime and uid,gid for a symlink.
chown() and utime() operate on the link target and
not the symlink itself.
This is what I'm trying to do,
# where's the symlink pointing
$ptr = readlink $link;
# backup the symlink somewhere else
symlink $ptr, "$bdir/$level/$link";
$ls = lstat $link;
if ($ls) {
$uid=$ls->uid;
$gid=$ls->gid;
# there's gotta be a better way
`chown $uid:$gid "$bdir/$level/$link"`;
# how do I set the time?
}
the system call to /bin/chown is an ugly hack.
--
steeve SysAdmin EPS McGill University Mtl Qc
:wq
------------------------------
Date: Mon, 9 Oct 2000 09:22:04 -0400
From: "John Menke" <john@eagleinfosystems.com>
Subject: system command
Message-Id: <39e1c679_2@news.eclipse.net>
I am running ActivePerl on a windows 98 machine and want to run a perl
script from another perl script.
I have read about the system command and want to use it to execute the
second script then return to the first script.
The path to my second script is f:/rss2/rss2html.pl
What I want to do is call the second script and direct it's output to a html
file called myfile.html. I have been trying this with no success.
($urlsource is a command line argument to rss2html.pl)
my $progpath = "f:/rss2/";
@args = ("rss2html | myfile.html", $urlsource);
system $progpath (@args) == 0
or print "not working";
can anyone help me with this?
------------------------------
Date: Mon, 09 Oct 2000 14:10:12 GMT
From: Steeve McCauley <steeve@pebbles.eps.mcgill.ca>
Subject: Re: system command
Message-Id: <8lkE5.1298$X76.39282@carnaval.risq.qc.ca>
John Menke <john@eagleinfosystems.com> wrote:
: I am running ActivePerl on a windows 98 machine and want to run a perl
: script from another perl script.
: I have read about the system command and want to use it to execute the
: second script then return to the first script.
: The path to my second script is f:/rss2/rss2html.pl
: What I want to do is call the second script and direct it's output to a html
: file called myfile.html. I have been trying this with no success.
: ($urlsource is a command line argument to rss2html.pl)
: my $progpath = "f:/rss2/";
: @args = ("rss2html | myfile.html", $urlsource);
Use '>' rather than '|'. The second symbol is a
pipe symbol which is meant to feed input to another
program. For example, "rss2html | more"
: system $progpath (@args) == 0
: or print "not working";
: can anyone help me with this?
--
steeve SysAdmin EPS McGill University Mtl Qc
:wq
------------------------------
Date: Mon, 9 Oct 2000 12:59:45 -0400
From: "John Menke" <john@eagleinfosystems.com>
Subject: Re: system command
Message-Id: <39e1f97f_2@news.eclipse.net>
> Use '>' rather than '|'. The second symbol is a
> pipe symbol which is meant to feed input to another
> program. For example, "rss2html | more"
>
doh... I have tried to use '>' and that is still not writing the file.
here is what I have:
my $progpath = "f:/rss2/";
@args = ("rss2html > myfile.html", $urlsource);
system $progpath (@args) == 0
or print "not working";
It doesn't return an error, but the file never gets' written. when I run
this on the command line it will write the file:
rss2html.pl http://slashdot.org/slashdot.rdf > myfile.html
how do I do this via system and pass variables instead of the url and the
actual file?
------------------------------
Date: 09 Oct 2000 12:07:12 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: system command
Message-Id: <87hf6muenz.fsf@limey.hpcc.uh.edu>
>> On Mon, 9 Oct 2000 12:59:45 -0400,
>> "John Menke" <john@eagleinfosystems.com> said:
> my $progpath = "f:/rss2/"; @args = ("rss2html >
> myfile.html", $urlsource); system $progpath (@args) == 0
> or print "not working";
You're trying to run a program called "f:/rss2/" with
arguments "rss2html > myfile.html" and $urlsource. Or so
it looks to me from your article.
I think what you really want is
system "f:/rss2/rss2html > myfile.html $urlsource";
although personally I would have put the redirection at
the end of the line:
system "$progpath/rss2html $urlsource > myfile.html";
Note the system() arguments are quoted to put them through
a shell so that > does what you want. Note also how to
interpret the return value of system() in "perldoc -f system".
hth
t
--
Namaste!
And an "oogabooga" to you too!
-- Homer Simpson
------------------------------
Date: Mon, 9 Oct 2000 23:20:11 +0800
From: "Lucas" <wstsoi@hongkong.com>
Subject: the fastest way to test String A included by String B
Message-Id: <8rsnme$7k51456@imsp212.netvigator.com>
Hi all,
I got two strings,
@A = ("apple", "banana", "cherry", "cocount", "pear", "peach", "mango");
@B = ("cherry", "banana", "pear");
what is the fastest way to test whether B is a subset of A?
Thanks.
Lucas
------------------------------
Date: Mon, 09 Oct 2000 15:34:45 GMT
From: Tom Briles <sariq@texas.net>
Subject: Re: the fastest way to test String A included by String B
Message-Id: <39E1E595.48A81211@texas.net>
[ Nonexistent newsgroup removed. ]
Lucas wrote:
>
> I got two strings,
> @A = ("apple", "banana", "cherry", "cocount", "pear", "peach", "mango");
> @B = ("cherry", "banana", "pear");
>
> what is the fastest way to test whether B is a subset of A?
Those aren't strings.
perldoc perldata
Then,
perldoc -q contains
And finally,
perldoc perldoc
perldoc perl
- Tom
------------------------------
Date: Mon, 09 Oct 2000 15:37:25 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: the fastest way to test String A included by String B
Message-Id: <slrn8u3pul.elj.rgarciasuarez@rafael.kazibao.net>
Lucas wrote in comp.lang.perl.misc:
>Hi all,
>
>I got two strings,
>@A = ("apple", "banana", "cherry", "cocount", "pear", "peach", "mango");
>@B = ("cherry", "banana", "pear");
These are not strings ; these are arrays.
>what is the fastest way to test whether B is a subset of A?
Use a hash instead of an array for A.
perldoc -q element
--
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: Mon, 09 Oct 2000 21:36:21 +0800
From: Beggar <cpegbeggar@mail.com>
Subject: use of "suidperl"
Message-Id: <39E1C9D5.A6F90D8B@mail.com>
Hi all,
I want to know the use of "suidperl", i cannot find the man page.
Is that a command
eg. > suidperl testing.pl
or funtion call inside perl code.
And how to call the perl program from web page?
Do I still need to set the suid bit of the file I want to access?
Thanks!!
Dicky
------------------------------
Date: Mon, 09 Oct 2000 13:20:21 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: What does $++ mean?
Message-Id: <slrn8u3e7o.29r.tjla@thislove.dyndns.org>
I was shocked! How could harry@drej.com <harry@drej.com>
say such a terrible thing:
>I'm looking at some sample code which begins:
>
>#!/usr/bin/perl -T
>use strict;
>$++;
I see you figured it out, but I thought you'd like to know that
alternatively:
#!/usr/bin/perl -T
use strict;
$+++;
is not a syntax error. Although it does not run of course.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Passion is that funny feeling that drives a man to bite a woman's neck
because she has beautiful legs.
------------------------------
Date: Mon, 09 Oct 2000 10:27:13 -0400
From: Greg Miller <gmiller@gregmiller.net>
Subject: Re: What does $++ mean?
Message-Id: <acl3usokuqhacpd172iemg6kdpghhcblm4@4ax.com>
Even if it's a misprint, it's still incrementing a variable
which hasn't been initialized.
On Sun, 8 Oct 2000 10:38:21 -0400, Brad Baxter
<bmb@ginger.libs.uga.edu> wrote:
>On Sun, 8 Oct 2000 harry@drej.com wrote:
>
>> I'm looking at some sample code which begins:
>>
>> #!/usr/bin/perl -T
>> use strict;
>> $++;
>>
>> I have looked far and wide for the meaning of $++. I would not be
>> posting this if I could find it myself, have looked through "Programming
>> Perl", other books, newsgroups, etc.
>>
>
>Looks like a misprint to me.
>
>Brad
----
Greg Miller (gmiller@nospam gregmiller.net)
http://www.customprogrammer.com
http://www.gregmiller.net
http://www.net-chess.com
------------------------------
Date: Mon, 9 Oct 2000 11:40:12 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: What does $++ mean?
Message-Id: <Pine.A41.4.21.0010091136170.11514-100000@ginger.libs.uga.edu>
On Mon, 9 Oct 2000, Greg Miller wrote:
> Even if it's a misprint, it's still incrementing a variable
> which hasn't been initialized.
Uh, actually, as it is, it's not doing anything because it won't compile.
That's what led me to believe that it was a misprint.
Brad
------------------------------
Date: Tue, 10 Oct 2000 00:43:06 +0800
From: Carfield Yim <carfield@programmer.net>
Subject: Re: Where can I find more information of perldoc HTML::Parser?
Message-Id: <39E1F59A.7AB42291@programmer.net>
Thx a lot! I solve my problem with TokeParser. But I think I still need
to learn more about HTML::Parser, as it act very difference compare with
most other module.
Bart Lateur wrote:
>
> Carfield Yim wrote:
>
> >After I read the perldoc of HTML::Parser, I still not get how to use
> >this package, and my testing code don't work at all. Can anyone tell me
> >where can I find more information of using HTML::Parser?
>
> Perhaps take a look at HTML::TokeParser. That is HTML::Parser turned
> inside out, with an interface that works in the same way like we
> ordinarily get data out of files.
>
> --
> Bart.
------------------------------
Date: Mon, 9 Oct 2000 18:08:05 +0200
From: "Amir E. Aharoni" <amir_e_a@netvision.net.il>
Subject: Windows system tray
Message-Id: <8rsqj3$qf7$1@news.netvision.net.il>
Does anyone know how to make Perl use Windows' taskbar system tray?
I tried looking in CPAN and found nada; and MSDN has only Visual Basic
examples.
Thanks in advance for any help.
------------------------------
Date: Mon, 09 Oct 2000 15:16:23 GMT
From: spwnet@mailcity.com
Subject: XSL (from CGI) not kept on server?
Message-Id: <8rsng1$28q$1@nnrp1.deja.com>
I want to create an XML file dynamically for one of several formats
(magazines, books, newspapers etc) and can do this quite easily
with a Perl CGI script, given a data file with the field names as well
as the actual records:
e.g. data file for books:
BookTitle,AuthorSurname, PublisherID, YearOfPub, Format
Lord Of The Rings,Tolkien,Unwin,1966,PB
e.g. data file for magazines:
Title,PublisherID,YearOfPub,VolNumber,IssueNumber
New Scientist,IPC,2000,100,12
When the XML is generated it is sent to the client. All fine so far.
However, for space and security reasons I don't want to store the
XSL on the server. Is it possible to dynamically generate XSL via a
Perl CGI script so that the XSL is accessible to the client but is NOT
stored on the serving computer? (eg making the XSL inline somehow with
the XML?)
Sean
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 4562
**************************************