[8034] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1659 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 17 02:06:19 1998

Date: Fri, 16 Jan 98 23:00:20 -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, 16 Jan 1998     Volume: 8 Number: 1659

Today's topics:
     Re: Access Log <geurt@sybase.com>
     Announce - New Version of Slideviewer.cgi  peters@daedalus.com.au
     Re: Can I create a Linked List in Perl <rjk@coos.dartmouth.edu>
     Re: Can I create a Linked List in Perl (Abigail)
     converting file names down a directory tree notsew@wwa.com
     Form Mail & HTML Page <ca96af@badger.ac.brocku.ca>
     Re: Getting the first two chars of a string - URGENT! <rjk@coos.dartmouth.edu>
     Re: HELP !! <rjk@coos.dartmouth.edu>
     Re: how to mix the order of the lines in a file? (Abigail)
     How to substitute for ^\ sequences?? (Jeeves)
     Install Perl Compiler in cgi-bin? thomasbererton@position-it.com
     Re: Logical 'and' in regex? (Kenneth Herron)
     parsing sql in perl (using a yacc grammar) (Joshua Burgin)
     perl compiler status? (Chris Ochs)
     Re: perl module question (Charles DeRykus)
     perl4 vs. perl5 verification <drswalker@home.com>
     Re: Puzzling behavior of c.l.p.* readers (Abigail)
     Re: Reg Expression, Case change of memory variables <rjk@coos.dartmouth.edu>
     Re: Statistics::Descriptive (Michael Fuhr)
     Re: Syntax errors with nested braces??? <rjk@coos.dartmouth.edu>
     Re: Tail -f (Michael Fuhr)
     Re: truncating (Terry Michael Fletcher - PCD ~)
     Utility to list shell script function tree <dkhosla@compaq.com>
     Re: WWWBoard Help (root)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 16 Jan 1998 01:35:36 +0100
From: Geurt Schimmel <geurt@sybase.com>
To: Hans Van Lint <hvanlint@lodestar.be>
Subject: Re: Access Log
Message-Id: <34BEAB58.FB79BED9@sybase.com>



Hans Van Lint wrote:

> Hi,
>
> i have a script that shows me detailed information ( in html format) of the
> access_log file.
>
> Now, when I try this,
>
> $logfile = "../logs/access_log";
> open(best, $logfile) || "Error"
>
> I get the following error:
> ../logs/access_log: Permission denied
>

In fact, you'r trying open(best,"> $logfile") - and that won't work if you're
not root. When running this program as root, it will remove the logfile
completely...

Try open(best,"< $logfile");

Geurt




------------------------------

Date: Fri, 16 Jan 1998 20:21:35 -0600
From: peters@daedalus.com.au
Subject: Announce - New Version of Slideviewer.cgi 
Message-Id: <885003485.1984888833@dejanews.com>

Verion 1.8.1 of slideviewer.cgi has been released.  This free perl CGI
script allows you to flexibly create a "slideshow" of images.

Features include:

o Dynamic size adjustments of images
o Ability to specify local/remote images
o Jump to an image specified by slide number
o Jump to a random image
o Popup window with index of slides
o Auto forward between slides
o Cycle option to create a continious slideshow
o Easy to customise different output formats using "style" files.
o And much more.

Available from http://www.daedalus.com.au/peter/tools/slideviewer/

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


------------------------------

Date: Fri, 16 Jan 1998 22:51:59 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: Can I create a Linked List in Perl
Message-Id: <34C02ADE.70AB0F75@coos.dartmouth.edu>

Abigail wrote:
> 
> Chipmunk (rjk@coos.dartmouth.edu) wrote on 1599 September 1993 in
> <URL: news:34BEEB70.A66A4F5D@coos.dartmouth.edu>:
> ++ Abigail wrote:
> ++ >
> ++ > They might be as functional, but using arrays instead of linked lists
> ++ > isn't always as efficient, as splice() in general take time linear
> ++ > to the size of the array. Linked lists *do* have their place.
> ++ >
> ++ > Here's a simple implementation, all operations are O (1):
> ++
> ++ Don't forget there's more than one kind of efficiency. This linked list
> ++ implementation may be more efficient in terms of running time, but it's
> ++ less efficient with regards to memory usage, programmer effort and
> ++ maintainer effort.  :-)
> 
> Uhm, it took me 5 minutes to write those handful of functions; well
> known algorithms find all over in textbooks hardly count as programming
> effort. Ok, perhaps overkill for a one shot program, but once you've
> put it in a module, how much time does 'use DataStructures::LinkedList;'
> take to type?

That's about 4 minutes longer than it would take to simply write code
to manipulate an array.  ;-)
In addition to typing 'use DataStructures::LinkedList;' you also have
to learn the names and syntax of the functions.

> The memory usage is more, but that's only a constant factor. Both
> arrays and linked list take O (n) memory.

Oh, that's true.

> ++ I suppose if time is your main concern, you might want to use
> ++ actual linked lists.
> 
> I tend to find a O (n) vs O (1) trade off something to seriously consider.
> 
> But that might just be my background.

Alright then...  Your add node function is O(1), but only if you
already know where in the list you want to add the new node.  If
you have to search through the list to find the proper place, it
becomes O(n).
If you have to search through the array to find the place to insert
the new element, well, it's still O(n).  On the other hand, if you're
adding the new element at the end of the array, then it's O(1).

Chipmunk


------------------------------

Date: 17 Jan 1998 05:16:40 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Can I create a Linked List in Perl
Message-Id: <69pero$ipb$2@client3.news.psi.net>

Chipmunk (rjk@coos.dartmouth.edu) wrote on 1600 September 1993 in
<URL: news:34C02ADE.70AB0F75@coos.dartmouth.edu>:
++ Abigail wrote:
++ > 
++ > Chipmunk (rjk@coos.dartmouth.edu) wrote on 1599 September 1993 in
++ > <URL: news:34BEEB70.A66A4F5D@coos.dartmouth.edu>:
++ > ++ Abigail wrote:
++ > ++ >
++ > ++ > They might be as functional, but using arrays instead of linked lists
++ > ++ > isn't always as efficient, as splice() in general take time linear
++ > ++ > to the size of the array. Linked lists *do* have their place.
++ > ++ >
++ > ++ > Here's a simple implementation, all operations are O (1):
++ > ++
++ > ++ Don't forget there's more than one kind of efficiency. This linked list
++ > ++ implementation may be more efficient in terms of running time, but it's
++ > ++ less efficient with regards to memory usage, programmer effort and
++ > ++ maintainer effort.  :-)
++ > 
++ > Uhm, it took me 5 minutes to write those handful of functions; well
++ > known algorithms find all over in textbooks hardly count as programming
++ > effort. Ok, perhaps overkill for a one shot program, but once you've
++ > put it in a module, how much time does 'use DataStructures::LinkedList;'
++ > take to type?
++ 
++ That's about 4 minutes longer than it would take to simply write code
++ to manipulate an array.  ;-)

I can't type that fast.

++ In addition to typing 'use DataStructures::LinkedList;' you also have
++ to learn the names and syntax of the functions.

True. But then, there are hundreds of names in the Perl core as well. :)

++ > The memory usage is more, but that's only a constant factor. Both
++ > arrays and linked list take O (n) memory.
++ 
++ Oh, that's true.
++ 
++ > ++ I suppose if time is your main concern, you might want to use
++ > ++ actual linked lists.
++ > 
++ > I tend to find a O (n) vs O (1) trade off something to seriously consider.
++ > 
++ > But that might just be my background.
++ 
++ Alright then...  Your add node function is O(1), but only if you
++ already know where in the list you want to add the new node.  If
++ you have to search through the list to find the proper place, it
++ becomes O(n).

Of course. In which case you probably don't use linked lists.

++ If you have to search through the array to find the place to insert
++ the new element, well, it's still O(n).  On the other hand, if you're
++ adding the new element at the end of the array, then it's O(1).

Right. I'm not saying linked lists are always better. I just don't
agree with the concept "perl arrays are as functional as linked lists,
so there is no need to use linked lists".



Abigail
-- 
perl -weprint\<\<EOT\; -eJust -eanother -ePerl -eHacker -eEOT


------------------------------

Date: Sat, 17 Jan 1998 02:59:42 GMT
From: notsew@wwa.com
Subject: converting file names down a directory tree
Message-Id: <34c11e46.1618717@news.wwa.com>

might someone suggest a quick way to change all file names (say,
lowercase them) down a directory tree?


------------------------------

Date: Fri, 16 Jan 1998 22:44:50 -0500
From: Craig Allen <ca96af@badger.ac.brocku.ca>
Subject: Form Mail & HTML Page
Message-Id: <34C02932.5AC7@badger.ac.brocku.ca>

hello everybody;

I'm new to this business and I know that some of my questions are going
to be stupid...

I have looked at 3 different CGI Script Books and for form-mail all have
been different, some use 'print <<"print_tag"' and others don't. This
there something special about that "print_tag"????

after gathering the data, do I...
a)  make the HTML code then mail the form info
b)  mail the form info then make the HTML code

One more question.
The fastest and easiest way to gather data from the form???


------------------------------

Date: Fri, 16 Jan 1998 23:28:01 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: Getting the first two chars of a string - URGENT!
Message-Id: <34C03350.E3A3024@coos.dartmouth.edu>

Ben Holness wrote:
> 
> If anyone knows how to return the first two chars of a string, please
> could you let me know as soon as possible.

I'd suggest using substr:

$first2 = $string;
substr($first2, -length($first2)-2)) = '';

;-)

Chipmunk


------------------------------

Date: Fri, 16 Jan 1998 23:50:36 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: HELP !!
Message-Id: <34C0389B.52F931EB@coos.dartmouth.edu>

Wayne Patton wrote:
> 
>     @Fields=split "\|" ;
> [...]
> The problem: It wont split on the "|"   How do I split on "|" ???

That worked for me.  I'm not sure why it didn't work for you.
I'm especially confused about why everyone else who responded said
it would not work.  I wonder if they actually tried it...

(I tested it with perl5.002 and perl5.004)

On the other hand, as they pointed out, you should be doing
split /\|/;

Chipmunk


------------------------------

Date: 17 Jan 1998 02:07:51 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: how to mix the order of the lines in a file?
Message-Id: <69p3pn$e56$1@client3.news.psi.net>

Shawn Gordon (sgordon@athena.lbl.gov) wrote on 1600 September 1993 in
<URL: news:34C00436.312F03A9@athena.lbl.gov>:
++ how about: 
++ @a = <>;
++ while(@a) {
++ 	$ran = int(rand($#a +1));
++ 	print splice(@a,$ran,1);
++ }

Shortened in the one-liner I once wrote:

perl -we '@a=<>;print+splice@a,rand@a,1while@a' file



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


------------------------------

Date: 17 Jan 1998 05:06:33 GMT
From: darlenem@PAS.DE.SPAM.flash.net (Jeeves)
Subject: How to substitute for ^\ sequences??
Message-Id: <slrn6c0g28.c68.darlenem@jeeves.flash.net>


I need to be able to substitute all the ^\ sequences in a string. It's
(obviously) not a printable character. However, how do I put this in a string
in the source? I can't "\c\\" (perl complains of 'trailing backslash'), and
single-quoted strings interpolate \\ and \', so

$ch = '\' ; $nc = "\c" . $ch; 

doesn't work either. How do I do this? I need to substitute all the ^\
sequences in the string with ASCII 175.

TIA,

Jeeves (darlenem@spamless.flash.net)


-- 
---------------------------------------------------------------------
     J |  Copyright (c) 1997 Jeeves Industries Limited.
     J |  All rights reserved. Void where prohibited.
     J |  Some restrictions may apply. Limit 1 per customer.
 J   J |  Offer not valid in conjunction with any other offer.
  JJJ  |  Some sold separately. Not intended for children under 3.
---------------------------------------------------------------------
>From .cshrc:
alias rm 'rm -rf \!*'
alias hose kill -9 '`ps -augxww | grep \!* | awk \'{print $2}\'`'
alias kill 'kill -9 \!* ; kill -9 \!* ; kill -9 \!*'
alias renice 'echo Renice\?  You must mean kill -9.; kill -9 \!*'
=====================================================================

-- 
---------------------------------------------------------------------
     J |  Copyright (c) 1997 Jeeves Industries Limited.
     J |  All rights reserved. Void where prohibited.
     J |  Some restrictions may apply. Limit 1 per customer.
 J   J |  Offer not valid in conjunction with any other offer.
  JJJ  |  Some sold separately. Not intended for children under 3.
---------------------------------------------------------------------
>From .cshrc:
alias rm 'rm -rf \!*'
alias hose kill -9 '`ps -augxww | grep \!* | awk \'{print $2}\'`'
alias kill 'kill -9 \!* ; kill -9 \!* ; kill -9 \!*'
alias renice 'echo Renice\?  You must mean kill -9.; kill -9 \!*'
=====================================================================


------------------------------

Date: Fri, 16 Jan 1998 22:21:37 -0600
From: thomasbererton@position-it.com
Subject: Install Perl Compiler in cgi-bin?
Message-Id: <885009999.58261508@dejanews.com>

I would like to use Malcolm Beattie's wonderful Perl Compiler, however,
all I have to work with is my ISP's linux perl install (5.004_01).

Is there any way to get the Compiler to work without installing it into
the default perl install directories?

Since I'm not a super user I don't have access to the default perl
directories to do an install. I've been able to get additional modules to
install properly in an arbitrary directory and then access them using a
BEGIN block like:

BEGIN { push(@INC, "/users/perluser/my_perl_library"); }

 .... however, Compiler-a3 doesn't seem to like being installed in an
arbitrary directory. Here's what it looks like from the make step on:

++++++++++++ venus:/usr/www/htdocs/zipweb/Compiler-a3$ make mkdir ./blib
mkdir ./blib/lib mkdir ./blib/arch mkdir ./blib/arch/auto mkdir
 ../blib/arch/auto/B mkdir ./blib/lib/auto mkdir ./blib/lib/auto/B mkdir
 ../blib/man3 cp B/Xref.pm ./blib/lib/B/Xref.pm cp B/CC.pm
 ../blib/lib/B/CC.pm cp B/Debug.pm ./blib/lib/B/Debug.pm cp B/Showlex.pm
 ../blib/lib/B/Showlex.pm cp B/Asmdata.pm ./blib/lib/B/Asmdata.pm cp
B/Bblock.pm ./blib/lib/B/Bblock.pm cp bytecode.pl ./blib/lib/bytecode.pl
cp O.pm ./blib/lib/O.pm cp B/Assembler.pm ./blib/lib/B/Assembler.pm cp
B/Disassembler.pm ./blib/lib/B/Disassembler.pm cp B/Bytecode.pm
 ../blib/lib/B/Bytecode.pm cp B.pm ./blib/lib/B.pm cp B/Stackobj.pm
 ../blib/lib/B/Stackobj.pm cp B/C.pm ./blib/lib/B/C.pm cp B/Terse.pm
 ../blib/lib/B/Terse.pm /usr/local/bin/perl
-I/usr/lib/perl5/i586-linux/5.00401 -I/usr/lib/perl5
/usr/lib/perl5/ExtUtils/ xsubpp  -typemap /usr/lib/perl5/ExtUtils/typemap
-typemap typemap B.xs >B.tc && mv B.tc B.c cc -c  -Dbool=char -DHAS_BOOL
-I/usr/local/include -O2  -DVERSION=\"a2\" -DXS_VERSION=\"a2\" -f pic
-I/usr/lib/perl5/i586-linux/5.00401/CORE  B.c cc -c  -Dbool=char
-DHAS_BOOL -I/usr/local/include -O2  -DVERSION=\"a2\" -DXS_VERSION=\"a2\"
-f pic -I/usr/lib/perl5/i586-linux/5.00401/CORE  ccop.c cc -c 
-Dbool=char -DHAS_BOOL -I/usr/local/include -O2  -DVERSION=\"a2\"
-DXS_VERSION=\"a2\" -f pic -I/usr/lib/perl5/i586-linux/5.00401/CORE 
byterun.c byterun.c: In function `byterun': byterun.c:274: warning:
assignment from incompatible pointer type byterun.c:288: warning:
assignment from incompatible pointer type byterun.c:302: warning:
assignment from incompatible pointer type byterun.c:351: warning:
assignment from incompatible pointer type byterun.c:358: warning:
assignment from incompatible pointer type byterun.c:764: warning:
assignment from incompatible pointer type byterun.c:820: warning:
assignment from incompatible pointer type Running Mkbootstrap for B ()
chmod 644 B.bs LD_RUN_PATH="" cc -o blib/arch/auto/B/B.so  -shared
-L/usr/local/lib B.o ccop.o byterun.o chmod 755 blib/arch/auto/B/B.so cp
B.bs ./blib/arch/auto/B/B.bs chmod 644 blib/arch/auto/B/B.bs Manifying
 ../blib/man3/B::Xref.3 cc -c  -Dbool=char -DHAS_BOOL -I/usr/local/include
-O2  -DVERSION=\"a2\" -DXS_VERSION=\"a2\" -f pic
-I/usr/lib/perl5/i586-linux/5.00401/CORE  byteperl.c cc -o byteperl
byteperl.o B.o ccop.o byterun.o -L/usr/local/lib
-L/usr/lib/perl5/i586-linux/5.004 01/CORE -lperl -lgdbm -ldbm -ldb -ldl
-lm -lc

venus:/usr/www/htdocs/zipweb/Compiler-a3$ perl -MO=C, -ohello.c hello.pl
Unrecognized switch: -ohello.c.
++++++++++++

Many thanks for any assistance!
Thomas.

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


------------------------------

Date: 17 Jan 1998 06:27:04 GMT
From: kherron@campus.mci.net (Kenneth Herron)
Subject: Re: Logical 'and' in regex?
Message-Id: <69pivo$7gi$2@news.campus.mci.net>

Something like

	@list = ($breakfast =~ /bacon|eggs|hashbrowns|juice/);

will extract all of the matching, non-overlapping substrings into
@list.  All that remains is to uniquify @list--the FAQ describes
three methods--and check how many values you have.  For example:

	undef %hash;
	@hash{($breakfast =~ /bacon|eggs|hashbrowns|juice/g)} = ();
	if ((scalar keys %hash) == 4) {
		...
	}
-- 
Kenneth Herron -- kherron@campus.mci.net
No animals were harmed during the production of this message.


------------------------------

Date: 17 Jan 1998 02:55:34 GMT
From: joshua@purestuff.com (Joshua Burgin)
Subject: parsing sql in perl (using a yacc grammar)
Message-Id: <slrn6c07d5.3c7.joshua@nothing.izzy.com>

Does anyone know of a way to use a 'lex' like anallyzer and parse a yacc
grammar but have it generate perl code, instead of C.

There's a great SQL grammar in the back of the Lex & Yacc book that I'd
love to be able to use, but it generates C-dode (with lex, anyway).  It's
fully implemented, so using it would be better than recreating a 'what is
an SQL' statement myself.  Plus, using a YACC grammar would allow me to
get the SQL statement returned as a properly tokenized and linked list
(or hash of hashes/arrays, if it were in perl).

Sure, I could write a small C parser and use XS, or I could use
Text::ParseWords and then make some loops that mark the various parts of
the statement, but it'd be really nice if someone else has already
implemented a solution (hey, I'm 'lazy')

Anyone know of a good way to parse SQL in perl?

- Joshua
_________________________________________________________________________
Joshua M. Burgin          | The best things in life aren't things
joshua@purestuff.com      | http://www.purestuff.com


------------------------------

Date: 17 Jan 1998 04:08:34 GMT
From: root@web1.valley-internet.com (Chris Ochs)
Subject: perl compiler status?
Message-Id: <69pas2$4g5$1@aurora.ns.net>

We have some programs written in perl that we would like to market 
commercially, but for two primary reasons we cannot give out source.

1.  It's commercial software and we don't want to give away our hard work.

2.  It has information in it that we cannot make public.

The software is credit card processing software for several of the larger
processing networks, and they are very firm on not giving out the source
code. (we have to sign non disclosures just to get the specs).  Even if we
could give it out legally we probably wouldn't, due to how easy it would be
for competitors to rip it off regardless of copywrites.


I have used the perl compiler to generate binaries of the code in question
and everything seems to work fine in our tests, but I wanted to double check
and get some of the opinions of people on this list as to what the 
general consensus was on the stability of the compiler, or whether there
might even be an alternative solution in the works somewhere?


Chris Ochs
Valley Internet Services




------------------------------

Date: Sat, 17 Jan 1998 01:53:26 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: perl module question
Message-Id: <EMwnx2.63D@bcstec.ca.boeing.com>

In article <34BFFB54.553D@sandiegoca.ncr.com>,
Justin Lee  <jlee@sandiegoca.ncr.com> wrote:
 > I'm having a bit of trouble with perl modules:
 > 
 > I've written the following module for perl5.003, 
 > and placed it in a file called 'Manipulate_Tree.pm'. 
 > ---------------------------------------------------------------
 > package Manipulate_Tree;
 > require Exporter;
 > @Manipulate_Tree::ISA = qw(Exporter);
 > @Manipulate_Tree::EXPORT = qw(Dump_Tree,Recover_Tree,Print_Tree);
 > 
                                          ^            ^
                                     replace the commas with spaces


HTH,
--
Charles DeRykus


------------------------------

Date: Fri, 16 Jan 1998 21:56:03 -0500
From: Jennifer and Matthew Walker <drswalker@home.com>
Subject: perl4 vs. perl5 verification
Message-Id: <34C01DC3.80E8D4D4@home.com>

Does anyone know of a means to check perl4 scripts for code
that will break under perl5?

        I suppose you could just run perl5 -cw on the perl4
scripts, but I'd like something a bit more comprehensive.


Matthew Walker


------------------------------

Date: 17 Jan 1998 02:11:40 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Puzzling behavior of c.l.p.* readers
Message-Id: <69p40s$e56$2@client3.news.psi.net>

David A. Frantz (wizard@eznet.net) wrote on 1600 September 1993 in
<URL: news:34bff535.0@news.eznet.net>:
++ 
++ Andy Lester wrote in message <69ordb$mi3$1@usenet48.supernews.com>...
++ >>Sniped
++ >
++ >* People who negate any chance of correspondence in their spamanoia.  This
++ >is all over Usenet, of course, but I'm amazed whenever I see it:
++ >"Remove the '.fuckyouspammers' from my email address in order to send me
++ >mail."  No, I won't.  You're on your own.
++ >
++ Andy for the most part I would agree with you and I'am a new PERL user.
++ But
++ the above remark kinda leaves me wondering if you have every recieved on
++ occasion
++ to much junk mail.     Its sad but there may be good reason for some to
++ respond as
++ above.


I get up to 600 spam mails a month. I don't mangle my address.
I just filter.

If spam bothers you that much, do as Knuth.


Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


------------------------------

Date: Fri, 16 Jan 1998 23:43:38 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: Reg Expression, Case change of memory variables
Message-Id: <34C036FA.2F585C2A@coos.dartmouth.edu>

Tad McClellan wrote:
> 
> Colin Kuskie (colink@latticesemi.com) wrote:
> 
> : Not many people bother to read the man pages, so they don't know that
> : ANY character can be used as the regexp delimiter:
>   ^^^^^^^^^^^^^
> 
> like an 's', for instance?
> 
>    ss(APP)\.(\w+)\.(\w+)s$1/$2/$3sgi
> 
> Nope  ;-)
> 
> "A lot" of characters other than slash, but not *any* character.
> 
> from 'perlop':
> 
>    "Any non-alphanumeric, non-whitespace delimiter may
>     replace the slashes."

So, is the documentation wrong, or the source code?

$_ = 'a';
s sasbs;
print "$_\n";

If you use an alphanumeric delimiter, you just need whitespace after the
operator.

Chipmunk


------------------------------

Date: 16 Jan 1998 21:30:49 -0700
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: Statistics::Descriptive
Message-Id: <69pc5p$ors@flatland.dimensional.com>

Rich Bowen <rbowen@databeam.com> writes:

> I am trying to use the package Statistics::Descriptive.  I am using the
> sample script that comes with the package:

What sample script in what package?  Here's what's in the module
available on CPAN:

  % tar tzf Statistics-Descriptive-2.1.tar.gz
  Statistics-Descriptive-2.1/
  Statistics-Descriptive-2.1/Makefile.PL
  Statistics-Descriptive-2.1/Changes
  Statistics-Descriptive-2.1/Descriptive.pm
  Statistics-Descriptive-2.1/README
  Statistics-Descriptive-2.1/MANIFEST

> #!/perl/bin/perl
> use Statistics::Descriptive;
> $stat = new Statistics::Descriptive;
> $stat -> AddData(1,2,3,4);
> print $mean=$stat->Mean();
>
> I get the error message Can't locate object method "new" via package
> "Statistics::Descriptive" at stattest.pl line 3.

Looks like you're using a script written for an older version
of Statistics::Descriptive.  Take a look at the manual page
for the current version and you should see what needs to be
changed.

Hope this helps!

-- 
Michael Fuhr
http://www.dimensional.com/~mfuhr/


------------------------------

Date: Sat, 17 Jan 1998 00:00:45 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: Sukumar Patel <Sukumar.Patel@mail.tju.edu>
Subject: Re: Syntax errors with nested braces???
Message-Id: <34C03AFC.6224477D@coos.dartmouth.edu>

[posted and mailed]

> 
>      Command:     perl -e '$a = ${P{${S{$k}{'s'}}}{'s'}};'
>      Error:       syntax error at -e line 1, near "}}"

You're using single quotes to protect your code from the shell,
and then you're using single quotes again within your code.
Is it any wonder the shell gets confused and munges the code
before passing it to perl?

Try this instead:
perl -e '$a = ${P{${S{$k}{"s"}}}{"s"}};'

Chipmunk


------------------------------

Date: 16 Jan 1998 21:20:46 -0700
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: Tail -f
Message-Id: <69pbiu$on2@flatland.dimensional.com>

"BDMA" <BDMA@prodigy.net> writes:

> I have a Perl/Tk program that logs all of its actions by writing them to a
> file.  I then kick off an xterm with a tail -f.  This xterm displays
> whatever is written to the log file.  I want to use a textbox to display,
> in real time, the contents of the log file, instead of using the xterm. 
> Can anyone give me a clue as to how to do this.  I have read Tk/Tcl books,
> I have looked through the Advanced Perl Programming book, and I looked
> through the Perl Development Kit manuals.

This is mentioned in the Perl FAQ:

  http://www.perl.com/CPAN-local/doc/FAQs/FAQ/PerlFAQ.html#How_do_I_do_a_C_tail_f_in_perl

There's also a File::Tail module on CPAN that will do the trick but it
will probably block while waiting for input, which might cause problems
in a Perl/Tk script.

-- 
Michael Fuhr
http://www.dimensional.com/~mfuhr/


------------------------------

Date: 17 Jan 1998 01:59:13 GMT
From: tfletche@pcocd2.intel.com (Terry Michael Fletcher - PCD ~)
Subject: Re: truncating
Message-Id: <69p39h$atr$1@news.fm.intel.com>

Aaron C. Paulley (aaronp@weirdness.com) so eloquently and verbosely pontificated:
> 
> So the line:
> 
> $filename = $fullfilename if m#.*/(.*)$#;
> 
> would take the variable $fullfinename which = "/usr/bin/local/filename.txt"
> and create a new variable ($filename) that would = "filename.txt"  ?

no.  any pattern match not using the =~ operator works on $_ by default.  you
would need to bind it to $fullfilename, like this:

$filename = $1 if $filename =~m#.*/(.+)#;   # reads nicely
# or
($filename) = $filename =~ m#.*/(.+)#;      # uses "list context"
# or
($filename = $fullfilename) =~ s#.*/##;     # utilize order of execution

that last one first assigns $fullfilename to $filename, then makes a
substitution on the new $filename.

hope that helps.

-- 
#!/usr/local/bin/perl -- tfletche@pcocd2.intel.com
map{$;.=chr$_}(112,114,105,110,116,32,117,110,112,97,99,107,32,34,117,
34);$_=$;.=q>,':2G5S="!A;F]T:&5R(%!E<FP@:&%C:V5R+`H`'>;y[\034]{}d;eval



------------------------------

Date: Sat, 17 Jan 1998 00:31:36 GMT
From: "Deepak Khosla" <dkhosla@compaq.com>
Subject: Utility to list shell script function tree
Message-Id: <01bd22df$d0924460$b90e12ac@print-tst01>

I have a large shell program and I would like to document a 'tree' or the
calling sequence of all the functions etc. Does anyone know of a utility
that can do that? 


Thanks



------------------------------

Date: 17 Jan 1998 04:14:39 GMT
From: root@lizard-breath.tiac.net (root)
Subject: Re: WWWBoard Help
Message-Id: <69pb7f$jkg@news-central.tiac.net>

Try checking the file permissions.  If you have any other
questions or problems, try posting to either
the author or (more appropriately) to the cgi newsgroup.

scott

In article <34BF6AEE.781277EC@mindless.com>, Jon A. wrote:
>I am trying to get a WWWBoard running, but when i try to post i get the
>error:
>
>Method Not Allowed
>
>The requested method POST is not allowed for the URL
>/~anotherpunk/cgi-bin/wwwboard.pl.
>
>What is wrong?
>
>E-mail any help to me directly, not (only) the NG, please.
>
>--JON A--
>


------------------------------

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 1659
**************************************

home help back first fref pref prev next nref lref last post