[7566] in Perl-Users-Digest
Perl-Users Digest, Issue: 1192 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 18 01:07:46 1997
Date: Fri, 17 Oct 97 22:00:28 -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 Fri, 17 Oct 1997 Volume: 8 Number: 1192
Today's topics:
$self in destructor? <oboyle@cs.purdue.edu>
Re: _Programming Perl_ new edition? (brian d foy)
Big Newbie Question?? Please Help!!! franklin@ideas4you.com
Re: Creating Arrays on the fly (Mike Stok)
Effective Perl: new chapters on-line joseph@5sigma.com
How to pick up an URL out of a string <wweng@attila.stevens-tech.edu>
Interactive Calendar <rlluhman@netins.net>
interprocess communcation for Win32 (Jianhua Wang)
load average (root)
Lookbehind (John Moreno)
Re: odd <rbush@up.net>
opposite of chop? (Richard Drake)
Re: opposite of chop? (Mike Stok)
Performance Question <philen@ans.net>
Re: Performance Question (brian d foy)
Perl pretty printer that generates HTML? <carrigad+usenet@iplenergy.com>
Re: Perl pretty printer that generates HTML? (Jeff R. Stone)
problem in JAVA exec of PERL scripts on Windows platfor <ajaym@hooked.net>
Re: qqq (brian d foy)
Re: qqq <usenet-tag@qz.little-neck.ny.us>
Re: qqq (brian d foy)
Re: reading in input <rra@stanford.edu>
Re: Searching Perl(5) grammar <merlyn@stonehenge.com>
Re: selecting files into array <bholzman@mail.earthlink.net>
Server Error <janovjak@ican.net>
Re: Server Error (brian d foy)
Re: String manipulation in Perl <jgoerzen+usenet@complete.org>
untie warning when using MLDBM module Gerben_Wierda@RnA.nl
What do I need for Oraperl? (Lennie Jarratt)
What kind of string will work ? <nishin@bekkoame.or.jp>
Re: Why am I running out of memory? (bug in perl?) (Jot Powers)
WinNT and Perl question <jspink@qualcomm.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 18 Oct 1997 04:19:58 GMT
From: Todd O'Boyle <oboyle@cs.purdue.edu>
Subject: $self in destructor?
Message-Id: <629dde$mqf@ector.cs.purdue.edu>
I need to use $self from the current package in the destructor
of my object. Is there some way to attain it? I don't see
an obvious way to pass it to END(), so..
I kind of hacked it by creating a global variable within the package.
Here is an example:
package Foo;
END
{
## Blows up here because I have no way of getting to the $self ref.
## I need the information in it, though..
####
$self->_break_lock();
}
sub _break_lock
{
my $self = shift;
## Do stuff with $self;
}
sub new
{
my $class = shift;
my $filename = shift;
$self = {
filename => $filename
## Some other stuff..
};
bless $self, $class;
## Do other stuff.
return $self;
}
## EOF
cheers,
-Todd
--
Key: ftp://csociety.ecn.purdue.edu/pub/oboyle/oboyle.asc
Fingerprint: DA 83 ED B0 48 79 F4 5D B2 4D B0 B7 F1 A3 C1 49
Location: 86 54' 29" W / 40 25' 33" N
------------------------------
Date: Fri, 17 Oct 1997 17:47:13 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: _Programming Perl_ new edition?
Message-Id: <comdog-ya02408000R1710971747130001@news.panix.com>
In article <eli$9710171511@qz.little-neck.ny.us>, Eli the Bearded <usenet-tag@qz.little-neck.ny.us> wrote:
to respond to the original poster - every tech book is somewhat outdated
by the time it hits the shelves. the latest edition covers Perl 5
(notice the lack of minor version specifier there), so don't worry about
the minor releases. to keep on top of things you'll need to read the
man pages and release notes et cetera, but it's still nice to have
the big reference that covers the syntax, core functions, and so on,
which don't change (dramatically).
>if brian can make dead horse jokes, so can I
surely this dead horse will come to haunt me.
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Fri, 17 Oct 97 23:45:45 -0400
From: franklin@ideas4you.com
Subject: Big Newbie Question?? Please Help!!!
Message-Id: <344832c0$1$senaxyva$mr2ice@news.alltel.net>
How do you start a new file.
In REXX it would work something like this.
String = "Sample String For File"
call lineout "fileaname.txt", String
call stream "fileaname.txt",'C','CLOSE'
This should be simple, but I can't find an example that shows this
information.
TIA
--
Coming Soon,
"Discussion Groups" the power of the news groups packed into the manageablity of a mail list.
Ideas Unlimited Consulting
http://www.ideas4you.com
------------------------------
Date: 17 Oct 1997 23:14:27 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Creating Arrays on the fly
Message-Id: <628rgj$6mh@news-central.tiac.net>
In article <3444548F.E7C2D86F@poolpros.com>, ryanr <ryanr@poolpros.com> wrote:
>How would I go about creating a 2 dimensional array on the fly?
>
>right now I am creating my arrays, according to the way Tom Christiansen
>says in FMTEYEWTK, such as:
>@Table = ([1,2,3,4],
> [5,6,7,8],
> [9,0,1,2]);
>
>This works o.k.. but what I would really like to do is read my values
>in from a file
>and build the array. I realize that I would have to use push(), but I'm
>not sure how I would go about adding to the 2nd dimension..
Just remember that complex data structures are really simple data
structures whose members are scalars which might in turn be references to
other data structures.
You can read a file a line at a time, and use split to get it into fields
and then use the [] operator to create an anonymous copy of the data and
return a reference to it to you. This can then be pushed onto an array as
any other scalar could.
Using the Data::Dumper module from CPAN you could try this (or use the X
command in the debugger to examine Table)
#!/usr/local/bin/perl -w
use Data::Dumper;
# effectively:
#
# push @Table, [split] while <DATA>;
while (<DATA>) {
@row = split;
$ref = [@row];
push @Table, $ref;
}
print Dumper \@Table;
__END__
1 2 3 4
5 6 7 8
9 0 1 2
which produces:
$VAR1 = [
[
1,
2,
3,
4
],
[
5,
6,
7,
8
],
[
9,
'0',
1,
2
]
];
The debugger, which can be run as an interactive shell like this:
perl -de 1
is useful for quickly trying things out and examining the results.
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: Fri, 17 Oct 1997 23:51:50 -0600
From: joseph@5sigma.com
To: joseph@5sigma.com
Subject: Effective Perl: new chapters on-line
Message-Id: <877150088.19984@dejanews.com>
I've just posted some more sample chapters from Effective Perl
Programming. They're online at the usual spot:
http://www.5sigma.com/perl/book.html
The two new ones are Regular Expressions and Subroutines.
Production has been moving along smoothly for the past couple of
months. I hope to see EPP in print before the end of the year, but
it will be close.
-joseph
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 17 Oct 1997 23:09:19 GMT
From: Wei Weng <wweng@attila.stevens-tech.edu>
Subject: How to pick up an URL out of a string
Message-Id: <628r70$iia$1@apocalypse.dmi.stevens-tech.edu>
Hi
I want to pick out the URL out of a string like below:
<a href="http://www.blah.com">blah.com</a>
I want to get www.blah.com or http://www.blah.com
COuld anyone help me with that?
thanx in advance.
--
************************************************************
Wei Weng & A N NIIIM MEEEE *
Box s-1398 & A A NN N I MM MM *
Stevens Institute of Technology& A A N N N I M M MEEEE *
Hoboken, NJ 07030 & AAAAAAAN NN I M M *
wweng@stevens-tech.edu &A A NIIIM MEEEE *
************************************************************
------------------------------
Date: Fri, 17 Oct 1997 16:27:57 -0500
From: "Rick" <rlluhman@netins.net>
Subject: Interactive Calendar
Message-Id: <628l0a$3bm$1@news.iastate.edu>
Does anyone know of an Interactive Web Calendar that will work with Novell's
Webserver 3.1.
RICK
------------------------------
Date: 17 Oct 1997 18:57:29 -0400
From: wjh@math.mit.edu (Jianhua Wang)
Subject: interprocess communcation for Win32
Message-Id: <628qgp$1mr@runge.mit.edu>
Hi all:
I am a new perl5.0 User. I am trying to do the following things:
1:launch a perl program
2:create a child process
3: communicate between the parent and the child process.
how do I achieve this? I tried to use chat2.pl but it doesn't work in
win32 because the "fork" doesn't work. Is there anyone who can help me?
thanks in advance.
jianhua
------------------------------
Date: 17 Oct 1997 22:04:07 GMT
From: root@mothership.dreamscape.com (root)
Subject: load average
Message-Id: <628ncn$iu8$1@newsfeed.dreamscape.com>
------------------------------
Date: Sat, 18 Oct 1997 00:44:46 -0400
From: phenix@interpath.com (John Moreno)
Subject: Lookbehind
Message-Id: <1997101800091724918410N@roxboro-169.interpath.net>
I was reading the perl regular expression manual and it looks to me like
perl doesn't have a look behind extension is this true?
Frex to find a 2 that was preceded by 1 and followed by a 3 I'd like to
write something like
/:<12:>3/;
Which is how I'd write it using QUED/M. Is this possible without
writing something like
/(1)(2)(3)/;
and then using $2 or doing something else similar, i.e. doing it in more
than one step.
--
John Moreno
------------------------------
Date: Fri, 17 Oct 1997 17:23:20 -0400
From: "Raymond K. Bush" <rbush@up.net>
Subject: Re: odd
Message-Id: <3447D748.BF3@up.net>
Raymond K. Bush wrote:
Thanks guys, just couldnt see it at first.
My co-worker came up with a script using egrep and diff cuts and some
temp files. Course he's almost anti perl sometimes ... But when i
blunder like that i see why ...
Thanks again,
--Ray
.70~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~07.
--- please include indication of past correspondence---
--- in order to receive a faster response ---
------------------------------
Date: 17 Oct 1997 22:38:09 GMT
From: drake@scapa.cs.ualberta.ca (Richard Drake)
Subject: opposite of chop?
Message-Id: <628pch$o4r$1@scapa.cs.ualberta.ca>
Is there a function that strips the first char off it's arguement?
thanks!
--
====================================><======================================
Richard Drake |"They never taste, who always drink;
drake@cs.ualberta.ca | They always talk, who never think."
http://ugweb.cs.ualberta.ca/~drake | Matthew Prior
------------------------------
Date: 17 Oct 1997 23:22:04 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: opposite of chop?
Message-Id: <628rus$6vi@news-central.tiac.net>
In article <628pch$o4r$1@scapa.cs.ualberta.ca>,
Richard Drake <me@nospam.com> wrote:
>Is there a function that strips the first char off it's arguement?
You mean something that might be called chip? Not explicitly, but you can
do stuff like:
$var =~ s/^.//s;
substr ($var, 0, 1) = '';
or any number of other things which have that effect, which you choose
probably depends on your data, experience and languages you're used to.
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: Wed, 15 Oct 1997 18:17:58 -0400
From: Phillip Lenhardt <philen@ans.net>
Subject: Performance Question
Message-Id: <Pine.GSO.3.95.971015181346.20476h-100000@earn.aa.ans.net>
Which is cheaper, to pass a string to a subroutine which then splits it
into characters or to split the string into an array and then pass it to
the subroutine. I will be doing this thousands of times and recursively to
boot (it is part of an object packing/unpacking set of methods).
phil
------------------------------
Date: Fri, 17 Oct 1997 23:35:59 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Performance Question
Message-Id: <comdog-ya02408000R1710972335590001@news.panix.com>
In article <Pine.GSO.3.95.971015181346.20476h-100000@earn.aa.ans.net>, Phillip Lenhardt <philen@ans.net> wrote:
>Which is cheaper, to pass a string to a subroutine which then splits it
>into characters or to split the string into an array and then pass it to
>the subroutine. I will be doing this thousands of times and recursively to
>boot (it is part of an object packing/unpacking set of methods).
look into the Benchmark module which will let you compare the
performance of different routines.
don't neglect to look into passing by reference either :)
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: 17 Oct 1997 15:47:42 -0600
From: Dave Carrigan <carrigad+usenet@iplenergy.com>
Subject: Perl pretty printer that generates HTML?
Message-Id: <86g1q06ozl.fsf@iplenergy.com>
I'm looking for a program which takes perl code and generates a
pretty-printed version in HTML a la tgrind. I'm guessing it's not an
easy task, given the nature of parsing Perl, but if anybody has
anything along those lines, I'd appreciate hearing from you.
--
Dave Carrigan | Yow! BELA LUGOSI is my co-pilot..
Unix Specialist, Technology Services |
Interprovincial Pipe Line Inc. |
Edmonton, Alberta, Canada |
------------------------------
Date: 17 Oct 1997 20:22:11 -0400
From: jstone@america.net (Jeff R. Stone)
Subject: Re: Perl pretty printer that generates HTML?
Message-Id: <x6hgafex8s.fsf@stone.america.net>
>>>>> "Dave" == Dave Carrigan <carrigad+usenet@iplenergy.com> writes:
Dave> I'm looking for a program which takes perl code and
Dave> generates a pretty-printed version in HTML a la tgrind. I'm
Dave> guessing it's not an easy task, given the nature of parsing
Dave> Perl, but if anybody has anything along those lines, I'd
Dave> appreciate hearing from you.
This isn't exactly what you are asking for, but the end result is the
same...
You can use Emacs with cperl mode to create nice formatted source and
then htmlize.el can write that source out as HTML -- including the
colors if you enabled font-lock.
cperl mode you can get from CPAN. htmlize.el is by Hrvoje Niksic
<hniksic@srce.hr>. If you want it and can't find it, let me know.
Jeff
--
Jeff R. Stone <jstone@america.net>
PGP Key: http://www.america.net/~jstone/
Fingerprint: A6 70 4D 2E A1 F9 CF 08 58 96 A9 45 0A 06 99 59
------------------------------
Date: Fri, 17 Oct 1997 21:31:18 -0700
From: Ajay Mittal <ajaym@hooked.net>
Subject: problem in JAVA exec of PERL scripts on Windows platforms
Message-Id: <34483B96.2106@hooked.net>
hello!
i m writing a JAVA GUI around some PERL scripts. The PERL scripts
make lots of native calls to some native executabes (don't ask me why!).
here is an example
java code:
Process p = runtime.exec ("perl xx.pl");
(after this i get OutputStream of the process to read
what this process is writing to STDOUT)
sample PERL code (xx.pl)
$xx = `ping 199.199.199.2`;
print $xx;
on UNIX i get the proper return strings in OutputStream of the process.
but on NT i noticed PING runs in a seperate command window and
i don't get anything in the output stream. is it because PERL was
not lauched from a command window? i noticed if i say
exec ("cmd32 perl xx.pl") then PING does not go out to a
separate command window but still i don't get anything on the
STDOUT. i know you are saying - why don't you write STDOUT
to a file and the later read it...b'cos i want to display
the output in GUI line-by-line and also there are tons of
such calls.
please help!
thanx
-ajay
------------------------------
Date: Fri, 17 Oct 1997 17:38:42 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: qqq
Message-Id: <comdog-ya02408000R1710971738420001@news.panix.com>
In article <eli$9710171423@qz.little-neck.ny.us>, Eli the Bearded <usenet-tag@qz.little-neck.ny.us> wrote:
>:r! perl5.00401 -we '$_ = qq qq ; print "($_)\n"'
>()
i like it! (i thought you would go for something like qq ;;; though)
does this work for you?
#!/usr/bin/perl -w
$_ = "some perl hackers\n";
s d #use lc('D')!
^
(some)
d$1 new yorkdx;
print;
__END__
it works for me despite the Blue Camel p. 41.
>Elijah
>------
>the way your newsreader works *will* change what you see here
so how does it work on other newsreaders?
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: 18 Oct 1997 04:01:14 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: qqq
Message-Id: <eli$9710172317@qz.little-neck.ny.us>
brian d foy <comdog@computerdog.com> wrote:
> Eli the Bearded <usenet-tag@qz.little-neck.ny.us> wrote:
> >:r! perl5.00401 -we '$_ = qq qq ; print "($_)\n"'
> >()
> i like it! (i thought you would go for something like qq ;;; though)
There was a problem with that. Ther were two ways to interpret it, and
I only showed one. In the above quoted mention, mangled by your newsreader,
'q' is the quoting character. In the Alternative version, ^H is the quote
character and "( qq )\n" is the output. Vim 4.2 gets the :r! wrong which
contributed to the problem.
> does this work for you?
Yes.
> s d #use lc('D')!
> ^
> (some)
> d$1 new yorkdx;
>
> it works for me despite the Blue Camel p. 41.
That simplifies things, probably to keep matters sane, possibly for
compatibility across several versions.
You can add this fun second statement, too:
s sSsSssi;
Even by my standards, that one is very cruel. (Ilya, are you reading this?
Are you going to patch the emacs syntax highlighting to deal with this?
Somehow I really doubt it does currently.)
> >the way your newsreader works *will* change what you see here
> so how does it work on other newsreaders?
Some hide the control characters, some do not. Using backspace as a quoting
character becomes amusing when it is invisible. :^)
Elijah
------
alas, "%a={ a => y};' foo ' # {{{ whee }}} ;" doesn't work.
------------------------------
Date: Sat, 18 Oct 1997 01:03:49 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: qqq
Message-Id: <comdog-ya02408000R1810970103490001@news.panix.com>
In article <eli$9710172317@qz.little-neck.ny.us>, Eli the Bearded <usenet-tag@qz.little-neck.ny.us> wrote:
>brian d foy <comdog@computerdog.com> wrote:
>> Eli the Bearded <usenet-tag@qz.little-neck.ny.us> wrote:
>> >:r! perl5.00401 -we '$_ = qq qq ; print "($_)\n"'
>> >()
>> so how does it work on other newsreaders?
>
>Some hide the control characters, some do not. Using backspace as a quoting
>character becomes amusing when it is invisible. :^)
dog[52] perl -we '$_ = qq^H qq ^H; print"($_)\n"'
( qq )
back to my question from d.b.a: can you still use a newline
as a delimiter? well, not anymore at least. maybe someone with an
ancient version of perl can...
>You can add this fun second statement, too:
>
> s sSsSssi;
how about
dog[57] perl -e '$_ = "abcs"; s Ss$S$sS; print "($_)\n";'
(abc)
but not (sadly) (using control-H)
dog[58] perl -we '$_ = "abcs"; s^HSs$S^H$sS^Hs; print "($_)\n";'
Substitution pattern not terminated at -e line 1.
although when you think they are visible they aren't:
dog[64] perl -e '$_ = 'abcs'; s^HSs$S^H$sS^s; print "($_)\n";'
(abcs)
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
wonders if this is anywhere near the original post
------------------------------
Date: 17 Oct 1997 21:23:48 -0700
From: Russ Allbery <rra@stanford.edu>
To: webadmin <webadmin@prestel.net>
Subject: Re: reading in input
Message-Id: <m3lnzraecr.fsf@windlord.Stanford.EDU>
[ Posted and mailed. ]
webadmin <webadmin@prestel.net> writes:
> I have a perl script which calles another perl script. Now I want the
> first one to parse values to the second one
> `test.pl value1 value2`
> the values should be sent to test.pl which can mainpulate them.
Those values will be visible to test.pl in the array @ARGV. Have you
checked there for them?
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 17 Oct 1997 22:50:20 -0400
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Searching Perl(5) grammar
Message-Id: <97-10-092@comp.compilers>
Keywords: parse
>>>>> "Chip" == Chip Salzenberg <chip@rio.atlantic.net> writes:
Chip> According to Gerd Weishaar <weishaar@soft.uni-linz.ac.at>:
>> I'm searching for a Perl grammar with the purpose to develope an
>> analysis tool for perl programs. The yacc-file included in the
>> perl5 package is quite tricky and difficult to read.
Chip> That's because Perl itself is tricky and difficult to parse.
>> [I'd be surprised if anything much simpler than the parser in perl5 could
>> correctly parse perl5. -John]
Chip> Good call. Some parser decisions depend on such factors as whether
Chip> a given package (class) has been defined yet.
You forgot "phase of the moon", "remaining supply of smoke for
smoke-and-mirrors", and "relative Bacon number".
:-)
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
--
Send compilers articles to compilers@iecc.com, meta-mail to
compilers-request@iecc.com. Archives at http://www.iecc.com/compilers
------------------------------
Date: Fri, 17 Oct 1997 20:49:57 -0400
From: Benjamin Holzman <bholzman@mail.earthlink.net>
To: mathias@linux.ek79.uni-koeln.de
Subject: Re: selecting files into array
Message-Id: <344807B5.6636A3F1@mail.earthlink.net>
[posted & mailed]
mathias@linux.ek79.uni-koeln.de wrote:
>
> Hi,
>
> I am looking for a way to get filenames selected
> by a command line expression into an array, i.e
>
> > TheScript m??rep.*
>
> TheScript:
> #!/usr/bin/perl
>
> $SelectionString = @ARGV;
>
> m??rep.* -> @Files
> ...
> @Files[1] = m95rep.in;
> @Files[2] = m95rep.out;
> @Files[3] = m96rep.in;
> ...
>
First of all, @Files[1] isn't really what you think it is; the scalar
contained in the first element of the array @Files is '$Files[0]'.
'@Files[1]' is an _array_slice_ of @Files consisting of the 2nd
element. Similarly, your code '$SelectionString = @ARGV' is setting a
scalar to an array, which evaluates the array @ARGV in scalar context,
returning the _length_ of the array.
That said, I think this will do what you want:
$ the_script m??rep.*
the_script:
#!/usr/bin/perl
@Files=@ARGV;
Ta-dah! Actually, you don't even have to copy the ARGV array. You
could just use it... You might also be interested in the '<>' operator;
read perlop!
> Thank you for your emailed tip.
>
> Regards,
>
> Mathias
------------------------------
Date: Fri, 17 Oct 1997 20:36:09 -0400
From: Janovjak <janovjak@ican.net>
Subject: Server Error
Message-Id: <34480479.2080@ican.net>
Hello,
Please pardon the simple question (newbie posting)...
I have a perl script which generates a html file, and returns the output
to stdout (that is, it displays the results on screen, in html format).
The script executes fine. When I view the output html file in the
browser by typing it's address, it also appears fine. However, when I
attempt, from the form html page to call this perl script, I get a
message something like:
Server Error likely due to a system configuration problem. Have your
sys admin check the logs.
Would you please tell me what are things I need to verify...
Permissions?
Nobody access?
.rhosts file modifications?
Where is this error log?
More details...
Running on Sun (web server) Solaris (application server), Perl 4.
The script:
Form captures user parameters / info.
Script creates a file.
Rsh to other server (where SAS is)
SAS reads file as a sysparm, submits job to Sybase.
SAS creates html document.
Document rcp'd to server.
Please help.
Thank you,
Dan Janovjak
janovjak@ican.net
------------------------------
Date: Fri, 17 Oct 1997 21:45:49 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Server Error
Message-Id: <comdog-ya02408000R1710972145490001@news.panix.com>
In article <34480479.2080@ican.net>, Janovjak <janovjak@ican.net> wrote:
> Server Error likely due to a system configuration problem. Have your
>sys admin check the logs.
>
>Would you please tell me what are things I need to verify...
there is a troubleshooting guide at
<URL:http://language.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html>
good luck :)
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: 17 Oct 1997 07:31:42 -0500
From: John Goerzen <jgoerzen+usenet@complete.org>
Subject: Re: String manipulation in Perl
Message-Id: <87afg8po41.fsf@garfield.complete.org>
ckc@dmi.min.dk (Casper K. Clausen) writes:
> >>>>> "J" == John Goerzen <jgoerzen+usenet@complete.org> writes:
>
> J> zawodny@hou.moc.com (Jeremy D. Zawodny) writes:
>
> J> Also.. It is hard to specify a "range" of characters, excluding some
> J> certain specific ones, with regexps (unless I am missing some regexp
> J> feature).
>
> As in /[^\x20-\x79]/ (any character not in the range 32-127) or
> perhaps /[\x00-\x1F\x80-\xFF]/ (any character from 0-31 or 128-255)?
Urmm, yeah, that would be the one :-)
geez, I feel sorta silly now, that wasn't really that hard... I guess
I have to get out of this "C" mindset...
--
John Goerzen | Running Debian GNU/Linux (www.debian.org)
Custom Programming | Debian GNU/Linux is a free replacement for
jgoerzen@complete.org | DOS/Windows -- check it out at www.debian.org.
------------------------------
Date: Fri, 17 Oct 1997 22:50:13 GMT
From: Gerben_Wierda@RnA.nl
Subject: untie warning when using MLDBM module
Message-Id: <EI7wrp.Mzy@RnA.NL>
When I try to untie after having tied with
tie %::gorddb, 'MLDBM', $::gorddb_name, O_RDONLY, 0640 or warn $!;
I get the warning:
untie attempted while 1 inner references still exist at ./gord.pl
line 284.
I like to reload this database at a certain point. Might this be because I am
doing this in an interrupt handler?
--
Gerben_Wierda@RnA.nl (Gerben Wierda)
"If you don't know where you're going, any road will take you there"
Paraphrased in Alice in Wonderland, originally from the Talmud.
Renee: "Met veel koper maakt men hoempa." (After hearing Brahms'
Festouverture)
------------------------------
Date: Fri, 17 Oct 1997 21:31:21 GMT
From: lbj_ccsi@atl.mindspring.com (Lennie Jarratt)
Subject: What do I need for Oraperl?
Message-Id: <628lbt$78u@camel20.mindspring.com>
I am using Oracle v7.3.2. I want to install Oraperl. What do I need
to grab and install. I already have Perl 5.003 running. I got
oraperl v2.4. Is this the correct version or is there something else
I should be using?
Should I use the DBD and DBI modules instead and not Oraperl?
I need help as soon as possible.
Thanks in advance.
Lennie
------------------------------
Date: Sat, 18 Oct 1997 13:03:01 +0900
From: Mic <nishin@bekkoame.or.jp>
Subject: What kind of string will work ?
Message-Id: <344834F5.1E75@bekkoame.or.jp>
I would like to ask someone out there if they can tell me what this
string means.
if ($input = /~user=(.*)&newpasswd1=(\S*)&newpasswd2=(\S*)\s*$/){
...
}
What kind of string is valid.
I hope I am in the right Newsgroup for this question.
Thank you for your time.
Mic
------------------------------
Date: 17 Oct 1997 22:45:59 GMT
From: news@bofh.com (Jot Powers)
Subject: Re: Why am I running out of memory? (bug in perl?)
Message-Id: <628pr7$r9l$1@gazette.corp.medtronic.com>
In article <NOSPAM.97Oct17153947@pickering.ll.mit.edu>,
Joseph Scott Stuart wrote:
>
>I think I found the memory leak, and it is in perl's string
>interpolation routines.
>
>This is my system:
>
>% perl -v; uname -a
>This is perl, version 5.004_01
>
>% uname -a
>OSF1 herpolhode V3.2 148 alpha
>
>
>The following program eats memory and eventually (hours) dies with
>the message "Out of memory!".
I ran your program, unmodified, with the results to /dev/null for about
10 CPU minutes on a Sun Ultra 1/170 and saw no increase in memory consumption.
node127% perl -V
Summary of my perl5 (5.0 patchlevel 4 subversion 0) configuration:
Platform:
osname=solaris, osvers=2.5.1, archname=sun4-solaris
uname='sunos node127 5.5.1 generic sun4u sparc sunw,ultra-1 '
hint=recommended, useposix=true, d_sigaction=define
bincompat3=y useperlio= d_sfio=
HTH
-Jot
--
Jot Powers news@bofh.com
Unix System Administrator
"Sometimes you just have to grab the bull by the tail and face the situation."
------------------------------
Date: Thu, 16 Oct 1997 11:46:34 -0600
From: Jim Spink <jspink@qualcomm.com>
Subject: WinNT and Perl question
Message-Id: <344652FA.6AE7@qualcomm.com>
I'm a newbie to Perl and this newsgroup, so if my question is
inappropriate or belongs elsewhere please let me know. Its a long note.
The program I'm working with interacts with Perl by spawning a separate
process. To get output from the child Perl process the parent redirects
the child's stdin, stdout, and stderr by creating anonymous pipes, using
those to replace stdin, stdout, stderr, spawning perl (which inherits
them), then resetting them back. Pretty standard way to get output from
a console-mode program in Windows. The parent program waits on those
pipes for output from the child process (Perl), and everything is
hunky-dory except for one obscure bug.
Seems that, if the child process calls Win32 Sleep() or any functions
that wait on stdin, i.e. getc(), then any output to stdout (i.e. via
printf) never makes it thru the pipe in the parent process. For
example, the Perl script might call sleep(1), then call print "hello
world\n". You'll never see the hello world or anything else for an
indeterminate (perhaps indefinite) time period. From what I can tell,
the output simply buffers up in stdout or stderr and is never flushed.
This doesn't appear to be Perl's fault - rather, it seems to be a bug in
Windows NT itself. I've been able to recreate it with generic programs.
Naturally I'm looking into contacting Microsoft support, but having
worked with them before I know that even if they agree its a bug and fix
it, it won't be ready in the timeframe I require, i.e. right now, and in
all likelihood it wouldn't appear until the next Service Pack for VC++
5.0 or NT 4.x at the very earliest. Thus the need to change Perl
source, something I had hoped to avoid.
So, I have two possible solutions to propose to the Perl source owners,
specific to Win32. One of them is to, in \win32\perlmain.c, perform the
following calls:
setvbuf( stdout, NULL, _IONBF, 0 );
setvbuf( stderr, NULL, _IONBF, 0 );
These unbuffer the streams and 'cure' the problem. However, I
understand they may have performance implications and are probably not
the best work around. The other option is to go into \win32\win32.c and
place the following inside each offending function call (i.e. sleep())
fflush(stdout);
fflush(stderr);
This probably works better, but is a bigger hit and is unlikely to close
all possible routes to cause this problem.
Suggestions? Should I ask this question somewhere else?
Thanx!
Jim Spink
jspink@qualcomm.com
------------------------------
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 1192
**************************************