[10591] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4183 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 9 19:07:21 1998

Date: Mon, 9 Nov 98 16: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           Mon, 9 Nov 1998     Volume: 8 Number: 4183

Today's topics:
    Re: *Why* does clpm attract non-perl posts? <keithmur@mindspring.com>
    Re: *Why* does clpm attract non-perl posts? <keithmur@mindspring.com>
    Re: Attaching a binary file... <yk08@dial.pipex.com>
        Change in string <vhti-katho@unicall.be>
    Re: dont echo passwords !!! (Tad McClellan)
        EOF condition before actual EOF aclamann@hotmail.com
        Exec Perl Offline with Webbrowser <debot@xs4all.nl>
    Re: Exec Perl Offline with Webbrowser <yk08@dial.pipex.com>
    Re: Hard coding a variable into a perl script - help (Tore Aursand)
        Help: Read & Write to a serial Port <moji@mo.net>
    Re: I want my perl program to return a specific number (Tad McClellan)
    Re: I'm making a counter. And need some help reading th (Alastair)
        looking for a Perl script which... panchamh@my-dejanews.com
    Re: looking for a Perl script which... <carvdawg@patriot.net>
    Re: looking for a Perl script which... <eugene@vertical.net>
        Looking for a web site with good script examples <jim.mosier@mci.com>
        Looking for a web site with good script examples <jim.mosier@mci.com>
        Looking for a web site with good script examples <jim.mosier@mci.com>
        Looking for a web site with good script examples <jim.mosier@mci.com>
        MLDBM and each/keys functions (Kevin Sheely)
    Re: newbie question (Andre L.)
    Re: newbie question (Jang Choe)
        OOP or not? (for a Perl module) (Paul Winkler)
    Re: Opening files (Tad McClellan)
    Re: Opening files <tchrist@mox.perl.com>
        Perl & MS personal web server <llampe1@uic.edu>
    Re: perl program wanted <perlguy@technologist.com>
    Re: Perl/Win'95 <carvdawg@patriot.net>
    Re: PERL (Alastair)
    Re: pod2html and <BR> and L<text> tags (I R A Aggie)
    Re: Prof Help Needed (Alastair)
    Re: Security - How to circumvent it. <cdi@thewebmasters.net>
    Re: Sending SOLICITED bulk mail. (Alastair)
    Re: split and replace????? <ckuskie@cadence.com>
        Time Stamp email <host@gte.net>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Mon, 09 Nov 1998 17:02:00 -0600
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: *Why* does clpm attract non-perl posts?
Message-Id: <36477468.1B93C4F4@mindspring.com>

Uri Guttman wrote:
> 
> >>>>> "KGM" == Keith G Murphy <keithmur@mindspring.com> writes:
> 
>   KGM> By the way, I've not seen a flamewar addressing the trivial topic
>   KGM> of whether you should reply to a posting "on top" or
>   KGM> "underneath".  I prefer "on top" myself.  ;-)
> 
> but you didn't edit the quote. and if you reply to various parts of the
> quote it is hard to follow if you reply "on top". i don't like it also
> as it tends to make no editing of quotes the norm. then you can't follow
> the thread of several quotes (which can be hard in many cases anyway
> with bad quoting mechanisms).
> 
That's an excellent point.  The only thing I like about "on top", is
that if you are following a whole thread at one time, and have already
digested the contents of previous messages, if the next posting is "on
top" you can read just that part easily to get the "new" stuff.  But
that only works for brief, simple postings, it's true.  I defer to your
superior judgment, as you can see.


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

Date: Mon, 09 Nov 1998 17:03:56 -0600
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: *Why* does clpm attract non-perl posts?
Message-Id: <364774DC.B188CF7E@mindspring.com>

David Alan Black wrote:
> 
> Hello -
> 
> "Keith G. Murphy" <keithmur@mindspring.com> writes:
> 
> >Well, when I was in my naive late 30's, instead of the mature and
> >seasoned 40 I find myself at now, I also seemed to think there was some
> >tight coupling between Perl and CGI.  There's something about the more
> >general articles and books that are out there that must encourage folks
> >to make that connection stronger than it ought to be.  Not that I can
> >cite anything.
> 
> One thing is the tendency of bookstores - definitely Borders, and others
> to one degree or another - to shelve all Perl books in the CGI programming
> section.  I wonder whether it would be worth campaigning to get this
> changed.
> 
YES!  It was Borders that warped my mind, I believe!  Well, warped it
more.  :-b


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

Date: Mon, 9 Nov 1998 23:40:32 -0000
From: "Chris Liley" <yk08@dial.pipex.com>
Subject: Re: Attaching a binary file...
Message-Id: <727umt$g5m$1@plug.news.pipex.net>

The file must be encoded before it can be sent as an attachment. The unix
utility uuencode does the trick, with the
result of the encoding stored in a list array.

Just use sendmail and include the list array as part of the
email, and everything works out fine.

VYTiS wrote in message <3647335b.0@news.takas.lt>...
>Hi, does anyone know how to attach a binary file (let's say, a .zip) when
>sending email from perl (through sendmail)???
>
>        Thanks.




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

Date: Mon, 9 Nov 1998 13:36:57 +0100
From: "Roderik Valcke" <vhti-katho@unicall.be>
Subject: Change in string
Message-Id: <726k40$3g4$2@trex.antw.online.be>

How can I change  hex "0D 0A" to "0A" in a string
with the command string$ =~ s/\n/...../g;

or what is the \  code for 0A ??

Thanks
roderikvalcke@unicall.be





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

Date: Mon, 9 Nov 1998 07:51:19 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: dont echo passwords !!!
Message-Id: <n0s627.va5.ln@flash.net>

Michael Renshaw (michaelr@lndn.tensor.pgs.com) wrote:
: I came across the Expect module last week. While going through the
: examples I found the following code to prevent echoing
: a password....

: $stdin->exp_stty('-echo');

: Does anyone know a way to do this outside of the Expect module
: as I would like to use it in non-Expect scripts ?


   Anyone who has read the answer to your Frequently Asked 
   Question knows how to do that outside of the Expect module  ;-)


   Perl FAQ, part 8:

      "How do I ask the user for a password?"


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Mon, 09 Nov 1998 22:03:00 GMT
From: aclamann@hotmail.com
Subject: EOF condition before actual EOF
Message-Id: <727oqk$vmr$1@nnrp1.dejanews.com>

I am reading in a file and my script is finishing before reading all lines in
the file. This is a LARGE file (>1M lines) so finding the problem by hand
presents problem.

My question is, what can cause:
     (defined $line = <FILE>)
to be false before the end of file is reached?

I do not think this is an NFS related issue. I have copied this file to a
local drive and the program completes in the same place.

I am using:
Perl version 5.005_02 built for MSWin32-x86-object
Binary build 502 provided by ActiveState Tool Corp.
Built 10:59:41 Aug 11 1998

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 09 Nov 1998 22:46:22 +0100
From: Frank <debot@xs4all.nl>
Subject: Exec Perl Offline with Webbrowser
Message-Id: <364762AE.8C8A67CF@xs4all.nl>

I need to find a method to test my scripts when I am offline. I know
only the program perl.exe, but that isn't what I am looking for. It's
debugging script, and it even doesn't debug very well (instead to good)




--
Visit my pages:

http://www.xs4all.nl/~debot/
http://www.xs4all.nl/~debot/webdesign/
http://www.xs4all.nl/~debot/mp3planet/
http://www.xs4all.nl/~debot/frank/
http://www.geocities.com/SunStrip/Frontrow/4346/
http://www.geocities.com/Vienna/Choir/1516/
http://www.geocities.com/Heartland/4345/
http://members.tripod.com/~botje1/

Contact me:
email: debot@xs4all.nl
ICQ: 13307469




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

Date: Mon, 9 Nov 1998 23:31:25 -0000
From: "Chris Liley" <yk08@dial.pipex.com>
Subject: Re: Exec Perl Offline with Webbrowser
Message-Id: <727u5p$f2f$1@plug.news.pipex.net>

You could also set up a web-server on your local machine so that you can
test without needing to connect.


Chris Liley


>I need to find a method to test my scripts when I am offline. I know
>only the program perl.exe, but that isn't what I am looking for. It's
>debugging script, and it even doesn't debug very well (instead to good)





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

Date: Mon, 09 Nov 1998 13:12:47 GMT
From: tore@forumnett.no (Tore Aursand)
Subject: Re: Hard coding a variable into a perl script - help
Message-Id: <3646ea24.420093322@news.online.no>

On Mon, 09 Nov 1998 09:39:58 GMT, gachious@my-dejanews.com wrote:
> I am using a "Form to Email" script (FormMail.pl from Matt's Script Archive)
> and am wanting to know if it is possible to "hard code" the recipient e-mail
> address (my address) into the script.

Try changing line #104 from...

    %Config = ('recipient','',          'subject','',

 ...to:

    %Config = ('recipient','your@email.com', 'subject','',

Maybe? :-)


-- 
Tore Aursand
ForumNett Online AS
http://www.forumnett.no/


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

Date: Mon, 9 Nov 1998 17:00:10 -0500
From: "MoJi" <moji@mo.net>
Subject: Help: Read & Write to a serial Port
Message-Id: <ByJ12.1416$Sn6.4463@news.cwix.com>

Anyone have luck with this?

I've tried sysopen, but couldn't read with it.

Tried IPC::Open2, but kept blocking.

Also tried echo directly to /dev/cua/a, but not sure how to read from it.

plz help!

Here' the current failure..
--------------
#!/usr/local/bin/perl
#
#------------------------------------------------------------------
# Usage:
#        #dbrCall.pl [customer name] [interface] [tel_number]
#------------------------------------------------------------------

use IPC::Open2;
use Fcntl;
use POSIX qw( :errno_h);

#------------------------------------------------------------------
# Global Vars / Read ARGS
#------------------------------------------------------------------
$num_of_parms = @ARGV;

#------------------------------------------------------------------
# Give feedback on input format!
#------------------------------------------------------------------
if( $num_of_parms < 1 ) {
  print "Usage: #dbrCall.pl [customer name] [interface] [tel_number]\n";
  exit;
}

#------------------------------------------------------------------
# Open the cu program with serial port A
#------------------------------------------------------------------
open2( *README, *WRITEME, "cu -lcua/a -s9600" );

#------------------------------------------------------------------
# Set the flgs so that reads of serial port A aren't blocking
#------------------------------------------------------------------
$flags= '';
fcntl( README, F_GETFL, $flags ) || die "Couldn't get flags for $!";
$flags |= O_NONBLOCK|O_RDRW;
fcntl( README, F_SETFL, $flags ) || die "Couldn't set flags for $!";

#------------------------------------------------------------------
# read & write to the cu program
#------------------------------------------------------------------
sub PortW {
  $rv = syswrite( WRITEME, $buffer, length $buffer );
  if( !defined( $rv ) && $! == EAGAIN ) {
    print "We're blocking here!\n";
  }
  elsif( $rv != length $buffer ) {
    print "We've got a problem here!\n";
  }
  else {
    # print "Success!\n";
  }
}

sub PortR {
  $rv = sysread( README, $buffer, $BUFSIZ );
  if( !defined( $rv ) && $! == EAGAIN ) {
    print "We're blocking here!\n";
  }
  else {
    print "Buffer-> $buffer\n";
  }
}

PortR;
$buffer = "AT&F\n";
PortW;
until ( $buffer eq "OK" ) {
  PortR;
}

#------------------------------------------------------------------
# Close the cu program with serial port A
#------------------------------------------------------------------
$buffer = "~.\n";
PortW;
close( README );
close( WRITEME );

exit;






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

Date: Mon, 9 Nov 1998 07:48:09 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: I want my perl program to return a specific number
Message-Id: <pqr627.va5.ln@flash.net>

luong@my-dejanews.com wrote:

: I'm sorry in advance if my question sounds stupid. Just wonder if I can set
: the numeric return code of my perl program to a specific value.


   perldoc -f exit


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Mon, 09 Nov 1998 23:01:42 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: I'm making a counter. And need some help reading the data file...
Message-Id: <slrn74et0v.8c.alastair@calliope.demon.co.uk>

VYTiS <vip@takas.lt> wrote:
>Hello,
>I'm almost done with the image counter...
>Still need some help:
>I have a file data.txt which contains these lines:
>
>12::http://www.hoo.com/main.html
>34::http://www.hoo.com/frame.html
>6::http://www.hoo.com/links.html
>
>Now I need perl code that would check what is the name of the page it's called 
>from (I use SSI tag) and then set $hits = [number before ::]
>(If it's called from main.html, perl would set $hits = "12";
>Please help me!!!

I'd probably look into using 'split'.

$t = '12::http://www.hoo.com/main.html';

($hits,$link) =  split /::/,$t;
print "hits = ",$hits,"\n";
print "link = ",$link,"\n";

HTH.

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Mon, 09 Nov 1998 21:02:54 GMT
From: panchamh@my-dejanews.com
Subject: looking for a Perl script which...
Message-Id: <727l9u$sga$1@nnrp1.dejanews.com>

Hi...
I am looking for a perl script which basically can help me upload a file (any)
to a server and then create a link to that file in a html page...

Thanks in advance for any suggestions...

Mihir

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 09 Nov 1998 17:18:51 +0000
From: Marquis de Carvdawg <carvdawg@patriot.net>
Subject: Re: looking for a Perl script which...
Message-Id: <364723FB.7547270D@patriot.net>



> I am looking for a perl script which basically can help me upload a file (any)
> to a server and then create a link to that file in a html page...
>

1.  Keep a copy of the HTML page locally.2.  When you want to upload a new file,
first make your
     alterations/mods to the HTML page.
3.  Use Net::FTP or Win32::Internet to upload the two files.




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

Date: Mon, 9 Nov 1998 17:56:12 -0500
From: "Eugene Sotirescu" <eugene@vertical.net>
Subject: Re: looking for a Perl script which...
Message-Id: <36477410.0@news.dca.net>

You want to:

1.Find one already customized to your wishes (doubt you'l find it)
or
2.Buy one.
or
3. Write one for yourself.

Eugene

panchamh@my-dejanews.com wrote in message
<727l9u$sga$1@nnrp1.dejanews.com>...
>Hi...
>I am looking for a perl script which basically can help me upload a file
(any)
>to a server and then create a link to that file in a html page...
>
>Thanks in advance for any suggestions...
>
>Mihir
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own




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

Date: Mon, 9 Nov 1998 17:09:12 -0500
From: "Jim Mosier" <jim.mosier@mci.com>
Subject: Looking for a web site with good script examples
Message-Id: <dHJ12.1429$Sn6.4713@news.cwix.com>

NE1?




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

Date: Mon, 9 Nov 1998 17:09:12 -0500
From: "Jim Mosier" <jim.mosier@mci.com>
Subject: Looking for a web site with good script examples
Message-Id: <4HJ12.1428$Sn6.4901@news.cwix.com>

NE1?




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

Date: Mon, 9 Nov 1998 17:09:12 -0500
From: "Jim Mosier" <jim.mosier@mci.com>
Subject: Looking for a web site with good script examples
Message-Id: <iJJ12.1436$Sn6.5248@news.cwix.com>

NE1?




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

Date: Mon, 9 Nov 1998 17:09:12 -0500
From: "Jim Mosier" <jim.mosier@mci.com>
Subject: Looking for a web site with good script examples
Message-Id: <sHJ12.1431$Sn6.5341@news.cwix.com>

NE1?




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

Date: Mon, 9 Nov 1998 22:52:12 GMT
From: sheely@misty.ca.boeing.com (Kevin Sheely)
Subject: MLDBM and each/keys functions
Message-Id: <F26FJ0.JLz@news.boeing.com>


 ------------------------------------------------------
 Is anyone using MLDBM to store complex data structures ?
 
 We are attempting to use the MLDBM module in order to store a complex
 multilevel hash structure (up to 8 levels deep).  This seems to work
 fine for a small number of top level entries (48, which translates to
 over 1000 total hash structures), but we run into trouble if that
 number is increased. At some point the "each" and "keys" functions
 start failing when traversing the top level hash. There is a workaround
 for the second level hash as Gurusamy Sarathy pointed out in a posting
 from 2/14/97: a temporary variable must be used --
 
    my $rec = $db{'002340'};
    while(($k, $v) = each %$rec) { ...
 
 The information in the database itself seems to be intact: if you know
 the top keys the data can be accessed to the deepest nesting level. Our
 problem is that we have methods that rely on the ablity to traverse
 across all top level keys.  All is well if we build the hash structure
 in memory but when we attempt to do the same thing after a tie using
 MLDBM we cannot access the top level keys.
 
 So the question is: short of saving all the top level keys in another
 hash while building the database and using "each" to get these keys and
 then apply them to the top level MLDBM hash is there a better cleaner
 solution to the problem?
 
 We are currently using:
 
 use MLDBM qw(DB_File Storable);
 DataDumper 2.09
 MLDBM 2.00
 DB_File 1.60
 BerkleyDB 1.85
 Perl 5.004_04
 HP-UX 10.20
 
 We'd like to hear from anyone using MLDBM.  
 


--
-----------------------------------------------------------------------
   Kevin Sheely                          Boeing Shared Services 
                                         P.O. Box 3707  m/s  7M-HC 
                                         Seattle,  WA.  98124-2207
                                         sheely@misty.ca.boeing.com 
-----------------------------------------------------------------------



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

Date: Mon, 09 Nov 1998 14:58:29 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: newbie question
Message-Id: <alecler-0911981458290001@dialup-695.hip.cam.org>

It's amazing. The *exact same* question was asked a few days ago in the
thread "split and replace?????". Synchronicity?

Andre


In article <725e5c$286@catapult.gatech.edu>, gt6786b@acmey.gatech.edu
(Jang Choe) wrote:

> How do I attatch 2 strings together to a variable?
> like
> 
> $foo = "hello"  +  "world";
> 
> 
> which makes $foo = "hello world"


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

Date: 9 Nov 1998 19:50:01 GMT
From: gt6786b@acmey.gatech.edu (Jang Choe)
Subject: Re: newbie question
Message-Id: <727h19$bit@catapult.gatech.edu>

Andre L. scribbled:
: It's amazing. The *exact same* question was asked a few days ago in the
: thread "split and replace?????". Synchronicity?


I don't know, the day I posted that question was like my first time in this
newsgroup. Maybe I should of read every post before I posted huh? Sorry for
the spam.





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

Date: Mon, 09 Nov 1998 11:01:21 GMT
From: zarmzarmNO@SPAMhotmail.com (Paul Winkler)
Subject: OOP or not? (for a Perl module)
Message-Id: <3646c7ae.24122529@news.erols.com>

Greetings, Csound users and Perl hackers. This message is being posted
to the Csound mailing list, and to comp.lang.perl.misc.

The purpose of this letter is to announce a project I'm working on,
which I'm calling Pscore (short for Perl-score). It aims to be a Perl
library (probably to be called Csound::Pscore) intended to allow
Csound composers to write their score files directly in Perl. It will
be released under the GNU Public License.

I'm inviting suggestions, input, commentary, offers of collaboration,
etc., from any interested parties... hence this announcement. The main
question I have right now is whether or not to take an object-oriented
approach. Below, I'll explain why I can't decide...

To those unfamiliar with either language:

------- begin boring intro blah-blah ------------

Perl (http://www.perl.org) is ... oh, c'mon, you know what Perl is.
It's a fairly easy-to-learn language that excels at (among other
things) processing text, and it's been ported to all the platforms
Csound runs on (I think).

Briefly, Csound is a language for generating digital sound by creating
an "orchestra" file (basically a collection of virtual synthesizers)
and a "score" file (a collection of events in time which are passed to
the orchestra for rendering into digital audio). It is notoriously
flexible and notoriously difficult. It's been ported to a wide variety
of platforms including many flavors of Unix, Mac, and Wintel.

Csound score files are made entirely of... guess what... text. Each
line is an event, split into "p-fields": p1 gives the instrument
number from the score to use; p2 gives the time the event starts; p3
gives the duration of the event; and an arbitrary number of following
pfields do any damn thing you want them to.

Csound has a new home page in progress at:
http://www.ping.be/calliope/Csound/
And an outdated front page at:
http://www.leeds.ac.uk/music/Man/c_front.html

------ end boring intro blah-blah. -----------

Now, why would I want a perl Csound::Pscore library?

What started the idea was being frustrated with the Csound standard
numeric score. The S.N.S. does (recently) allow for repeated sections
and macros, but in limited ways. For instance, there's no way to write
two different repeating sections that overlap in time, except to put
them in separate .sco files, invoke csound to do all the soring etc.,
and then find and combine the relevant parts of the output score.srt
files by hand. YUCK.

I posted a question about this to the Csound mailing list months ago,
and Eric Lyon wrote me to suggest using a scripting language to do it,
in particular Perl. I'd been interested in Perl, but Eric's mail was
the straw that, er, broke the camel's back, so I got "Learning Perl"
and have gone through the whole book and many of the Perl man pages.
 
While thinking about the original problem, I thought of all sorts of
other fun things you could implement while you were solving it!

For instance:
--Create a named sequence of events (let's call it a "pattern").
--Play arbitrarily selected sections of named patterns.
--Extensively modify arbitrarily selected sections of patterns.
--More easily & flexibly specify the timing of patterns relative to
other events... I've put a lot of thought into how to handle keeping
track of & using timing...
--Score-level global variables could be useful for lots of things and
could be generated in all kinds of interesting ways.

These ideas have obvious implications for composers. It should be a
lot easier to write any kind of repetitious music, and it could be a
very useful environment for playing with algorithmic composition.

When I started working on the project a month or so ago, I was
basically inventing a new score language, a "meta-score" if you will,
that would be interpreted by a Perl script which would output a score
useable by Csound. This approach quickly seemed short-sighted: Why
invent a new language that's not useful for any other purpose? Why not
re-implement my functions as a Perl library, allowing one to basically
compose music directly in Perl? That way, anyone who knows Perl and
Csound would already know the syntax, and would just have to learn
some new functions. And if something was lacking from the capabilities
I'd already provided for, you could quickly roll your own in plain old
Perl, and add code to the module if it's something that would be
useful in the future.

Some knowledgeable Csounders might be saying, "Why don't you just
learn Common Music?" (CM has a page at
http://ccrma-www.stanford.edu/CCRMA/Software/cm/cm.html ... which
begins like this:

"Common Music (CM) is an object-oriented music composition
environment. It produces sound by transforming a high-level
representation of musical structure into a variety of contol protocols
for sound synthesis and display: MIDI, Csound, Common Lisp Music,
Music Kit, C Mix, C Music, M4C, RT, Mix, VRML and Common  Music
Notation. Common Music defines an extensive library of compositional
tools and provides a public interface through which the composer may
easily modify and extend the system." It's implemented in Lisp and has
a Lisp-like syntax.

Well, the answer is: Eventually, I might. It looks like pretty much
everything I want to do with composition is do-able in CM.

But for now:
--I don't know Lisp at all.
--I like Perl.
--Lots of other people like Perl and don't know Lisp.
--Some of those people might be fellow Csounders.
--There is room for many ways to generate Csound scores... and this
might be a very useful addition to the existing tools (CM, Cscore,
SCOT, cecilia & cybil, SILENCE, HPKComposer, Midi2CS, ermmm... what
else?)
--Just for the heck of it, it would probably be pretty easy to add a
graphical front-end in Perl/TK.

Commentary is welcome. Probably the best forum for discussion of these
ideas is the Csound mailing list, except for technical questions about
Perl which belong in comp.lang.perl.misc.

As I said, the big question is whether to take an OOP approach or not.

Reasons Why OOP:
--might make usage syntax easier? We're dealing with a pretty unwieldy
data structure (see below).
--might make extension of the module easier?

Reasons Why NOT OOP:
--I don't really understand OOP.
--I think I know how to do what I want in traditional programming.
--Don't have to worry about mucking around outside of established
class methods.

The main issue is whether or not an OOP approach would make the system
easier to use? Remember, the scripts we're writing with this Perl
module are compositions, not applications!  So it's important that
they be quick & easy to write, and easy to read.

Probably at this point it would be helpful if I gave an example of
what I want to be able to do.

OK... here's a sample composition (or "script" if you prefer), though
all these functions are purely hypothetical and might end up with
different names and arguments... sorry for any blatantly bad code:

#!/usr/bin/perl -w
use Csound::Pscore;

pattern_from_file(Verse1, "some-score-file.sco", [ 4 .. 10 ]);
# We keep stuff in a big data 
# structure: a hash of list refs. of list refs. The hash keys
# are pattern names; the first-level list is of line numbers; the
# second-level list contains each line's pfields.
# pattern_from_file() would take three args: a name to give this
# pattern, a file to read score events from, and a reference to an
# array tells which lines we want. In this case it's an anonymous
# array which says use lines 4 to 10. The array could as easily be
# generated by a function...   Anyway, moving on:

play(Verse1, 2); # Plays Verse1 twice.
rewind(); # Set time to whatever it was when the last function was
          # called.
play(Verse2);    # Plays Verse2 at same start time as the first
                 # Verse1. If rewind() hadn't been there, it would
                 # come after the Verse1's...
                 # and there's lots of ways to do things like that.

select_pat(Verse2); # load it but don't do anything yet.
shuffle_pfield (pfield(5, beats(4 to 9),  *= 2));
play();

# set Verse2 as the "current pattern", do some interesting things
# to it (but don't save the changes!), and play the modified version.
# Here's what the shuffle_pfield(... line does:
# Read the fifth "p-field", a.k.a. p5,
# from any events occurring between
# beats 4 and 9 in the current pattern, and then multiply those p5's
# by 2, and then shuffle them randomly back into the lines they came
# from. Fun stuff! We can do this because shuffle_pfield expects
# an int (the pfield) followed by an array ref. (which line numbers?)
# as its arguments, and that's exactly what
# pfield() returns...




So, there's a taste of the ideas I have... there's lots more but this
message is already too long.

Am I nuts for doing things this way? Would OOP make life easier or
harder? If I followed an OOP strategy, what might the above code look
like? Are there some existing Perl modules that might be useful? (I
haven't found any yet...)

Please comment!

Thanks,

Paul Winkler
http://members.tripod.com/~slinkP/index.html
==============================================================
Paul Winkler  ---   music & sound   ---   zarmzarm@hotmail.com
              http://members.tripod.com/~slinkP/
                       a  member  of
           ARMS --- an ongoing pop music experiment
       http://members.tripod.com/~slinkP/mini-arms.html
==============================================================


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

Date: Mon, 9 Nov 1998 07:46:57 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Opening files
Message-Id: <hor627.va5.ln@flash.net>

webmaster@man.amis.com wrote:

: What file formats can Perl open and read?


   All of them.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 9 Nov 1998 13:13:21 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Opening files
Message-Id: <726pph$dja$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, webmaster@man.amis.com writes:
:What file formats can Perl open and read?

On whatever files the kernel's open(2) and read(2) 
system calls succeed on -- no more, no less.

--tom
-- 
"Usenet is like a herd of performing elephants with diarrhea --
massive, difficult to redirect, awe-inspiring, entertaining, and a
source of mind-boggling amounts of excrement when you least expect
it." --gene spafford, 1992


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

Date: Mon, 09 Nov 1998 14:34:36 -0600
From: Melanie Lampert <llampe1@uic.edu>
Subject: Perl & MS personal web server
Message-Id: <364751DC.7D00FD8C@uic.edu>

I'm trying to run a perl script on MS personal web server (win 95)
When i try to call it from the browser (http://localhost/etc...) it pops
up the box "You have started to download a file of type
application/x-perl " Pick App, Save file, etc.... so instead of
executing it, it is trying to open it.  And yes, I included the path to
the Perl interpreter on top of the script (i tried to erase that, but
then it returned the error "Document contains no data")

In the registry I have the following entry for HKEY_LOCAL_MACHINE --
system -- W3SVC -- ScriptMap -- .pl -- c:\Perl5\bin\PerlIIS.dll

When I try to run it from the DOS prompt, it works with perl test.pl if
the script is in Perl5 directory.  When I try to put in in another
directory, and run it the same way, it say "Bad command or file name".

Does anyone have any ideas on how to fix it?

Thanks,

Melanie


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

Date: Mon, 9 Nov 1998 12:33:12 GMT
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: perl program wanted
Message-Id: <3646E108.8DE3070A@technologist.com>

Jason,

I have an article which explains a program that should do what you are
looking for, it is free for you to use.

Check it out at:
http://webreview.com/wr/pub/98/10/23/perl/index.html

Good luck!
Brent
-- 
Java? I've heard of it, it is what I drink when I am hacking Perl. -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$            Brent Michalski             $
$         -- Perl Evangelist --          $
$    E-Mail: perlguy@technologist.com    $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$


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

Date: Mon, 09 Nov 1998 17:16:30 +0000
From: Marquis de Carvdawg <carvdawg@patriot.net>
Subject: Re: Perl/Win'95
Message-Id: <3647236E.D763E906@patriot.net>

Perl runs on both 95/98 and NT.  For the latest version of Perl for the
32-bit Windows (ie, Win32) platforms, go to:

http://www.activestate.com

Get build 506

>       Can Perl scripts be run on a Windows 95 system, or only NT?
>       What does Win 32 mean?





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

Date: Mon, 09 Nov 1998 22:52:22 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: PERL
Message-Id: <slrn74esfg.8c.alastair@calliope.demon.co.uk>

Sebastien Gontier <s.gontier@dl.ac.uk> wrote:
>Hi!!
>
>Does someone know why I have got this problem configuring Perl 5.00404
>on UNIX...
>"ld32: ERROR 33: Unresolved text symbol "pow" --1st referenced by
>libperl.a(pp.o).
>*** Error code 1 (bu21)"
>after the command "sh Configure -Dcc=gcc" and "make" ???

It might be that you're not linking in your math library (libm).

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Mon, 09 Nov 1998 17:18:11 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: pod2html and <BR> and L<text> tags
Message-Id: <fl_aggie-0911981718110001@aggie.coaps.fsu.edu>

In article <727mo0$qn6$1@nnrp4.snfc21.pbi.net>, snowhare@devilbunnies.org
(Snowhare) wrote:

+ pod2html generates broken HTML, period.

You mean Pod::Html generates broken HTML. The guts of pod2html:

use Pod::Html;

pod2html @ARGV;

I took a look at Pod::Html to gauge how big a job it would be, and it
ain't a 5 minute fix... :(

James


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

Date: Mon, 09 Nov 1998 22:48:56 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Prof Help Needed
Message-Id: <slrn74es92.8c.alastair@calliope.demon.co.uk>

Frank <debot@xs4all.nl> wrote:
>I need a script which can delete the first or last line of a data file.
>If the 11th line is added that the first line is deleted. Or reversed.

What you 'need' is ;

- the willingness to learn how to use Perl or
- the willingness to _pay_ for someone to do your programming work


-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Mon, 09 Nov 1998 15:50:35 -0800
From: cdi <cdi@thewebmasters.net>
To: asitmain.tperry@email.state.ut.us
Subject: Re: Security - How to circumvent it.
Message-Id: <36477FCB.53C0137E@thewebmasters.net>

Install and use sudo

http://www.courtesan.com/courtesan/products/sudo/

Much better for this type of thing. Although you can do what you want in
Perl, why reinvent the wheel?

asitmain.tperry@email.state.ut.us wrote:
> 
> I am trying to devise a script that will alow a user on my Y2K test
> system to reboot and set the date on that system.  I initally started
> to write this in shell and found that I could set the date and reboot
> the system vi a suid 4755 mode script.  However when I attempt this in
> perl I get many warning, errors, and aborts.  I have tried a C wrapper
> that executes the script where the suid bit is on the C, but I get the
> following message:
> 
> Insecure $ENV{PATH} while running setuid at /ipl/ipl.pl line 14, <>
> chunk 1
> 
> Although I understand that there is significant security risk with
> this script, let me make myself clear that I really don't care if the
> users have root password on this system, I was only hopeing not to
> have to give it to them in order to keep the less curious ones from
> biting their fingers off.
> 
> Could anyone give me an idea on how I can run this script with root
> permissions from a nonroot person without causing all of these
> security triggers to occure?  (I will recomplie perl again if that
> will help)
> 
> Thanks in advance,
> 
> Tim Perry
> asitmain.tperry@email.state.ut.us
> tperry@blinksoft.com
> 
> <please respond via email as well as via usenet>


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

Date: Mon, 09 Nov 1998 22:54:51 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Sending SOLICITED bulk mail.
Message-Id: <slrn74esk5.8c.alastair@calliope.demon.co.uk>

angus@od-site.com <angus@od-site.com> wrote:
>Hi,
>
>I have a client who  wants to send a weekly report to between
>100 and 1500 clients who _pay_ for the service [ie. its not spam ]
>
>The report is a binary file of about 600-1000K in size.
>
>Short of a foreach ($recp){ open(MAIL | sendmail $recp) etc}
>has anyone got a program which does this a little more efficiently without
>killing my server !  I can hack perl, but my sendmail knowledge is limited.
>
>Any suggestion appreciated,

Why not just email them a link to a web page (protected) and let them view that?

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Mon, 9 Nov 1998 09:09:09 -0800
From: Colin Kuskie <ckuskie@cadence.com>
Subject: Re: split and replace?????
Message-Id: <Pine.GSO.3.96.981109090506.7961B-100000@pdxue150.cadence.com>

On Sat, 7 Nov 1998, Tore Aursand wrote:

> On Sat, 7 Nov 1998 14:00:32 +0100, "Casema" <ours@casema.net> wrote:
> > $result = $a + $b;
> >
> > if $a would contain: "Hello "
> >    $b would contain: "World"
> > and I want $Result to contain "Hello World"


What you're looking for is called concatenation.  Read the perlop manpage
for more information on these solutions:

>     $result = $a . " " . $b;
>     $result = "$a $b";

There is one more solution that was left out:

$result = join ' ', $a, $b;

You can learn about join in the perlfunc manpage.

Read your local friendly manpages!
Colin



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

Date: Thu, 5 Nov 1998 15:08:14 -0800
From: "Rodney Payne" <host@gte.net>
Subject: Time Stamp email
Message-Id: <71t4i9$psh$1@news-2.news.gte.net>

Hi

I am new at cgi/perl so I need a bit of help

I am wanting to process email thru a script that assigns a ticket number to
the email and responses to the emailer with the ticket number,

What would take place is :

a@a.com would email the script which would cc the email to b@b.com with a
ticket number and the contents of the email, it would also send a copy of
the same ticket number and email back to a@a.com


any ideas..

It is something like Internic uses...

Any Help would be appreicated...






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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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