[21881] in Perl-Users-Digest
Perl-Users Digest, Issue: 4085 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 8 11:07:03 2002
Date: Fri, 8 Nov 2002 08:05:13 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 8 Nov 2002 Volume: 10 Number: 4085
Today's topics:
"on-the-fly" gfx creation <tk@WINDOZEdigiserv.net>
Re: "on-the-fly" gfx creation <tk@WINDOZEdigiserv.net>
#!/usr/local/bin/perl <g-preston1@ti.com>
[ANNOUNCE] Tk::MinMaxScale 0.05 released (Jean-Pierre Vidal)
Re: A vision for Parrot (Cameron Laird)
ANNOUNCE: Curses::Widgets & Curses::Forms v.1996 relea (Arthur Corliss)
awstats - logfile names problem <oliver@email.ch>
button groups <g-preston1@ti.com>
Checking a window exists? <spikey-wan@bigfoot.com>
Re: file order in opendir DH <chris.harris@cwfi.co.fk>
How to globally override a module function? <phlipcpp@yahoo.com>
Image::Magick <willis3140@_no_YAHOO_spam.com>
listing values <g-preston1@ti.com>
Re: listing values <fxn@hashref.com>
Looking for directions : spawning independent CGIs <ole.voss@netrogue.de>
Re: Object in @INC returning Tie::Handles from INC meth (Bryan Castillo)
perl array into sql database <rwh2100@hotmail.com>
Perl Tk Memory Leak (TD)
Regex *faster* with ignorecase <Andreas.Karrer-02@gmx.net>
Re: script to modify database table as different user <tech7890@yahoo.com>
Re: Simple question - What is unicode? <flavell@mail.cern.ch>
Re: Simple question - What is unicode? (Villy Kruse)
Re: Simple question - What is unicode? (Alan Barclay)
Re: Simple question - What is unicode? <flavell@mail.cern.ch>
Re: system("rm filename") <s_grazzini@hotmail.com>
Re: system("rm filename") <jurgenex@hotmail.com>
Re: What is this: "sub myFunc ($$) {" (Tad McClellan)
Re: What is this: "sub myFunc ($$) {" <member@mainframeforum.com>
Re: What is this: "sub myFunc ($$) {" <bernard.el-hagin@DODGE_THISlido-tech.net>
Re: What is this: "sub myFunc ($$) {" (Tad McClellan)
Re: Why not PERL? <cingram@pjocsNOSPAMORHAM.demon.co.uk>
Re: Why not PERL? (Tad McClellan)
Re: Why not PERL? <fxn@hashref.com>
Re: Why not PERL? (hymie!)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 08 Nov 2002 11:20:15 GMT
From: tk <tk@WINDOZEdigiserv.net>
Subject: "on-the-fly" gfx creation
Message-Id: <hc7nsu84ufpuo0uuq5h8e5roe26tr36b2l@4ax.com>
Mornin all =)
Has anyone got any info as to what (if any) modules/libs are required
for generating graphics on the fly from within Perl scripts?
I have the GD lib installed which I use from PHP on some sites, but
would like to know what's required to be able to do a similar task from
Perl.
Any information appreciated.
Thanks in advance =)
Regards,
tk
--
+--------------------------+
| digiServ Network |
| Web solutions |
| http://www.digiserv.net/ |
+--------------------------+
Remove WINDOZE to reply
------------------------------
Date: Fri, 08 Nov 2002 11:24:44 GMT
From: tk <tk@WINDOZEdigiserv.net>
Subject: Re: "on-the-fly" gfx creation
Message-Id: <on7nsu4oqiq4066536e0f12v83mhq6toh7@4ax.com>
In a fit of excitement on Fri, 08 Nov 2002 11:20:15 GMT, tk
<tk@WINDOZEdigiserv.net> managed to scribble:
| Mornin all =)
|
| Has anyone got any info as to what (if any) modules/libs are required
| for generating graphics on the fly from within Perl scripts?
|
| I have the GD lib installed which I use from PHP on some sites, but
| would like to know what's required to be able to do a similar task from
| Perl.
|
| Any information appreciated.
|
| Thanks in advance =)
|
|
| Regards,
|
| tk
After searching more on google.. found the GD module (and a GD::Graph
mod) that appears to be what's required. Please feel free to ignore the
above request.
Regards,
tk
--
+--------------------------+
| digiServ Network |
| Web solutions |
| http://www.digiserv.net/ |
+--------------------------+
Remove WINDOZE to reply
------------------------------
Date: Fri, 8 Nov 2002 09:49:14 -0600
From: "Jerry Preston" <g-preston1@ti.com>
Subject: #!/usr/local/bin/perl
Message-Id: <aqgmea$ome$1@tilde.itg.ti.com>
Hi!,
Is it passable to have a script look at two different startup lines in a
script:
#!/usr/local/bin/perl
#!/usr/bin/perl
I have 20 servers with to many different locations for perl?
Thanks,
Jerry
------------------------------
Date: 7 Nov 2002 12:08:38 -0800
From: jeanpierre.vidal@free.fr (Jean-Pierre Vidal)
Subject: [ANNOUNCE] Tk::MinMaxScale 0.05 released
Message-Id: <3dcbdac0$1_2@news.teranews.com>
Tk::MinMaxScale is a composite widget wrapping 2 Scale(s)
Its goal is to obtain two values defining a range narrower than the
range defined for both Scale(s), say '-from' and '-to' options.
url : www.cpan.org/authors/id/J/JP/JPVIDAL/Tk-MinMaxScale-0.05.readme
url : www.cpan.org/authors/id/J/JP/JPVIDAL/Tk-MinMaxScale-0.05.tar.gz
------------------------------
Date: Fri, 08 Nov 2002 12:47:39 -0000
From: claird@lairds.com (Cameron Laird)
Subject: Re: A vision for Parrot
Message-Id: <usncjb4tdjbbbf@corp.supernews.com>
In article <aqdpsq$5ur$4@srv38.cas.org>, <lvirden@yahoo.com> wrote:
.
.
.
>Perhaps Guile programmers never saw a need for the facilities of perl/tcl/
>python.
.
.
.
Guile dynamics are rather interesting, from what I
know. There's a LOT to say about the needs Guile
programmers see.
One particular point of possible interest: there
was, quite predictably a Guile Tk (guile-tk) <URL:
http://wiki.tcl.tk/GuileTk >.
--
Cameron Laird <Cameron@Lairds.com>
Business: http://www.Phaseit.net
Personal: http://phaseit.net/claird/home.html
------------------------------
Date: Mon, 04 Nov 2002 01:49:50 -0000
From: corliss@freya.gallanttech.lan (Arthur Corliss)
Subject: ANNOUNCE: Curses::Widgets & Curses::Forms v.1996 released
Message-Id: <3dcbdacd$1_7@news.teranews.com>
Greetings:
Parallel releases of Curses::Widgets and Curses::Forms have just been released
as v1.996. These are available on both my digitalmages.com site and CPAN.
The v.199x are beta-quality versions, and are being made available for testing
prior to the v2.0 release of both modules.
Description:
============
Curses::Widgets consists of an OO base class from which curses widgets can be
derived. It also includes a basic set of widgets for immediate use:
ButtonSet
Calendar
ComboBox
Label
ListBox
Menu
ProgressBar
TextField
TextMemo
This package also includes helpful functions to simplify colour control and
garnering input. Tutorials on both usage and widget creation are present as
well.
Curses::Forms provides OO-based control and manipulation of collections of
widgets on a form. A few basic dialogs are provided for convenience as well:
Dialog
Input
Logon
The combined use of both modules provide a faster and easier way to implement
curses-based user interfaces with your current Perl scripts. And being
OO-based, it's also flexible and extensible enough to meet most of your needs.
--
--Arthur Corliss
Bolverk's Lair -- http://arthur.corlissfamily.org/
Digital Mages -- http://www.digitalmages.com/
"Live Free or Die, the Only Way to Live" -- NH State Motto
------------------------------
Date: Fri, 08 Nov 2002 15:30:19 GMT
From: Oliver Spiesshofer <oliver@email.ch>
Subject: awstats - logfile names problem
Message-Id: <fMQy9.302780$ab3.273416@fe02>
Hi,
I am running the latest version of awstats on a apache server.
the current months logfile is always called
domainname.com.access_log
however, each other days logfiles are called
dmoainname.com.access_log.01Nov2002.gz
and so on for each day.
how can I acces those?
thanks
Oliver
------------------------------
Date: Fri, 8 Nov 2002 06:19:31 -0600
From: "Jerry Preston" <g-preston1@ti.com>
Subject: button groups
Message-Id: <aqga53$5e9$1@tilde.itg.ti.com>
Hi!
I two sets of buttons in my script:
group 1
print $query->button( -name=>'SysFail',
-value=>'Failed in System',
);
print $query->button( -name=>'DOA',
-value=>'DOA',
);
print $query->button( -name=>'DiagEscape',
-value=>'Diag Escape',
);
group 2
print $query->button( -name=>Good,
-value=>GOOD',
);
print $query->button( -name=>'Bad',
-value=>'BAD',
);
print $query->button( -name=>'Very Bad',
-value=>'VERY_BAD',
);
group 3
print $query->submit( -name => 'Submit',
-value => 'Send'
);
print $query->button( -name=>'PRINT',
-value=>'Print',
);
print $query->reset;
print $query->submit( -name=>'QUIT',
-value=>'Quit',
);
They inter react with each other. Is it possible to have the buttons not
react with each other? How to do this?
Thanks,
Jerry
------------------------------
Date: Fri, 8 Nov 2002 11:46:26 -0000
From: "Richard S Beckett" <spikey-wan@bigfoot.com>
Subject: Checking a window exists?
Message-Id: <aqg87u$2ci$1@newshost.mot.com>
Guys,
I'm using active state perl on win32, Tk for my gui, and Tk::ErrorDialog for
any errors that occur.
I have a start button on my main window that initiates a subroutine. At the
start of the routine, I open a "working, please wait" window, and at the end
of the routine I destroy it.
Unfortunately if an error occurs, then Tk::ErrorDialog steps in, and the
"working, please wait" window does not get destroyed.
I can add another destroy in another part of the script, but if all works
well, then this destroy causes an error, as the window it tries to destroy
is already gone.
How can I do a check for the existence of the window, so I can destroy it if
it still exists?
Thanks.
R.
------------------------------
Date: Fri, 8 Nov 2002 11:00:46 -0300
From: "Chris Harris" <chris.harris@cwfi.co.fk>
Subject: Re: file order in opendir DH
Message-Id: <aqgg4g$9lr84$1@ID-134007.news.dfncis.de>
Maybe it wasn't there 10 or 12 years, maybe it was. I'm afraid I don't
remember using it.
Cheers anyway.
"Benjamin Goldberg" <goldbb2@earthlink.net> wrote in message
news:3DCADCCB.C8AA779@earthlink.net...
> Chris Harris wrote:
> >
> > Thanks go everyone who replied. I have the anser now.
> >
> > Last time I programmed anything was using C many years ago and there
> > were no handy sort routines then, you had to do it all yourself, I
> > thought there must have been something suitable in Perl, which seems
> > to have everything built in :-)
>
> This is rather OT for perl, but doesn't C have qsort()?
>
> --
> my $n = 2; print +(split //, 'e,4c3H r ktulrnsJ2tPaeh'
> ."\n1oa! er")[map $n = ($n * 24 + 30) % 31, (42) x 26]
------------------------------
Date: Fri, 08 Nov 2002 14:51:24 GMT
From: Phlip <phlipcpp@yahoo.com>
Subject: How to globally override a module function?
Message-Id: <MbQy9.6655$II7.6008@newssvr19.news.prodigy.com>
New title, new day. I thought this question would have been easy for a
lifer.
Phlip wrote:
> Perlies:
>
> I like unit tests. My employers like Win32, VC++, and Perl. So here I
> am writing an "acceptance test" rig for our VC++ code, and it calls
> Perl embedded in the C++ code.
>
> When an assertion fails, such as this one...
>
> $self -> assert ($result =~ /LW is god/);
>
> ...I want the VC++ Output window to contain the file name, line
> number, and spit-list of the failure:
>
> c:\projects\testage.pm:14: get a clue, homey...
>
> That way I can tap <F4> and go straight to the offending line in the
> editor. No more reading & GotoLine-ing. That's the computer's job.
>
> (Other Perl editors may support these kinds of features before the new
> Millenium is old...)
>
> So first I get OutputDebugString from here:
>
> Win32-API-OutputDebugString-0.03.tar.gz
>
> Now I feel like overriding Test::Unit::Debug::debug so it also pushes
> text out OutputDebugString:
>
> use Test::Unit::Debug;
> {
> package Test::Unit::Debug;
> *Test::Unit::Debug::debug = sub {
> my ($package, $filename, $line) = caller();
> print $out "***************************************that's the
> facts, Jack!\n";
> print $out @_ if $DEBUG{$package};
> }
> }
>
> That's as far as I can decipher the documentation on global hostile
> takeover-style overrides. But even with "strict" and "-w" turned off,
> Perl still screams at me: "Subroutine debug redefined..."
>
> Then, if Perl think's it's "redefined" (past-tense), why don't Perl
> then call it?
>
> How am I expected to do this?
>
> (BTW I can't "inherit" Test::Unit::Debug and then overload because the
> other Test-Unit stuff won't call my derived class.)
>
--
Phlip
http://www.greencheese.org/SkeletonCrew
-- Have a :-) day --
------------------------------
Date: Fri, 08 Nov 2002 13:49:48 GMT
From: w i l l <willis3140@_no_YAHOO_spam.com>
Subject: Image::Magick
Message-Id: <r5gnsu4v1lual8r7jh3frudqvobha2hmp6@4ax.com>
Could some one show me an example of how to retreive and uploaded
image via CGI and then resize it so that the width is always 94px with
Image::Magick?
Thanks,
W i l l
------------------------------
Date: Fri, 8 Nov 2002 09:26:36 -0600
From: "Jerry Preston" <g-preston1@ti.com>
Subject: listing values
Message-Id: <aqgl3s$fvv$1@tilde.itg.ti.com>
Hi!,
I am trying to look at all of the variables by name with their value. I can
list the value, but not the name.
foreach $is ($query->param) {
print "* value is *$is* $%query->param( $key )*<BR>";
}
How do I list the names?
Thanks,
Jerry
------------------------------
Date: Fri, 8 Nov 2002 15:36:23 +0000 (UTC)
From: "F. Xavier Noria" <fxn@hashref.com>
Subject: Re: listing values
Message-Id: <aqglln$hn9$1@news.ya.com>
In article <aqgl3s$fvv$1@tilde.itg.ti.com>, Jerry Preston wrote:
> I am trying to look at all of the variables by name with their value. I can
> list the value, but not the name.
>
> foreach $is ($query->param) {
> print "* value is *$is* $%query->param( $key )*<BR>";
> }
>
> How do I list the names?
Read the section
FETCHING THE NAMES OF ALL THE PARAMETERS PASSED TO YOUR SCRIPT:
in CGI.pm's documentation.
-- fxn
------------------------------
Date: Fri, 8 Nov 2002 15:12:56 +0100
From: "Ole Voss" <ole.voss@netrogue.de>
Subject: Looking for directions : spawning independent CGIs
Message-Id: <aqggp5$9t88l$1@ID-118921.news.dfncis.de>
Hi,
just a quick summary of my problem. Maybe somebody here can point me in the
right direction:
I want to do some database administration using a web-interface.
Once the file is uploaded the Perl script has a lot of work to do. Because
the browser doesn't wait long enough for the script to finish, but rather
reports a server error (after approx. 5 min) I would like to seperate the
tasks from one another.
My Idea was to spawn a child process and keep the browser busy reloading a
dynamically created html-page. Unfortunately it seems that it's not possible
since the execution of the perl script is bound to the http-server-user and
process.
Any ideas?
Regards,
Ole.
------------------------------
Date: 8 Nov 2002 07:54:25 -0800
From: rook_5150@yahoo.com (Bryan Castillo)
Subject: Re: Object in @INC returning Tie::Handles from INC method
Message-Id: <1bff1830.0211080754.495840c3@posting.google.com>
Benjamin Goldberg <goldbb2@earthlink.net> wrote in message news:<3DCB731E.D76BF311@earthlink.net>...
> Bryan Castillo wrote:
> >
> > I've been trying to come up with a way to load perl modules out of zip
> > files, by appending an object that implements an INC method, onto the
> > end of @INC.
>
> Have you considered the ex::lib::zip module from CPAN?
D**m CPAN! Every time I think of something fun to write. It's already
done. (or half way). It just takes all the joy out of it. :)
------------------------------
Date: Sat, 9 Nov 2002 02:36:02 +1100
From: "Rodney Hunter" <rwh2100@hotmail.com>
Subject: perl array into sql database
Message-Id: <BQQy9.25839$Sr6.748171@ozemail.com.au>
newbie using perl CGI script - i have data in an array (passed by POST) and
need to get it into sql database(Oracle) - here's my attempt that's not
working - where's the perl code errors?
thanks
Rodney Hunter
do 'dbi-lib.pl';
use CGI ':standard';
use DBI;
use strict;
my $q = new CGI;
# get value passed from form
my $thisjobno = $q->param('job_no');
my @veg_type = $q->param('veg_type');
# SQL insert statement
my $query1 = "insert into ea_veg (job_no, veg_type, veg_status) values
('$thisjobno', '@veg_type', 1)";
# Database DBI driver name
my $dbname = "DBI:Oracle:";
# Create database handle
my $dbh = DBI->connect($dbname, $user, $passwd);
if (!$dbh) {
showSQLerror("Connecting to the database");
return;
} else {
# set AutoCommit 1 = ON, 0 = OFF (1 is default)
# transaction control *required* here - set OFF
$dbh->{AutoCommit} = 0;
}
# Insert the data fetched
while ((@veg_type) = $sth->fetchrow_array) {
my ($veg_insert);
$veg_insert = run_statement($dbh,$query1,"N");
if ($veg_insert == 1) {
$dbh->rollback;
$dbh->disconnect;
return;
}
else {
# Commit transaction and disconnect from database
$dbh->commit;
$dbh->disconnect;
}
} # end of fetch while
------------------------------
Date: 8 Nov 2002 07:17:32 -0800
From: tushar08@yahoo.com (TD)
Subject: Perl Tk Memory Leak
Message-Id: <584a8362.0211080717.383da3c2@posting.google.com>
Hello all,
Perl TK Module has a memory leak. I am not sure of this. I am running
Perl on Win 32
***************************************************************
This is perl, v5.6.1 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-2001, Larry Wall
Binary build 631 provided by ActiveState Tool Corp.
http://www.ActiveState.com
Built 17:16:22 Jan 2 2002
****************************************************************
Here is the program I am running
use Tk;
$top = MainWindow -> new;
$top->withdraw;
$cb = sub {
do_func();
};
$top->repeat(100,$cb);
MainLoop();
sub do_func() {
my $x = "Sample String\n";
my $y = $x;
print STDOUT $x;
undef $x;
undef $y;
return;
}
if you run this through DOS Command prompt, you will notice perl.exe
taking up ~4000K. Minimize the command window and restore again. NOW
you will memory growing continuously. Can anybody please explain if
this is memory leak or normal behaviour.
Thanks for you help.
Tushar
------------------------------
Date: 8 Nov 2002 17:00:35 +0100
From: Andreas Karrer <Andreas.Karrer-02@gmx.net>
Subject: Regex *faster* with ignorecase
Message-Id: <slrnasnnt2.3uk.Andreas.Karrer-02@irgendwo.switzerland.org>
Over in de.comp.lang.perl.misc, we found a counter-intuitive
misbehaviour of a regex match. The program
#!/usr/bin/perl
$_ = "Hello World\n" x 10000 . "Goodbye Perl\n";
m/^Hello\s+Perl$/mg;
takes more than a second cpu time even on fast hardware. However, if
we use the /i modifier or (?i) within the regex, the program runs
almost instantaneously. (In both cases, there is no match, of course.)
It turns out that the regex optimizer, before applying the regex, finds
that the search text must contain some fixed-length strings, "Hello"
and "Perl".
If either of those is not found, it can immediately declare failure.
Unfortunately, the floating substring `Perl' is indeed found, but only
at the end of the 120-KB-String.
That alone woudn't be all that bad, but it appears that the substring
searches for "Perl$" are repeated at each new trial location:
Found anchored substr `Hello' at offset 0...
Found floating substr `Perl'$ at offset 120008...
Found anchored substr `Hello' at offset 11...
Found floating substr `Perl'$ at offset 120007...
Found anchored substr `Hello' at offset 11...
Found floating substr `Perl'$ at offset 119995...
Found anchored substr `Hello' at offset 11...
Found floating substr `Perl'$ at offset 119983...
...
Found anchored substr `Hello' at offset 11...
Found floating substr `Perl'$ at offset 43...
Found anchored substr `Hello' at offset 11...
Found floating substr `Perl'$ at offset 31...
This apparently takes a lot of time.
When using the /i modifier, these anchored and floating string
optimizations are not made, and the match returns much faster.
- Andi
------------------------------
Date: Fri, 8 Nov 2002 09:21:38 -0500
From: "Andrew" <tech7890@yahoo.com>
Subject: Re: script to modify database table as different user
Message-Id: <aqgh5d$ovc$1@news.monmouth.com>
"peter pilsl" <pilsl_use@goldfisch.at> wrote in message
news:3dcb18ad$1@e-post.inode.at...
> Why not use a server-client-solution (via a socket)
> The server runs "unreachable" for the user and has all the
> logon-information. The user-script sends its data to this server and the
> server sends it to the sql-database.
>
good point. i know others have mentioned a "wrapper" binary to me. i know
how to write a cgi script which could do what you say, but how do i restrict
access to the script in apache? .htaccess still passes the password in
clear text.
> This is merely what each webbased CMS does where we dont want to have all
> users to edit all the database but only certain tables or rows/cols.
can you provide any links with more information you idea? how do i bind the
script to a different port? i have a web server running apache on port 80
already.
>
> peter
>
> --
> peter pilsl
> pilsl_@goldfisch.at
> http://www.goldfisch.at
>
Thank you!
-----
Andrew
tech7890REMOVETHIS@yahoo.com
remove 'REMOVETHIS' chars from e-mail address above to e-mail me
------------------------------
Date: Fri, 8 Nov 2002 12:20:05 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Simple question - What is unicode?
Message-Id: <Pine.LNX.4.40.0211081203380.3267-100000@lxplus074.cern.ch>
On Nov 7, Malcolm Dew-Jones inscribed on the eternal scroll:
> I still stand by my underlying issues. Unicode originated as an extremely
> simple idea.
As far as I recall, some significant features on the road to today's
unicode were:
* the decision to converge the initially competing iso-10646 and
Unicode developments
* character encoding schemes.
* Han unification
> By simply increasing the size of the elementry unit of data,
> almost all textual language/character data transmision issues are dealt
> with while still retaining extremenly simple and obvious data handling
> techniques.
And, by your scheme, creating a new fixed limit of 16 bits.
To my way of thinking, the introduction of the key distinction between
the character code (the unique identification of each character with a
specific integer value), and a character encoding scheme (of which
there are several, chosen according to circumstances) is one of the
significant features of unicode/iso-10646, rather than being a
pointless and counter-productive complication as you would apparently
have us believe.
But surely this takes us too far OT for the group. In fact I had
composed a longer reply to your earlier posting, last night, but then
I had ruled myself off-topic and discarded it.
cheers
------------------------------
Date: 08 Nov 2002 12:22:42 GMT
From: vek@station02.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: Simple question - What is unicode?
Message-Id: <slrnasnb4i.jio.vek@station02.ohout.pharmapartners.nl>
On 7 Nov 2002 13:19:32 -0800,
Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca> wrote:
>
>ASCII was created when 7 bits was the value normally available.
>
The eighth bit was used as parity bit, which at that time was considered
usefull.
Villy
------------------------------
Date: 8 Nov 2002 13:11:34 GMT
From: gorilla@elaine.furryape.com (Alan Barclay)
Subject: Re: Simple question - What is unicode?
Message-Id: <1036761094.843477@elaine.furryape.com>
In article <Pine.LNX.4.40.0211081203380.3267-100000@lxplus074.cern.ch>,
Alan J. Flavell <flavell@mail.cern.ch> wrote:
>On Nov 7, Malcolm Dew-Jones inscribed on the eternal scroll:
>> By simply increasing the size of the elementry unit of data,
>> almost all textual language/character data transmision issues are dealt
>> with while still retaining extremenly simple and obvious data handling
>> techniques.
>
>And, by your scheme, creating a new fixed limit of 16 bits.
And 16 bits isn't enough to code all the characters in all the
natural languages used in the world.
------------------------------
Date: Fri, 8 Nov 2002 14:26:32 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Simple question - What is unicode?
Message-Id: <Pine.LNX.4.40.0211081407100.3267-100000@lxplus074.cern.ch>
On Nov 7, Malcolm Dew-Jones inscribed on the eternal scroll:
> xml doesn't allow the smart quotes because they're in the value range
> where, if the eigth bit where removed, then the value would be a control
> code.
You seem to have missed out at least 3 steps of the reasoning
which, very indirectly, led to that.
> Allowing these values to be used might, therefore, in some
> situations involving old equipment
No: &#number; representations in XML (as also in HTML) require the
_Unicode_ code value of the character, nothing more and nothing less,
irrespective of which character coding you are using: the range
128-159 in Unicode doesn't contain any displayable charaters, and such
values are illegal in XML (and "undefined" in HTML).
Admittedly, at two or more steps removed, the original cause of that
was the way in which the iso-8859-1 code was defined; but that's past
history.
> To ensure that nobody using this equipment could ever be inconvenienced in
> this manner, the standards people decided to be slightly incompatible with
> the character set used by the vast majority of computer users,
The "character set" of XML is Unicode. It's irrelevant that in your
opinion the "vast majority" of computer users are using Windows-125x
codings.
You're perfectly entitled to send XML using Windows-1252 coded
characters - if you so choose and if the other party agrees. This has
absolutely _nothing_ to do with the numbers which appear in &#number;
representations in XML. So I'm afraid your rant missed the target
again.
------------------------------
Date: Fri, 08 Nov 2002 14:43:02 GMT
From: Steve Grazzini <s_grazzini@hotmail.com>
Subject: Re: system("rm filename")
Message-Id: <W3Qy9.91382$Up6.19929761@twister.nyc.rr.com>
Tan Nguyen <nospam@nospam.com> wrote:
>
> system returns the exit value of the command that is run.
> Conventionally, programs return 0 for success, and rm simply
> follows this. Negation of the return value of system might
> not report the right exit status as in the case of system
> failing to run the command (for example, it returns undef).
If perl's fork or exec fails, system() will return -1 and $! will
be set appropriately.
> The safe way is checking the exit status as you know how it's
> supposed to be.
> system("rm $filename") == 0 or die "cannot remove $filename: $!\n";
But if the exec succeeded and the external program failed, $! is
garbage and you need to examine $? instead.
> You can also use Perl's built-in function unlink to remove file
> unlink $filename or die "failed to unlink $filename: $!\n";
Much better...
--
Steve
perldoc -qa.j | perl -lpe '($_)=m("(.*)")'
------------------------------
Date: Fri, 08 Nov 2002 15:14:49 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: system("rm filename")
Message-Id: <JxQy9.63$Dl.23@nwrddc01.gnilink.net>
Lois wrote:
> If I need to delete a file and prompt message for failure to do
> so.
>
> if (-e "filename")
> {
> system("rm filename") || die "error\n";
> }
>
> but this code always end with a die. I tried to capture the value for
> system("rm filename") and I got a 0 for success and 256 for
> non-success.
Does that surprise you? It is the documented behaviour of "system".
Please check the documentation of the function you are using.
> can i just negate the command to obtain the correct
> answer?
This is also documented in "perldoc -f system".
However, the real question is why are you writing complicated, slow, and
non-portable code instead of using the simpler, faster, and portable Perl
solution "unlink"?
jue
------------------------------
Date: Fri, 8 Nov 2002 07:10:02 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: What is this: "sub myFunc ($$) {"
Message-Id: <slrnasndta.2ka.tadmc@magna.augustmail.com>
yisraelharris <member@mainframeforum.com> wrote:
> I have seen functions declared like this:
>
> sub myFunc ($$) { .... }
>
> What exactly does the "$$" mean?
It means that myFunc takes 2 scalar arguments.
Perl's subroutines are documented in:
perldoc perlsub
See the "Prototypes" section.
See also:
"Far More Than Everything You've Ever Wanted to Know about
Prototypes in Perl"
http://www.perl.com/pub/a/language/misc/fmproto.html
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 8 Nov 2002 08:08:10 -0500
From: yisraelharris <member@mainframeforum.com>
Subject: Re: What is this: "sub myFunc ($$) {"
Message-Id: <3dcbb73a$1_5@news.onlynews.com>
3 helpful people have responded -- thanks to you all.
However, I still don't know the answer.
I had actually already read the perlsub documentation under prototypes,
but I didn't understand it, because it uses a lot of terms with which I
am unfamiliar. In general, I find the Perl documentation very difficult
to understand, compared to documentation I have seen on other languages.
Here's how the section on prototyping begins:
Perl supports a very limited kind of compile-time argument checking
using function prototyping. If you declare
sub mypush (\@@)
then mypush() takes arguments exactly like push() does. The function
declaration must be visible at compile time. The prototype affects only
interpretation of new-style calls to the function, where new-style is
defined as not using the & character.
I don't understand any of this.
Later on, it said this:
Declared as: sub mylink ($$) Called as: mylink $old, $new
I have no idea on earth what this means.
Is there someone out there who can explain it in very simple terms?
So, back to the original question: in
sub myFunc ($$) { ..... }
What does the ($$) do?
Thank you.
--
www.MainFrameForum.com - USENET Gateway
------------------------------
Date: Fri, 8 Nov 2002 13:32:07 +0000 (UTC)
From: Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: What is this: "sub myFunc ($$) {"
Message-Id: <slrnasnbh8.53f.bernard.el-hagin@gdndev25.lido-tech>
In article <3dcbb73a$1_5@news.onlynews.com>, yisraelharris wrote:
>
> So, back to the original question: in
>
> sub myFunc ($$) { ..... }
>
> What does the ($$) do?
The simplest possible answer is that if you declare a function like
this:
sub myFunc ($$) {
# wonka wonka
}
You're saying that myFunc() takes two scalar arguments. If then you
try to call myFunc() with, say, *three* scalar arguments you'll get an
error. Again, this is a very simple explanation and you really should
make the effort to understand the docs to learn more.
Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'
------------------------------
Date: Fri, 8 Nov 2002 08:06:56 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: What is this: "sub myFunc ($$) {"
Message-Id: <slrnasnh80.30g.tadmc@magna.augustmail.com>
yisraelharris <member@mainframeforum.com> wrote:
> However, I still don't know the answer.
Even people that _do_ understand Perl's prototypes often choose
to not use them.
If you don't understand them, then just don't use them.
If you just "want to know", then press on...
> I had actually already read the perlsub documentation under prototypes,
> but I didn't understand it, because it uses a lot of terms with which I
> am unfamiliar.
Do you have Computer Science training/education?
Most of the terms used are standard fare in CS.
> Here's how the section on prototyping begins:
>
> Perl supports a very limited kind of compile-time argument checking
> using function prototyping. If you declare
>
> sub mypush (\@@)
>
> then mypush() takes arguments exactly like push() does.
perldoc -f push
push ARRAY,LIST
so mypush() takes an array as first arg and a list as the second arg.
> Later on, it said this:
>
> Declared as: sub mylink ($$) Called as: mylink $old, $new
>
> I have no idea on earth what this means.
This means that the mylink() subroutine must be called with
two scalars as arguments. If it is called any other way,
it is an error.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 8 Nov 2002 12:29:58 -0000
From: "Clyde Ingram" <cingram@pjocsNOSPAMORHAM.demon.co.uk>
Subject: Re: Why not PERL?
Message-Id: <aqgam1$baa$1$830fa7b3@news.demon.co.uk>
David,
"David K. Wall" <usenet@dwall.fastmail.fm> wrote in message
news:Xns92BF908246542dkwwashere@216.168.3.30...
> cp <cpryce@pryce.net> wrote on 07 Nov 2002:
>
> I recently ran across a program that claimed full support for "Pearl's
> regular expressions". Um... ok....
>
> "Oook."
Is it just Urban Myth (possibly not widely known) that "Pearl" was someones
wife/girlfriend/mistress, and this is merely hinted at in the chosen name
"Perl". (Sure I read that - but cannot recall where . . .)
Clyde
------------------------------
Date: Fri, 8 Nov 2002 07:01:54 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Why not PERL?
Message-Id: <slrnasnde2.2ka.tadmc@magna.augustmail.com>
Clyde Ingram <cingram@pjocsNOSPAMORHAM.demon.co.uk> wrote:
> David,
>
> "David K. Wall" <usenet@dwall.fastmail.fm> wrote in message
> news:Xns92BF908246542dkwwashere@216.168.3.30...
>> cp <cpryce@pryce.net> wrote on 07 Nov 2002:
>>
>> I recently ran across a program that claimed full support for "Pearl's
>> regular expressions". Um... ok....
> Is it just Urban Myth (possibly not widely known) that "Pearl" was someones
> wife/girlfriend/mistress, and this is merely hinted at in the chosen name
> "Perl". (Sure I read that - but cannot recall where . . .)
Larry had considered naming it "Gloria" after his wife.
Maybe that's what you were thinking of.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 8 Nov 2002 14:51:32 +0000 (UTC)
From: "F. Xavier Noria" <fxn@hashref.com>
Subject: Re: Why not PERL?
Message-Id: <aqgj1j$enj$1@news.ya.com>
In article <aqgam1$baa$1$830fa7b3@news.demon.co.uk>, Clyde Ingram wrote:
> David,
>
> "David K. Wall" <usenet@dwall.fastmail.fm> wrote in message
> news:Xns92BF908246542dkwwashere@216.168.3.30...
>> cp <cpryce@pryce.net> wrote on 07 Nov 2002:
>>
>> I recently ran across a program that claimed full support for "Pearl's
>> regular expressions". Um... ok....
>>
>> "Oook."
>
> Is it just Urban Myth (possibly not widely known) that "Pearl" was someones
> wife/girlfriend/mistress, and this is merely hinted at in the chosen name
> "Perl". (Sure I read that - but cannot recall where . . .)
From the interview you can read in
http://www.linuxjournal.com/article.php?sid=3394
Marjorie: Well, that certainly answered the question fully. I must admit I
didn't expect you to go back as far as the beginning of the Universe. :-)
How'd you come up with that name?
Larry: I wanted a short name with positive connotations. (I would never name
a language `Scheme'' or `Python'', for instance.) I actually looked at every
three- and four-letter word in the dictionary and rejected them all. I
briefly toyed with the idea of naming it after my wife, Gloria, but that
promised to be confusing on the domestic front. Eventually I came up with
the name `pearl'', with the gloss Practical Extraction and Report Language.
The `a'' was still in the name when I made that one up. But I heard rumors
of some obscure graphics language named `pearl'', so I shortened it to
`perl''. (The `a'' had already disappeared by the time I gave Perl its
alternate gloss, Pathologically Eclectic Rubbish Lister.)
Another interesting tidbit is that the name `perl'' wasn't capitalized at
first. UNIX was still very much a lower-case-only OS at the time. In fact, I
think you could call it an anti-upper-case OS. It's a bit like the folks who
start posting on the Net and affect not to capitalize anything. Eventually,
most of them come back to the point where they realize occasional
capitalization is useful for efficient communication. In Perl's case, we
realized about the time of Perl 4 that it was useful to distinguish between
`perl'' the program and `Perl'' the language. If you find a first edition of
the Camel Book, you'll see that the title was Programming perl, with a small
`p''. Nowadays, the title is Programming Perl.
-- fxn
------------------------------
Date: Fri, 08 Nov 2002 15:37:01 -0000
From: hymie@lactose.smart.net (hymie!)
Subject: Re: Why not PERL?
Message-Id: <usnmgt2oenk928@corp.supernews.com>
In our last episode, the evil Dr. Lacto had captured our hero,
"TBN" <ihave@noemail.com>, who said:
>I've only been using Perl for a couple of months, so I'll admit to ignorance
>here, but according to ActiveState, Perl stands for "Practical Extraction
>and Report Language". If that's the case, it should be PERL.
As many people have already said, the name "perl" came before the acronym.
More imporantly, however, is that a very large number of us use computer
languates that are case-sensitive. This makes the name "perl" that much
more important.
erich-x:~> PERL
zsh: command not found: PERL
erich-x:~>
You might even say that it would be grammatically incorrect to
capitalize it at the beginning of a sentence, because it's a name and
thus a proper (but lowercase) noun, much like e. e. cummings.
hymie! http://www.smart.net/~hymowitz hymie@lactose.smart.net
===============================================================================
------------------------------
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 4085
***************************************