[19132] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1327 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 18 18:09:39 2001

Date: Wed, 18 Jul 2001 15:05:17 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <995493917-v10-i1327@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 18 Jul 2001     Volume: 10 Number: 1327

Today's topics:
    Re: ####  ADD 6 INCHES TO YOUR PENIS #####  2830 (Craig Berry)
    Re: about image::Magick quality please ! <bart.lateur@skynet.be>
    Re: about image::Magick quality please ! <shijialee@yahoo.com>
    Re: All computers in world MUST sync with ATOMIC clock  (Ken Kalish)
    Re: All computers in world MUST sync with ATOMIC clock  <ddunham@redwood.taos.com>
    Re: All computers in world MUST sync with ATOMIC clock  (Joe Cosby)
    Re: All computers in world MUST sync with ATOMIC clock  <adam@dedekind.com>
    Re: ANNOUNCE: "Compiler" 2.0beta1 <pne-news-20010718@newton.digitalspace.net>
    Re: Anyone used blat.exe? (Abigail)
    Re: Array Contents modification? (Craig Berry)
        Authorize Net Credit Card Script Works on One Server bu <kevin@inetws.net>
    Re: Debugger -- ActivePerl / Perl Builder / Perltk / (Joe Chung)
    Re: extracting a range of lines from a text file (Abigail)
        FAQ: Is it unsafe to return a pointer to local data? <faq@denver.pm.org>
        Generic Language interpreter in Perl? <ekulis@apple.com>
    Re: Generic Language interpreter in Perl? <tony_curtis32@yahoo.com>
    Re: Generic Language interpreter in Perl? <rsherman@ce.gatech.edu>
    Re: Generic Language interpreter in Perl? <ekulis@apple.com>
    Re: Generic Language interpreter in Perl? (Abigail)
        Getting error on Oracle CLOB insert using PERL DBI <ethernaut43@yahoo.com>
    Re: How to timeout a socket recv under win32? <schabernackel@hotmail.com>
        I cannot get imagemagick working either <dbdavids@uiuc.edu>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 18 Jul 2001 20:59:37 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: ####  ADD 6 INCHES TO YOUR PENIS #####  2830
Message-Id: <tlbu5poda69q68@corp.supernews.com>

Bernard El-Hagin (bernard.el-hagin@lido-tech.net) wrote:
: Who needs a module?
: 
: $your_cock += 6;

Yeah, if yours is scalar...

  push @your_cock, ("inches") x 6;

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Brute force done fast enough looks slick."
   |             - William Purves


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

Date: Wed, 18 Jul 2001 18:38:39 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: about image::Magick quality please !
Message-Id: <jjlblts4m3bdvc8fctq3kgbj51d3o59emg@4ax.com>

James wrote:

>i am trying to resize image and lower the quality in order to make a smaller
>thumbnail. i am specifically dealing with JPEG file now. My problem is that
>the
>size of the image seems not to be affected no matter what number i set
>for the quality. even with nothing set for the quality! the size always
>remains the same.

>$test->Write(quality=>'50',filename=>'copy.jpg');

>i am new to perl , please give me any thought you may have, thanks!

Apparently, your syntax is alright. But it looks like the quality
setting makes the file size vary in huge jumps. For example , for a
value of 100, or 1, I get an image of 13604 bytes, and for a larger
value, like 120 or 5000, I get 43683 bytes. A quality value of 0 still
gets me a 13604 bytes image, and -1 or lower gives me a horribly blocky
image of 1219 bytes.

So it roughly works as on other imaging software, but not as
fine-tunable.

But anyway, 6.85 k for a thumbnail is already quite low. You should be
happy with what you get here, IMO.

-- 
	Bart.


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

Date: Wed, 18 Jul 2001 20:43:27 GMT
From: "James" <shijialee@yahoo.com>
Subject: Re: about image::Magick quality please !
Message-Id: <Pxm57.2132$2V.507685@news3.rdc1.on.home.com>

with GD, i can lower the quality and actually see the decrement of the size.
i.e seize becomes 6.85k , 5.43k etc while lower the quality ...
So, it seems Image::Magick can't beat it with this..?!
but i have to admit that Image::Magick can keep a quite decent quality for
me though. i am happy.

James


"Bart Lateur" <bart.lateur@skynet.be> wrote in message
news:jjlblts4m3bdvc8fctq3kgbj51d3o59emg@4ax.com...
> James wrote:
>
> >i am trying to resize image and lower the quality in order to make a
smaller
> >thumbnail. i am specifically dealing with JPEG file now. My problem is
that
> >the
> >size of the image seems not to be affected no matter what number i set
> >for the quality. even with nothing set for the quality! the size always
> >remains the same.
>
> >$test->Write(quality=>'50',filename=>'copy.jpg');
>
> >i am new to perl , please give me any thought you may have, thanks!
>
> Apparently, your syntax is alright. But it looks like the quality
> setting makes the file size vary in huge jumps. For example , for a
> value of 100, or 1, I get an image of 13604 bytes, and for a larger
> value, like 120 or 5000, I get 43683 bytes. A quality value of 0 still
> gets me a 13604 bytes image, and -1 or lower gives me a horribly blocky
> image of 1219 bytes.
>
> So it roughly works as on other imaging software, but not as
> fine-tunable.
>
> But anyway, 6.85 k for a thumbnail is already quite low. You should be
> happy with what you get here, IMO.
>
> --
> Bart.




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

Date: Wed, 18 Jul 2001 19:26:14 GMT
From: kkal@javakk.com (Ken Kalish)
Subject: Re: All computers in world MUST sync with ATOMIC clock before 12:00 AM  21July 2001
Message-Id: <3b57e281.2281789@news.earthlink.net>

Thank you. Please continue to relay to us all orders from the mother ship.


On Wed, 18 Jul 2001 02:41:22 GMT, alavoor <alavoor@yahoo.com> wrote:

>
>All computers in the world MUST sync with ATOMIC clock before 12:00 AM
>21 July 2001!!!
>
>hello:
>You must sync your PC's date and time with Cesium Atomic clock.
>
>Use this very small and tiny program written in PHP.
>
>Do you know that Cesium Atomic clock located in Boulder, Colarado, USA
>is the world's most accurate clock!! It does not lose or gain one second
>
>even after running for 25 MILLION YEARS!!! This clock is the official
>time USA and for the world.
>
>There are also similar Atomic clocks in France, UK, Germany and Japan.
>
>This program runs on MS Windows 95/98/NT/2000/XP/ME and MS Windows 3.11.
>
>This program also runs on all flavors of Unix and Linux and Apple Mac.
>
>Please download the program from:
> http://phpclasses.upperdesign.com/browse.html/package/285

-- 

Regards,

Ken Kalish

there is no Java cartel



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

Date: Wed, 18 Jul 2001 20:12:09 GMT
From: Darren Dunham <ddunham@redwood.taos.com>
Subject: Re: All computers in world MUST sync with ATOMIC clock before 12:00 AM  21July 2001
Message-Id: <t4m57.1563$Tn6.79252@news.pacbell.net>

Philip Newton <pne-news-20010718@newton.digitalspace.net> wrote:
> <carlos@plant.student.utwente.nl> wrote:

>> isn't that why the NTP protocol uses UDP?

> I highly doubt it. I don't think that the choice of TCP vs UDP makes
> that much of a difference in the round-trip times. If you have a thin
> link or you're far away netwise from the NTP server, you'll still have
> to compensate for the time the packets take to get to you.

It actually makes a great difference.

TCP can retransmit.... UDP can't.

If you're measuring timings, you don't want packets retransmitted
without you knowing about it.  :-)

-- 
Darren Dunham                                           ddunham@taos.com
Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                           San Francisco, CA bay area
          < How are you gentlemen!! Take off every '.SIG'!! >


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

Date: Wed, 18 Jul 2001 20:24:00 GMT
From: joecosby@SPAMBLOCKmindspring.com (Joe Cosby)
Subject: Re: All computers in world MUST sync with ATOMIC clock before 12:00 AM  21July 2001
Message-Id: <3b55f01a.2170914@news.mindspring.com>

kkal@javakk.com (Ken Kalish) hunched over a computer, typing
feverishly;
thunder crashed, kkal@javakk.com (Ken Kalish) laughed madly, then
wrote:

>Thank you. Please continue to relay to us all orders from the mother ship.

"Double cheeseburger, cheddar curly fries, and a large diet coke"

Signed, The Mother Ship

--
Joe Cosby
http://joecosby.home.mindspring.com
 
"Christianity is a rebellion of everything that crawls on the ground 
against that which has height:  The evangel of the 'lowly' makes low."
- Nietzsche 
 
 
Sig by Kookie Jar 5.98d http://go.to/generalfrenetics/


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

Date: Wed, 18 Jul 2001 17:20:45 -0400
From: "Adam Meikle" <adam@dedekind.com>
Subject: Re: All computers in world MUST sync with ATOMIC clock before 12:00 AM  21July 2001
Message-Id: <tlbvdcj67gi61f@corp.supernews.com>

How do we know when that is, exactly?

"Ken Kalish" <kkal@javakk.com> wrote in message
news:3b57e281.2281789@news.earthlink.net...
> Thank you. Please continue to relay to us all orders from the mother ship.
>
>
> On Wed, 18 Jul 2001 02:41:22 GMT, alavoor <alavoor@yahoo.com> wrote:
>
> >
> >All computers in the world MUST sync with ATOMIC clock before 12:00 AM
> >21 July 2001!!!
> >
> >hello:
> >You must sync your PC's date and time with Cesium Atomic clock.
> >
> >Use this very small and tiny program written in PHP.
> >
> >Do you know that Cesium Atomic clock located in Boulder, Colarado, USA
> >is the world's most accurate clock!! It does not lose or gain one second
> >
> >even after running for 25 MILLION YEARS!!! This clock is the official
> >time USA and for the world.
> >
> >There are also similar Atomic clocks in France, UK, Germany and Japan.
> >
> >This program runs on MS Windows 95/98/NT/2000/XP/ME and MS Windows 3.11.
> >
> >This program also runs on all flavors of Unix and Linux and Apple Mac.
> >
> >Please download the program from:
> > http://phpclasses.upperdesign.com/browse.html/package/285
>
> --
>
> Regards,
>
> Ken Kalish
>
> there is no Java cartel
>




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

Date: Wed, 18 Jul 2001 20:13:36 +0200
From: Philip Newton <pne-news-20010718@newton.digitalspace.net>
Subject: Re: ANNOUNCE: "Compiler" 2.0beta1
Message-Id: <b4jblt8jaiis2b8lfjmuhcv2jgtruos0kn@4ax.com>

On Wed, 18 Jul 2001 17:22:51 +0200, Andreas Otto <aotto@t-online.de>
wrote:

> Dear Customer,

You sent this to the newsgroup comp.lang.perl.misc. How can a newsgroup
be your customer? (If you meant the readers: there's more than one
reader. Plural would have been better.)

>   "Compiler" 2.0beta1, a tool for creating native binaries ot of Tcl
> code is available for download.

I'm not sure whether comp.lang.perl.misc is the best place to market
something to do with Tcl. comp.lang.tcl.announce exists, you know. (I
don't know whether they accept commercial advertisements -- best ask
around there.)

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


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

Date: 18 Jul 2001 19:05:08 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Anyone used blat.exe?
Message-Id: <slrn9lbngo.nor.abigail@alexandra.xs4all.nl>

Brian Spittles (ng@spittles.freeuk.com) wrote on MMDCCCLXXVII September
MCMXCIII in <URL:news:bf39ltki7uu11g78hogaolui661so651fd@4ax.com>:
^^ Hi,
^^ 
^^ I'm trying to use blat.exe (after my host switched from Unix to NT).
^^ Following answers given (to other questions) in other NGs, I've
^^ constructed the following:
^^ 
^^  system qq(blat.exe "$body"
^^   -to "$rs22->Fields(3)->{Value}"
^^   -subject "Your squad"
^^   -i "$from"
^^   -body "$body");
^^ 
^^ As you can see, there's a mixture of scalars and hard-coded strings
^^ being passed to blat.  So far, nothing has appeared in my mailbox!

I guess that's because you have newlines in the call, and the NT
shell, just like most other shells, thinks that a newline is a command
separator?



Abigail
-- 
use   lib sub {($\) = split /\./ => pop; print $"};
eval "use Just" || eval "use another" || eval "use Perl" || eval "use Hacker";


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

Date: Wed, 18 Jul 2001 18:51:46 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Array Contents modification?
Message-Id: <tlbmm2ffofai47@corp.supernews.com>

PaAnWa (paanwa@hotmail.com) wrote:
: I have an array called @Booklets.  Let's say the contents of the array are:
: "\"AB\"," "\"BC\"," "\"CD\"," "\"DE\"," "\"EF\""

For future notational convenience, that's easier to write as

  qw("AB" "BC" "CD" "DE" "EF")

: The contents are fomatted this way so that I can print the array contents to
: a text file in .csv format.

Usually a better idea to maintain array items in whatever the natural
internal format might be, and transform them on output to any required
external format.

: I would like to take the formatting out at a certain point in my code so
: that I can print this:
: 
:   foreach (@Booklets)
:   {
:   print "<img src=",$_ ,".jpg>&nbsp; ";
:   }
: 
: and get a .jpg image for each item in the array.

That's why you keep it in internal format. :)

However, you can always just transform on the fly, which I'd do like this:

  foreach (@Booklets) {
    (my $link = $_) =~ tr/"//d;
    print qq!<img src="$link.jpg">&nbsp; !;
  }

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Brute force done fast enough looks slick."
   |             - William Purves


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

Date: Wed, 18 Jul 2001 16:09:46 -0400
From: Kevin Diffily <kevin@inetws.net>
Subject: Authorize Net Credit Card Script Works on One Server but not the other
Message-Id: <B77B6549.563A%kevin@inetws.net>

I have run into a weird problem.  The script below runs perfectly on my
office Server but when I run it on my clients web host it doesn't.
Similarities:
1) Both Red Hat Linux
2) Both scripts running as a non root user
3) Both tried from command line.

** I have authorized successfully with Authorize Net from both servers with
a script I rolled for testing that uses Net::SSLeay and a preformatted
string with the name value pairs.  If I use an incorrect or missing login
name in that script I get the same error that I receive when trying to run
the script from the clients computer.  It is
"Unparsed reply data:
  Invalid Merchant Login or Account Inactive"

Results:
Office: List of values from auth net for a authorized transaction
Clients: 
DATE: Wed, 18 Jul 2001 20:00:53 GMT
CONTENT-LENGTH: 42
CONTENT: 
SERVER: Microsoft-IIS/4.0

 Reply type specification received from v3.0
transact.dll:
 HTTP/1.1 200 OK 

 Unparsed reply data:
  Invalid Merchant Login or Account Inactive
 
 Data returned by v3.0 transact.dll
(see v3.0 transact.dll documentation for
a descriptions of each data item returned):
 Item 1: Invalid Merchant Login or Account Inactive


*** MY SCRIPT *****
#!/usr/bin/perl
use Net::SSLeay qw(post_https make_headers make_form);

###### EDIT THESE LINES ######
# Auth Net Variables
$login = "globalmarket";
$adc_delim_data     = "TRUE";
$adc_url            = "FALSE";
$authorization_type = "AUTH_CAPTURE";
$an_version         = "3.0";

# Simulate the basic required form data.
# Your form field name          Form field value entered by client.
#
$form_data{'first_name'}         = "John";
$form_data{'last_name'}          = "Doe";
$form_data{'payment_method'}     = "CC";
$form_data{'card_num'}           = "4007000000027";
$form_data{'expiration_date'}    = "11/2001";
$form_data{'charge_amount'}      = "49.95";

$test_mode = "TRUE";
$echo_data = "TRUE";

# Auth Net Gateway Variables
$host = "secure.authorize.net";
$script = "/gateway/transact.dll";
$port = "443";

# Fill in the v3.0 transact.dll fields with the data you
# collected via your checkout form.
#
%form_data = make_form
        (
            'x_Login'           => $login
           ,'x_Version'         => $an_version
           ,'x_ADC_Delim_Data'  => $adc_delim_data
           ,'x_ADC_URL'         => $adc_url
           ,'x_Type'            => $authorization_type
           ,'x_Test_Request'    => $test_mode
           ,'x_Method'          => $form_data{'payment_method'}
           ,'x_First_Name'      => $form_data{'first_name'}
           ,'x_Last_Name'       => $form_data{'last_name'}
           ,'x_Amount'          => $form_data{'charge_amount'}
           ,'x_Card_Num'        => $form_data{'card_num'}
           ,'x_Exp_Date'        => $form_data{'expiration_date'}
           ,'x_Echo_Data'       => $echo_data
        );

    # Send data via SSL and wait for reply via the same
    # encrypted channel.
    #
($reply_data, $reply_type, %reply_headers) =
              post_https($host, $port, $script, '', %form_data);

print "Reply headers received from v3.0 transact.dll";

foreach $key (keys %reply_headers)
 { print "$key: $reply_headers{$key}\n";
 }

print "\n Reply type specification received from v3.0
transact.dll:\n $reply_type \n";

# split out the returned fields
@data = split (/\,/, $reply_data);

    # Print the unparsed reply_data.
    #
print STDOUT "\n Unparsed reply data:\n  $reply_data\n ";
 
print "\n Data returned by v3.0 transact.dll
(see v3.0 transact.dll documentation for
a descriptions of each data item returned):\n ";

$data_item = 1;
foreach(@data)
 { print "Item $data_item: $_ \n ";
   $data_item++;
 }


-- 
Kevin Diffily
InterNetWorkingSolutions
Enterprise Class Solutions for All Enterprises
VOICE: 1.866.inetws.net (Toll Free), 802.563.3100
FAX: 888.726.9030 




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


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

Date: Wed, 18 Jul 2001 17:25:12 GMT
From: m_010@yahoo.com (Joe Chung)
Subject: Re: Debugger -- ActivePerl / Perl Builder / Perltk /
Message-Id: <3b55c5d6.172406312@enews.newsguy.com>

I think writing the code on unix would save me time.  Is Perltk most
popular choice on unix?  Since I just installed it on SunOS 2.6. Its'
easy to install.

Thanks.


On Wed, 18 Jul 2001 08:17:45 -0500, Michael Carman <mjcarman@home.com>
wrote:

>Joe Chung wrote:
>> 
>> I found 3 popular perl debugger, which one is the best?
>
>Whichever one works best for you. Play with them, see how you like using
>them. I normally just use perl -d, but have found ptkdb to be handy at
>times as well.
>
>> I perfer writing perl code on windows and run on Unix. I wonder if
>> perl code is portable across different platform, like Java code?
>
>Probably moreso. :) 
>
>Most of the time a well-written script will be completely portable
>between different platforms, but there are some things to be aware of.
>Not all of the builtin functions are implemented on all platforms. Most
>of those which aren't have to do with sysadmin tasks and herald back to
>Perl's birthplace on Unix. They aren't available on Win* because they
>have no meaning there.
>
>And of course, if you like making liberal use of system(), exec(), and
>backticks (that is, calls to the OS) you'll have problems with
>portability. :)
>
>> Does ActivePerl come with the standard perl interpreter?
>
>ActivePerl is a distribution of Perl for Win32 platforms. It contains a
>port of the interpreter.
>
>> so that I can write code using ActivePerl,  then run it on unix's
>> perl.  Any compatiblity problem?
>
>Rarely. It's actually pretty easy to write portable Perl most of the
>time. See the perlport manpage for a full description of things to keep
>in mind. There are also manpages for specific platform oddities
>(perlwin32, perlos2, etc.)
>
>Other things to keep in mind is whether or not your Win* and *nix
>machines are running different versions of Perl, and whether you have
>all of the same modules available on both platforms.
>
>-mjc



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

Date: 18 Jul 2001 19:29:03 GMT
From: abigail@foad.org (Abigail)
Subject: Re: extracting a range of lines from a text file
Message-Id: <slrn9lbotj.nor.abigail@alexandra.xs4all.nl>

Ren Maddox (ren@tivoli.com) wrote on MMDCCCLXXVII September MCMXCIII in
<URL:news:m3snfvqjqc.fsf@dhcp9-161.support.tivoli.com>:
[] On Tue, 17 Jul 2001, cberry@cinenet.net wrote:
[] 
[] > Ren Maddox (ren@tivoli.com) wrote:
[] > : 
[] > : perl -ne "print if 300_000 .. 400_000; last if $. == 400_000"
[] > 
[] > If you're going to do that, it's probably more efficient to avoid
[] > the range operator and do a simple $. compare:
[] > 
[] >   perl -ne "print if $. >= 300_000; last if $. == 400_000"
[] 
[] True, two compares is better than three.  For that matter, one is
[] better than two for this first part of the file:
[] 
[]   perl -ne "next if $. < 300_000; print; last if $. == 400_000"


But then you're still doing 100_000 tests too many. Not to mention
all those needless assignments to $_.


    perl -e '             <> for 1 .. 300_000; 
             print scalar <> for 1 .. 100_000;'


Abigail
-- 
use   lib sub {($\) = split /\./ => pop; print $"};
eval "use Just" || eval "use another" || eval "use Perl" || eval "use Hacker";


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

Date: Wed, 18 Jul 2001 18:17:01 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ: Is it unsafe to return a pointer to local data?
Message-Id: <xok57.26$pQ2.181518848@news.frii.net>

This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with every Standard Distribution of
Perl.

+
  Is it unsafe to return a pointer to local data?

    No, Perl's garbage collection system takes care of this.

        sub makeone {
            my @a = ( 1 .. 10 );
            return \@a;
        }

        for $i ( 1 .. 10 ) {
            push @many, makeone();
        }

        print $many[4][5], "\n";

        print "@many\n";

- 

Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short.  They represent an important
part of the Usenet tradition.  They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.

If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile.  If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.

Answers to questions about LOTS of stuff, mostly not related to
Perl, can be found by pointing your news client to

    news:news.answers

or to the many thousands of other useful Usenet news groups.

Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release.  It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.

The perlfaq manual page contains the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-1999 Tom Christiansen and Nathan
    Torkington.  All rights reserved.

This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.

                                                           03.18
-- 
    This space intentionally left blank


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

Date: Wed, 18 Jul 2001 13:38:03 -0700
From: Ed Kulis <ekulis@apple.com>
Subject: Generic Language interpreter in Perl?
Message-Id: <3B55F3A9.459E068@apple.com>

Hi,

I find myself always wanting to write little languages in configuration
files and then to interpret them.

So is there something in perl that would allow me to define a language
grammer, interpret it and then call appropriate perl modules or
subroutines?

(Thanks in advance for your help.)

For instance, one of our back burner projects is a to build a flexible
Unix directory cleaner.

The idea is that there would be a config file on each directory which
would maintain the files on that directory.

Here's some sample instuctions that could direct activity for that
directory.
#------------------------
File name: !!!directory_maintenance.cfg

In this file would be instructions like:

# cfg file comment

# for interface log files compress at 15 days old
#
file pattern: interface.*\.dat
compress days: 15
notify: ekulis@apple.com

# remove compressed interface files at 30 days old
#
file pattern: interface.*\.dat.Z
remove days: 30

# remove first 50% of of large log files
#
file pattern: activity.*\.log
truncate top: 50%

# move processed incoming data files to archive
# and compress
#
file pattern: vendor_request.\.dat
archive days: 5
arcchive dir: ../Archives
compress archive:
notify: opsmanager@apple.com, ekulis@apple.com
#-----------------------------------



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

Date: 18 Jul 2001 15:52:31 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Generic Language interpreter in Perl?
Message-Id: <87zoa2q7sg.fsf@limey.hpcc.uh.edu>

>> On Wed, 18 Jul 2001 13:38:03 -0700,
>> Ed Kulis <ekulis@apple.com> said:

> Hi, I find myself always wanting to write little
> languages in configuration files and then to interpret
> them.

> Here's some sample instuctions that could direct
> activity for that directory.  #------------------------
> File name: !!!directory_maintenance.cfg

> In this file would be instructions like:

> # cfg file comment
> 
> # for interface log files compress at 15 days old
> #
> file pattern: interface.*\.dat
> compress days: 15
> notify: ekulis@apple.com
> 
> # remove compressed interface files at 30 days old
> #
> file pattern: interface.*\.dat.Z
> remove days: 30
> 
> ...

With a slight syntax change, you could probably use
something like Config::IniFiles for this.

  [compressor]
  pattern = interface.*.dat
  time = 15d
  notify = ...@...

  [remove]
  pattern = ...
  time = 30d
  ...

You can then iterate over the various [] sections...

A search for "config" at http://search.cpan.org/ turned up
a few likely-looking modules.

hth
t
-- 
Beep beep!  Out of my way, I'm a motorist!


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

Date: Wed, 18 Jul 2001 17:25:44 +0500
From: Robert Sherman <rsherman@ce.gatech.edu>
Subject: Re: Generic Language interpreter in Perl?
Message-Id: <3B558048.1EB612CB@ce.gatech.edu>

Ed Kulis wrote:
> 
> Hi,
> 
> I find myself always wanting to write little languages in configuration
> files and then to interpret them.
> 
> So is there something in perl that would allow me to define a language
> grammer, interpret it and then call appropriate perl modules or
> subroutines?

yes...the perl interpreter.


why not just have your perl script read the conf file directly and take
appropriate action based on its contents? you can use cron to schedule
it. you seem to want to add a layer of complexity for no reason...unless
i am missing something here...


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

Date: Wed, 18 Jul 2001 14:45:08 -0700
From: Ed Kulis <ekulis@apple.com>
Subject: Re: Generic Language interpreter in Perl?
Message-Id: <3B560364.FB2A623B@apple.com>

Thanks, Tony.

Excellent references.

As you mentioned , a search for "config" at http://search.cpan.org/
turned up just what I needed.

It always seems true that no matter what you need to do in Perl someone
has already done it and done it well.

-ed

Tony Curtis wrote:

> >> On Wed, 18 Jul 2001 13:38:03 -0700,
> >> Ed Kulis <ekulis@apple.com> said:
>
> > Hi, I find myself always wanting to write little
> > languages in configuration files and then to interpret
> > them.
>
> > Here's some sample instuctions that could direct
> > activity for that directory.  #------------------------
> > File name: !!!directory_maintenance.cfg
>
> > In this file would be instructions like:
>
> > # cfg file comment
> >
> > # for interface log files compress at 15 days old
> > #
> > file pattern: interface.*\.dat
> > compress days: 15
> > notify: ekulis@apple.com
> >
> > # remove compressed interface files at 30 days old
> > #
> > file pattern: interface.*\.dat.Z
> > remove days: 30
> >
> > ...
>
> With a slight syntax change, you could probably use
> something like Config::IniFiles for this.
>
>   [compressor]
>   pattern = interface.*.dat
>   time = 15d
>   notify = ...@...
>
>   [remove]
>   pattern = ...
>   time = 30d
>   ...
>
> You can then iterate over the various [] sections...
>
> A search for "config" at http://search.cpan.org/ turned up
> a few likely-looking modules.
>
> hth
> t
> --
> Beep beep!  Out of my way, I'm a motorist!



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

Date: 18 Jul 2001 22:03:48 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Generic Language interpreter in Perl?
Message-Id: <slrn9lc1vo.nor.abigail@alexandra.xs4all.nl>

Ed Kulis (ekulis@apple.com) wrote on MMDCCCLXXVIII September MCMXCIII in
<URL:news:3B55F3A9.459E068@apple.com>:
)) Hi,
)) 
)) I find myself always wanting to write little languages in configuration
)) files and then to interpret them.
)) 
)) So is there something in perl that would allow me to define a language
)) grammer, interpret it and then call appropriate perl modules or
)) subroutines?


Parse::RecDescent.



Abigail
-- 
perl -swleprint -- -_='Just another Perl Hacker'
#    The Lone Merchant departs
#    beside a pond. Bankei
#    laughs near a rooftop.


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

Date: Wed, 18 Jul 2001 18:53:42 GMT
From: Greg <ethernaut43@yahoo.com>
Subject: Getting error on Oracle CLOB insert using PERL DBI
Message-Id: <3B55DE5F.BF68DAE7@yahoo.com>

Hi;
I've searched through the newsgroups but haven't found an answer:

I am trying to insert a large amount of text (greater than 4K) into a
CLOB field in my Oracle 8.1.5 table, using the PERL DBI. I get the
following error:

ORA-01461: can bind a LONG value only for insert into a LONG column (DBD

ERROR: OCIStmtExecute)

Does anyone know if this is a bug in either Oracle or the PERL DBI
modules?

Thanks a million for any suggestions

Greg



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

Date: Wed, 18 Jul 2001 18:20:06 GMT
From: Haber Schabernackel <schabernackel@hotmail.com>
Subject: Re: How to timeout a socket recv under win32?
Message-Id: <1104_995480789@f3bpc14>

On Wed, 18 Jul 2001 12:25:45 GMT, Bart Lateur <bart.lateur@skynet.be> wrote:
> Benjamin Goldberg wrote:
> 
> >> So you mean recv().
> >
> >Umm, what do you mean by that comment?
> 
> Oops, I have ben mixing threads. I cconfused this with another current
> thread, where the OP asked how you can know how many bytes there are
> currently available for reading.
> 
> It all boils down to this: how do you receive all the data that the
> other side is sending to you, without waiting for more that won't come?
> How do you know that, for the moment, the transmission is complete?

Can't you just receive something from a socket with <HANDLE> ?
I'm not sure if this solution is bulletproof, but works for me:
(althougt it sometimes hangs, not sure where, any comments?
i've tried $sock->timeout(10) but it doesnt seem to work)

use IO::Socket;
my $host='www.perl.com';
my $sock=IO::Socket::INET->new("$host:80");
$sock->autoflush(1);
my $EOL="\015\012";
my($http,$html);
print $sock "GET / HTTP/1.1${EOL}Host: $host$EOL$EOL";
1../^[\s$EOL]*$/ ? ($http.=$_) : ($html.=$_) while <$sock>;
close($sock);

 
> <S>, read, sysread, recv are similar yet different. I guess that only
> read() is not usable. select() or IO::Select can tell you that something
> is available, but not how much. I have the feeling that there isn't a
> real generic solution, that the sender somehow HAS to indicate how long
> the transmission will be. Otherwise, the receiver can stop receiving too
> soon, or wait for something that won't come.
> 
> -- 
> 	Bart.




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

Date: Wed, 18 Jul 2001 16:37:12 -0500
From: Donald Davis <dbdavids@uiuc.edu>
Subject: I cannot get imagemagick working either
Message-Id: <3B560188.430A56C1@uiuc.edu>

Can someone tell me step by step how to get imagemagick working, I keep
screwing something up.

Donald



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

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


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