[7499] in Perl-Users-Digest
Perl-Users Digest, Issue: 1125 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 4 11:05:46 1997
Date: Sat, 4 Oct 97 08:00:26 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 4 Oct 1997 Volume: 8 Number: 1125
Today's topics:
Automated subscription with .htaccess ECSSPEAR@livjm.ac.uk
Re: better at win32/COM/gui: python or perl?? <pvhp@forte.com>
change referer and ip address ? (Javier Vargas)
DProf installation problems... (Daniel Walton)
h2ph <yeowkee@slime.ipv6.irdu.nus.sg>
Re: h2ph (Mike Stok)
help the new user <kckcheng@netvigator.com>
Re: help the new user (Mike Stok)
Re: help the new user (Tad McClellan)
How to use string contents as string name <mission@bellsouth.net>
Re: How to use string contents as string name (Mike Stok)
Re: ioctl (Markus Borbely)
Re: Is there a Newsgroup for "Perl for NT and/or IIS"? <pvhp@forte.com>
New pages/mirror -- 5600+ links on Object-Orientation ( <manfred.schneider@rhein-neckar.de>
New to Perl - How to get Windows version (Greg Teets)
Re: New to Perl - How to get Windows version <Steinar.Kleven@ahs.hist.no>
Re: Newbie ques: How to concatenate two strings? <jgostin@shell2.ba.best.com>
Re: Q: FREE DATABASES AND PERL CGI <pvhp@forte.com>
Re: regex matching HTML comments <russ@mail.org.uk>
regexp question. (Calle ]sman)
Re: regexp question. (Tad McClellan)
send another referer an ip using perl ? (Javier Vargas)
Sending files with sendmail ECSSPEAR@livjm.ac.uk
Re: System calls (Billy Chambless)
Re: System calls (Tad McClellan)
Re: Trapping Errors on Object Creation (Jason Gloudon)
Re: Turning a formmated string into a list <Matthew.Rice@ftlsol.com>
Re: Unlist syntax <russ@mail.org.uk>
Re: Unlist syntax (Jason Gloudon)
Re: Wanted: Wall/Schwartz book (1st ed) (dk smith)
Re: Wanted: Wall/Schwartz book (1st ed) <pas@unh.edu>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 04 Oct 1997 15:31:20 -0700
From: ECSSPEAR@livjm.ac.uk
Subject: Automated subscription with .htaccess
Message-Id: <3436C3B8.49E3@livjm.ac.uk>
Does anyone know of any scripts that will automate the subscription of
new users using .htaccess?
Simon Pearce
Webmaster
ScoutNet UK
------------------------------
Date: Fri, 03 Oct 1997 23:23:38 -0700
From: Peter Prymmer <pvhp@forte.com>
To: John Nielsen <jnielsen@chemistry.mps.ohio-state.edu>
Subject: Re: better at win32/COM/gui: python or perl??
Message-Id: <3435E0EA.1217@forte.com>
John Nielsen wrote:
>
> I have recently entered into the NT world from Unix and am looking
> at the scripting languages available for NT.
>
> Both python and perl look to be reasonably solid on the NT platform.
>
> So, I am curious which supports COM and win32 better?
>
> For example, one thing I have of interest is MAPI. I'd like to resolve
> a mail alias into their corresponding usernames. It looks like I'd have
> to use extended MAPI on the NT side w/C++. If I can use perl or python
> instead, that would be preferred.
>
> Also, are both reasonably adept at producing gui envrions for windows
Be aware that the state of perl on NT is undergoing some changes at this
time (for the better, but it still requires patience to "have it all").
There is a perl port that does MAPI, ISAPI, Active Server Pages, COM,
DCOM, a Win32::* API, etc. There is a separate, distinct port that does
Perl/Tk GUIs (that is not based on the Tcl/Tk 8 code that allegedly is a
better fit to NT controls). However: there is active work right now on
the Perl/Tk based on Tk 8 and there will be a merging of these two
distinct ports this fall.
For the COM, DCOM capable perl see:
http://www.activestate.com/
for the Perl/Tk perl see:
http://www.perl.com/CPAN/authors/Gurusamy_Sarathy/
Good luck.
Peter Prymmer
------------------------------
Date: Sat, 04 Oct 97 10:44:11 GMT
From: javier@vr-web.com (Javier Vargas)
Subject: change referer and ip address ?
Message-Id: <343610d7.0@news.interactiva.cl>
hi,
someone knows where i can get some info or how can i send another referer and
ip when making an http call using perl ?
Thanks :)
Javier.
javier@vrweb.cl
javier@cobreweb.com
------------------------------------------------------------
MAINFRAME CHAT : Chat para chilenos... el mejor
http://chat.vrweb.cl/
VRWEB Internet Design : Diseqo de paginas interactivas
http://www.vrweb.cl/
COBREWEB : The official mining guide in Chile
http://www.cobreweb.com/
MI HOMEPAGE : Dedicado al Manga/Comics/Fantasia/Bizarro
http://www.vrweb.cl/mf/
------------------------------------------------------------
------------------------------
Date: Sat, 04 Oct 1997 10:19:19 GMT
From: dan@okdirect.com (Daniel Walton)
Subject: DProf installation problems...
Message-Id: <34371826.15606014@okdirect.com>
For some reason the DProf package doesn't want to install on my
correctly on my system. The make test command give's me an error on
test5.v. Anyone have a clue why this could be?
Thanks!
Dan
[root@turbo DProf-19960930]# perl Makefile.PL
MakeMaker (v5.34)
DISTNAME => q[DProf]
EXE_FILES => [q[dprofpp]]
NAME => q[Devel::DProf]
PL_FILES => { dprofpp.PL=>q[dprofpp] }
PREREQ_PM => { }
VERSION_FROM => q[DProf.pm]
XSPROTOARG => q[-noprototypes]
clean => { FILES=>q[tmon.out t/tmon.out t/err dprofpp
T/tmon.out] }
dist => { COMPRESS=>q[gzip], SUFFIX=>q[gz] }
Using PERL=/usr/bin/perl
Writing Makefile for Devel::DProf
[root@turbo DProf-19960930]# make
cc -c -Dbool=char -DHAS_BOOL -I/usr/local/include -O2
-DVERSION=\"19960930\" -DXS_VERSION=\"19960930\" -fpic
-I/usr/lib/perl5/i386-linux/5.003/CORE DProf.c
Running Mkbootstrap for Devel::DProf ()
chmod 644 DProf.bs
LD_RUN_PATH="" cc -o blib/arch/auto/Devel/DProf/DProf.so -shared
-L/usr/local/lib DProf.o
chmod 755 blib/arch/auto/Devel/DProf/DProf.so
cp DProf.bs ./blib/arch/auto/Devel/DProf/DProf.bs
chmod 644 blib/arch/auto/Devel/DProf/DProf.bs
Manifying ./blib/man1/dprofpp.1
Manifying ./blib/man3/Devel::DProf.3
cp dprofpp ./blib/script/dprofpp
[root@turbo DProf-19960930]# make test
PERL_DL_NONLAZY=1 /usr/bin/perl -I./blib/arch -I./blib/lib
-I/usr/lib/perl5/i386-linux/5.003 -I/usr/lib/perl5 test.pl -p
/usr/bin/perl
test1.t............. 0 secs ( 0.16 cusr 0.04 csys = 0.20 cpu)
test1.v.............ok 1, ok 2, ok 3, ok 4,
test2.t............. 0 secs ( 0.15 cusr 0.03 csys = 0.18 cpu)
test2.v.............ok 1, ok 2, ok 3, ok 4,
test3.t............. 0 secs ( 0.15 cusr 0.04 csys = 0.19 cpu)
test3.v.............ok 1, ok 2, ok 3, ok 4,
test4.t............. 1 secs ( 0.16 cusr 0.05 csys = 0.21 cpu)
test4.v.............ok 1, ok 2, ok 3, ok 4,
test5.t............. 1 secs ( 0.14 cusr 0.05 csys = 0.19 cpu)
test5.v.............not ok 1,
------------------------------
Date: 4 Oct 1997 09:46:46 GMT
From: yeowkee <yeowkee@slime.ipv6.irdu.nus.sg>
Subject: h2ph
Message-Id: <6153a6$g3e@nuscc.nus.sg>
hi all, i am having problems running h2ph. everytime i try to run it,
it would report that the header files are not found! the files are
obviously there! Anyway i followed the INSTALL readme in the perl dist.
and i am at my wits end. if someone out there has encoiuntered this prob,
plaese help. Thanks
regards
yeowkee
------------------------------
Date: 4 Oct 1997 13:28:31 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: h2ph
Message-Id: <615g9v$16l@news-central.tiac.net>
In article <6153a6$g3e@nuscc.nus.sg>,
yeowkee <yeowkee@slime.ipv6.irdu.nus.sg> wrote:
>hi all, i am having problems running h2ph. everytime i try to run it,
>it would report that the header files are not found! the files are
>obviously there! Anyway i followed the INSTALL readme in the perl dist.
>and i am at my wits end. if someone out there has encoiuntered this prob,
>plaese help. Thanks
Did you remember to cd to /usr/include and then run
h2ph *.h sys/*.h
(assuming you're on a unix system...)
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Sat, 04 Oct 1997 17:45:36 +0800
From: Kenneth Cheng <kckcheng@netvigator.com>
Subject: help the new user
Message-Id: <34361040.66BB8965@netvigator.com>
Hi,
I'm new to perl. I'm interested in Perl.
I think my server is running Perl 4.0, since I have the following
message from "perl -v".
---------------------------------
This is perl, version 4.0
$RCSfile: perl.c,v $$Revision: 4.0.1.8 $$Date: 1993/02/05 19:39:30 $
Patch level: 36
Copyright (c) 1989, 1990, 1991, Larry Wall
Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 4.0 source
kit.
----------------------------------
Is the above message good enough to prove the perl interpreter is in
version 4.0? Can anyone tell me how to figure out what version of perl
my server is running.
Thanks a lot
Kenneth
kckcheng@netvigator.com
------------------------------
Date: 4 Oct 1997 13:24:45 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: help the new user
Message-Id: <615g2t$sq@news-central.tiac.net>
In article <34361040.66BB8965@netvigator.com>,
Kenneth Cheng <kckcheng@netvigator.com> wrote:
>I'm new to perl. I'm interested in Perl.
>
>I think my server is running Perl 4.0, since I have the following
>message from "perl -v".
>---------------------------------
>
>This is perl, version 4.0
>
>$RCSfile: perl.c,v $$Revision: 4.0.1.8 $$Date: 1993/02/05 19:39:30 $
>Patch level: 36
>
>Copyright (c) 1989, 1990, 1991, Larry Wall
>
>Perl may be copied only under the terms of either the Artistic License
>or the
>GNU General Public License, which may be found in the Perl 4.0 source
>kit.
>----------------------------------
>
>Is the above message good enough to prove the perl interpreter is in
>version 4.0? Can anyone tell me how to figure out what version of perl
>my server is running.
That is perl 4.036, which was the last version of perl 4 to be released
(if your sys admins care about security then there's a patch which adds
+ suidperl security patch
under the patch level line and should be used if you're running set-uid
scripts in perl.) There is no more maintenance being done on perl 4.xxx,
and most books and people these days assume that you're using perl 5.xxx.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Sat, 4 Oct 1997 08:29:59 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: help the new user
Message-Id: <ncg516.ii.ln@localhost>
Kenneth Cheng (kckcheng@netvigator.com) wrote:
: I think my server is running Perl 4.0, since I have the following
: message from "perl -v".
: ---------------------------------
: This is perl, version 4.0
: $RCSfile: perl.c,v $$Revision: 4.0.1.8 $$Date: 1993/02/05 19:39:30 $
: Patch level: 36
: Copyright (c) 1989, 1990, 1991, Larry Wall
: Perl may be copied only under the terms of either the Artistic License
: or the
: GNU General Public License, which may be found in the Perl 4.0 source
: kit.
: ----------------------------------
: Is the above message good enough to prove the perl interpreter is in
: version 4.0?
Yes. (probably. They may have different perl versions installed in
different places. Use the absolute path to perl to be sure
which one is there: /usr/bin/perl -v
)
That is perl version 4.036.
Besides being unsupported, there are significant security risks that
your server is exposed to.
Versions of perl before 5.004 are dangerous for CGI scripting uses.
: Can anyone tell me how to figure out what version of perl
: my server is running.
You already know that ;-)
[
If this is on an ISP, I would without a doubt change ISPs as soon
as possible.
Using perl 4 in this day and age indicates that the ISP doesn't
know very much...
]
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 04 Oct 1997 09:35:27 -0500
From: Daniel <mission@bellsouth.net>
Subject: How to use string contents as string name
Message-Id: <3436542F.5723@bellsouth.net>
Thanks in advance for any help.
I'm trying to take name/value pairs from a file, and assign the $name
from
($name,$value) = split(/=/,$inline);
to make a new stringname from the contents of $name.
For instance if the value of $name is JOE I'd like to create a string
called $JOE.
Is this possible?
Thanks
Daniel
------------------------------
Date: 4 Oct 1997 13:45:15 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: How to use string contents as string name
Message-Id: <615h9b$27t@news-central.tiac.net>
In article <3436542F.5723@bellsouth.net>,
Daniel <mission@bellsouth.net> wrote:
>Thanks in advance for any help.
>
> I'm trying to take name/value pairs from a file, and assign the $name
>from
>
>($name,$value) = split(/=/,$inline);
>
>to make a new stringname from the contents of $name.
>
>For instance if the value of $name is JOE I'd like to create a string
>called $JOE.
If you're using perl 5.xxx you can use soft references e.g.
$$name = $value;
where the extra $ tells perl to use the string contents of $name as a
name, assuming that strict references aren't in force.
If you're still using perl 4 you can say
{
local (*GLOB) = $name;
$GLOB = $value;
}
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: 4 Oct 1997 10:44:49 GMT
From: e95mbo@efd.lth.se (Markus Borbely)
Subject: Re: ioctl
Message-Id: <6156n1$c69$1@news.lth.se>
In article <610te9$72v$1@news.lth.se>,
e95mbo@efd.lth.se (Markus Borbely) writes:
>Hi!
>I'd be happy if anyone can point me out to the module I
>need. I'm working in X and need to read one single
-snip-
>Oh yeah... if you you say CPAN or RTFM, then don't say it... :)
What I was trying to say, what that I was already RTFM and going
trough CPAN... But If somebody had a real kickass answer
(as i already got) I would like to hear about it...
I'm sorry everyone... Next time I'll be a bit more clear... :)
_____________________________________________________
/ \ \
|__| Markus Borbely +46(0)46-39 73 55 |
| e95mbo@efd.lth.se Magistratsvdgen 57M12 |
| www.efd.lth.se/~e95mbo/ 22644 Lund ____ |
| _______________________________________/ __ \____|_
\/______________________________________| (__) |____/
\____/
| |
| |
|/\|
------------------------------
Date: Fri, 03 Oct 1997 23:17:32 -0700
From: Peter Prymmer <pvhp@forte.com>
To: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: Is there a Newsgroup for "Perl for NT and/or IIS"?
Message-Id: <3435DF7C.7F86@forte.com>
Cameron Dorey wrote:
> many Win users are not true "computer jocks," which is why they like
> Windows (my last non-PC computer experience was Fortran on a VAX 780 in
> 1982), and you've got a growing number of Perl hackers who are coming in
> from a much lower level of comfort with the language than most of the
> answer providers on this list;
I presume you meant a VAX 11-780: a fine machine for number crunching
with Fortran (VAX Fortran: now that was a language!). These days most
of my VAX 3100 and 4000-90 scripting gets done in perl 5.004 however ;-)
Peter Prymmer
------------------------------
Date: Sat, 4 Oct 1997 11:03:56 +0200
From: "Manfred Schneider" <manfred.schneider@rhein-neckar.de>
Subject: New pages/mirror -- 5600+ links on Object-Orientation (in English & French)
Message-Id: <6150k0$r02$1@trumpet.uni-mannheim.de>
From: The Cetus Team
Subject: Cetus Links -- 5600+ links on Object-Orientation
Newsgroups: Some comp.* newsgroups related to OO
Summary: News, editions, topics, URLs, team members
Posting-Freq.: Monthly
Hello,
are you interested in a collection of more than 5600 links on
Object-Orientation - running on 14 servers in 12 countries ?
No ads, few graphics, fast and free access!
What4s new?
o Update of the French edition
o New pages 'Dylan' and 'REXX'
o New layout for page 'Patterns'
o New mirror in Spain
o Brazilian mirror has gone offline
Available editions:
o English
o French
Main topics:
o General Information and Links about Object-Orientation
o Distributed Objects, Business Objects, Mobile Agents, Object
Request Brokers, ActiveX/OLE, Corba, Java Beans/RMI, OpenDoc
o OOA/OOD Methods and Tools, Diagram Layout
o Languages, Ada, BETA, C++, CLOS, COBOL, Delphi, Dylan,
Eiffel, Java, JavaScript, Modula-3, Oberon, Objective-C,
Perl, Python, REXX, Sather, Self, Simula, Smalltalk,
Tcl/Tk, VBScript, Visual Basic, Visual C++
o Databases, OO DBMS, OR DBMS, OR Mapping
o Patterns, Libraries, Frameworks, Metrics, Reuse, Testing, Numerics
o Services and Companies
Web Sites:
o The main site runs at Heidelberg, Germany
o The French edition runs at Quebec, Canada
o URLs of all sites:
Germany http://www.rhein-neckar.de/~cetus/software.html
Canada http://www.csioo.com/cetusen/software.html
USA/IL http://www.objenv.com/cetus/software.html
USA/VA http://www.eidea.com/OO_site/cetus/software.html
USA/WA http://mini.net/cetus/software.html
Australia http://www.csse.swin.edu.au/manfred/software.html
Japan http://aries.ise.eng.osaka-u.ac.jp/cetus/software.html
Singapore http://sunsite.nus.sg/pub/cetus/software.html
Austria http://www.infosys.tuwien.ac.at/cetus/software.html
Netherlands http://www.objecthouse.nl/cetus/software.html
Russia http://oop.rosweb.ru/cetus/software.html
New! Spain http://www.uax.es/uax/oop/software.html
Switzerland http://www.sente.ch/cetus/software.html
UK http://www.parallax.co.uk/cetus/software.html
French ed. http://www.csioo.com/cetusfr/software.html
Cetus Team Members:
o Ralf Comtesse (Databases, OO DBMS, OR DBMS, OR Mapping)
o Bernard Ctti (Methods, Tools)
o Wolfgang Lugmayr (Mobile Agents)
o Georg Odenthal (Patterns)
o Eugene Siu (Java)
o Elizabeth Veitch (CORBA, Object Request Brokers)
o Rich Wellner (Python; tool support)
o Manfred Schneider (all other pages)
We hope you will find the Cetus Links useful.
Please feel free to send new or changed URLs, comments or suggestions.
Manfred
------------------------------
Date: Sat, 04 Oct 1997 13:41:49 GMT
From: teetshd@email.uc.edu (Greg Teets)
Subject: New to Perl - How to get Windows version
Message-Id: <34364737.56785515@news.ececs.uc.edu>
I am using Perl at work on UNIX. I'd like to fool around with it at
home on a Win95 box to get more familiar with it. Please let me know
where I can get a port for Win95.
Thanks
Greg Teets
Cincinnati, Ohio
------------------------------
Date: Sat, 04 Oct 1997 15:45:37 +0100
From: Steinar Kleven <Steinar.Kleven@ahs.hist.no>
Subject: Re: New to Perl - How to get Windows version
Message-Id: <34365691.F907B490@ahs.hist.no>
Try http://www.perl.org/CPAN/ports/win32
There are two releases there: Standard and NOT Standard ;-)
Greg Teets wrote:
>
> I am using Perl at work on UNIX. I'd like to fool around with it at
> home on a Win95 box to get more familiar with it. Please let me know
> where I can get a port for Win95.
>
> Thanks
> Greg Teets
> Cincinnati, Ohio
------------------------------
Date: 4 Oct 1997 06:46:58 GMT
From: Jeff Gostin <jgostin@shell2.ba.best.com>
Subject: Re: Newbie ques: How to concatenate two strings?
Message-Id: <614op2$q2t$3@nntp1.ba.best.com>
Tad McClellan <tadmc@flash.net> wrote:
: You seem to not have gotten the point.
: It is *not* about asking a newbie question.
[etc, etc... snip]
I have to agree with you here, Tad. When I made my post asking for
information about the Net::FTP module, I darn well made sure I RTF'd as many
M's as I could find... perldoc, the FAQ, Camel/Llama, man perl, and even the
Net::FTP module source itself (not that I understood alot of it, as I'm
still learning). Funny though, when I did get an answer, the gent who helped
me was kind enough to not only tell me what he thought the problem was, but
also provided a nice workaround (which, btw, is working admirably. Thanks
alot!).
When you pay for support, you have a right to expect to be spoon-fed the
information (although, many companies will tell you to RTFM before they'll
help you out). When people are donating their time, you get what you pay
for, and you do it their way, or you don't do it. Such is the law of a
volunteer economy.
--Jeff
------------------------------
Date: Fri, 03 Oct 1997 23:30:42 -0700
From: Peter Prymmer <pvhp@forte.com>
To: Mario Biron <biron@almerco.ca>
Subject: Re: Q: FREE DATABASES AND PERL CGI
Message-Id: <3435E292.6388@forte.com>
Mario Biron wrote:
> I do not want to match <> tags, so I have to read the page and get rid
> of the tags in memory before I try to match the regexp? Someone has
> any example code too on this?
>
> Any lead will be usefull, thanks!
Take a look at Tom Christiansen's striphtml script in the scripts/
directory on the CPAN.
Peter Prymmer
------------------------------
Date: Thu, 02 Oct 1997 14:50:43 +0100
From: Russell Odom <russ@mail.org.uk>
Subject: Re: regex matching HTML comments
Message-Id: <3433A6B3.48C5E5D7@mail.org.uk>
Markus Spring wrote:
>
> Randals solution leaded me to the question:
>
> How to read the file content into one scalar?
>
> What I do now is to read it into an Array and then join this with "\n"'s,
> but I think there's another, better way to do this.
open (FILEHANDLE, $filename) or die ("Aaaaaaaaaaaargh!");
while (<FILEHANDLE>) { $whatever .= $_ }
close (FILEHANDLE);
HTH,
Russ
---------------------------------------------------------------------
--[ R u s s e l l O d o m ]---[ *NEW:* mailto:russ@mail.org.uk ]--
--[ University of York, UK ]---[ http://www.york.ac.uk/~rjo100/ ]--
---------------------------------------------------------------------
--[ FAQ maintainer, news:comp.os.ms-windows.win95.moderated ]--
---------------------------------------------------------------------
------------------------------
Date: 04 Oct 1997 16:01:17 +0200
From: md4calle@mdstud.chalmers.se (Calle ]sman)
Subject: regexp question.
Message-Id: <w7pg1qhk4pe.fsf@dada8.mdstud.chalmers.se>
$all = "<!--start US left tablecell--> \n</td><!--end US left tablecell-->";
$all =~ s/<!--start US left tablecell-->(.*)<!--end US left tablecell-->/<!--start US left tablecell-->something<!--end US left tablecell-->/g;
I want to replace everything between the html-comments with something else,
it work fine if $all does NOT contain any \n but if it contains a \n
the regexp will not spot the pattern?
why is that ?
I also wants to keep the value for further use, therefore the ()
anyone got a solution?
--
/Calle
**************************************************************************
* * My homepage about the author Tom Holt: *
* /_\ http://www.mdstud.chalmers.se/~md4calle/holt/ *
* { ~._.~ } *
* ( Y ) other things like OnLine Guitar Archive linkpage *
* ( )~*~( ) and heaps of musiclinks can be found at *
* (__)-(__) http://www.mdstud.chalmers.se/~md4calle/ *
**************************************************************************
------------------------------
Date: Sat, 4 Oct 1997 09:34:19 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: regexp question.
Message-Id: <b5k516.so.ln@localhost>
Calle ]sman (md4calle@mdstud.chalmers.se) wrote:
: $all = "<!--start US left tablecell--> \n</td><!--end US left tablecell-->";
: $all =~ s/<!--start US left tablecell-->(.*)<!--end US left tablecell-->/<!--start US left tablecell-->something<!--end US left tablecell-->/g;
: I want to replace everything between the html-comments with something else,
: it work fine if $all does NOT contain any \n but if it contains a \n
: the regexp will not spot the pattern?
: why is that ?
Because you did not tell it to match the newline.
A dot does not normally match a newline.
s///gs
the 's' option will make a dot match a newline.
If there may be more than one '<!--end US left tablecell-->'
in the string, then you probably also want a non-greedy match too.
(.*?) instead of (.*)
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 04 Oct 97 10:45:06 GMT
From: javier@vr-web.com (Javier Vargas)
Subject: send another referer an ip using perl ?
Message-Id: <3436110e.0@news.interactiva.cl>
hi,
someone knows where i can get some info or how can i send another referer and
ip when making an http call using perl ?
Thanks :)
Javier.
javier@vrweb.cl
javier@cobreweb.com
------------------------------------------------------------
MAINFRAME CHAT : Chat para chilenos... el mejor
http://chat.vrweb.cl/
VRWEB Internet Design : Diseqo de paginas interactivas
http://www.vrweb.cl/
COBREWEB : The official mining guide in Chile
http://www.cobreweb.com/
MI HOMEPAGE : Dedicado al Manga/Comics/Fantasia/Bizarro
http://www.vrweb.cl/mf/
------------------------------------------------------------
------------------------------
Date: Sat, 04 Oct 1997 15:30:26 -0700
From: ECSSPEAR@livjm.ac.uk
Subject: Sending files with sendmail
Message-Id: <3436C382.CA1@livjm.ac.uk>
I am using a simple perl script through a web interface to enable people
to have files e-mailed to them. Is it possible to have the files
e-mailed as attachments just as they would if they were sent with any
modern e-mail program (as opposed to sending them uuencoded in the mail
message)?
Simon Pearce
Webmaster
ScoutNet UK
------------------------------
Date: 4 Oct 1997 13:24:39 GMT
From: billy@cast.msstate.edu (Billy Chambless)
Subject: Re: System calls
Message-Id: <615g2n$fu3$2@NNTP.MsState.Edu>
In article <kfj416.t21.ln@localhost>, tadmc@flash.net (Tad McClellan) writes:
|> Bosch Patrick (bosch@goweb.lu) wrote:
|> : Perl. I have tried
|> : print '/usr/bin/tar -cvf $file $directory';
|> : But all he did was printing to standard output.
|> That is because all you asked it to do was to print it to standard output.
Perl's really nasty that way.
Has this bug been reported?
------------------------------
Date: Sat, 4 Oct 1997 09:37:31 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: System calls
Message-Id: <bbk516.so.ln@localhost>
Billy Chambless (billy@cast.msstate.edu) wrote:
: In article <kfj416.t21.ln@localhost>, tadmc@flash.net (Tad McClellan) writes:
: |> Bosch Patrick (bosch@goweb.lu) wrote:
:
: |> : Perl. I have tried
: |> : print '/usr/bin/tar -cvf $file $directory';
: |> : But all he did was printing to standard output.
:
: |> That is because all you asked it to do was to print it to standard output.
: Perl's really nasty that way.
: Has this bug been reported?
Darn computers.
They don't do what I want them to do.
They only do what I ask them to do...
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: 4 Oct 1997 14:03:54 GMT
From: jgloudon@bbn.remove.com (Jason Gloudon)
Subject: Re: Trapping Errors on Object Creation
Message-Id: <615ica$m99$1@daily.bbnplanet.com>
: More specifically, here's the relevent line of code (referred to as
: <the snippet above> hereafter):
: my $ftp = Net::FTP->new($host, @firewall, Debug => $debug ? 1 : 0);
: #first attempt, "ugly" for brevity
: eval { <the snippet above>};
: if $@ { die "$@"; }
You may not have read the manpage entry on eval too closely.
If there is a syntax error or runtime error, or a
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
die() statement is executed, an undefined value is
returned by eval(), and $@ is set to the error
message. If there was no error, $@ is guaranteed
to be a null string.
Your call to Net::FTP failing isn't a Perl syntax or run-time error. So
$@ is not affected.
: #second attempt, still "ugly"
: eval { <the snippet above>; if $@ { die "$@"; } };
I refer you to the manpage snippet above. Eval catches the die within it.
$@ only has a meaningful value in the context following an eval.
: #third attempt, $ugly = 1;
: <snippet above>
: if (ref($ftp) ne "Net::FTP")
: {
: die "$@";
: }
This is close but not ideal. This is not working for you as you have
: my $ftp = Net::FTP->new($host, @firewall, Debug => $debug ? 1 : 0);
within the eval. An eval block is closed with respect to my variables
just as a sub is. In otherwords $ftp doesn't exist outside of the eval.
This is why perl gives you an error, as $ftp is undefined.
The solution is simple. Test whether $ftp is defined or not.
Net:FTP returns an undefined(false) value if fails, as is the nor with
constructors.
$ftp = Net::FTP->new($host, @firewall, Debug => $debug ? 1 : 0) or
die "My Error Message";
or
$ftp = Net::FTP->new($host, @firewall, Debug => $debug ? 1 : 0);
if (! defined($ftp)){
die "my error";
}
or any number of ways of testing $ftp.
Jason Gloudon
------------------------------
Date: 03 Oct 1997 15:55:16 -0400
From: Matthew Rice <Matthew.Rice@ftlsol.com>
Subject: Re: Turning a formmated string into a list
Message-Id: <m3d8lmk4ez.fsf@hudson.ftlsol.com>
chadbour@sashimi.wwa.com (James Weisberg) writes:
> I have a fairly simple question. I would like to write a function
> which takes a string of the form: MMDDYYhhmm.ext and returns a
> list of each component. For example:
>
> $file="0903971430.txt"
>
> ($MM, $DD, $YY, $hh, $mm, $ext) = filetolist($file);
A quick way is:
die "bad format in $file" if not $file =~ /\d{10}\..+/;
($MM, $DD, $YY, $hh, $mm, $ext) = ($file =~ /(..)(..)(..)(..)(..)(.*)/);
Clean it up as you like,
--
Matthew Rice e-mail: matthew.rice@ftlsol.com
------------------------------
Date: Thu, 02 Oct 1997 14:35:43 +0100
From: Russell Odom <russ@mail.org.uk>
Subject: Re: Unlist syntax
Message-Id: <3433A32F.52A42BD2@mail.org.uk>
I wrote:
>
> wazza wrote:
> >
> > Thanks to those who promptly answered my query on how to delete files.
> >
> > I tried out the lines:
> > $file = $path."temp.txt";
> > unlink $file;
> >
> > but nothing seems to be happening. Could someone assist me with the
> > correct syntax please.
>
> Your syntax looks correct to me. My guess is that there's no '/' on the
> end of $path. Oh, and check the return value from unlink()...
>
> $path .= '/temp.txt';
> unlink $file or die ('Can't unlink $file');
Oops, try...
$file = $path . '/temp.txt';
unlink $file or die ('Can't unlink $file');
...instead
HTH,
Russ
---------------------------------------------------------------------
--[ R u s s e l l O d o m ]---[ *NEW:* mailto:russ@mail.org.uk ]--
--[ University of York, UK ]---[ http://www.york.ac.uk/~rjo100/ ]--
---------------------------------------------------------------------
--[ FAQ maintainer, news:comp.os.ms-windows.win95.moderated ]--
---------------------------------------------------------------------
------------------------------
Date: 4 Oct 1997 13:11:16 GMT
From: jgloudon@bbn.remove.com (Jason Gloudon)
Subject: Re: Unlist syntax
Message-Id: <615f9k$gp6$1@daily.bbnplanet.com>
Russell Odom (russ@mail.org.uk) wrote:
: I wrote:
: >
: > wazza wrote:
: > >
: > > Thanks to those who promptly answered my query on how to delete files.
: > >
: > > I tried out the lines:
: > > $file = $path."temp.txt";
: > > unlink $file;
: > >
: > > but nothing seems to be happening. Could someone assist me with the
: > > correct syntax please.
: >
: > Your syntax looks correct to me. My guess is that there's no '/' on the
: > end of $path. Oh, and check the return value from unlink()...
: >
: > $path .= '/temp.txt';
: > unlink $file or die ('Can't unlink $file');
: Oops, try...
: $file = $path . '/temp.txt';
: unlink $file or die ('Can't unlink $file');
: ...instead
You typed the wrong quotes and forgot the error message.
unlink $file or die ("Can't unlink $file: $!\n");
Jason Gloudon
------------------------------
Date: Sat, 04 Oct 1997 03:38:24 -0700
From: dks@mediaweb.com (dk smith)
Subject: Re: Wanted: Wall/Schwartz book (1st ed)
Message-Id: <dks-0410970338240001@204.94.139.103>
In article <3433579C.1D9024AB@absyss.fr>, Doug Seay <seay@absyss.fr> wrote:
> Gregory Glockner wrote:
> >
> > I am looking for a copy of the old version of the book "Programming perl"
> > by Wall and Schwartz that covers Perl 4.0. I can only seem to find the
> > newer version that covers Perl 5.0. If you have an extra copy of this
> > book (ISBN 0-937175-64-1), please contact me by email. TIA.
>
> Good luck. Ain't no way I'm gettin' rid of mine. It's a classic.
>
> - doug
Amcurious. Why is this sentiment held by so many? Is there some good
content in the 1st edition that did not appear in the 2nd?
thx,
dk
--
dk smith MediaWeb, Inc.
dks@mediaweb.com http://www.mediaweb.com
------------------------------
Date: 4 Oct 1997 13:18:13 GMT
From: Paul A Sand <pas@unh.edu>
Subject: Re: Wanted: Wall/Schwartz book (1st ed)
Message-Id: <615fml$dkt@mozz.unh.edu>
dks@mediaweb.com (dk smith) writes:
>Amcurious. Why is this sentiment held by so many? Is there some good
>content in the 1st edition that did not appear in the 2nd?
Yes. Most notably, a couple of chapters containing code snippets and
complete scripts for performing useful tasks. I appreciate that the
Perl5 Camel probably didn't have room for that content, and probably
the authors didn't have time to Perl5-ify the code, and probably they
wanted to make the book more clearly a reference tome than a tutorial,
etc., etc.
But it was great stuff, and fit in well with the rest of the book. The
new Camel is an invaluable, technically correct reference, but it has
significantly less soul.
--
-- Paul A. Sand | I can't decide if I'm bragging or
-- University of New Hampshire | complaining.
-- pas@unh.edu | (Mary Loveless, rec.arts.books)
-- http://pubpages.unh.edu/~pas |
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 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.
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 1125
**************************************