[23467] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5681 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 19 18:06:07 2003

Date: Sun, 19 Oct 2003 15:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 19 Oct 2003     Volume: 10 Number: 5681

Today's topics:
    Re: Any thought on "Perl Database" based on "Tie:File"? <REMOVEsdnCAPS@comcast.net>
    Re: Any thought on "Perl Database" based on "Tie:File"? (Tad McClellan)
    Re: Any thought on "Perl Database" based on "Tie:File"? (Randal L. Schwartz)
    Re: character mapping functions and UNICODE : remove ac <jwillmore@remove.adelphia.net>
    Re: Help me with is code <tom@nosleep.net>
    Re: How can i write the values of a form through a cgi  (JR)
    Re: How can i write the values of a form through a cgi  <ebohlman@earthlink.net>
    Re: How do I do this without database? <REMOVEsdnCAPS@comcast.net>
    Re: How do I do this without database? <jwillmore@remove.adelphia.net>
    Re: How do I do this without database? <invalid-email@rochester.rr.com>
    Re: How do I do this without database? <ebohlman@earthlink.net>
        How do I make a standalone WIN32 executable from Perl? <perlnews@kwcpa.com>
    Re: How do I make a standalone WIN32 executable from Pe <tom@nosleep.net>
    Re: How do I make a standalone WIN32 executable from Pe <perlnews@kwcpa.com>
    Re: how to keep database connection persistent <jwillmore@remove.adelphia.net>
    Re: how would i handle this? <REMOVEsdnCAPS@comcast.net>
    Re: how would i handle this? (The Mosquito ScriptKiddiot)
    Re: HTML whitespace/commnets cruncher <REMOVEsdnCAPS@comcast.net>
    Re: Manipulation binary files <REMOVEsdnCAPS@comcast.net>
    Re: Manipulation binary files <krahnj@acm.org>
        Net::Aim - find out if user is online? <e02@removethis.toao.net>
    Re: Net::Aim - find out if user is online? <e02@removethis.toao.net>
        Newbie dumb but quick question <perlnews@kwcpa.com>
    Re: Newbie dumb but quick question <e02@removethis.toao.net>
    Re: Newbie dumb but quick question <bobx@linuxmail.org>
    Re: Newbie dumb but quick question <perlnews@kwcpa.com>
        Recursive inheritance after using h2xs (Ken Weaverling)
    Re: Recursive inheritance after using h2xs (Ken Weaverling)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 19 Oct 2003 08:28:25 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Any thought on "Perl Database" based on "Tie:File"?
Message-Id: <Xns9419605221904sdn.comcast@216.196.97.136>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

"Public Interest" <ir@labranche.com> wrote in
news:dWokb.6707$Ec1.611722@bgtnsc05-news.ops.worldnet.att.net: 

> Here is what my friend told me: Database sucks and MySQL too. Try
> program without using database. Database is a file system. It is slow,
> take more space...

Your friend is very much mistaken.  MySQL does not "suck".  It is much 
faster than anything one could write in Perl.


> But still there is many things I can not do with just simple text
> file, such as updating a record....
> 
> I just found Tie:File which added many features to text files. Here is
> my feature request to the owner of Perl: Add Perl Database, or at
> least something called Perl Table
> 
> For instance in file:
> symbol|price on day1|volume on day1|price on day2|price on day2|....
> IBM|98.02|203092|97.01|1212300
> SUNW|3.45|1112232|3.72|1212219
> 
> Let me select where symbel=IBM, or let me update price on day1 where
> symbol=IBM to 99.08....

How do you propose finding the IBM record without reading through the 
entire file, line by line?  You would need some sort of index.  That 
index would take up file overhead, which you seem to want to avoid.  How 
would you update the record, if the changes took up more space than the 
original record?  You would either need to rewrite the whole file each 
time, or you would need some sort of buffered-indexed file system model, 
which has additional overhead and complexity.

There are already many existing excellent database systems out there 
(MySQL, Oracle, Sybase, Informix, etc), each with its own pros and cons.  
Leave database system development to database system experts.  Perl has 
interfaces to all of these systems.  It is far easier and more efficient 
for a Perl programmer to use the DBI module than to create a new database 
system.

- -- 
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print

-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBP5KRZWPeouIeTNHoEQIJPQCdFaQrRFbAga3FVIrKTye+rov+QBkAnjZV
mC0Je6mR4LkpqWcWHcW1Sso3
=ZoKV
-----END PGP SIGNATURE-----


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

Date: Sun, 19 Oct 2003 09:34:55 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Any thought on "Perl Database" based on "Tie:File"?
Message-Id: <slrnbp588f.h9e.tadmc@magna.augustmail.com>

Public Interest <ir@labranche.com> wrote:

> Here is my
> feature request to the owner of Perl: Add Perl Database


> Any thought on my idea?


Things that can be done in modules are *never* added to the core.

Only things that really need to be in the core go in the core.

There are a bazillion existing modules that can do What You Want,
so you don't really need anything that isn't already existing.

All you have to do is go find it.  :-)


   http://search.cpan.org/modlist/Database_Interfaces


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sun, 19 Oct 2003 17:00:04 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Any thought on "Perl Database" based on "Tie:File"?
Message-Id: <9a38a4a9ba3ec59db1f5e8a7db8b2e23@news.teranews.com>

>>>>> "Public" == Public Interest <ir@labranche.com> writes:

Public> Here is what my friend told me: Database sucks and MySQL too. Try program
Public> without using database. Database is a file system. It is slow, take more
Public> space...

Try DBD::SQLite.  A full transaction-savvy SQL implementation, without
the server!


-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Sun, 19 Oct 2003 15:34:19 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: character mapping functions and UNICODE : remove accents, case, etc
Message-Id: <20031019113448.2b3d3e91.jwillmore@remove.adelphia.net>

On Sun, 19 Oct 2003 09:45:57 GMT
"An. Valula" <avlula@hotmail.com> wrote:

>=20
> does anyone out there know about perl capabilities to convert rich
> text, such as "=E9trang=E8res" to "etrangere" (remove accents)?
> Of course, tr/=E9=E8/ee/ would do, but I look for sth better: you do not
> tr/a-z/A-Z/ for uc(), do you?

I realize this doesn't answer the question directly, but have you
checked out RTF::Parse
(http://search.cpan.org/~pverd/RTF-Parser-1.07/)?  Thay _may_ aid you
in what you want to accomplish.

HTH

--=20
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt=20
for more information.

a fortune quote ...
Celebrate Hannibal Day this year.  Take an elephant to lunch.=20



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

Date: Sun, 19 Oct 2003 12:34:08 -0700
From: "Tom" <tom@nosleep.net>
Subject: Re: Help me with is code
Message-Id: <3f92e66d$1@nntp0.pdx.net>


"Public Interest" <ir@labranche.com> wrote in message
news:_Mpkb.6746$Ec1.615125@bgtnsc05-news.ops.worldnet.att.net...
> i am trying to use proxy 64.161.246.100:8080
>
> original code without proxy:
>  use Net::HTTP;
>  #
>  my $s = Net::HTTP->new(Host => 'quote.yahoo.com') || die $@;
>  $s->write_request(GET => 'http://quote.yahoo.com', 'User-Agent' =>
> 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)' );
>  my($code, $mess, %h) = $s->read_response_headers;
>  print %h;
>  $location=$h{'Location'} ;
>  print $location;
>
> it find that the location is http://finance.yahoo.com/?

Just curious, but was wondering where you got your idea?
I'm working on something similar, but artificially intelligent and with
features no one has ever done before.
I did tell a few people about my idea, so it could have spread.

Doesn't really matter though, since all that can happen is the more people
with this the better it works.

Mine is almost fully functional, but my regular job is preventing me from
finishing this for some time to come.

Depending on what you are doing, possibly we could share some ideas, or
possibly some of the work.
I'll have to think about it; depends on who you work for and what your goal
is, etc.

Post a contact here if interested.




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

Date: 19 Oct 2003 11:15:09 -0700
From: jorenders@hotmail.com (JR)
Subject: Re: How can i write the values of a form through a cgi script in a txt file.
Message-Id: <4096148f.0310191015.4352754a@posting.google.com>

Tore Aursand <tore@aursand.no> wrote in message news:<pan.2003.10.18.23.02.05.957072@aursand.no>...
> On Fri, 17 Oct 2003 12:01:16 -0700, JR wrote:
> > I tried your code but i get the follow error
> 
> Please post the complete code.

#!/usr/bin/perl
#
use strict;
use warnings;

use CGI;
my $cgi = CGI->new();
print $cgi->header(-type => 'text/html');

my $params = $cgi->Vars();
open( EEP, '>passwords.txt' ) || die "$!";
foreach my $key ( keys %$params ) {
  print EEP $key . ' = ' . $params{$key} . '<br';
}
close( EEP );

this is my complete code

Thanks

Jo


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

Date: 19 Oct 2003 19:58:16 GMT
From: Eric Bohlman <ebohlman@earthlink.net>
Subject: Re: How can i write the values of a form through a cgi script in a txt file.
Message-Id: <Xns94199A37638A6ebohlmanomsdevcom@130.133.1.4>

jorenders@hotmail.com (JR) wrote in
news:4096148f.0310191015.4352754a@posting.google.com: 

> foreach my $key ( keys %$params ) {

Here you treat $params as the hash reference it is...

>   print EEP $key . ' = ' . $params{$key} . '<br';

But here you're not dereferencing it, instead you're trying to look up the 
key in the non-existent hash %params.  You want $params->{$key}, or 
$$params{$key} if you prefer (though I find the arrow-style easier to 
read).


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

Date: Sun, 19 Oct 2003 08:18:49 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: How do I do this without database?
Message-Id: <Xns94195EB14B8BCsdn.comcast@216.196.97.136>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

"Public Interest" <ir@labranche.com> wrote in news:cQokb.6701$Ec1.610254
@bgtnsc05-news.ops.worldnet.att.net:

> Ok, I did not know that Tie:File is now in place starting with 5.8.0
> 
> Tie:File super

Tie::File is super, but you misunderstand it.  It will not make your 
program any faster.  What Tie::File does is (more or less) what you have 
been trying to do -- it has to do the same amount of reading and writing.  
Tie::File makes it easier to update files on a line-by-line basis; it does 
not make it any faster, in general.

- -- 
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print

-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBP5KPGWPeouIeTNHoEQJE+ACg1OkZ0/lQety2EJmsomal0UzWEuIAn0rt
+q/EjmONqmuppofN5Lj7ShKv
=sNXV
-----END PGP SIGNATURE-----


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

Date: Sun, 19 Oct 2003 15:08:57 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: How do I do this without database?
Message-Id: <20031019110926.1dca0ea0.jwillmore@remove.adelphia.net>

On Sun, 19 Oct 2003 04:11:32 GMT
"Public Interest" <ir@labranche.com> wrote:

> I am trying to scan stock price and volumes on a watch list. I have
> 1100 stocks on the list and I want to save them in a single file
> then use excel. Here is the format I want:
> 
> symbol|price on day1|volume on day1|price on day2|price on day2|....
> IBM|98.02|203092|97.01|1212300
> SUNW|3.45|1112232|3.72|1212219
> 
> I will scan the price and update add the new price and volume to the
> end of the line of each stock. The only thing I came up is to read
> the whole file in one array and add things to each element of the
> array then rewrite the whole array to the file. I know it is kind of
> breaking the RULE of not reading the whole file but only line by
> line. And it takes me 1 hours for scan all the data due to my
> dial-up connections. So I want to have something that I can start
> and pause then restart.But if I only read line by line, how do I
> append only to the end of the line not to the end of the file? It
> came back to the old question which is how to delete/modify lines in
> a text file.
> 
> I am using active perl on windows.

You _could_ use DBD::CSV.  In this case, the file could be treated as
a database.  So, you could use SQL to manipulate the file.  You _may_
not gain much as far as speed using this method.

If you're more interested in speed, use a RDBMS - such as MySQL,
PostgreSQL, etc.

You could also, since you're using Windows, M$ Access and use the
DBD::ODBC module to access the database.  However, it's not an
efficent or portable solution.

Bottom line, IMHO, is give serious consideration to finding a way to
do this in a RDBMS.

HTH

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
"We are on the verge: Today our program proved Fermat's
next-to-last theorem."   -- Epigrams in Programming, ACM SIGPLAN
Sept. 1982 


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

Date: Sun, 19 Oct 2003 16:22:44 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: How do I do this without database?
Message-Id: <3F92BA48.5050909@rochester.rr.com>

Public Interest wrote:

> I am trying to scan stock price and volumes on a watch list. I have 1100
> stocks on the list and I want to save them in a single file then use excel.
> Here is the format I want:
> 
> symbol|price on day1|volume on day1|price on day2|price on day2|....
> IBM|98.02|203092|97.01|1212300
> SUNW|3.45|1112232|3.72|1212219
> 
> I will scan the price and update add the new price and volume to the end of
> the line of each stock. The only thing I came up is to read the whole file
> in one array and add things to each element of the array then rewrite the
> whole array to the file. I know it is kind of breaking the RULE of not
> reading the whole file but only line by line. And it takes me 1 hours for
> scan all the data due to my dial-up connections. So I want to have something
> that I can start and pause then restart.But if I only read line by line, how
> do I append only to the end of the line not to the end of the file? It came
> back to the old question which is how to delete/modify lines in a text file.
> 
> I am using active perl on windows.

You should check out tie'ing a hash to a DBM-type file.

That will give very quick access to individual records
without the necessity to read the entire file each time.
See:

    perldoc -f dbmopen
    perldoc -f tie

to get started with that.


-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl



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

Date: 19 Oct 2003 19:50:22 GMT
From: Eric Bohlman <ebohlman@earthlink.net>
Subject: Re: How do I do this without database?
Message-Id: <Xns941998E04F9DDebohlmanomsdevcom@130.133.1.4>

Bob Walton <invalid-email@rochester.rr.com> wrote in
news:3F92BA48.5050909@rochester.rr.com: 

> Public Interest wrote:
> 
>> I am trying to scan stock price and volumes on a watch list. I have
>> 1100 stocks on the list and I want to save them in a single file then
>> use excel. Here is the format I want:
>> 
>> symbol|price on day1|volume on day1|price on day2|price on day2|....
>> IBM|98.02|203092|97.01|1212300
>> SUNW|3.45|1112232|3.72|1212219
>> 
>> I will scan the price and update add the new price and volume to the
>> end of the line of each stock. The only thing I came up is to read
>> the whole file in one array and add things to each element of the
>> array then rewrite the whole array to the file. I know it is kind of
>> breaking the RULE of not reading the whole file but only line by
>> line. And it takes me 1 hours for scan all the data due to my dial-up
>> connections. So I want to have something that I can start and pause
>> then restart.But if I only read line by line, how do I append only to
>> the end of the line not to the end of the file? It came back to the
>> old question which is how to delete/modify lines in a text file. 
>> 
>> I am using active perl on windows.
> 
> You should check out tie'ing a hash to a DBM-type file.
> 
> That will give very quick access to individual records
> without the necessity to read the entire file each time.

I think everybody here has been misreading the OP's requirements.  He's not 
looking to speed up the scanning process, which as he points out is slow 
because the data is being pulled in over a slow connection.  The most 
optimized database engine in the world would probably give a 2%-3% runtime 
savings.

What makes the most sense to me is to grab the watch list from the Web and 
build from it a hash whose keys are the stock symbols and whose values are 
the prices.  Then open the pipe-delimited file and read it line by line; if 
there's an entry in the hash for the symbol on the line, tack the value on 
to the end.  In any case, write out the line.

 


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

Date: Sun, 19 Oct 2003 15:14:22 -0400
From: Jeff W <perlnews@kwcpa.com>
Subject: How do I make a standalone WIN32 executable from Perl?
Message-Id: <KdGdnQoQc9gNfw-iRVn-jw@comcast.com>

Hi - Since I'm not a programmer, and OOP C++ is a bit beyond me, but i
AM a UNIX perl hacker, I was thinking of learning Perl/TK on WIN32 so I
could write PC scripts and utilities.  I downloaded ActivePerl and
looked at it.   However, it appears that I would need a perl
installation on every target machine.  Is there any easy, (and low or
zero cost) way to generate standalone Perl/Tk executables?   

Thanks
/j



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

Date: Sun, 19 Oct 2003 12:22:10 -0700
From: "Tom" <tom@nosleep.net>
Subject: Re: How do I make a standalone WIN32 executable from Perl?
Message-Id: <3f92e39f$1@nntp0.pdx.net>


"Jeff W" <perlnews@kwcpa.com> wrote in message
news:KdGdnQoQc9gNfw-iRVn-jw@comcast.com...
> Hi - Since I'm not a programmer, and OOP C++ is a bit beyond me, but i
> AM a UNIX perl hacker, I was thinking of learning Perl/TK on WIN32 so I
> could write PC scripts and utilities.  I downloaded ActivePerl and
> looked at it.   However, it appears that I would need a perl
> installation on every target machine.  Is there any easy, (and low or
> zero cost) way to generate standalone Perl/Tk executables?

I would look at embedding the Perl in C/C++ and compiling it that way.
That way, all you need is a very basic C/C++ program.

>
> Thanks
> /j
>




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

Date: Sun, 19 Oct 2003 15:49:39 -0400
From: Jeff W <perlnews@kwcpa.com>
Subject: Re: How do I make a standalone WIN32 executable from Perl?
Message-Id: <hPidnZjR97BIdw-iRVn-uw@comcast.com>

Can I do that with Perl / Tk?  Can you point me to an example?

thanks!
/j

Tom wrote:

>"Jeff W" <perlnews@kwcpa.com> wrote in message
>news:KdGdnQoQc9gNfw-iRVn-jw@comcast.com...
>> Hi - Since I'm not a programmer, and OOP C++ is a bit beyond me, but i
>> AM a UNIX perl hacker, I was thinking of learning Perl/TK on WIN32 so I
>> could write PC scripts and utilities.  I downloaded ActivePerl and
>> looked at it.   However, it appears that I would need a perl
>> installation on every target machine.  Is there any easy, (and low or
>> zero cost) way to generate standalone Perl/Tk executables?
>
>I would look at embedding the Perl in C/C++ and compiling it that way.
>That way, all you need is a very basic C/C++ program.
>
>>
>> Thanks
>> /j
>>
>
>
>  
>



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

Date: Sun, 19 Oct 2003 15:25:32 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: how to keep database connection persistent
Message-Id: <20031019112601.309e58ed.jwillmore@remove.adelphia.net>

On Sat, 18 Oct 2003 13:15:40 -0400
"James Q.L" <dragon@china.com> wrote:

> Hi,
> 
> i have a non-cgi script being called by users in command line. this
> script query database and return data.
> as this script is called frequently, i would like to keep a database
> connection so it won't initiate a new db connection.
> 
> how do i do that ?

Depends on what you're doing and what kind of effort you want to put
into writing the script.  You could, for eaxample, use 'fork'
(untested) to execute an 'update' SQL statement, but the initial
connection and final closing of the connection would be performed
outside of the fork by the parent process.  I'm thinking that, because
you already created a DBI object in the parent, the children would
re-use the connection.  One of the issues you'd encounter is locking
of the records (multiple writes/updates being performed).

It's, IMHO, less of a headache to just re-connect to the database each
time you need to do something.  Unless you have _really_ slow
connections :-)

HTH

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
U: There's a U -- a Unicorn!  Run right up and rub its horn. 
Look at all those points you're losing!  UMBER HULKS are so
confusing.   -- The Roguelet's ABC 


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

Date: Sun, 19 Oct 2003 08:42:18 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: how would i handle this?
Message-Id: <Xns941962AC02AFDsdn.comcast@216.196.97.136>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

anotherway83@aol.comnospam (The Mosquito ScriptKiddiot) wrote in
news:20031018181754.15203.00000295@mb-m26.aol.com: 

> im building a full-fledged 32-bit assembler in perl (its really gonna
> be a perl script) and i have a problem with the hash table that will
> hold the mnemonic - opcode conversion info...this hash table is gonna
> be pretty big because its gonna have all the info along with the
> various forms of each instruction 
> 
> so instead of having to build the hash table everytime the script is
> run in a session, i would like to make it so that in a given session,
> the hash table gets constructed only the first time around and then
> stays in memory for later use in that session, because that hash table
> info doesnt change at all 
> 
> how would i go abt achieving this? any special modules needed?

What's a "session"?

I think you have basically two choices:  build the hash each time 
(preferably from a config file), or store the data into a database file and 
tie a hash to that db file.

- -- 
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print

-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBP5KUpWPeouIeTNHoEQLZtwCgpLHKT7xZBOtfY/7vxrTpZ3pboAoAoNrD
E05sae9aht0ODTjze3b+CoIC
=+wy8
-----END PGP SIGNATURE-----


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

Date: 19 Oct 2003 18:05:58 GMT
From: anotherway83@aol.comnospam (The Mosquito ScriptKiddiot)
Subject: Re: how would i handle this?
Message-Id: <20031019140558.29227.00001486@mb-m06.aol.com>

>What's a "session"?

by session i mean everytime the user works on his program...writes the asm
code, assembles+links,rewrites and so on until he/she gets tired and comes back
another time

>I think you have basically two choices:  build the hash each time 
>(preferably from a config file), or store the data into a database file and 
>tie a hash to that db file.

i think this is what im gonna have to do..thanks


--The Mosquito Scriptkiddiot. 
"Those who dance are often considered crazy by those who can't hear the music"


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

Date: Sun, 19 Oct 2003 08:37:49 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: HTML whitespace/commnets cruncher
Message-Id: <Xns941961E9A32B8sdn.comcast@216.196.97.136>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

Garry Heaton <none@none.com> wrote in news:zOtkb.12373$kA.3236929
@wards.force9.net:

> Can anyone recommend a perl script for crunching HTML whitespace and
> comments? I wish to make duplicates of HTML files for uploading.

Why not gzip the html files?  Seems to me that'd be even better. 


A quick google search turned up a couple freeware and commercial HTML 
strippers.  And I seem to recall there's an apache module that does it, but 
I'm not sure.

- -- 
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print

-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBP5KTlWPeouIeTNHoEQLWUACgpXEJ99HvToQI6liJHMN5tBLWYZMAoKoH
3r8JlfmJtxcwvovr3YPz1/YD
=MhE2
-----END PGP SIGNATURE-----


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

Date: Sun, 19 Oct 2003 08:32:27 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Manipulation binary files
Message-Id: <Xns941961011DCB3sdn.comcast@216.196.97.136>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

"Chris" <chris@nospam.dustbubble.com> wrote in
news:cSvkb.498$jk1.619339@newsfep1-win.server.ntli.net: 

> I have a binary file of unsigned byte values, and I wish to convert
> these into a .wav file, so that I can use the soundcard DAC to
> generate the waveform the binary file describes (cool huh? Cheap
> signal generator :-) 
> 
> The problem is that the wav file format needs to have all all sorts of
> stuff munged into the header, including strings "RIFF" "WAVE" and "fmt
> " and values that describe other paramters. SOme of these data types
> are 32 bit, some are 16 some are 8.
> 
> In perl how do i ...
> 
> a) write to a file in binary mode. I have tried using binmode(FH)
> before the writing beging, but it seems to make little difference

To write to a binary file, you use "print", just like writing to a text 
file.  You should use binmode on the file handle beforehand, yes.


> b) write strings in binary mode. I dont really have to do write 0x52
> 0x49 0x46 0x46 if there is a way to write "RIFF" and have perl do the
> donkey work 

Yes: print FH "RIFF";


> c) Declare the widths of my variables. I need to be able to assign a
> variable with a value, and output all 4 bytes of that value to the
> file in binary mode.

You should look into the 'pack' operator.  It's a pain to use (imho), but 
this is exactly what it does: convert numeric variables into binary 
strings, suitable for printing to your file.

- -- 
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print

-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBP5KSV2PeouIeTNHoEQJRCQCfUaNmZpfUwSNWUXoNZMPYzkaLoUYAoKvD
RaVBrEksKxoWpV73CyDPS3H7
=IPZU
-----END PGP SIGNATURE-----


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

Date: Sun, 19 Oct 2003 19:31:51 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Manipulation binary files
Message-Id: <3F92E688.93E63693@acm.org>

"Eric J. Roode" wrote:
> 
> "Chris" <chris@nospam.dustbubble.com> wrote in
> news:cSvkb.498$jk1.619339@newsfep1-win.server.ntli.net:
> >
> > a) write to a file in binary mode. I have tried using binmode(FH)
> > before the writing beging, but it seems to make little difference
> 
> To write to a binary file, you use "print", just like writing to a text
> file.  You should use binmode on the file handle beforehand, yes.
> 
> > b) write strings in binary mode. I dont really have to do write 0x52
> > 0x49 0x46 0x46 if there is a way to write "RIFF" and have perl do the
> > donkey work
> 
> Yes: print FH "RIFF";

And you may want to turn on autoflush for your output file handle.  Have
a look in perlvar.pod for "OUTPUT_AUTOFLUSH".


John
-- 
use Perl;
program
fulfillment


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

Date: Sun, 19 Oct 2003 19:07:20 GMT
From: "Experienced but Undocumented" <e02@removethis.toao.net>
Subject: Net::Aim - find out if user is online?
Message-Id: <IhBkb.127999$pl3.104436@pd7tw3no>

Is it possible to use Net::AIM to find out if a specific user is online or
offline?  If so, how is this done?

Thanks!




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

Date: Sun, 19 Oct 2003 19:58:31 GMT
From: "Experienced but Undocumented" <e02@removethis.toao.net>
Subject: Re: Net::Aim - find out if user is online?
Message-Id: <H1Ckb.126722$9l5.32468@pd7tw2no>

"Experienced but Undocumented" <e02@removethis.toao.net> wrote
> Is it possible to use Net::AIM to find out if a specific user is online or
> offline?  If so, how is this done?

Alternately, I would be just as content if I could capture a message a user
sent to me.  I'm having troubles with the following from
http://www.webreference.com/perl/tutorial/13/2.html.  For some reason it
dies on line 8.  Without that line it does not die...but nothing happens
either ;-)

1  use Net::AIM;
2  my $nick = "motherofperlbot";
3  my $aim = new Net::AIM;
4  $aim->debug(1);
5  my $conn = $aim->newconn(Screenname   => 'motherofperlbot',
6  			   Password     => 'motherofperl')
7      or die "Can't connect to AIM server.\n";
8  $conn->add_handler('config',    \&on_config);
9  $aim-start;
10
11 sub on_config {
12     my ($self, $event) = @_;
13     my ($str) = $event->args;
14     $self->set_config($str);
15     $self->send_im($nick, 'testing...');
16 }




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

Date: Sun, 19 Oct 2003 14:10:00 -0400
From: Jeff W <perlnews@kwcpa.com>
Subject: Newbie dumb but quick question
Message-Id: <MpKdnXL9gt_mTg-iRVn-gA@comcast.com>

Hi - I've been coming up on Perl at work in a UNIX environment.
I downloaded Active Perl onto my PC to play with it there.

Question:  Is it possible to create WIN32 Perl scripts and
"compile" them so that they will run places where Perl is
not installed?

Thanks
/j



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

Date: Sun, 19 Oct 2003 19:09:29 GMT
From: "Experienced but Undocumented" <e02@removethis.toao.net>
Subject: Re: Newbie dumb but quick question
Message-Id: <JjBkb.126494$9l5.5040@pd7tw2no>

"Jeff W" <perlnews@kwcpa.com> wrote
> Question:  Is it possible to create WIN32 Perl scripts and
> "compile" them so that they will run places where Perl is
> not installed?

Sure!  Check out http://www.indigostar.com/perl2exe.htm :)

Alternately, you can add c:\Program Files\Perl\bin (if this is where you
chose to install PERL) to your %PATH% variable so that you can type "perl
somefile.pl" at any prompt and it will run.

Good luck!




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

Date: Sun, 19 Oct 2003 19:20:15 GMT
From: "Bob X" <bobx@linuxmail.org>
Subject: Re: Newbie dumb but quick question
Message-Id: <PtBkb.1744$CE2.1773775@news2.news.adelphia.net>

"Jeff W" <perlnews@kwcpa.com> wrote in message
news:MpKdnXL9gt_mTg-iRVn-gA@comcast.com...
> Hi - I've been coming up on Perl at work in a UNIX environment.
> I downloaded Active Perl onto my PC to play with it there.
>
> Question:  Is it possible to create WIN32 Perl scripts and
> "compile" them so that they will run places where Perl is
> not installed?
>
> Thanks
> /j
>

Look at "Par"




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

Date: Sun, 19 Oct 2003 15:30:57 -0400
From: Jeff W <perlnews@kwcpa.com>
Subject: Re: Newbie dumb but quick question
Message-Id: <LP-dnRn2WqLlew-iRVn-jg@comcast.com>

I found par and pp, but not as part of ActivePerl - am I missing
something here - is this really an easy thing to do?  (i want to write a
phonebook program, and I'm not a professional programmer)

thanks
/j

Bob X wrote:

>"Jeff W" <perlnews@kwcpa.com> wrote in message
>news:MpKdnXL9gt_mTg-iRVn-gA@comcast.com...
>> Hi - I've been coming up on Perl at work in a UNIX environment.
>> I downloaded Active Perl onto my PC to play with it there.
>>
>> Question:  Is it possible to create WIN32 Perl scripts and
>> "compile" them so that they will run places where Perl is
>> not installed?
>>
>> Thanks
>> /j
>>
>
>Look at "Par"
>
>
>  
>



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

Date: 19 Oct 2003 17:24:12 GMT
From: weave@navajo.dtcc.edu (Ken Weaverling)
Subject: Recursive inheritance after using h2xs
Message-Id: <bmuhbs$5mu$1@news.dtcc.edu>

I'm going a bit nuts after trying to build a package with h2xs and 
getting the error...

Recursive inheritance detected while looking for method 'import' in package...

I tried to simplify it down as much as possible, so I took the "empty
subclass test" example out of Perl Cookbook, section 13.9 and plugged
it into the .pm file produced by h2xs and get the above error soon as
I try to call new from a script that uses that package.

All the texts I've read show how to do classes, packages, modules, 
but nothing seems to put it all together! :)

A gentle nudge would be must appreciated. Thanks

-- 

Ken Weaverling (ken @ weaverling.org) WHOIS: KJW  http://www.weaverling.org/



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

Date: 19 Oct 2003 18:50:43 GMT
From: weave@navajo.dtcc.edu (Ken Weaverling)
Subject: Re: Recursive inheritance after using h2xs
Message-Id: <bmume3$652$1@news.dtcc.edu>

In article <bmuhbs$5mu$1@news.dtcc.edu>,
Ken Weaverling <weave@navajo.dtcc.edu> wrote:
>I'm going a bit nuts after trying to build a package with h2xs and 
>getting the error...
>
>Recursive inheritance detected while looking for method 'import' in package...

Looks like if I do something like....

Package Subclass;
@Subclass::ISA('ParentClass');

 ... then it all works as intended -- I think... :)

Now to try and fold this into my larger project...

-- 

Ken Weaverling (ken @ weaverling.org) WHOIS: KJW  http://www.weaverling.org/



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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 5681
***************************************


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