[15505] in Perl-Users-Digest
Perl-Users Digest, Issue: 2915 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 1 14:10:26 2000
Date: Mon, 1 May 2000 11:10:16 -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: <957204616-v9-i2915@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 1 May 2000 Volume: 9 Number: 2915
Today's topics:
Problems with Installing JPL (Java-Perl Lingos) on Win johnpe@my-deja.com
Re: Pulling my hair out! (Bart Lateur)
Re: Question on flock() <rootbeer@redcat.com>
Reformatting a File (Variable to Fixed) mkrol@my-deja.com
Re: regex jlamport@calarts.edu
Re: regex <aperrin@davis.DEMOG.Berkeley.EDU>
Regular Expression and HTML tags <rudie@wpi.edu>
Re: Should a class that exports no symbols provide an e <franl-removethis@world.omitthis.std.com>
Re: Something isn't working, and I can't figure it out (Jerome O'Neil)
Sprite and CGI.pm schnurmann@my-deja.com
Re: Sprite and CGI.pm schnurmann@my-deja.com
Re: Sprite and CGI.pm <tony_curtis32@yahoo.com>
Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
subroutines in perl4 <eijkhout@disco.cs.utk.edu>
Re: This is sorted... sorry for wasting anyone's time! (Bart Lateur)
troubleshooting <bh_ent@my-deja.com>
Re: troubleshooting <uri@sysarch.com>
Re: troubleshooting <red_orc@my-deja.com>
Re: troubleshooting <red_orc@my-deja.com>
what is xxEOFXX <jcolby@my-deja.com>
Re: what is xxEOFXX <red_orc@my-deja.com>
Re: what is xxEOFXX (Tad McClellan)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 01 May 2000 15:56:57 GMT
From: johnpe@my-deja.com
Subject: Problems with Installing JPL (Java-Perl Lingos) on Win NT
Message-Id: <8ek9fc$beu$1@nnrp1.deja.com>
I have problems installing JPL (Java-Perl Lingos
) on the Windows NT system.
* I downloaded the source code of Perl 5.6.0.
* My machine has JDK1.2.2.
* I use Microsoft Visual C++ 6.0 as a compiler
for the source code.
* The compilation for perl 5.6.0 was successful.
* Following the instruction, I cd to JPL
directory and do the following:
perl Makefile.PL
nmake
nmake install
It was successful.
* Following the instruction, I cd to JNI
directory to compile the closer.java class by
using:
javac Closer.java
It was successful.
* Following the instruction, I
copy typemap.win32 typemap and then type:
perl Makefile.PL
nmake
The CMD window gave a bunch of error messages
such as:
Jni.c
JNI.xs(124): error C2223: left of -
>NewBooleanArray must point to struct/union.
left of ->SetBooleanArrayRegion must point to
struct/union
I would appreciate if someone shares experience
with installing JPL (Java-Perl Lovers) in Win32
with JDK1.2.2.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 01 May 2000 15:29:41 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Pulling my hair out!
Message-Id: <39109b2f.1155786@news.skynet.be>
Adam T Walton wrote:
>"murry the hump" big leaves "terris" catatonia "60ft dolls"
>
>a regexp that would extract "murry the hump", "terris" and "60ft dolls" and
>stick them into an array.
>I have been trying variations of:-
>
>@chopped=/"([^"]+)"/g;
>
>This works but totally ignores the first double-quoted string (ie. in the
>above example @chopped would contain "terris" and "60ft dolls", but NOT
>"murry the hump"!!!!)... why why why why????
It doesn't fail for me.
$_ = '"murry the hump" big leaves "terris" catatonia "60ft dolls"';
($\, $,) = ("\n", '|');
print /"([^"]*)"/g;
-->
murry the hump|terris|60ft dolls
There must be some other reason for your failure. Is the string what you
think it is?
But maybe you can try another regex, anyway. This looks rather
promising:
$_ = '"murry the hump" big leaves "terris" catatonia "60ft dolls"';
($\, $,) = ("\n", '|');
print grep defined, /"([^"]*)"|([^\s"]+)/g;
-->
murry the hump|big|leaves|terris|catatonia|60ft dolls
--
Bart.
------------------------------
Date: Mon, 1 May 2000 10:38:16 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Question on flock()
Message-Id: <Pine.GSO.4.10.10005011036500.13677-100000@user2.teleport.com>
On Mon, 1 May 2000, Tad McClellan wrote:
> exclusive locking will work for reading too, but is more
> restrictive than need be.
On many systems, if a file is not open for output, you can't get an
exclusive lock on the filehandle. So, in general, you shouldn't ask for an
exclusive lock in all cases.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 01 May 2000 16:34:35 GMT
From: mkrol@my-deja.com
Subject: Reformatting a File (Variable to Fixed)
Message-Id: <8ekbmr$e1c$1@nnrp1.deja.com>
Is there a way to convert a file that has variable length records to a
file with fixed length records using a Perl script? I have a file with
25 records that are 238 chars long, but when I Ftp the file to an IBM
MVS system the file is showing as variable length (255 chars long).
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 01 May 2000 13:01:05 GMT
From: jlamport@calarts.edu
Subject: Re: regex
Message-Id: <8ejv6a$63$1@nnrp1.deja.com>
In article <u5kpur83m9m.fsf@davis.DEMOG.Berkeley.EDU>,
Andrew Perrin - Demography <aperrin@davis.DEMOG.Berkeley.EDU> wrote:
> jlamport@calarts.edu writes:
>
> > In article <390A88A0.D9D7A0C7@aol.com>,
> > chris <chris@aol.com> wrote:
> > >
> > > and will this work
> > >
> > > $one =~ s/book/script.pl/e;
> >
> > If $one contains the string 'book', then this will call the subroutine
> > named script, then call the subroutine named pl, and replace the first
> > occurance in $one of the string 'book' with the concatenated return
> > values of the two subroutines. If this is what you want, then yes, this
> > works.
> >
>
> Nope. Did you test it?
No, I confess I didn't test it. However:
>
> $one = 'book';
> $one =~ s/book/script.pl/e;
> print "After second, \$one is $one\n";
>
> aperrin@SLOVO ~/perl % perl s.pl
> After second, $one is scriptpl
This is true if and only if the 'use strict subs' pragma is NOT in
effect. Any sensibly-written Perl program is going to include 'use
strict' somewhere near the beginning, in which case
script.pl
and
script() . pl()
*are* semantically equivalent (except that "script.pl" needs to be put
AFTER the subroutines script and pl are declared, otherwise the program
won't compile, whereas "script().pl()" can be put anywhere, just as long
as the subroutines are defined at some point before the code
"script().pl()" is actually executed).
-jason
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 01 May 2000 10:16:47 -0700
From: Andrew Perrin - Demography <aperrin@davis.DEMOG.Berkeley.EDU>
Subject: Re: regex
Message-Id: <u5kpur6mbr4.fsf@davis.DEMOG.Berkeley.EDU>
jlamport@calarts.edu writes:
>
> No, I confess I didn't test it. However:
You might want to, before posting.
>
> >
> > $one = 'book';
> > $one =~ s/book/script.pl/e;
> > print "After second, \$one is $one\n";
> >
> > aperrin@SLOVO ~/perl % perl s.pl
> > After second, $one is scriptpl
>
> This is true if and only if the 'use strict subs' pragma is NOT in
> effect. Any sensibly-written Perl program is going to include 'use
> strict' somewhere near the beginning, in which case
>
> script.pl
>
> and
>
> script() . pl()
>
> *are* semantically equivalent (except that "script.pl" needs to be put
> AFTER the subroutines script and pl are declared, otherwise the program
> won't compile, whereas "script().pl()" can be put anywhere, just as long
> as the subroutines are defined at some point before the code
> "script().pl()" is actually executed).
>
> -jason
>
>
True, given the added criterion that the subs be defined. But
behavior - both under use strict and not - without script() and pl()
differs:
using s/book/script.pl/e :
aperrin@SLOVO ~/perl % perl s.pl
After s, $one is scriptpl
using s/book/script().pl()/e :
aperrin@SLOVO ~/perl % perl s.pl
Undefined subroutine &main::script called at s.pl line 8.
--
---------------------------------------------------------------------
Andrew J. Perrin - aperrin@demog.berkeley.edu - NT/Unix Admin/Support
Department of Demography - University of California at Berkeley
2232 Piedmont Avenue #2120 - Berkeley, California, 94720-2120 USA
http://demog.berkeley.edu/~aperrin --------------------------SEIU1199
------------------------------
Date: Mon, 1 May 2000 12:22:20 -0400
From: Brian Murphy <rudie@wpi.edu>
Subject: Regular Expression and HTML tags
Message-Id: <Pine.OSF.4.21.0005011214500.18494-100000@bert.WPI.EDU>
Hello,
Here is a quick lowdown of what I am doing.
The html:
<P>
MAY 5...AT THE LONG ISLAND ZOO...BANE, SKYCAMEFALLING, FAHRENHEIT 451,
NEWGROUND,AKIN, STRONGPOINT...6PM...$7<A
HREF="mailto:bullprod@earthlink.net">bullprod@earthlink.net</A>
<P>
<P>
May 19 - Swingset LI - glassjaw, shelter, bane, shai hulud,
thisyearsmodel,six pm, $10
<P>
The text is always surrounded by a <P>\n on both sides. Say I am looking
for the string bane, or BANE, Bane, or even BaNe. I've been attempting to
snatch all the text with the following regexp, and then print it back
out in a nice html format, like this:
while($content =~ /<P>\n(.*\n?)(.*\n?)($group.*)\n(.*\n)(.*\n)(.*\n)/gmi){
print "<P>\n<FONT SIZE=\"2\">\n";
print "$1$2$3";
if($4 !~ /<p>/i){
print "$4";
}
if($5 !~ /<p>/i){
print "$5";
}
if($6 !~ /<p>/i){
print "$6";
}
print "\n<BR>\n";
print "<\/FONT>\n</P>\n";
}
This works sometimes, but there has to be a better method. I would loive
to be able to do the following, and still be able to print it out:
while($content =~ /<P>/\n(.*\n?)*(.*$group)(.*/n*)*<P>/igm){
#print all the snatched up text
}
Can anyone tell me (.*\n?)* translates with $1, $2, $3? Or a better
method of doing what I want. Keep in mind the text in between the <P>
tags can be 2 lines to 12 lines.
Thanks
brian
------------------------------
Date: Mon, 1 May 2000 17:47:24 GMT
From: Francis Litterio <franl-removethis@world.omitthis.std.com>
Subject: Re: Should a class that exports no symbols provide an empty import method?
Message-Id: <m38zxukvrn.fsf@franl.andover.net>
mjtg@cus.cam.ac.uk (M.J.T. Guy) writes:
> Francis Litterio <franl-removethis@world.omitthis.std.com> wrote:
> >"perldoc Exporter" explains:
> >
> > As a general rule, if the module is trying to be object
> > oriented then export nothing.
> >
> >Does this mean I can omit "use Exporter;" from my class and simply
> >provide an empty "import" method (as follows)?
>
> Better still - you don't need to provide an import method at all.
That's probably not wise given this documentation:
$ perldoc -f use
...
If no `import()' method can be found then the error is currently
silently ignored. This may change to a fatal error in a future
version.
--
Francis Litterio
franl-removethis@world.std.omit-this.com
PGP public keys available on keyservers.
------------------------------
Date: Mon, 01 May 2000 16:06:29 GMT
From: jerome@activeindexing.com (Jerome O'Neil)
Subject: Re: Something isn't working, and I can't figure it out
Message-Id: <9YhP4.44$g53.2533@news.uswest.net>
In article <MPG.13751131e547049b98a9b8@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> writes:
> In article <390B3154.E23A5CAC@attglobal.net> on Sat, 29 Apr 2000
> 15:00:36 -0400, Drew Simonis <care227@attglobal.net> says...
>
> ...
>
> use CGI::Carp qw(fatalsToBrowser);
>
> Someone chose to use stupid studly caps to define the function (instead
> of rational underscores: 'fatals_to_browser'), and this error is the
> result.
My boss is a fairly well known Java personality, and we have this argument
all the time. Apparently, mixed case is considered a good thing in those
circles.
I think its hallucinations brought about by too much caffeen.
------------------------------
Date: Mon, 01 May 2000 16:28:34 GMT
From: schnurmann@my-deja.com
Subject: Sprite and CGI.pm
Message-Id: <8ekbac$dlp$1@nnrp1.deja.com>
Has anyone used CGI.pm and Sprite.pm in the same Perl script? Does it
work? I am trying to use Sprite for some database work. The script
works fine from the command line, but does not from a web browser. As
far as I can tell, it does even try to do an insert.
Any suggestions???
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 01 May 2000 16:32:57 GMT
From: schnurmann@my-deja.com
Subject: Re: Sprite and CGI.pm
Message-Id: <8ekbjo$e0k$1@nnrp1.deja.com>
And the answer is???
File permissions....duh....
In article <8ekbac$dlp$1@nnrp1.deja.com>,
schnurmann@my-deja.com wrote:
> Has anyone used CGI.pm and Sprite.pm in the same Perl script? Does it
> work? I am trying to use Sprite for some database work. The script
> works fine from the command line, but does not from a web browser. As
> far as I can tell, it does even try to do an insert.
>
> Any suggestions???
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 01 May 2000 11:44:26 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Sprite and CGI.pm
Message-Id: <87r9bmkyol.fsf@shleppie.uh.edu>
>> On Mon, 01 May 2000 16:28:34 GMT,
>> schnurmann@my-deja.com said:
> Has anyone used CGI.pm and Sprite.pm in the same Perl
> script? Does it work? I am trying to use Sprite for
> some database work. The script works fine from the
> command line, but does not from a web browser. As far
> as I can tell, it does even try to do an insert.
"does not work" is far too vague for anyone to suggest
what the problem might be.
Do you have
use CGI::Carp qw(fatalsToBrowser);
? This might feed back some useful information within the
browser (or agent or whatever you're doing).
What happens if you try running the program from the
command-line? Are you using -w and strict?
Also don't forget that CGI introduces a new set of
restrictions on how programs using it execute, e.g. see
http://www.boutell.com/openfaq/cgi/
hth
t
------------------------------
Date: Mon, 01 May 2000 14:38:54 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <sgr5nui1oog77@corp.supernews.com>
Following is a summary of articles spanning a 7 day period,
beginning at 24 Apr 2000 15:40:26 GMT and ending at
01 May 2000 14:54:58 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 2000 Greg Bacon.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Excluded Posters
================
perlfaq-suggestions\@(?:.*\.)?perl\.com
Totals
======
Posters: 458
Articles: 1515 (600 with cutlined signatures)
Threads: 433
Volume generated: 2733.8 kb
- headers: 1314.2 kb (24,194 lines)
- bodies: 1347.7 kb (44,851 lines)
- original: 881.8 kb (31,803 lines)
- signatures: 70.4 kb (1,965 lines)
Original Content Rating: 0.654
Averages
========
Posts per poster: 3.3
median: 1.0 post
mode: 1 post - 255 posters
s: 8.8 posts
Posts per thread: 3.5
median: 3 posts
mode: 1 post - 105 threads
s: 2.9 posts
Message size: 1847.8 bytes
- header: 888.3 bytes (16.0 lines)
- body: 910.9 bytes (29.6 lines)
- original: 596.0 bytes (21.0 lines)
- signature: 47.6 bytes (1.3 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
123 220.7 (121.9/ 84.1/ 56.7) Tom Phoenix <rootbeer@redcat.com>
81 151.4 ( 58.1/ 84.1/ 48.3) Larry Rosler <lr@hpl.hp.com>
60 112.4 ( 56.6/ 54.8/ 25.5) Jonathan Stowe <gellyfish@gellyfish.com>
51 85.8 ( 34.9/ 43.9/ 27.0) Tad McClellan <tadmc@metronet.com>
31 55.9 ( 26.0/ 27.3/ 13.0) nobull@mail.com
25 35.9 ( 18.9/ 16.9/ 7.5) Tony Curtis <tony_curtis32@yahoo.com>
25 31.7 ( 22.9/ 8.8/ 4.7) Makarand Kulkarni <makarand_kulkarni@My-Deja.com>
24 34.2 ( 20.4/ 13.6/ 8.8) Bart Lateur <bart.lateur@skynet.be>
23 48.4 ( 24.4/ 23.4/ 18.1) "Alan J. Flavell" <flavell@mail.cern.ch>
21 45.5 ( 18.9/ 26.5/ 21.6) care227@attglobal.net
These posters accounted for 30.6% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
220.7 (121.9/ 84.1/ 56.7) 123 Tom Phoenix <rootbeer@redcat.com>
151.4 ( 58.1/ 84.1/ 48.3) 81 Larry Rosler <lr@hpl.hp.com>
112.4 ( 56.6/ 54.8/ 25.5) 60 Jonathan Stowe <gellyfish@gellyfish.com>
85.8 ( 34.9/ 43.9/ 27.0) 51 Tad McClellan <tadmc@metronet.com>
60.6 ( 3.1/ 57.4/ 51.2) 4 "yoon" <yoonjung@cs.tamu.edu>
55.9 ( 26.0/ 27.3/ 13.0) 31 nobull@mail.com
48.4 ( 24.4/ 23.4/ 18.1) 23 "Alan J. Flavell" <flavell@mail.cern.ch>
45.5 ( 18.9/ 26.5/ 21.6) 21 care227@attglobal.net
44.0 ( 18.2/ 20.2/ 11.8) 19 Uri Guttman <uri@sysarch.com>
38.4 ( 11.0/ 27.4/ 23.6) 11 "Godzilla!" <godzilla@stomp.stomp.tokyo>
These posters accounted for 31.6% of the total volume.
Top 10 Posters by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.864 ( 23.6 / 27.4) 11 "Godzilla!" <godzilla@stomp.stomp.tokyo>
0.852 ( 0.9 / 1.1) 5 "Akihabara" <akihabara@denno.gumi.com>
0.815 ( 21.6 / 26.5) 21 care227@attglobal.net
0.799 ( 2.7 / 3.3) 5 Makau Divangamene <makau@multimania.com>
0.772 ( 18.1 / 23.4) 23 "Alan J. Flavell" <flavell@mail.cern.ch>
0.741 ( 3.9 / 5.3) 5 andrew-johnson@home.com
0.719 ( 6.9 / 9.7) 18 Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
0.718 ( 0.7 / 1.0) 5 "David Stiff" <dstiff@delanotech.com>
0.675 ( 56.7 / 84.1) 123 Tom Phoenix <rootbeer@redcat.com>
0.669 ( 2.9 / 4.3) 6 Jonathan.L.Ericson@jpl.nasa.gov
Bottom 10 Posters by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.453 ( 4.5 / 9.9) 10 Rodney Engdahl <red_orc@my-deja.com>
0.441 ( 7.5 / 16.9) 25 Tony Curtis <tony_curtis32@yahoo.com>
0.430 ( 3.4 / 7.8) 7 "Chello" <stephane@siw.ch>
0.402 ( 4.4 / 10.9) 21 Tom Briles <sariq@texas.net>
0.401 ( 1.3 / 3.3) 5 sid@eurekanet.com
0.394 ( 2.9 / 7.4) 12 "Tintin" <you.will.always.find.him.in.the.kitchen@parties>
0.356 ( 2.0 / 5.6) 6 steve <schan_ca@geocities.com>
0.309 ( 2.5 / 8.1) 8 "Brian Smith" <mrsparkle@gamerzuniverse.com>
0.278 ( 2.4 / 8.7) 7 "Dimitri Ostapenko" <dimitrio@perlnow.com>
0.246 ( 1.0 / 4.1) 5 Ron Reidy <rereidy@indra.com>
56 posters (12%) had at least five posts.
Top 10 Threads by Number of Posts
=================================
Posts Subject
----- -------
21 Random number
17 [REGEXP] Extremely important please read!
16 Something isn't working, and I can't figure it out
14 trying to access elements of a scalar variable
14 Put Variable Initializations In Other File
13 Value of Reference
13 how to measure processing time by millisecond unit
13 why is thi not working?
12 Critique My Code
12 Co
These threads accounted for 9.6% of all articles.
Top 10 Threads by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Subject
-------------------------- ----- -------
57.8 ( 1.7/ 56.0/ 49.5) 2 Help )How can I do this?
39.3 ( 20.5/ 17.6/ 11.4) 21 Random number
37.9 ( 15.1/ 21.9/ 17.2) 16 Something isn't working, and I can't figure it out
29.7 ( 12.1/ 17.3/ 10.8) 13 how to measure processing time by millisecond unit
29.0 ( 10.5/ 18.0/ 7.8) 12 Critique My Code
28.9 ( 14.1/ 13.7/ 7.9) 17 [REGEXP] Extremely important please read!
28.1 ( 14.5/ 12.1/ 8.1) 14 Put Variable Initializations In Other File
27.9 ( 10.4/ 17.5/ 8.1) 11 perl in NT .BAT files Question
26.8 ( 12.5/ 13.9/ 7.0) 13 why is thi not working?
26.2 ( 7.7/ 18.2/ 11.5) 9 strict
These threads accounted for 12.1% of the total volume.
Top 10 Threads by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.822 ( 3.8/ 4.6) 5 help me
0.821 ( 3.4/ 4.2) 5 Out of memory!
0.814 ( 4.8/ 5.9) 7 newbie: camel vs. llama
0.787 ( 17.2/ 21.9) 16 Something isn't working, and I can't figure it out
0.766 ( 4.3/ 5.6) 10 String to scalar
0.758 ( 3.6/ 4.8) 5 How to test perl CGI scripts on my computer first?
0.750 ( 4.9/ 6.5) 7 Please Explain ... print "Location: http:etc.";
0.745 ( 2.4/ 3.2) 6 Converting Macintosh files to UNIX
0.741 ( 2.3/ 3.1) 5 Need info on perl modules
0.740 ( 2.3/ 3.1) 5 how to close a subrutine
Bottom 10 Threads by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.478 ( 2.5 / 5.3) 7 Help with Linux & Perl command line
0.477 ( 3.4 / 7.2) 8 How to replace these strings in a html file (2nd post)
0.464 ( 3.9 / 8.5) 6 how to get a reference to an object's method and use it?
0.464 ( 8.1 / 17.5) 11 perl in NT .BAT files Question
0.452 ( 2.4 / 5.2) 7 Printing integers from array
0.435 ( 1.4 / 3.1) 5 to print a flat data file with a certain lengths ?
0.434 ( 7.8 / 18.0) 12 Critique My Code
0.404 ( 3.8 / 9.3) 8 Random number bis (more difficult IMO - with database)
0.352 ( 2.0 / 5.7) 9 A can't find the beauty REGEXP
0.331 ( 1.5 / 4.7) 5 mysql
99 threads (22%) had at least five posts.
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
47 comp.lang.perl.modules
17 alt.perl
11 comp.lang.perl.moderated
10 de.comp.lang.perl.cgi
9 comp.lang.perl
3 comp.answers
3 alt.www.webmaster
3 news.answers
2 comp.unix.solaris
2 comp.lang.perl.announce
Top 10 Crossposters
===================
Articles Address
-------- -------
13 "Chello" <stephane@siw.ch>
6 Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
5 Larry Rosler <lr@hpl.hp.com>
5 Dave Cornejo <dave@dogwood.com>
5 Tom Phoenix <rootbeer@redcat.com>
4 Henry <htp@mac.com>
4 johnpc@xs4all.nl
4 "Doug Thomas" <dougtho@geocities.com>
3 Medi Montaseri <medi@cybershell.com>
3 Tye McQueen <tye@metronet.com>
------------------------------
Date: 01 May 2000 13:21:59 -0400
From: Victor Eijkhout <eijkhout@disco.cs.utk.edu>
Subject: subroutines in perl4
Message-Id: <om4s8itcco.fsf@disco.cs.utk.edu>
I'm in the situation of having to write a perl script to process
some simple data, and the script has to run on many different machines,
including ones that have different versions of perl, including one
that has version 4.
Apparently I can not use 'my', but I can live without that.
Did subroutines exist in perl4? Is there a way of calling them
that works in 4 and 5?
Please don't tell me to update; the machine is not mine,
and my script will have to run on it....
Assistance, including in the form of pointers to the faq, appreciated.
--
Victor Eijkhout
"When I was coming up, [..] we knew exactly who the they were. It was us
versus them, and it was clear who the them was were. Today, we are not
so sure who the they are, but we know they're there." [G.W. Bush]
------------------------------
Date: Mon, 01 May 2000 15:29:45 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: This is sorted... sorry for wasting anyone's time!
Message-Id: <39129def.1860584@news.skynet.be>
Adam T Walton wrote:
>/"([^"]+)"/g && "ed();
>
>if the string matched the criteria in the regexp it sent it to a subroutine
>to put the double quoted strings into an array... once I took the /g
>modifier off the end of the test everything worked fine... I'm not sure
>why... but I'm going to work it out!
Because //g in a scalar context does only one match. It can be used in a
loop, to do multiple matches. So, if you want to use //g, try something
like
while(/"([^"]+)"/g) {
"ed();
}
--
Bart.
------------------------------
Date: Mon, 01 May 2000 15:29:57 GMT
From: bh <bh_ent@my-deja.com>
Subject: troubleshooting
Message-Id: <8ek7t2$9tn$1@nnrp1.deja.com>
I am getting an error message and I am not sure why.
#!/usr/bin/perl -w
use strict;
sub Readfile {
open (PASS, "/tmp/HDRsysinfo.txt")
|| die "Could not read from data file: $!";
my @lists = (<PASS>);
for (@lists) {
chomp;
}
close (PASS) || die "Could not close data file: $!";
return (\@lists);
}
sub Processfile {
my ($DATE, $NAME, $PASS, $OS_LVL, $UMASK, $ROOT_SUID) = @_;
print ($NAME); # error msg points here.
}
my ($lists_ref) = Readfile();
print ($lists_ref); #I get output here.
Processfile ($lists_ref);
This is the error I am getting:
Use of uninitialized value at securelog.pl line 18.
Any ideas?
--
bh
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 01 May 2000 15:48:22 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: troubleshooting
Message-Id: <x7aeiaz2yi.fsf@home.sysarch.com>
>>>>> "b" == bh <bh_ent@my-deja.com> writes:
b> #!/usr/bin/perl -w
b> use strict;
good, both strict and -w
b> sub Readfile {
b> open (PASS, "/tmp/HDRsysinfo.txt")
b> || die "Could not read from data file: $!";
clean up the indent on the ||. it is not obvious at first glance that
you are checking the results of the open. a minor nit is to change the
word 'read' to 'open'.
b> my @lists = (<PASS>);
the parens are not needed
b> for (@lists) {
b> chomp;
b> }
the loop is not needed. chomp can work on a list directly:
chomp( @lists ) ;
b> close (PASS) || die "Could not close data file: $!";
b> return (\@lists);
b> }
b> sub Processfile {
b> my ($DATE, $NAME, $PASS, $OS_LVL, $UMASK, $ROOT_SUID) = @_;
b> print ($NAME); # error msg points here.
and where did $NAME get assigned? you pass in a single ref to the arrays
of lists (shouldn't that name be lines?) which gets assigned to $DATE
which is definitely wrong. the rest of your params are undefined so you
get that error. perhaps you meant to split the lines first in one of
these routines?
also don't use uppercase for regular var names. it is used by convention
for constant values.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Mon, 01 May 2000 16:22:17 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: troubleshooting
Message-Id: <8ekaum$dac$1@nnrp1.deja.com>
In article <8ek7t2$9tn$1@nnrp1.deja.com>,
bh <bh_ent@my-deja.com> wrote:
> I am getting an error message and I am not sure why.
>
> #!/usr/bin/perl -w
>
> use strict;
>
> sub Readfile {
> open (PASS, "/tmp/HDRsysinfo.txt")
> || die "Could not read from data file: $!";
> my @lists = (<PASS>);
> for (@lists) {
> chomp;
> }
> close (PASS) || die "Could not close data file: $!";
> return (\@lists);
> }
>
> sub Processfile {
> my ($DATE, $NAME, $PASS, $OS_LVL, $UMASK, $ROOT_SUID) = @_;
you passed the reference to the array, not the array itself . . .
assuming you passed the ref properly:
my ($ref) = @_;
($DATE, $NAME, $PASS, $OS_LVL, $UMASK, $ROOT_SUID) = @$ref;
> print ($NAME); # error msg points here.
> }
> my ($lists_ref) = Readfile();
> print ($lists_ref); #I get output here.
> Processfile ($lists_ref);
>
> This is the error I am getting:
> Use of uninitialized value at securelog.pl line 18.
>
> Any ideas?
>
> --
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 01 May 2000 16:29:45 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: troubleshooting
Message-Id: <8ekbck$dth$1@nnrp1.deja.com>
In article <8ekaum$dac$1@nnrp1.deja.com>,
Rodney Engdahl <red_orc@my-deja.com> wrote:
> In article <8ek7t2$9tn$1@nnrp1.deja.com>,
> bh <bh_ent@my-deja.com> wrote:
> > I am getting an error message and I am not sure why.
> >
> > #!/usr/bin/perl -w
> >
> > use strict;
> >
> > sub Readfile {
> > open (PASS, "/tmp/HDRsysinfo.txt")
> > || die "Could not read from data file: $!";
> > my @lists = (<PASS>);
> > for (@lists) {
> > chomp;
> > }
> > close (PASS) || die "Could not close data file: $!";
> > return (\@lists);
> > }
> >
> > sub Processfile {
> > my ($DATE, $NAME, $PASS, $OS_LVL, $UMASK, $ROOT_SUID) = @_;
>
> you passed the reference to the array, not the array itself . . .
> assuming you passed the ref properly:
>
> my ($ref) = @_;
> ($DATE, $NAME, $PASS, $OS_LVL, $UMASK, $ROOT_SUID) = @$ref;
er, make that:
my ($DATE, $NAME, $PASS, $OS_LVL, $UMASK, $ROOT_SUID) = @$ref;
>
> > print ($NAME); # error msg points here.
> > }
> > my ($lists_ref) = Readfile();
> > print ($lists_ref); #I get output here.
> > Processfile ($lists_ref);
> >
> > This is the error I am getting:
> > Use of uninitialized value at securelog.pl line 18.
> >
> > Any ideas?
> >
> > --
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
--
Some drink at the fountain of knowledge...others just gargle.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 01 May 2000 14:29:54 GMT
From: rainmak <jcolby@my-deja.com>
Subject: what is xxEOFXX
Message-Id: <8ek4ci$5ri$1@nnrp1.deja.com>
All -
I am a fairly new to perl, and I encountered the following line in a
script and I was wondering what it does.
print <<"XXEOFXX;
(some html code here)
XXEOFXX
What is this?
Thanks in advance
-Rainmak
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 01 May 2000 15:07:07 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: what is xxEOFXX
Message-Id: <8ek6ih$81c$1@nnrp1.deja.com>
In article <8ek4ci$5ri$1@nnrp1.deja.com>,
rainmak <jcolby@my-deja.com> wrote:
> All -
>
> I am a fairly new to perl, and I encountered the following line in a
> script and I was wondering what it does.
>
> print <<"XXEOFXX;
>
> (some html code here)
>
> XXEOFXX
>
> What is this?
>
This might be a multiline quoting machanism called a here document, but
there is a missing double-quote in the print line. If there were a
double-quote between the last X and the semi-colon, the print line would
specify the target, which would be XXEOFXX in this case.
Assuming that the second occurance of XXEOFXX is flush against the left
margin, each line of (some html code here) would be interpolated and
printed.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 1 May 2000 10:31:37 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: what is xxEOFXX
Message-Id: <slrn8gr5a9.1id.tadmc@magna.metronet.com>
On Mon, 01 May 2000 14:29:54 GMT, rainmak <jcolby@my-deja.com> wrote:
>I am a fairly new to perl, and I encountered the following line in a
>script and I was wondering what it does.
>print <<"XXEOFXX;
>XXEOFXX
It is an alternate form of quoting called a "here-doc".
Search for "here-doc" (without the quotes) in perldata.pod
perldoc perldata
See also the FAQ (part 4) that mentions here-docs:
"Why don't my <<HERE documents work?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
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 2915
**************************************