[19574] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1769 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 18 18:08:01 2001

Date: Tue, 18 Sep 2001 15:05:11 -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: <1000850710-v10-i1769@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 18 Sep 2001     Volume: 10 Number: 1769

Today's topics:
        2002 USENIX ANNUAL TECHNICAL CONFERENCE - CALL FOR PAPE <mktgadm@usenix.org>
        Combining messages sent to user (Donnajeanne Liu)
    Re: Combining messages sent to user <jurgenex@hotmail.com>
    Re: Combining messages sent to user <Jon.Ericson@jpl.nasa.gov>
    Re: convert time string to date format <bart.lateur@skynet.be>
    Re: debug CGI script <bart.lateur@skynet.be>
        Decode Base64 <megastopholes@hotmail.com>
    Re: finding out working directory <gnarinn@hotmail.com>
        Help with $ENV{'PATH'} statement <robert.rawlinson@worldnet.att.net>
    Re: Help with $ENV{'PATH'} statement (Malcolm Dew-Jones)
    Re: HELP!  Having Trouble concatenating or joining and  <gnarinn@hotmail.com>
    Re: HELP!  Having Trouble concatenating or joining and  <gnarinn@hotmail.com>
    Re: html 2 xml <ilya@martynov.org>
    Re: html 2 xml (Chris Fedde)
    Re: http PUT method <tintin@snowy.calculus>
    Re: Looking for Perl programers in Toronto <sun_tong@users.sourceforge.net>
    Re: Lotus Notes <lmoran@wtsg.com>
    Re: Numeric check on data with underscore <gnarinn@hotmail.com>
    Re: object to string and back to object..... <bart.lateur@skynet.be>
        Opinion <musinguzi@usa.net>
    Re: Opinion <rsherman@ce.gatech.edu>
        package initialization <sun_tong@users.sourceforge.net>
        Perl English only?????? <nospam@newsranger.com>
    Re: Perl English only?????? <Laocoon@eudoramail.com>
    Re: Perl English only?????? <tsee@gmx.net>
    Re: Perl English only?????? <jurgenex@hotmail.com>
        PERL VARIABLE IN JAVASCRIPT (ALERT) <dima@caramail.com>
    Re: PERL VARIABLE IN JAVASCRIPT (ALERT) <philip@zaynar.demon.co.uk>
    Re: Persistence in Perl (Chris Fedde)
        split SuchKindOfWord into individual words <sun_tong@users.sourceforge.net>
    Re: split SuchKindOfWord into individual words <skuo@mtwhitney.nsc.com>
    Re: split SuchKindOfWord into individual words (Chris Fedde)
    Re: split SuchKindOfWord into individual words <mbudash@sonic.net>
    Re: split SuchKindOfWord into individual words <rsherman@ce.gatech.edu>
    Re: What does this do ? "select( (select($writer), $|=1 <uri@sysarch.com>
    Re: write to a file handle (Joe Chung)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 18 Sep 2001 12:58:51 -0700
From: Ann Tsai <mktgadm@usenix.org>
Subject: 2002 USENIX ANNUAL TECHNICAL CONFERENCE - CALL FOR PAPERS
Message-Id: <mktgadm-B820A4.12585118092001@reader.news.uu.net>

2002 USENIX Annual Technical Conference
June 9-14, 2002
Monterey, CA
http://www.usenix.org/events/usenix02/

The USENIX Annual Technical Conference is the core conference for the 
USENIX community and a premier forum for computing professionals to 
share the results of their latest and best work, develop new ideas and 
solutions, and connect with their colleagues.

The 2002 Annual Technical program committee seeks original and 
innovative papers about the applications, architecture, implementation, 
and performance of modern computing systems. Possible application topics 
include, but are not limited to:

*Cluster computing         *File systems and storage systems
*Complexity management     *Distributed caching and replication
*Mobile code            *Mobile/Wireless computing
*Reliability and QoS       *Security and privacy
*Interoperability of heterogeneous systems

Submissions to the General Refereed Sessions Track are due on November 
19, 2001.

FREENIX is a special track within the USENIX Annual Technical Conference 
that showcases the latest developments and applications in freely 
redistributed technology. The FREENIX track covers the full range of 
software and source code including but not limited to Apache, Darwin, 
FreeBSD, GNOME, GNU, KDE, Linux, NetBSD, OpenBSD, Perl, PHP, Python, 
Samba, Tcl/Tk and more.

The FREENIX progam committee is looking for papers about projects with a 
solid emphasis on nurturing the open source/freely available software 
community and talks which advance the state of the art of freely 
redistributable software. Areas of interest include, but are not limited 
to:

*Cross-platform source portability and binary compatibility
*Free Software development/mgmt  *File system design
*Storage Systems     *Highly scalable and clustered systems
*Security         *System and user management tools
*Quality Assurance      *Large scale system management

Submissions to the Freenix Track are due on November 12, 2001.

Submission guidelines and conference details are available on our 
website:
http://www.usenix.org/events/usenix02/cfp/

Join us in developing the best technical conference program of 2002!

====================================================================
The 2002 USENIX Annual Technical Conference is sponsored by
USENIX, The Advanced Computing Systems Association. www.usenix.org
====================================================================


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

Date: 18 Sep 2001 11:43:40 -0700
From: dliu2@umbc.edu (Donnajeanne Liu)
Subject: Combining messages sent to user
Message-Id: <82751023.0109181043.24b07ff5@posting.google.com>

How could I combine perl files so that only one message would be
emailed to the user as opposed to three different messages.


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

Date: Tue, 18 Sep 2001 12:01:10 -0700
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Combining messages sent to user
Message-Id: <3ba799fe@news.microsoft.com>

"Donnajeanne Liu" <dliu2@umbc.edu> wrote in message
news:82751023.0109181043.24b07ff5@posting.google.com...
> How could I combine perl files so that only one message would be
> emailed to the user as opposed to three different messages.

What Perl files are you talking about?
With "combine" do you mean some sort of archive, like e.g. zip or tar?
If you want one email instead of three, then just send only one. I can only
guess here but do you send the perl files as attachements? Then just attach
all three to the first mail.

Really, without some more information it's to everyone's guess what you want
to do

jue




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

Date: 18 Sep 2001 11:15:55 +0000
From: Jon Ericson <Jon.Ericson@jpl.nasa.gov>
Subject: Re: Combining messages sent to user
Message-Id: <86r8t4kavo.fsf@jon_ericson.jpl.nasa.gov>

dliu2@umbc.edu (Donnajeanne Liu) writes:

> How could I combine perl files so that only one message would be
> emailed to the user as opposed to three different messages.

You need to provide some sort of context before this question starts
to make sense.  I assume you have some code that sends email--possibly
based on input from an HTML form.  It sends three emails rather than just
one.  You'd like to change it but you don't know how.

If you are a programmer, you should try your best to make the changes
yourself.  If you run into problems, look at the documentation that
comes with perl.  After that, you could try posting some code--ideally
short, self-contained code along with inputs, outputs, expected
outputs and relevant information about you environment.

If you are not a programmer and have no desire to learn, you're going
to have to bit the bullet and hire one.

Jon


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

Date: Tue, 18 Sep 2001 20:29:02 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: convert time string to date format
Message-Id: <sabfqt0tpvfea32qealkkuhhgsa40m8vuj@4ax.com>

Thomas Bätzler wrote:

>Use the Time::Local module. If you time spec is GMT, replace timelocal
>with timegm.
>
>#!/usr/bin/perl -w
>
>use strict;
>use Time::Local;
>
>my %month = (
>  'Jan' => 0, 'Feb' => 1, 'Mar' => 3,
>  'Apr' => 0, 'May' => 1, 'Jun' => 3,
>  'Jul' => 0, 'Aug' => 1, 'Sep' => 3,
>  'Oct' => 0, 'Nov' => 1, 'Dec' => 11 );
>
>my $datetime = "Mon Sep 17 16:49:46 2001";
>
>my( undef, $mm, $dd, $h, $m, $s, $yy ) =
>  split /[ :]+/, $datetime;
>
>$mm = $month{$mm};
>
>my $ticks = timelocal($s,$m,$h,$dd,$mm,$yy);
>
>print "$datetime is $ticks seconds after 0:00:00 on 1. 1. 1970\n";

This prints:

Mon Sep 17 16:49:46 2001 is 987518986 seconds after 0:00:00 on 1. 1.
1970

That value seems too low to me, since we recently passed the 1E9 mark.
And it is:

	print scalar localtime($ticks);
-->
	Tue Apr 17 16:49:46 2001

Gee. 5 months low. I wonder why. Most probably because your %month hash
has such weird values.

-- 
	Bart.


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

Date: Tue, 18 Sep 2001 21:06:19 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: debug CGI script
Message-Id: <umcfqtgmmcnhlum5ufnvhb4ctb6d3uld47@4ax.com>

Joe Chung wrote:

>On Mon, 17 Sep 2001 09:29:16 GMT, Bart Lateur <bart.lateur@skynet.be>
>wrote:
>

>>I don't ever debug perl scripts that way, and most definitely not CGI
>>scripts.

>then, how you debug your CGI script?  

[and in another follow-up:]

>I mean for HTTP POSTing

Whether it's GET or POST, shouldn't really make a difference. You should
make use of a library that gets the data passed from the browser to the
CGI irrespective of whether it's in GET or in POST mode. Use CGI,
CGI::Request, CGI::Minimal or something of your own devising (just make
sure it's well debugged), or even the old cgi-lib.pl, I don't care. But
get that problem out of the way first.

And then, it's just debugging with a twist.

I never use a debugger to go through my code. Single-stepping is
impractical, you're not getting anywhere interesting fast; and when you
do, you find you're already past the point of interest. Grrr. So what
can you do? Set breakpoints and "go"? Well alright. Then what will you
do when you get at that breakpoint? Most likely, you'll inspect some
data. It's *very* likely that you already know beforehand what you will
do when you get there. So why do it manually? Why not make it part of
the script? Then you can tweak the script and repeat as often as you
like, till you get it right.

That's right, I mostly do debugging by printing. The most useful tool
perl has for that aim, is the module Data::Dumper. It will allow you to
print any perl data structure, as data structure constructing perl code,
and see if you get what you expect. The main problem I have with this
module, on Windows, is that for larger data structures, arrays or hashes
containing thousands of records, it will take ages, and then eventually
still give you an "out of memory" error. So, keep them data structures
small.

And the second tool, is using perl's warnings, and setting
$SIG{__WARN__} so that every warning can also give you a dump of the
relevant program data. That way, you can quickly pinpoint the problem,
which, unless you get a warning every time through a loop, commonly
turns out to be irregularities in the data.

That's all in general. More specifically aimed at CGI: with a module
like CGI::Carp, you can print out "die" messages, and now even warnings
(commonly as HTML comments), to your browser. That's a  lot handier than
having to look for them in the server error log.

-- 
	Bart.


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

Date: Tue, 18 Sep 2001 18:08:07 -0400
From: "megaStopholes" <megastopholes@hotmail.com>
Subject: Decode Base64
Message-Id: <9o8gbl$bhoh9$1@ID-100510.news.dfncis.de>

I'm looking at the Digest-MD5 module...
is there a decode_base64 somewhere?


--
'les




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

Date: Tue, 18 Sep 2001 17:44:49 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: finding out working directory
Message-Id: <1000835089.901475788094103.gnarinn@hotmail.com>

In article <93aad7d0.0109171148.2f09284d@posting.google.com>,
Joachim Ziegler <ziegler@algorilla.de> wrote:
>with perl, how do i find out 
>in which directory my script currently is?

use FindBin;

gnari


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

Date: Tue, 18 Sep 2001 19:24:04 GMT
From: Robert Rawlinson <robert.rawlinson@worldnet.att.net>
Subject: Help with $ENV{'PATH'} statement
Message-Id: <3BA79F26.329AC329@worldnet.att.net>

I was given a script to dial up an ISP and it has a line in
it which says:
    $ENV{'PATH'} = ' '; and a comment #make $ENV{'PATH'}
untainted
I thin this is to set the path in env to empty. If this is
wrong please let ;me know.
The problem is that while this statement works as root when
I am a user and try to run it I get the message:
    Insecure $ENV{BASH_ENV} while running setuid at
/usr/sbin/ppp-on line 29
What is the cause and cure for this problem? Thanks for any
help/enlightenment you can offer.
Bob

--
Robert A.Rawlinson             | Check us out at:
                                            |
robert.rawlinson.home.att.net
Felicity Ohio 45120




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

Date: 18 Sep 2001 13:05:55 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Help with $ENV{'PATH'} statement
Message-Id: <3ba7a923@news.victoria.tc.ca>

Robert Rawlinson (robert.rawlinson@worldnet.att.net) wrote:
: I was given a script to dial up an ISP and it has a line in
: it which says:
:     $ENV{'PATH'} = ' '; and a comment #make $ENV{'PATH'}
: untainted
: I thin this is to set the path in env to empty. If this is
: wrong please let ;me know.
: The problem is that while this statement works as root when
: I am a user and try to run it I get the message:
:     Insecure $ENV{BASH_ENV} while running setuid at

The script must be using the variable $ENV{BASH_ENV} . 

The data in that variable is tainted because it comes from outside the
script. 

You need to determine what to do to make the data in the variable
trustworthy so you can untaint it.

If the BASH_ENV variable is hard coded into a shell script that calls the
perl script, and over which you have the same control as the perl script,
then you can simply apply an RE to the variable to untaint it.

If the BASH_ENV variable is not under your reliable control then you need
to figure out how to check the value is ok, and/or force it to be ok. 
Sometimes the easiest thing to do is to simply figure out the desired
value that will work in your situation and then hard code that value into
the script. 




: /usr/sbin/ppp-on line 29
: What is the cause and cure for this problem? Thanks for any
: help/enlightenment you can offer.
: Bob

: --
: Robert A.Rawlinson             | Check us out at:
:                                             |
: robert.rawlinson.home.att.net
: Felicity Ohio 45120



--
Want to access the command line of your CGI account?  Need to debug your
installed CGI scripts?  Transfer and edit files right from your browser? 

What you need is "ispy.cgi" - visit http://nisoftware.com/ispy.cgi


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

Date: Tue, 18 Sep 2001 18:22:45 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: HELP!  Having Trouble concatenating or joining and making or  building  a url with ActivePerl and the '.' operator.
Message-Id: <1000837365.732562429271638.gnarinn@hotmail.com>

In article <4b459565.0109180512.a5df23d@posting.google.com>,
codeslayer <weedmonster_99@yahoo.com> wrote:


(comments removed from following quote)

>#!/usr/bin/perl -w
>$rtpath = "http://www.news.com";
>$picrt = "pageq_";
>$count = 06;	#(or whatever the count is at the time,)
>$ext = "html";
>
>$url_t1 = "$rtpath/$picrt$count.$ext";

this is fine

>$url_t2 = "$rtpath/$picrt$count..$ext";

the '.' is not interpolated in any ways inside a double quote string
so this will give you http://www.news.com/pageq_6..html as you would
expect

>$url_t3 = "$rtpath/" . "$picrt" . "$count" . ".$ext";

this is fine

>$url_t4 = "$rtpath/$picrt$count.\$ext";

here you quote the last '$', so $ext is not longer interpolated.
so you get the unsurprising http://www.news.com/pageq_6.$ext

>All that works on my AIX box at work, but doesn't seem to display
>correctly in ActivePerl 5 on my Win32 system.
>
>Here is the output in AIX (seems like the first and third work):
>
>~> makeurltest.pl
>http://www.news.com/pageq_6.html
>http://www.news.com/pageq_6..html
>http://www.news.com/pageq_6.html
>http://www.news.com/pageq_6.$ext

yep, looks normal.

so what *do* you get from activeperl?

my guess is that you are not running the same script on both machines
if you do not get the same output

gnari


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

Date: Tue, 18 Sep 2001 18:10:43 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: HELP!  Having Trouble concatenating or joining and making or building  a url with ActivePerl and the '.' operator.
Message-Id: <1000836643.858893102500588.gnarinn@hotmail.com>

In article <4b459565.0109171619.fe41924@posting.google.com>,
codeslayer <weedmonster_99@yahoo.com> wrote:
>HELP!  Having Trouble concatenating or joining and making or building 
>a url with ActivePerl and the '.' operator.
>------------------------------------------------------------------------------
>
>
>I have what seems like a simple question.   It has nothing to do with
>Web pages or CGI in the strictest sense, but it is definitely a Perl
>issue:
>
>I am having significant trouble utilizing the standard "dot"
>concatenation operator to "build" a URL.   Here is an illustration of
>what I am trying to do,  the output desired, and the actual output:
>
>
>The url will be of the form:
>
>$rtpath/$picrt$count.$ext

(useless verbosity that does not show actual code snipped)

so how about
  $url="$rtpath/$picrt$count.$ext";
?

gnari


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

Date: 18 Sep 2001 22:37:59 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: html 2 xml
Message-Id: <87k7ywny48.fsf@abra.ru>

>>>>> On Tue, 18 Sep 2001 17:07:24 GMT, "Dave Palmer" <dave@nospam.stratumonline.com.del> said:

DP> Hello all...
DP> I am writing this script that reads an HTML file, and does some basic
DP> transformations so that it could be considered a well formatted XML
DP> document.

DP> Any example of what I'm talking about is... if you come across this line:

DP> <br>

DP> In XML, this is not well formatted... but <br/> is

DP> I just started writing this script and before I get too married to the
DP> technique I am using, I felt it would be benefitial to get some feedback or
DP> some pointers...

DP> [..skip..]

DP> This just seems to be getting too nasty looking, and I could be
DP> dealing with thousands of files, and then not only is this nasty
DP> its also slow and painful. So, before I plunge headfirst into this
DP> and make a bigger mess...  thought I'd get some advice :)

Parse HTML files with HTML::Parser.

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)                                    |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)                          |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


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

Date: Tue, 18 Sep 2001 19:55:28 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: html 2 xml
Message-Id: <QENp7.512$Owe.288877056@news.frii.net>

In article <87k7ywny48.fsf@abra.ru>, Ilya Martynov  <ilya@martynov.org> wrote:
>>>>>> On Tue, 18 Sep 2001 17:07:24 GMT, "Dave Palmer"
><dave@nospam.stratumonline.com.del> said:
>
>DP> Hello all...
>DP> I am writing this script that reads an HTML file, and does some basic
>DP> transformations so that it could be considered a well formatted XML
>DP> document.
>
>DP> [..skip..]
>
>DP> This just seems to be getting too nasty looking, and I could be
>DP> dealing with thousands of files, and then not only is this nasty
>DP> its also slow and painful. So, before I plunge headfirst into this
>DP> and make a bigger mess...  thought I'd get some advice :)
>
>Parse HTML files with HTML::Parser.
>

I like to procss most of my HTML through tidy before doing anything with it
using a perl script  http://www.w3.org/People/Raggett/tidy/ If your goal is
just a conversion to well formed XHTML then tidy is just what you want.

Good Luck
-- 
    This space intentionally left blank


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

Date: Wed, 19 Sep 2001 07:49:27 +1000
From: "Tintin" <tintin@snowy.calculus>
Subject: Re: http PUT method
Message-Id: <MkPp7.6$F15.177296@news.interact.net.au>


"Insub" <insub@charter.net> wrote in message
news:tqctkh8dvrdrc8@corp.supernews.com...
> I'd like to test http PUT method using Perl.

Congratulations.

Assuming you're using the CGI module, then just test it from the command
line.




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

Date: 18 Sep 2001 18:06:28 -0300
From: * Tong * <sun_tong@users.sourceforge.net>
Subject: Re: Looking for Perl programers in Toronto
Message-Id: <sa84rq06wff.fsf@suntong.personal.users.sourceforge.net>

"hallaj.com" <wael@hallaj.com> writes:

> I'm looking for perl programers in Toronto. Contact me if you know one.

Hi, 

I don't know how serious you are, so first a quick question. What
kind of programing environment/project is it? 

I'm graduating soon, and I've had more than 4 years of Perl
programming experience. 

Best Regards

-- 
Tong (remove underscore(s) to reply)
  *niX Power Tools Project: http://xpt.sourceforge.net/
  - All free contribution & collection


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

Date: Tue, 18 Sep 2001 17:38:11 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: Lotus Notes
Message-Id: <8iffqtgi4je6sgkn8hf9f336ol9u102feq@4ax.com>

On Mon, 17 Sep 2001 19:43:32 -0400, "Steve K"
<skradel@mindspring.common.sense> wrote wonderful things about
sparkplugs:

>This is _probably_ not something most Notes admins will know.  It's more of
>a developer issue... and most Notes developers won't have a clue about other
>systems/languages.  There are lots of ways to get at Notes data, but they
>all have their "special" traits...
>
As a Notes Admin all I can say is, "Man is he right."
As a Notes Developer who has tried to use Perl to do my bidding with
Notes all I can say is, "I can't wait to see what Steve comes up with.


SNIP

--
TMTOWTDI, but not all of them work...
lmoran@wtsg.com


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

Date: Tue, 18 Sep 2001 17:41:47 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: Numeric check on data with underscore
Message-Id: <1000834907.833266863133758.gnarinn@hotmail.com>

In article <9eca2bc5.0109171128.7c62e22@posting.google.com>,
kiran dronamraju <dronamk@yahoo.com> wrote:
>I'm having problems with numeric checks on data with underscore.
>I am aware the numeric literals can have _ as a character as a
>thousands separator. However, I'd want the data to be treated as
>Non-Number.
>Below is a sample depicting the problem.
>Any help is appreciated and gladly accepted. Thanks.
>
>#! (whence perl)
>$x = 123_456_;

here you are using a numeric literal.

but here is a string:
 $x= "123_456_";

gnari


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

Date: Tue, 18 Sep 2001 19:31:27 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: object to string and back to object.....
Message-Id: <lq7fqts8t98m93vislusclf83v65mrkjps@4ax.com>

Weston Cann wrote:

>I'm looking for a solution that will enable me to dump arbitrary
>perl data structures to a string, and transform that string, in turn,
>back into an arbitrary data structure.
>
>Data::Dumper and Data::Dump are close, but there's one problem: I'd like
>some mechanism other than eval for transforming the string representation
>back to a data structure.

Storable?

>The reason is that it's likely I'll be passing
>the string representation as a parameter from a web based form, and letting
>people execute arbitrary perl code from a web form generally won't do. :)

Note that Storable will convert the data into binary, so if you'll have
to encode your binary bytes into text... maybe using base64 encoding, as
I think it will take the fewest of bytes. Certainly less then one of
"%xx" per byte...

-- 
	Bart.


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

Date: Tue, 18 Sep 2001 17:35:10 -0400
From: "Hannington Musinguzi" <musinguzi@usa.net>
Subject: Opinion
Message-Id: <9o8em9$jlf$1@bob.news.rcn.net>

I would call it the  "Slimemernater". I would call it that because it is a
controller and it controlles the slime buckets and a controller is simlier
to a robot, but smaller version.That's the reason I would call it the
"Slimernater".








                                                                   From,
Nancy Musinguzi
                                                          Princeton,NJ





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

Date: Tue, 18 Sep 2001 17:52:54 +0500
From: Robert Sherman <rsherman@ce.gatech.edu>
Subject: Re: Opinion
Message-Id: <3BA743A6.33DBABE1@ce.gatech.edu>

Hannington Musinguzi wrote:
> 
> I would call it the  "Slimemernater". I would call it that because it is a
> controller and it controlles the slime buckets and a controller is simlier
> to a robot, but smaller version.That's the reason I would call it the
> "Slimernater".
> 
>                                                                    From,
> Nancy Musinguzi
>                                                           Princeton,NJ


$ perldoc -f slimernator
No documentation for perl function `slimernater' found
$

-- 
robert sherman
css, cee
georgia institute of technology
atlanta, ga, usa


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

Date: 18 Sep 2001 16:11:36 -0300
From: * Tong * <sun_tong@users.sourceforge.net>
Subject: package initialization
Message-Id: <sa8d74o71qv.fsf@suntong.personal.users.sourceforge.net>

Hi,

Don't understand why my package initialization fails. Before I get
into details, Is there any good site tutor on writing a package? 
Is there a good template that I use as my first blue print? 

Now back to my question. I have a dbg_init function, which open a
file for the rest of its life session:

sub dbg_init {
    require IO::File;

    $fd = new IO::File;
    $fd->open(">>$debuglog") ||
	die "Can't write to $debuglog $!";
    print $fd "\n\n\n##########\n" . localtime(). "\n";
    $fd->autoflush(1);
}

Is it ok to call this init script at the bottom of the package?:

dbg_init();
1;

I found the consecutive writing to $fd will only work if the
dbg_init is called outside of my package (in main), but not
within. Can anybody explain why? ( I declared local $fd;)

Thanks

-- 
Tong (remove underscore(s) to reply)
  *niX Power Tools Project: http://xpt.sourceforge.net/
  - All free contribution & collection


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

Date: Tue, 18 Sep 2001 19:53:32 GMT
From: Anonymoose <nospam@newsranger.com>
Subject: Perl English only??????
Message-Id: <0DNp7.4699$p77.15971@www.newsranger.com>

Is Perl written in one language based? Like are all the strings in English, or
say if you are German do you write the strings in  German. Thank You




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

Date: Tue, 18 Sep 2001 22:02:43 +0200
From: Laocoon <Laocoon@eudoramail.com>
Subject: Re: Perl English only??????
Message-Id: <Xns9120E1996B8F4Laocooneudoramail@62.153.159.134>

i dun get it..sorry..


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

Date: Tue, 18 Sep 2001 22:16:24 +0200
From: "Steffen Müller" <tsee@gmx.net>
Subject: Re: Perl English only??????
Message-Id: <9o89p9$3c8$07$1@news.t-online.com>

"Anonymoose" <nospam@newsranger.com> schrieb im Newsbeitrag
news:0DNp7.4699$p77.15971@www.newsranger.com...
> Is Perl written in one language based? Like are all the strings in
English, or
> say if you are German do you write the strings in  German. Thank You

You can call your vars whatever you like.

Call them $call_me_whatever_you_want (don't actually, that's usually just
too long), $nenn_mich_wie_du_willst, $adskjsadjksalkdlas or maybe just use
some descriptive name in any language you like.

However, keep in mind that you'll make code difficult for non-Germans to
read if you do use German names...

 ... and you might want help one day :)

Steffen





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

Date: Tue, 18 Sep 2001 15:03:15 -0700
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Perl English only??????
Message-Id: <3ba7c4a3$1@news.microsoft.com>

"Anonymoose" <nospam@newsranger.com> wrote in message
news:0DNp7.4699$p77.15971@www.newsranger.com...
> Is Perl written in one language based? Like are all the strings in
English, or
> say if you are German do you write the strings in  German. Thank You

Well, the string will be whatever you put in them, be it English, German,
Chinese, or Arabic.
If you want a user-friendly UI then by all means use strings in the language
the user understands best or even use multi-lingual techniques and check the
users locale to determine the most appropriate language.

jue




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

Date: Tue, 18 Sep 2001 21:12:57 GMT
From: "Dima" <dima@caramail.com>
Subject: PERL VARIABLE IN JAVASCRIPT (ALERT)
Message-Id: <tNOp7.2452$1M2.1369236@carnaval.risq.qc.ca>

Hi there,

In Perl, I would like to read from a file and output its content in a
javascript alert.


while (<SOURCEFILE>)
{
    $message= $message . $_ ;  #Read line by line and append it to the
$message variable
}

print("<SCRIPT> alert(\"${message}\"); <SCRIPT>");


When I run the perl page, I get an error.

However, if I write the following instead:
print("${message}");
The correct content is shown.

And if instead of reading from a file I write: $message="test"; then the
alert correctly displays "test".

Does anyone know why I cannot display the file's content in an alert? (is
there a limit in an alert? I tried entering a long text and it worked)

THANKS!




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

Date: Tue, 18 Sep 2001 22:46:45 +0100
From: Philip Taylor <philip@zaynar.demon.co.uk>
Subject: Re: PERL VARIABLE IN JAVASCRIPT (ALERT)
Message-Id: <xu8yBDAFD8p7Ew5p@zaynar.demon.co.uk>

In article <tNOp7.2452$1M2.1369236@carnaval.risq.qc.ca>, Dima
<dima@caramail.com> writes
>Hi there,
>
>In Perl, I would like to read from a file and output its content in a
>javascript alert.
>
>
>while (<SOURCEFILE>)
>{
>    $message= $message . $_ ;  #Read line by line and append it to the
>$message variable
>}
>
>print("<SCRIPT> alert(\"${message}\"); <SCRIPT>");
>
>
>When I run the perl page, I get an error.

It would help to say what the error is, but one problem could be
$message containing double quotes, which would confuse Javascript.

Try using something like

  $message =~ s/"/\\"/g;

to replace "s with \"s, thus changing an error-producing

  alert("He said, "Hello world"")

into a working

  alert("He said, \"Hello world\"")

-- 
Philip Taylor
philip @ zaynar . demon . co . uk

http://robowarriors.ultrastore.com/legoworld.shtml
  -- If the Earth was made of Lego...


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

Date: Tue, 18 Sep 2001 20:09:48 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Persistence in Perl
Message-Id: <gSNp7.513$Owe.310801920@news.frii.net>

In article <3BA78C28.3000603@prodigio.com>,
Miguel Manso  <mmanso@prodigio.com> wrote:
>Hi wonder if you can use Memoize with object methods has well... that 
>would be great...
>

Looks like it works to me...

#!/usr/bin/perl -l

package Fib;
use strict;
use warnings;

use Memoize;
memoize ('new');

sub new {
    shift;
    my $n = shift;

    return $n if ($n < 2);

    return Fib->new($n -2) + Fib->new($n - 1);
}

package main;

print(Fib->new(100));

-- 
    This space intentionally left blank


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

Date: 18 Sep 2001 17:27:28 -0300
From: * Tong * <sun_tong@users.sourceforge.net>
Subject: split SuchKindOfWord into individual words
Message-Id: <sa88zfc6y8f.fsf@suntong.personal.users.sourceforge.net>

Hi,

I'm wondering if there are some neat ways to split SuchKindOfWord
into individual words, i.e., Such Kind Of Word. 

Any tip will be appreciated. Thanks

-- 
Tong (remove underscore(s) to reply)
  *niX Power Tools Project: http://xpt.sourceforge.net/
  - All free contribution & collection


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

Date: Tue, 18 Sep 2001 13:47:09 -0700
From: Steven Kuo <skuo@mtwhitney.nsc.com>
Subject: Re: split SuchKindOfWord into individual words
Message-Id: <Pine.GSO.4.21.0109181345070.22568-100000@mtwhitney.nsc.com>

On 18 Sep 2001, * Tong * wrote:

> Hi,
> 
> I'm wondering if there are some neat ways to split SuchKindOfWord
> into individual words, i.e., Such Kind Of Word. 
> 
> Any tip will be appreciated. Thanks
> 

Use look-behind and look-ahead assertions to define a boundary
between lowe and upper case letters:

split (/(?<=[a-z])(?=[A-Z])/,$string);

-- 
Cheers,
Steve



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

Date: Tue, 18 Sep 2001 20:47:39 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: split SuchKindOfWord into individual words
Message-Id: <LpOp7.516$Owe.267347456@news.frii.net>

In article <sa88zfc6y8f.fsf@suntong.personal.users.sourceforge.net>,
* Tong *  <sun_tong@users.sourceforge.net> wrote:
>Hi,
>
>I'm wondering if there are some neat ways to split SuchKindOfWord
>into individual words, i.e., Such Kind Of Word. 
>
>Any tip will be appreciated. Thanks
>

I'm sure that the golf pros can do better than this but here is my attempt:

perl -e 'print "$1 "while("SuchKindOfWord"=~/([A-Z][[a-z]+)/g);print"\n"'
-- 
    This space intentionally left blank


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

Date: Tue, 18 Sep 2001 20:52:38 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: split SuchKindOfWord into individual words
Message-Id: <mbudash-4DE2FC.13524018092001@news.sonic.net>

In article <sa88zfc6y8f.fsf@suntong.personal.users.sourceforge.net>, * 
Tong * <sun_tong@users.sourceforge.net> wrote:

> Hi,
> 
> I'm wondering if there are some neat ways to split SuchKindOfWord
> into individual words, i.e., Such Kind Of Word. 
> 
> Any tip will be appreciated. Thanks

based strictly on your example, here's one way:

push @words, $1 while /([A-Z][^A-Z]+)/g;

hth-
-- 
Michael Budash ~~~~~~~~~~ mbudash@sonic.net


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

Date: Tue, 18 Sep 2001 16:54:04 +0500
From: Robert Sherman <rsherman@ce.gatech.edu>
Subject: Re: split SuchKindOfWord into individual words
Message-Id: <3BA735DC.720C52B@ce.gatech.edu>

* Tong * wrote:
> 
> Hi,
> 
> I'm wondering if there are some neat ways to split SuchKindOfWord
> into individual words, i.e., Such Kind Of Word.
> 
> Any tip will be appreciated. Thanks
> 


caps have ordinal values of 65-90, inclusive. you could split the string
into individual cahracters, test their values with ord (perldoc -f ord),
and join them accordingly.

-- 
robert sherman
css, cee
georgia institute of technology
atlanta, ga, usa


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

Date: Tue, 18 Sep 2001 19:23:43 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: What does this do ? "select( (select($writer), $|=1)[0] );" ?
Message-Id: <x7zo7scnfu.fsf@home.sysarch.com>

>>>>> "SB" == Stan Brown <stanb@panix.com> writes:

  SB> Can you read?

can you learn usenet?

  SB> Hopefully someone intelegent enough to actually _read_ the post
  SB> will look at it.

i purposely DID NOT read it. i don't read 5k line posts from anyone. if
i do, i would charge for it. you still don't get how usenet works. get a
clue. hire someone to fix your bug. but don't post moby cruft here. it
doesn't matter what the content, posts of that size is not wanted in
non-binary groups.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Search or Offer Perl Jobs  --------------------------  http://jobs.perl.org


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

Date: Tue, 18 Sep 2001 19:55:38 GMT
From: m_010@yahoo.com (Joe Chung)
Subject: Re: write to a file handle
Message-Id: <3ba7a678.9831887@enews.newsguy.com>

On 18 Sep 2001 15:05:39 GMT, Clay Irving <clay@panix.com> wrote:

>In article <3ba6a115.30075095@enews.newsguy.com>, Joe Chung wrote:
>
>> i found out I must put the "\n" in the end of the string.  why this
>> happen?  Is that if i want to write a line into a filehandle, I must
>> end the line with "\n"?
>
>You don't.
>
>   #!/usr/local/bin/perl
>
>   open F, ">foo3" or die "$!\n";
>   print F "This is a test";
>
>Result:
>
>   clay@energy: cat foo3
>   This is a testclay@energy:

nope, i tried

open(LOCK,">/export/home/admin/log") or die "$!\n";
print LOCK "0aaaa";
close(LOCK);

but it doesn't work. the only way to write to a file handle is end
with \n on each line.

 


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

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


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