[6326] in Perl-Users-Digest
Perl-Users Digest, Issue: 948 Volume: 7
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 14 11:17:11 1997
Date: Fri, 14 Feb 97 08:00:23 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 14 Feb 1997 Volume: 7 Number: 948
Today's topics:
Re: $I{$J}{$K} (M.J.T. Guy)
[Q]: How to input info into passwd command <sfierro@snowball.millersv.edu>
Re: advise with require in perl5 <rootbeer@teleport.com>
Re: Case insensitive comparison (Dave Thomas)
Re: Case insensitive comparison (Tad McClellan)
Re: case-insensitive grep()? <merlyn@stonehenge.com>
Re: case-insensitive grep()? (Andrew M. Langmead)
Re: compiling perl <tchrist@mox.perl.com>
Re: DBfile verses no DBfile (Tad McClellan)
Re: Escaping \u in a string (M.J.T. Guy)
Re: Escaping \u in a string (Nathan V. Patwardhan)
Re: Help please with text wrap (Stijn van Dongen)
How to impliment AnsiColor in perl? lstanl01@fiu.edu
Re: How to open an HTTP connection with PERL ? (Nathan V. Patwardhan)
Re: How to return exit values to UNIX ?!?!? (Tad McClellan)
Re: How to return exit values to UNIX ?!?!? <rootbeer@teleport.com>
Re: Howto determine an object is a HASH or ARRAY <rootbeer@teleport.com>
Re: howto match newlines? <tchrist@mox.perl.com>
Re: Normal Distribution Function in Perl <jim.michael@gecm.com>
Re: OK I know that I am a newbie But I need HELP!! (Nathan V. Patwardhan)
Re: perl script bug <merlyn@stonehenge.com>
Re: Perl script debug help (Dave Thomas)
Problem using diagnostics.pm <imran@science.gmu.edu>
Re: Questions about formline <rootbeer@teleport.com>
Re: Randal trashed yet again--*sigh* <merlyn@stonehenge.com>
Re: socket i/o <tchrist@mox.perl.com>
Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 14 Feb 1997 14:10:09 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: $I{$J}{$K}
Message-Id: <5e1ro1$1jj@lyra.csx.cam.ac.uk>
Anthony Bucci III <axb21@po.CWRU.Edu> wrote:
>
>There were indeed multidimensional arrays in perl4, but they were
>"faked." Thus, notation like:
>
> $array[0,1,1] = 10;
>
>will work in perl4, and will do what you expect it to. This notation is
>actually shorthand for something like (this is paraphrased from the Camel
>book):
>
> $array[join($;,(0,1,1))];
Not quite. Change all those [] to {} and you'll have it.
Mike Guy
------------------------------
Date: Thu, 13 Feb 1997 16:25:27 -0500
From: Steven Fierro <sfierro@snowball.millersv.edu>
Subject: [Q]: How to input info into passwd command
Message-Id: <Pine.SOL.3.95.970213161949.11701A-100000@snowball>
Hello,
I am writing a perl program to generate user accounts. I have the script
written except for the password generation part.
I have a routine that randomly generates an 8 character password and
stores it as a variable. At the end of my program (i.e. I have taken all
the necesary info and am ready to gen the account), I use the useradd
command. This actually creates the account but puts no password. I want
to somehow take my autocreated password and apply it to this new account.
I am not sure how to do this. I can't seem to redirect the output of the
variable into the passwd command.
Does anyone have any suggestions on how this could be done?
Thank you.
Steven Fierro
****************************************************************************
Academic Computing Services E-MAIL: sfierro@snowball.millersv.edu
Boyer Computer Center TITLE: Systems Administration
Millersville University GOPHER: snowball.millersv.edu port 70
Millersville, PA 17551 WWW: http://snowball.millersv.edu
****************************************************************************
------------------------------
Date: Fri, 14 Feb 1997 07:20:51 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Bob Mariotti <rmariott@tiac.net>
Subject: Re: advise with require in perl5
Message-Id: <Pine.GSO.3.95q.970214071429.11248M-100000@julie.teleport.com>
On Fri, 14 Feb 1997, Bob Mariotti wrote:
> the subroutines end with 1; }
Actually, the subroutines usually shouldn't end that way. What's important
is that require'd files return a true value, and the value returned is the
last expression evaluated. So, the code (not each subroutine) will
traditionally end with '1;'. (Subroutines also have a return value of the
last expression evaluated, so they frequently end with some other
expression than a constant.)
Perhaps someone reading this is left wondering why this odd requirement
should be a part of Perl. The reason is that perhaps your require'd code
in turn requires some other software or hardware. This way, it can check
on them and return false when its requirements aren't satisfied.
Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 14 Feb 1997 14:13:13 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Case insensitive comparison
Message-Id: <slrn5g8sik.lak.dave@fast.thomases.com>
On Fri, 14 Feb 1997 01:16:55 -0800, Rupesh Kapoor <rupesh@whowhere.com> wrote:
> Hi,
>
> Its probably an easy question. What is the operator/function to compare
> two strings in a case insensitive way
You could use
print "*match*\n" if ($str1 =~ m/^$str2$/i);
Dave
--
_________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Fri, 14 Feb 1997 09:37:18 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Case insensitive comparison
Message-Id: <er02e5.pi1.ln@localhost>
Rupesh Kapoor (rupesh@whowhere.com) wrote:
: Its probably an easy question. What is the operator/function to compare
: two strings in a case insensitive way (or is it an option to cmp
: operator?). Don't want to lowercas-ify both strings for efficiency
: reasons.
cmp tests for 'less than', 'more than', or 'equals'.
are you saying that you want it to return 'equals' for: "a" cmp "A" ??
cmp is most often used for sorting stuff. Do you want to do a case
insensitive sort?
If so, I cannot think of a way to do it without lowercasing them
on the fly...
I guess I'm having trouble divining _why_ you would need to do this.
What is it that you are really trying to do?
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 14 Feb 1997 07:27:12 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Kin Cho <kin@sampras.isi.com>
Subject: Re: case-insensitive grep()?
Message-Id: <8ck9obwji6.fsf@gadget.cscaper.com>
>>>>> "Kin" == Kin Cho <kin@sampras.isi.com> writes:
Kin> There does not appear to be a way to grep() with case off.
Kin> Am I missing something?
Kin> By the way, [A-Za-z] isn't so great in what I'm trying to do.
@result = grep /case is ignored here/i, @source_list;
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 564 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Fri, 14 Feb 1997 14:24:57 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: case-insensitive grep()?
Message-Id: <E5LK1L.MHH@world.std.com>
Kin Cho <kin@sampras.isi.com> writes:
>There does not appear to be a way to grep() with case off.
>Am I missing something?
>By the way, [A-Za-z] isn't so great in what I'm trying to do.
You seem to be confusing the unix tool "grep" and perl's "grep"
operator. Perl's grep has the following syntax according to the
perlfunc man page:
grep BLOCK LIST
grep EXPR,LIST
EXPR can be _any_ perl expression, and BLOCK and be _any_ block of
perl code. Now if you use a the regular expression match operator as
the expression, you get something that looks a bit like the unix grep
tool. (Maybe if you squint a bit.)
@result = grep /match/, @list;
Now if you look at the match operator in the perlop man page, you can
see that there are many flags you can append to the end of the
operator, to control its behavior. One of these, the /i modifier, will
cause the regular expression to match case insensitively. Also, in the
perlre man page, you can find out about special regular expression
sequences like "(?i)" which perform the same function as the
modifiers.
--
Andrew Langmead
------------------------------
Date: 14 Feb 1997 15:43:51 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: compiling perl
Message-Id: <5e217n$ac$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Morten@everyday.no writes:
:I'm having trouble compiling undump program. The errormsg I get is:
: undump.c:206: structure has no member named `u_tsize'
I would give up on that.
:The problem I originally have, is that I have a cgi script written in
:Perl, and when I set the permissions to --x--x--x, it wont execute. I
:have to set the permissions to r-xr-xr-x to make it execute. The problem
:then is that the script can be read by anyone, and I don't want that.
No, that's not readable by "anyone", in that it's certainly not readable
by people on web. Local users maybe, but you can change that by making
it mode 700 and owned by the user it executes as, probably nobody.
But there's probably no good reason for you to hide it from the other
people on your machine. It smells of either security-through-obscurity
or else source-hoarding, neither of which is very commendable.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"If it makes goo on the windshield, we'll call it a bug." --Larry Wall
------------------------------
Date: Fri, 14 Feb 1997 09:29:23 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: DBfile verses no DBfile
Message-Id: <jc02e5.pi1.ln@localhost>
Geoffrey Hebert (soccer@microserve.net) wrote:
: tadmc@flash.net (Tad McClellan) wrote:
: >Geoffrey Hebert (soccer@microserve.net) wrote:
: >: Proplem: 50 online internet users using an application. Count each
: >: application access by user. Each user has a user-id.
: >: Everyone uses DBfile. But why?
: >What if a user has _two_ instances of the app running? Multi-tasking
: >brings concurrency control problems as does Multi-user.
: >That may be disallowed by your access control, but you haven't said so...
: I am trying to understand your response. If I only have one file and
^^^^^^^^^^^^^^^^^^^^^^^^
: multiple apps running then I do have concurrency problems. Solution
: below avoids it.
^^^^^^^^^
It avoids it for multi-user, yes. I was trying to point out that it
does _not_ avoid it for multi-tasking...
: >: Why not - Have an individual file for each user id with a count to
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
So, if a user has _two_ instances of the app running, this
"Solution below" does _not_ avoid concurrency problems.
If a user fires off two invocations of the app, then you have a 'race'
to see which invocation updates the file. In the few milliseconds that
it takes to log these two uses, you might have this sequence of event:
1) app1 reads the number
2) app2 read the number (same number that app1 got)
3) app1 writes the number ( one more than orig number)
4) app2 writes the number ( one more than orig number again)
so, the number got increased by one, when there were _two_ uses...
: >: increment. Here I have a simple directory lookup, increment without
: >: lock, open file, increment counter, write, and close. Simple with
: >: minimal system resources.
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 14 Feb 1997 14:24:46 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Escaping \u in a string
Message-Id: <5e1sje$229@lyra.csx.cam.ac.uk>
In article <5dvurn$htf@fridge-nf0.shore.net>,
Nathan V. Patwardhan <nvp@shore.net> wrote:
>Marc Philips (Marc.Philips@ping.be) wrote:
>: I'm trying to open a file on this path "test\uit" but the the \u
>: gets interpreted and then it opens testIt
>
>Escape the "\", so it's "\\".
>$var = 'test\\uit';
That way, you'll get two backslashes. Presumably you mean either
$var = "test\\uit";
or
$var = 'test\uit';
Mike Guy
------------------------------
Date: 14 Feb 1997 14:34:43 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Escaping \u in a string
Message-Id: <5e1t63$bti@fridge-nf0.shore.net>
M.J.T. Guy (mjtg@cus.cam.ac.uk) wrote:
: That way, you'll get two backslashes. Presumably you mean either
: $var = "test\\uit";
Yes, sorry. Shame on me. :-)
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: Fri, 14 Feb 1997 15:10:08 GMT
From: stijnvd@cwi.nl (Stijn van Dongen)
Subject: Re: Help please with text wrap
Message-Id: <stijnvd.855933008@news.cwi.nl>
Gabriele R Fariello - 608-576-8660 <gabriele@lachesis.inxpress.net> writes:
>Eric Wong <egwong@netcom.com> writes:
>> My favorite word wrap routine is (of course) a regexp:
>> s/(.{1,80})\s+/$1\n/g;
>Yes, this is a quick and dirty way of doing it, but you might want to
>be a little careful using it. As it is, lines that are shorter than
>80 chars will still get split so if you have a line like this:
>This is a test
>Then you are going to get this
>This is a
>Test
>Which isn't that bad, but....
If you are formatting paragraphs, a good solution is to append a space
to the paragraph beforehand. The problem will go away:
$par .= ' ';
$par =~ s/(.{1,80})\s+/$1\n/g;
Regards,
Stijn
stijnvd@cwi.nl
------------------------------
Date: 14 Feb 1997 15:12:55 GMT
From: lstanl01@fiu.edu
Subject: How to impliment AnsiColor in perl?
Message-Id: <5e1vdn$b89@isis.fiu.edu>
Keywords: Ansicolor
Well, hi. This is my first time sending a post to this newsgroup, so
don't really know all the protocols. But, anyway. I have been trying to
get ansicolor into my client, and I thought it would be just like
everything else, be it VAX, DOS, or Unix with escape sequences. perhaps I
am doing it wrong.
$blink = "\c[[5m"; # This will blink the current text color I thought.
# I don't filter out escape sequences, yet this
# doesn't work
I was also told that I could do this too:
$blink = "\27[5m";
If anyone has written anything close to this, or anyone who can help me, I
would greatly appreciate it. Thanx for taking the time to read this post.
A bientot.
--
\|/
@ @
+------oOO-(_)-OOo-----------------<*>----------------------------------+
------------------------------
Date: 14 Feb 1997 14:34:00 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: How to open an HTTP connection with PERL ?
Message-Id: <5e1t4o$bti@fridge-nf0.shore.net>
Terry D. Brashley (brashley@worldnet.att.net) wrote:
: >I presume that working a project requires research, in which case I'll help
: >you research your topic: Check out http://www.dejanews.com and query for:
: Nathan - arrogance is ignorant, and I presume (?) you're not. Be nice
: - folks come here for help. If you can't help civily - don't!
I was teasing - too bad it didn't come across out-of-context.
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: Fri, 14 Feb 1997 07:58:01 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: How to return exit values to UNIX ?!?!?
Message-Id: <91r1e5.n61.ln@localhost>
David J. Topper (Pathfinder) (dtopper@pathfinder.com) wrote:
: I am having a hell of a time returning exit codes to the
: UNIX OS. Here's an example using perl4.
^^^^^
A perl of only historical interest.
Do you say 'thou' instead of 'you' too? Sorry ;-)
If you won't upgrade (perl 4 has been superceded for two _years_),
at least mention perl 4 in your Subject: so my killfile will work.
: #!/usr/local/bin/perl
Enable compiler warnings, and perl will tell you where your problem is!!
(perl 5 does anyway, I don't have antique perl installed on my system)
#!/usr/local/bin/perl -w
# ^^
: print "ERROR TEST SCRIPT";
: &error_sub; #call the subroutine
: print "Exiting with error $error\n";
: return $error;
^^^^^^
return? This isn't in a subroutine...
: sub error_sub {
: print "Please enter a value: ";
: $error = <STDIN>;
You probably don't want that newline at the end of your return code either:
chomp($error = <STDIN>); # use Perl 5
: }
: I am using an automation package (Autosys) to catch the return
: from this, and it ain't gettin' nothin' ?!?!?
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Fri, 14 Feb 1997 07:11:46 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "David J. Topper (Pathfinder)" <dtopper@pathfinder.com>
Subject: Re: How to return exit values to UNIX ?!?!?
Message-Id: <Pine.GSO.3.95q.970214071028.11248L-100000@julie.teleport.com>
On Thu, 13 Feb 1997, David J. Topper (Pathfinder) wrote:
> I am having a hell of a time returning exit codes to the
> UNIX OS. Here's an example using perl4.
> return $error;
Well, return is used in a subroutine. I think you want exit instead.
They're both documented in perlfunc(1). Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Fri, 14 Feb 1997 07:29:40 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Loh Thiam Wah <ltw@arraycomm.com>
Subject: Re: Howto determine an object is a HASH or ARRAY
Message-Id: <Pine.GSO.3.95q.970214072139.11248N-100000@julie.teleport.com>
On Fri, 14 Feb 1997, Loh Thiam Wah wrote:
> As you all know an object data member can be implemented using HASH or
> ARRAY. But how can you tell during runtime after the blessing , if it is
> a HASH or ARRAY ?
Mostly, you shouldn't have to do that; the only code that fiddles with the
internals of an object should already know which it is. But if you've got
to find out, here's one method. Hope this helps!
(undef) = eval { %$ref }; # using undef to avoid warnings
print "It's a hash\n" unless $@;
(undef) = eval { @$ref };
print "It's an array\n" unless $@;
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 14 Feb 1997 15:48:28 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: howto match newlines?
Message-Id: <5e21gc$ac$3@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
chrender@rbg.informatik.th-darmstadt.de (Christoph Ender) writes:
:There has been a discussion about stripping text between <a> and </a>
:including newlines some time ago. I've practically the same problem,
:but none of the solutions seems to work for me.
That's because you need to arrange to **READ IN** more than one
line at a time. One way to do this is by setting $/ to ''.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"Espousing the eponymous /cgi-bin/perl.exe?FMH.pl execution model is like
reading a suicide note -- three days too late."
--Tom Christiansen <tchrist@mox.perl.com>
------------------------------
Date: 14 Feb 1997 14:46:33 GMT
From: Jim Michael <jim.michael@gecm.com>
Subject: Re: Normal Distribution Function in Perl
Message-Id: <5e1ts9$uai@gcsin3.geccs.gecm.com>
jimmy_wong@trimble.com wrote:
>Can anyone tell me if they know where to find a Perl module or
>package to calculate normal distribution function for statistical
>analysis? I checked CPAN and the statistics packages listed didn't
>have this capability.
>
>If there isn't a Perl module readily available, then can someone
>point me to any online resources which might explain the algorithm
>for calculating the normal gaussian distribution function?
>
Sorry, I don't have a Perl routine, but here is a java function based on
the algorithm in Hull, Options Futures and Other Derivative Securities (I
forget the number of sig figs of accuracy). As you can see, easily
converted to Perl. The function (n=d>0?x:1-x) returns x if d>0 and 1-x
otherwise. The pow(x,n) function raises x to nth power:
// This calculates the Normal distribution function N(x):
double N(double d) {
double z;
double y;
double x;
double n=0;
z=.3989423 * Math.exp(-d*d/2);
y=1/(1+.2316419* Math.abs(d));
x=1-z*(1.330274*Math.pow(y,5)-1.821256*Math.pow(y,4)+1.781478*Math.pow(y,3
)-.356538*y*y+.3193815*y);
n=d>0?x:1-x;
return n;
}
Hope this helps.
Cheers,
Jim
------------------------------
Date: 14 Feb 1997 14:36:29 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: OK I know that I am a newbie But I need HELP!!
Message-Id: <5e1t9d$bti@fridge-nf0.shore.net>
Mike Stok (mike@stok.co.uk) wrote:
: Are you a cunning AI program let loose by someone at MIT?
SYNTAX ERROR ON LINE 10. :-)
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: 14 Feb 1997 07:26:00 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: rking@thepoint.net (RKing)
Subject: Re: perl script bug
Message-Id: <8cn2t7wjk7.fsf@gadget.cscaper.com>
>>>>> "RKing" == RKing <rking@thepoint.net> writes:
RKing> This is the message I keep getting when I run ./ in unix:
RKing> Literal @thepoint now requires backslash at ./wilma line 217, within
RKing> string Execution of ./wilma aborted due to compilation errors.
RKing> # heres the code, it's my e-mail addy:
RKing> <ADDRESS>
RKing> <A HREF=mailto:"rking@thepoint.net">rking@thepoint.net</A>
RKing> </ADDRESS>
RKing> Can anyone tell me why I'm getting this error msg?
Have you tried putting the required backslash in front of @thepoint in
line 217, just like the error message says?
(And people wonder why we have error messages. :-)
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 564 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 14 Feb 1997 14:05:31 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Perl script debug help
Message-Id: <slrn5g8s46.lak.dave@fast.thomases.com>
On Thu, 13 Feb 1997 14:07:38, RKing <rking@thepoint.net> wrote:
> #!/usr/bin/perl -w
...
> I went and put it in at the top of my script, just as it apears
> above. THEN when I do ./program, I get a message that says "no such file or
> directory" Am I using it wrong? I'm using unix and perl v. 4. (036
> I think).
Perl is probably not in /usr/bin/perl. Its a very stupid Unix error message,
reported when you have a #! line reference a command interpreter that
doesn;t exist.
You may be able to type 'which perl' to find the correct path (or just look
in each of the directories in your $PATH.
Regards
Dave
--
_________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Fri, 14 Feb 1997 09:30:09 -0400
From: Imran Shah <imran@science.gmu.edu>
Subject: Problem using diagnostics.pm
Message-Id: <330468E1.5D05B38C@science.gmu.edu>
I would like some help with using the 'diagnostics' module.
I am using in the following script (test_diag):-
#!/usr/bin/perl
use diagnostics;
use strict;
print "OK\n";
which gives the following errors:-
couldn't find diagnostic data in /usr/lib/perl5/pod/perldiag.pod
/usr/lib/perl5/i586-linux/5.003 /usr/lib/perl5
/usr/lib/perl5/site_perl/i586-linux
/usr/lib/perl5/site_perl .
/users/ishah/bin/test_diag at /usr/lib/perl5/diagnostics.pm line 225,
<POD_DIAG> chunk 507.
BEGIN failed--compilation aborted at /users/ishah/bin/test_diag line 19,
<POD_DIAG> chunk 507.
I have read the man pages for perldiag, diagnostics, and I am using perl
5.003.
I cannot figure out where this error is coming from. I would appreciate
any
advice.
Thank you
Imran
--
// Imran Shah imran@science.gmu.edu
// Graduate Student
//
// Computational Sciences &Informatics Off (703) 993.3614
// Mail Stop 5C3 Fax (703) 993.1980
// George Mason University
// 4400 University Drive
// Fairfax, Va 22030-4444
// U. S. A.
------------------------------
Date: Fri, 14 Feb 1997 07:49:46 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Robert S. Kissel" <rsk@cris.com>
Subject: Re: Questions about formline
Message-Id: <Pine.GSO.3.95q.970214073445.11248O-100000@julie.teleport.com>
On Thu, 13 Feb 1997, Robert S. Kissel wrote:
[ Problem with formline snipped. ]
> This is Perl v. 5.003. I don't understand why this corrects the
> incorrect output I was getting.
Sounds like a bug to me, but I may have misunderstood. Could you code up a
small example program and run perlbug to submit it as a bug report?
> I would also like someone who DOES understand the following remark (in
> the description of formline in the blue Camel Book) to restate it in
> words I can get through my thick skull:
>
> "...the formline function itself doesn't care how many
> newlines are embedded in the PICTURE. This means that
> the ~ and ~~ tokens will treat the entire PICTURE as
> a single line." [p. 169]
The idea here is that in a normal format, those tokens apply to only their
own line. But if you call formline with a several lines at once (rather
than one line at a time) those tokens apply to the whole picture, which
may span several lines. The right way to do that is to call formline once
for each line of the format, rather than to lump them together.
Of course, the _really_ right way might well be to use (s)printf instead
of formats. It's much more versatile. Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 14 Feb 1997 07:39:40 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Phil Stripling <philip@crl.com>
Subject: Re: Randal trashed yet again--*sigh*
Message-Id: <8cbu9nwixf.fsf@gadget.cscaper.com>
>>>>> "Phil" == Phil Stripling <philip@remove.crl.com> writes:
Phil> Clinton Pierce <cpierce1@cp501.fsic.ford.com> wrote:
Phil> : *sigh* The suits have trashed him yet again. Catch the Feb 3 issue
Phil> : of Fortune Magazine. For God's sake don't buy it! Just catch it
Phil> : online at:
Phil> Just out of idle curiousity, is the mention of Randal Schwartz's
Phil> conviction _always_ worth bringing up and publishing world-wide
Phil> on Usenet and rubbing his nose in it for those that didn't read
Phil> it in the magazine? Or is it just something you do for fun?
Phil, I hope I'm reading your tone correctly, in that you think you'd
be doing me a favor by keeping this quiet. Quite the contrary, it's
very important to me that as *many* people find out about the mistakes
I made (as painful as that part is), but more importantly, the current
state of our legal system that permitted those mistakes to be treated
as *criminal* activity.
The worst thing that I could hear at this point is that someone got
convicted under similar circumstances, just be cause he/she hadn't
heard about my case. I *must* be the first, last, and only story like
this, and I am committed to making that so.
Yes. I made mistakes. But I didn't perform harmful, criminal
actions. For the details, visit
http://www.lightlink.com/fors/intro.html, or if you are
web-challenged, send email to my reply-bot at fund@stonehenge.com.
And now back to your normally-scheduled Perl discussions...
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 14 Feb 1997 15:39:51 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: socket i/o
Message-Id: <5e2107$af$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl, a dead newsgroup, strad@mondenet.com writes:
:what i would like to be able to do is open a session to a port
:and be able to read and write to that port - any suggestions?
:i have tried such options as
: print SOCK "a line of output\n";
:but apparently nothing happens.....
That because you never set the SOCK handle to be autoflushed.
See perlipc.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
I can't change the way people talk,
but I can damn well complain about it.
--David Casseres in <28542@goofy.Apple.COM>
------------------------------
Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Jan 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.
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 V7 Issue 948
*************************************