[27965] in Perl-Users-Digest
Perl-Users Digest, Issue: 9329 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 21 03:05:47 2006
Date: Wed, 21 Jun 2006 00:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 21 Jun 2006 Volume: 10 Number: 9329
Today's topics:
Re: asyncrhronous system call <jurgenex@hotmail.com>
Re: Find repeating substring <msgrinnell@charter.net>
Gtk2-perl <prameela.vankineni@gmail.com>
How to pronounce $ <hobosalesman@gmail.com>
Re: How to pronounce $ supercrazy74@gmail.com
Re: How to pronounce $ <corff@zedat.fu-berlin.de>
Re: How to pronounce $ <penryu@saiyix.ath.cx>
Re: How to pronounce $ <hoosier45678@hotmail.com>
Re: How to pronounce $ <hobosalesman@gmail.com>
how to replace this like <img width=100 ...> with <img <zhanye815@gmail.com>
Re: how to replace this like <img width=100 ...> with < <tadmc@augustmail.com>
Re: how to replace this like <img width=100 ...> with < <jurgenex@hotmail.com>
Re: how to replace this like <img width=100 ...> with < <tadmc@augustmail.com>
Re: How to select subroutine <benmorrow@tiscali.co.uk>
Re: Looping through Class::Accessor accessors <attn.steven.kuo@gmail.com>
new CPAN modules on Wed Jun 21 2006 (Randal Schwartz)
Re: perl / ajax / js / quoting question <seven.reeds@gmail.com>
Re: perl / ajax / js / quoting question <hobosalesman@gmail.com>
Re: two servers listening on same port ? <sisyphus1@nomail.afraid.org>
Re: two servers listening on same port ? <sisyphus1@nomail.afraid.org>
use of uninitialized value (beginner) <mstep@t-online.de>
Re: use of uninitialized value (beginner) usenet@DavidFilmer.com
Re: What is Expressiveness in a Computer Language <david.nospam.hopwood@blueyonder.co.uk>
Re: What is Expressiveness in a Computer Language <david.nospam.hopwood@blueyonder.co.uk>
Re: What is Expressiveness in a Computer Language <benmorrow@tiscali.co.uk>
Re: What is Expressiveness in a Computer Language <david.nospam.hopwood@blueyonder.co.uk>
Re: What is Expressiveness in a Computer Language <david.nospam.hopwood@blueyonder.co.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 21 Jun 2006 01:56:58 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: asyncrhronous system call
Message-Id: <KH1mg.9345$1G2.9042@trnddc06>
Spin wrote:
> [...] What I am looking for is my script to
> continue running but the system call to not hold up the script. I
> want it to launch and do its thing on its own. How can I do this?
Two ways:
- launch the external program in the background. How to do that depends on
your OS
- fork() a child process and then exec() the external program in the child
jue
------------------------------
Date: 20 Jun 2006 19:35:21 -0700
From: "Mike" <msgrinnell@charter.net>
Subject: Re: Find repeating substring
Message-Id: <1150857321.439533.182640@i40g2000cwc.googlegroups.com>
David Squire wrote:
> Mike wrote:
>
> [big snip]
>
> >
> > Sorry. My mistake. I ran the Perl script with your suggestion and no
> > 37.33/2 (as you noted). As I am trying to also see if this will work
> > in C# code (on demand) I ran it on Expresso as ^(.*).*\1 against the
> > same string and it left the code. Different implementation? I only
> > use regular expressions irregularly and so am merely dangerous with
> > them.
>
> What makes you think that REs in one language will function like those
> in another? [1]
>
> DS
>
> [1] Deliberatively provocative.
I don't expect them to function 'exactly' alike, but I was kind of
expecting similar.... Regular expressions are pretty much like
everything else in my life -- I need to get better at them.
------------------------------
Date: 20 Jun 2006 22:01:56 -0700
From: "prameela" <prameela.vankineni@gmail.com>
Subject: Gtk2-perl
Message-Id: <1150866116.305705.193490@i40g2000cwc.googlegroups.com>
Hai All,
I developed one application in Gtk2-perl.I craeted one setup
for this.To run my application in remote systems i installed gtk 2.8.6
runtime installer,because my gtk version is 2.8.6.My problem is when i
run my application with the same thing in WindowsNT4 it is showing
error as ......
The procedure entrypoint FlashWindowEx could not be
located in the dynamic link library USER32.dll
Can anyone suggest solutin for this.
Thanking You,
prameela
------------------------------
Date: 20 Jun 2006 20:22:40 -0700
From: "Hobo Salesman" <hobosalesman@gmail.com>
Subject: How to pronounce $
Message-Id: <1150860160.504769.198660@y41g2000cwy.googlegroups.com>
I realize this may be a stupid question but if theres one thing I don't
fear it's making an ass of myself.
How do you pronounce $, in the context of it defining a variable? When
I was 10 years old or so and starting programming in basic foo$ was a
string of text, so now for me "$"="string" whenever I see the damn
thing. Now in perl I see $x=1 and a voice in my head says "string x
equals one", which makes me a feel a little daft because unlike basic
the same type holds strings and integers.
"Dollar sign foo" is clumsy, so is the general pronounciation "scalar
foo", "array foo", etc?
------------------------------
Date: 20 Jun 2006 20:27:54 -0700
From: supercrazy74@gmail.com
Subject: Re: How to pronounce $
Message-Id: <1150860474.383346.96060@i40g2000cwc.googlegroups.com>
Hobo Salesman wrote:
> I realize this may be a stupid question but if theres one thing I don't
> fear it's making an ass of myself.
>
> How do you pronounce $, in the context of it defining a variable? When
> I was 10 years old or so and starting programming in basic foo$ was a
> string of text, so now for me "$"="string" whenever I see the damn
> thing. Now in perl I see $x=1 and a voice in my head says "string x
> equals one", which makes me a feel a little daft because unlike basic
> the same type holds strings and integers.
>
> "Dollar sign foo" is clumsy, so is the general pronounciation "scalar
> foo", "array foo", etc?
I would pronounce it as it is, a scalar. So I would say $x=1 as scalar
x equals one. (By the way, if you didnt know, a scalar (a variable
prefixed with $) holds more than just strings and integers.)
------------------------------
Date: 21 Jun 2006 04:39:50 GMT
From: <corff@zedat.fu-berlin.de>
Subject: Re: How to pronounce $
Message-Id: <4fs0smF1kuclnU1@uni-berlin.de>
Hobo Salesman <hobosalesman@gmail.com> wrote:
: I realize this may be a stupid question but if theres one thing I don't
: fear it's making an ass of myself.
: How do you pronounce $, in the context of it defining a variable?
: "Dollar sign foo" is clumsy, so is the general pronounciation "scalar
: foo", "array foo", etc?
Virtually a question self answered. The mnemonics go really as
$calar and @rray (there is no nice catch for the %ash, though).
Read more about pronouncable and/or memorizable names of weird characters
in perldoc perlvar.
Oliver.
--
Dr. Oliver Corff e-mail: corff@zedat.fu-berlin.de
------------------------------
Date: Wed, 21 Jun 2006 04:52:49 GMT
From: Tim Hammerquist <penryu@saiyix.ath.cx>
Subject: Re: How to pronounce $
Message-Id: <slrne9hk51.1dhf.penryu@ruri.saiyix>
Hobo Salesman <hobosalesman@gmail.com> wrote:
> How do you pronounce $, in the context of it defining a variable?
> When I was 10 years old or so and starting programming in basic foo$
> was a string of text, so now for me "$"="string" whenever I see the
> damn thing. Now in perl I see $x=1 and a voice in my head says
> "string x equals one", which makes me a feel a little daft because
> unlike basic the same type holds strings and integers.
I sympathize. Due to my own unfortunate (read: catastrophic) TRS-80
BASIC incident years back, I too still find myself pronouncing '$' as
"string"... even in Perl.
Also, depending on the code in question, I may leave off labels
entirely. If there is only one variable of a given name, a data type
label may be considered redundant.
On my list of things which terrify me most, "Fear of burning alive"
and "Fear of Gallifreyan Bureaucracy" appear *just* below "Fear of
having to read Perl code out loud."
AFAICT, the accepted standard, as mentioned elsewhere in this thread,
is "$tring" and "@rray". Try that.
And as for the lingering BASIC contamination, I know a great
therapist...
Cheers!
Tim Hammerquist
------------------------------
Date: Wed, 21 Jun 2006 01:04:46 -0500
From: James <hoosier45678@hotmail.com>
Subject: Re: How to pronounce $
Message-Id: <pan.2006.06.21.06.04.40.972502@hotmail.com>
On Tue, 20 Jun 2006 20:22:40 -0700, Hobo Salesman wrote:
>
> "Dollar sign foo" is clumsy, so is the general pronounciation "scalar
> foo", "array foo", etc?
round my office it's either "dollar x", "aref x", "hashref x", "function
ref x". Arrays might get "at" or "array" prepended, hashes will get
"hash" prepended, or they may all just be called "x", because we only
speak in code while shoulder surfing, and the name alone should be
unambiguous.
------------------------------
Date: 20 Jun 2006 23:58:36 -0700
From: "Hobo Salesman" <hobosalesman@gmail.com>
Subject: Re: How to pronounce $
Message-Id: <1150873116.153821.139590@m73g2000cwd.googlegroups.com>
Tim Hammerquist wrote:
> I sympathize. Due to my own unfortunate (read: catastrophic) TRS-80
> BASIC incident years back, I too still find myself pronouncing '$' as
> "string"... even in Perl.
Ha, thanks, now I don't feel so bad. It wouldn't be so bad if it were a
throwback from a respectable language, but I feel like if I said it to
someone they'd roll their eyes and expect my next question to be what
Perl's equivalent of "goto" is...
HS
------------------------------
Date: 20 Jun 2006 19:19:26 -0700
From: "zhanye815@gmail.com" <zhanye815@gmail.com>
Subject: how to replace this like <img width=100 ...> with <img width="100" ...>
Message-Id: <1150856366.246944.140310@g10g2000cwb.googlegroups.com>
i want to write a script to convert the html to xhtml,so i want to use
the regular expression to solve some problem like <img width=100
height=100...> converting into <img width="100" height="100"...>.how to
do it?
------------------------------
Date: Tue, 20 Jun 2006 21:29:39 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: how to replace this like <img width=100 ...> with <img width="100" ...>
Message-Id: <slrne9hboj.qs9.tadmc@magna.augustmail.com>
zhanye815@gmail.com <zhanye815@gmail.com> wrote:
> i want to write a script to convert the html to xhtml,so i want to use
> the regular expression to solve some problem like <img width=100
> height=100...> converting into <img width="100" height="100"...>.how to
> do it?
I know how to do that.
But it does not meet your requirement of using a regex so, never mind.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 21 Jun 2006 03:15:15 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: how to replace this like <img width=100 ...> with <img width="100" ...>
Message-Id: <7R2mg.13465$DR1.10125@trnddc02>
zhanye815@gmail.com wrote:
> i want to write a script to convert the html to xhtml,so i want to use
> the regular expression
Now, were is that posting, I know it must be somewhere...
Ah, there it is, just from this morning:
<quote>
As has been mentioned gazillion of times REs are the wrong tool for parsing
HTML.
See "perldoc -q HTML" for details why and for much better approaches.
</quote>
What ever happened to read first, then ask?
> to solve some problem like <img width=100
> height=100...> converting into <img width="100" height="100"...>.how
> to do it?
Simple. By not using the wrong tool but a real ready-made HTML parser from
CPAN.
AFAIR there was even a sample program in the HTML::Parser package that did
something very similar to what you are asking for.
jue
------------------------------
Date: Tue, 20 Jun 2006 22:37:10 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: how to replace this like <img width=100 ...> with <img width="100" ...>
Message-Id: <slrne9hfn6.s0k.tadmc@magna.augustmail.com>
Jürgen Exner <jurgenex@hotmail.com> wrote:
> zhanye815@gmail.com wrote:
>> i want to write a script to convert the html to xhtml,so i want to use
>> the regular expression
> What ever happened to read first, then ask?
> AFAIR there was even a sample program in the HTML::Parser package that did
> something very similar to what you are asking for.
Searching CPAN, or even Google, for "html2xhtml" finds stuff.
I guess we must then guess that this OP did not even look...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 21 Jun 2006 04:54:53 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: How to select subroutine
Message-Id: <dhsmm3-1cu.ln1@osiris.mauzo.dyndns.org>
Quoth "Jan Fure" <janfure@gmail.com>:
>
> Ben Morrow wrote:
> > Yes, but it would be a bad idea. A better answer would be to use a
> > proper lookup table (in Perl, a hash).
> >
> >
> > I would do this like (untested):
> >
> > my %dispatch = (
> > sr2 => sub { $_[1] ** 2 },
> > sr3 => sub { $_[1] ** 3 },
> > );
>
> If I understand you right, you are proposing a hash, with keys from my
> data, and anonymous subroutines linked to the keys.
Yes.
> For my actual code, this would be quite ugly, as the subroutines are
> 20+ lines of code.
FWIW, I don't see how
sub foo {
# 20 lines
}
sub bar {
# 20 lines
}
is substantially less ugly than
my %dispatch = (
foo => sub {
# 20 lines
},
bar => sub {
# 20 lines
},
);
; especially as the subs are all then kept together in an indented
block. However, if you disagree, then you can use
sub foo { ... }
sub bar { ... }
my %dispatch = (
foo => \&foo,
bar => \&bar,
);
just as easily.
> I also need the program to exit with appropriate error message, if
> there is no match between existing subroutine and requested subroutine,
perldoc -f exists
> Could you elaborate on why it is a bad idea to let the subroutine name
> be contained in the data?
Think about what happens if you get a key in your data that is the name
of some other sub, not part of your dispatch table.
If your next thought is to create a special package to keep these subs
in, then consider that a package is just a magical hash, and when you
don't need the magic (like now) it's safer, cleaner and faster to just
use a regular hash.
Ben
--
All persons, living or dead, are entirely coincidental.
benmorrow@tiscali.co.uk Kurt Vonnegut
------------------------------
Date: 20 Jun 2006 19:05:30 -0700
From: "attn.steven.kuo@gmail.com" <attn.steven.kuo@gmail.com>
Subject: Re: Looping through Class::Accessor accessors
Message-Id: <1150855530.345666.161350@y41g2000cwy.googlegroups.com>
Derek Basch wrote:
> Hi Everyone,
>
> I began using Class::DBI and love it. However, there are situations
> where I want to loop through the Class::Accessor accessors for an
> object and also get the name of the accessor as I loop through.
>
> For instance here is some psuedo-perl that I wrote to visualize what I
> need:
>
> # returns an array of objects
> my @gpsaccounts = Database::Members::Gpsaccounts->search($user_id);
>
> # loop through the array of objects
> foreach my @row_class (@gpsaccounts) {
> # loop through the objects accessors
> foreach $class_accessor (@row_class) {
> # print the accessors name and value
> print "$class_accessor_name: $class_accessor_value\n"
> }
> }
>
> Yes, I know that the above is syntactically unpossible but I don't know
> how else to express it.
>
> Here's how you would normally do it:
>
> my @gpsaccounts =
> Database::Members::Gpsaccounts->search_gpsaccounts($user_id);
>
> foreach(@gpsaccounts) {
> print $_->fullname . "\n";
> print $_->user . "\n";
> print $_->email . "\n";
> print "------------------------" . "\n";
> }
>
> Any ideas? I am a newer Perl programmer so any help is appreciated.
My only idea would be to look at the symbol tables
to find function names that match a certain pattern
convention (used by Class::Accessor):
#!/usr/bin/perl
package We;
use base 'Class::Accessor';
__PACKAGE__->mk_accessors(qw/foo bar baz/);
__PACKAGE__->mk_ro_accessors(qw/readonly/);
__PACKAGE__->mk_wo_accessors(qw/writeonly/);
sub new {
my $class = shift;
bless({}, $class)->_init;
}
sub _init {
my $self = shift;
$self->foo("FOO");
$self->bar("BAR");
$self->baz("BAZ");
$self->writeonly("WRITEONLY");
# $self->readonly("READONLY");
$self->{readonly} = "READONLY";
return $self;
}
1;
package You;
@ISA = (qw/We/);
1;
package main;
use strict;
use warnings;
use Devel::Symdump;
use Class::ISA;
my $class = 'You';
my $you = $class->new();
my @classes =
grep { $_ ne 'Class::Accessor' }
Class::ISA::self_and_super_path($class);
my @accessors =
map { /.*::_(.+)_accessor$/ }
Devel::Symdump->functions( @classes );
for my $accessor (@accessors)
{
eval
{
print $you->$accessor(), "\n";
};
warn $@ if $@;
}
--
Hope this helps,
Steven
------------------------------
Date: Wed, 21 Jun 2006 04:42:14 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Jun 21 2006
Message-Id: <J1712E.168r@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
Algorithm-Dependency-Objects-0.02
http://search.cpan.org/~nuffin/Algorithm-Dependency-Objects-0.02/
An implementation of an Object Dependency Algorithm
----
Alzabo-0.89
http://search.cpan.org/~drolsky/Alzabo-0.89/
A data modelling tool and RDBMS-OO mapper
----
Bayonne-Libexec-0.03
http://search.cpan.org/~dyfet/Bayonne-Libexec-0.03/
Perl extension for executing applications under Bayonne 2
----
Bayonne-Server-0.01
http://search.cpan.org/~dyfet/Bayonne-Server-0.01/
Perl extension for invoking Bayonne 2 webservices
----
Bio-FASTASequence-File-0.03
http://search.cpan.org/~reneeb/Bio-FASTASequence-File-0.03/
Perl extension for Bio::FASTASequence
----
Bio-FastaStream-0.03
http://search.cpan.org/~reneeb/Bio-FastaStream-0.03/
Perl extension for Bioinformatics. Parsing sequence informations.
----
Bundle-BugzillaInstall-0.01
http://search.cpan.org/~olegsher/Bundle-BugzillaInstall-0.01/
Perl extension for blah blah blah
----
Business-Tax-VAT-Validation-0.08
http://search.cpan.org/~bpgn/Business-Tax-VAT-Validation-0.08/
A class for european VAT numbers validation.
----
Business-Tax-VAT-Validation-0.09
http://search.cpan.org/~bpgn/Business-Tax-VAT-Validation-0.09/
A class for european VAT numbers validation.
----
Cache-Cascade-0.01
http://search.cpan.org/~nuffin/Cache-Cascade-0.01/
Get/set values to/from a group of caches, with some advanced semantics.
----
Compress-Raw-Bzip2-2.000_13
http://search.cpan.org/~pmqs/Compress-Raw-Bzip2-2.000_13/
Low-Level Interface to bzip2 compression library
----
Compress-Raw-Zlib-2.000_13
http://search.cpan.org/~pmqs/Compress-Raw-Zlib-2.000_13/
Low-Level Interface to zlib compression library
----
Compress-Zlib-2.000_13
http://search.cpan.org/~pmqs/Compress-Zlib-2.000_13/
Interface to zlib compression library
----
DBIx-Romani-0.0.13
http://search.cpan.org/~dsnopek/DBIx-Romani-0.0.13/
----
Devel-XRay-0.92
http://search.cpan.org/~jbisbee/Devel-XRay-0.92/
See What a Perl Module Is Doing
----
EekBoek-0.61
http://search.cpan.org/~jv/EekBoek-0.61/
Bookkeeping software for small and medium-size businesses
----
File-CacheDir-1.30
http://search.cpan.org/~earl/File-CacheDir-1.30/
Perl module to aid in keeping track and cleaning up files, quickly and without a cron $Id: CacheDir.pm,v 1.22 2006/05/17 00:05:34 earl Exp $
----
GD-Map-1.00
http://search.cpan.org/~cjs/GD-Map-1.00/
Perl extension for creating geographic map files with GD
----
Gnome2-GConf-1.031
http://search.cpan.org/~ebassi/Gnome2-GConf-1.031/
Perl wrappers for the GConf configuration engine.
----
IO-Compress-Base-2.000_13
http://search.cpan.org/~pmqs/IO-Compress-Base-2.000_13/
Base Class for IO::Compress modules
----
IO-Compress-Bzip2-2.000_13
http://search.cpan.org/~pmqs/IO-Compress-Bzip2-2.000_13/
Write bzip2 files/buffers
----
IO-Compress-Lzop-2.000_13
http://search.cpan.org/~pmqs/IO-Compress-Lzop-2.000_13/
Write lzop files/buffers
----
IO-Compress-Zlib-2.000_13
http://search.cpan.org/~pmqs/IO-Compress-Zlib-2.000_13/
----
IsUTF8-0.1
http://search.cpan.org/~heiko/IsUTF8-0.1/
detects if UTF8 characters are present
----
Kwiki-DoubleClickToEdit-0.10
http://search.cpan.org/~ingy/Kwiki-DoubleClickToEdit-0.10/
Double Click Starts Edit
----
Mac-Glue-1.26
http://search.cpan.org/~cnandor/Mac-Glue-1.26/
Control Mac apps with Apple event terminology
----
Net-Bluetooth-0.36
http://search.cpan.org/~iguthrie/Net-Bluetooth-0.36/
Perl Bluetooth Interface
----
Net-Delicious-1.0
http://search.cpan.org/~ascope/Net-Delicious-1.0/
OOP for the del.icio.us API
----
PAR-0.941
http://search.cpan.org/~smueller/PAR-0.941/
Perl Archive Toolkit
----
Rose-Object-0.81
http://search.cpan.org/~jsiracusa/Rose-Object-0.81/
A simple object base class.
----
Safe-Caller-0.03
http://search.cpan.org/~schubiger/Safe-Caller-0.03/
A nicer interface to caller() with code execution restriction
----
Sys-Syslog-0.16
http://search.cpan.org/~saper/Sys-Syslog-0.16/
Perl interface to the UNIX syslog(3) calls
----
Text-CSV-0.5
http://search.cpan.org/~erangel/Text-CSV-0.5/
comma-separated values manipulation routines
----
Text-Trac-0.01
http://search.cpan.org/~mizzy/Text-Trac-0.01/
Perl extension for formatting text with Trac Wiki Style.
----
Text-Trac-0.02
http://search.cpan.org/~mizzy/Text-Trac-0.02/
Perl extension for formatting text with Trac Wiki Style.
----
Unicode-Japanese-0.36
http://search.cpan.org/~hio/Unicode-Japanese-0.36/
Japanese Character Encoding Handler
----
WWW-ConfixxBackup-0.03
http://search.cpan.org/~reneeb/WWW-ConfixxBackup-0.03/
Create Backups with Confixx and download them via FTP
----
Win32-InternetShortcut-0.01
http://search.cpan.org/~ishigaki/Win32-InternetShortcut-0.01/
handles Internet Shortcut (IE's Favorite)
----
XML-DOM-Lite-0.10
http://search.cpan.org/~rhundt/XML-DOM-Lite-0.10/
Lite Pure Perl XML DOM Parser Kit
----
Xmldoom-0.0.13
http://search.cpan.org/~dsnopek/Xmldoom-0.0.13/
The XML Document Object-Oriented Model
----
mp3cut-1.12
http://search.cpan.org/~jv/mp3cut-1.12/
split MP3 files according to cue sheets
----
trace-0.52
http://search.cpan.org/~jbisbee/trace-0.52/
sufficiently advanced way to trace subroutine calls
----
trace-0.53
http://search.cpan.org/~jbisbee/trace-0.53/
Module Reanmed to Devel::XRay
----
winny_scanner-0.01
http://search.cpan.org/~masanorih/winny_scanner-0.01/
Perl Winny Scanner
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: 20 Jun 2006 22:15:01 -0700
From: "seven.reeds" <seven.reeds@gmail.com>
Subject: Re: perl / ajax / js / quoting question
Message-Id: <1150866901.072855.278300@b68g2000cwa.googlegroups.com>
Thanks. I've been told from another source that what I am trying to do
is not legal in js anyway. According to this source trying to display
"local" images is considered a security risk. tsk
ciao
------------------------------
Date: 20 Jun 2006 23:55:07 -0700
From: "Hobo Salesman" <hobosalesman@gmail.com>
Subject: Re: perl / ajax / js / quoting question
Message-Id: <1150872907.333150.138540@r2g2000cwb.googlegroups.com>
seven.reeds wrote:
> Thanks. I've been told from another source that what I am trying to do
> is not legal in js anyway. According to this source trying to display
> "local" images is considered a security risk. tsk
'file' URI is valid for browsers... <input type="file"> should give you
the absolute local path... I think some browsers even send the full
path to the server. If theres a check that keeps you from doing this
it's implemented in the browser not in JS. I'd test the code without
the AJAX/Perl, you went to this much trouble why not check it out? My
guess is it works in at least some browsers with some security
settings.
And post your results back here. Unless the off-topic thing bothers the
regulars.
------------------------------
Date: Wed, 21 Jun 2006 11:57:29 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: two servers listening on same port ?
Message-Id: <4498a863$0$5907$afc38c87@news.optusnet.com.au>
"Thomas Kratz" <ThomasKratz@REMOVEwebCAPS.de> wrote in message
news:4497e9b6$0$31170$bb690d87@news.main-rheiner.de...
> Sisyphus wrote:
> > "Thomas Kratz" <ThomasKratz@REMOVEwebCAPS.de> wrote in message
> > .
> > .
> >
> >>You might find IO::Socket easier to use.
> >>
> >
> >
> > Yes - that's what *I* use - but it still permits multiple instances of
> > servers to be listening on the same port.
>
> No to me it does not. Using:
>
> my $srv = IO::Socket::INET->new(
> Proto => 'tcp',
> LocalPort => 4016,
> Listen => SOMAXCONN,
> ReuseAddr => 0,
> );
>
> the second instance fails reporting 'Unknown error' ($!).
>
Yep - there was a stray 'Reuse => 1' in the constructor that was causing my
problem on Windows - no doubt the result of a mindless copy'n'paste
somewhere along the way. Removing it removed the need for that awful netstat
kludge.
Cheers,
Rob
------------------------------
Date: Wed, 21 Jun 2006 11:59:02 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: two servers listening on same port ?
Message-Id: <4498a8c1$0$22364$afc38c87@news.optusnet.com.au>
"Ben Morrow" <benmorrow@tiscali.co.uk>
.
.
>
> Have you *really* never used flock before?
>
Yep.
Does it show ?
Cheers,
Rob
------------------------------
Date: Wed, 21 Jun 2006 07:12:14 +0200
From: Marek Stepanek <mstep@t-online.de>
Subject: use of uninitialized value (beginner)
Message-Id: <C0BEA1CE.259B0%mstep@t-online.de>
Hello all,
I have some numbers to calculate (DATA). Each line represent a new day,
which are calculated with the subroutine "add_one_day"
But I can't get rid of the warnings, which I don't understand:
Use of uninitialized value in concatenation (.) or string at
./excel_autorech_test.pl line 35, <DATA> line 20.
Could somebody be so kind, and look through this script?
Thank you and best greetings from Munich
marek
#! /usr/bin/perl -w
use strict;
use Date::Calc qw(:all);
my $start_day = "01";
my $start_month = "06";
my $year = "2006";
my $day = $start_day;
my $month = $start_month;
my ($date, $wochentag);
my @lines;
while (<DATA>)
{
s/,/./g;
push @lines, $_ if (/^[\d,.\t\s]+$/ || /^$/);
}
foreach my $line (@lines)
{
if ($line =~ /^$/)
{
add_one_day($year, $month, $day);
print "$wochentag, $date: hurray, there is an empty line, but one
day more!\n";
}
elsif ($line=~ /[\d.\t]+/)
{
add_one_day($year, $month, $day);
print "$wochentag, $date: hurray, there is some stuff to
calculate!\n\t$line\n";
}
}
sub add_one_day
{
my $day_plus = 1;
my ($year2, $month2, $day2) = Add_Delta_Days($year, $month, $day,
$day_plus);
my $dow = Day_of_Week($year2,$month2,$day2);
Language(Decode_Language("Deutsch"));
my $lang = Language_to_Text(Language());
my $wochentag = Day_of_Week_Abbreviation($dow);
$month2 = sprintf("%02d", $month2);
$day2 = sprintf("%02d", $day2);
$date = "$day2.$month2.$year2";
($day, $month, $year) = ($day2, $month2, $year2);
# print "here for test reasons: $wochentag, $date, $year, $month,
$day\n\n";
return ($wochentag, $date, $year, $month, $day);
}
__DATA__
27192,1 10882,6 591 16 6138,5
27476,3 10990,7 596 16 6298,8
27737,9 11146,8 301 16 6523,1
27775,2 11158,5 604 16 6553,4
28179,1 11362,1 611 16 6863,3
28489,7 11524,2 619 16 7116,7
28752,1 11683,2 624 16 7849,6
29191,3 11882,2 618 16 7622,8
29290,8 11961,2 633 16 7746,7
29549,4 12109,9 638 16 7964,0
29778,4 12180,8 640 16 8063,2
30172,2 12364,1 644 16 8321,0
30282,0 12416,7 647 16 8401,1
30483,5 12506,1 652 16 8541,2
30769,3 12668,7 660 16 8788,6
30992,9 12725,4 662 16 8873,2
------------------------------
Date: 20 Jun 2006 23:34:36 -0700
From: usenet@DavidFilmer.com
Subject: Re: use of uninitialized value (beginner)
Message-Id: <1150871676.213385.106820@p79g2000cwp.googlegroups.com>
Marek Stepanek wrote:
> Use of uninitialized value in concatenation (.) or string at
> ./excel_autorech_test.pl line 35, <DATA> line 20.
Well, that means, um, that you are using an uninitalized value (ie, a
null variable) in a string. Just like it says.
The variable in question is $wochentag, which is declared but is not
populated within the scope of your line 35 (a different variable which
happens to have the same name is declared and populated in the
subroutine add_one_day, but this variable is lexically localized to
that subroutine and does not exist outside of that subroutine).
You need to clarify your thinking about that subroutine. You call it
like this:
> add_one_day($year, $month, $day);
which passes those values to the subroutine as a special array named
@_, but you never look at those passed values. Instead, you declare
lexically local variables with those same names (which will be
undefined). You return from it like this:
> return ($wochentag, $date, $year, $month, $day);
which returns five scalars as an array (not as five named scalars).
But the call to the subroutine does not attempt to capture the returned
values of this list.
I think your main problem is confusion on how lexical scoping works in
Perl (and how variables are passed to and from a subroutine).
Your program might work if you change your initial declarations from
"my" to "our" and drop the "my"s elsewhere in the program. But that's
an awful kludge.
--
David Filmer (http://DavidFilmer.com)
------------------------------
Date: Wed, 21 Jun 2006 03:46:11 GMT
From: David Hopwood <david.nospam.hopwood@blueyonder.co.uk>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <7i3mg.204167$8W1.155367@fe1.news.blueyonder.co.uk>
Chris Smith wrote:
> Chris Uppal <chris.uppal@metagnostic.REMOVE-THIS.org> wrote:
>
>>>I'm unsure whether to consider explicitly stored array lengths, which
>>>are present in most statically typed languages, to be part of a "type"
>>>in this sense or not.
>>
>>If I understand your position correctly, wouldn't you be pretty much forced to
>>reject the idea of the length of a Java array being part of its type ?
>
> I've since abandoned any attempt to be picky about use of the word "type".
I think you should stick to your guns on that point. When people talk about
"types" being associated with values in a "latently typed" or "dynamically typed"
language, they really mean *tag*, not type.
It is remarkable how much of the fuzzy thinking that often occurs in the
discussion of type systems can be dispelled by insistence on this point (although
much of the benefit can be obtained just by using this terminology in your own
mind and translating what other people are saying to it). It's a good example of
the weak Sapir-Whorf hypothesis, I think.
--
David Hopwood <david.nospam.hopwood@blueyonder.co.uk>
------------------------------
Date: Wed, 21 Jun 2006 03:54:02 GMT
From: David Hopwood <david.nospam.hopwood@blueyonder.co.uk>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <up3mg.438312$tc.289369@fe2.news.blueyonder.co.uk>
Pascal Costanza wrote:
> Chris Smith wrote:
>
>> Knowing that it'll cause a lot of strenuous objection, I'll
>> nevertheless interject my plea not to abuse the word "type" with a
>> phrase like "dynamically typed". If anyone considers "untyped" to be
>> perjorative, as some people apparently do, then I'll note that another
>> common term is "type-free," which is marketing-approved but doesn't
>> carry the misleading connotations of "dynamically typed." We are
>> quickly losing any rational meaning whatsoever to the word "type," and
>> that's quite a shame.
>
> The words "untyped" or "type-free" only make sense in a purely
> statically typed setting. In a dynamically typed setting, they are
> meaningless, in the sense that there are _of course_ types that the
> runtime system respects.
>
> Types can be represented at runtime via type tags. You could insist on
> using the term "dynamically tagged languages", but this wouldn't change
> a lot. Exactly _because_ it doesn't make sense in a statically typed
> setting, the term "dynamically typed language" is good enough to
> communicate what we are talking about - i.e. not (static) typing.
Oh, but it *does* make sense to talk about dynamic tagging in a statically
typed language.
That's part of what makes the term "dynamically typed" harmful: it implies
a dichotomy between "dynamically typed" and "statically typed" languages,
when in fact dynamic tagging and static typing are (mostly) independent
features.
--
David Hopwood <david.nospam.hopwood@blueyonder.co.uk>
------------------------------
Date: Wed, 21 Jun 2006 05:08:37 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <5btmm3-ghu.ln1@osiris.mauzo.dyndns.org>
Quoth David Hopwood <david.nospam.hopwood@blueyonder.co.uk>:
> Pascal Costanza wrote:
> > Chris Smith wrote:
> >
> > Types can be represented at runtime via type tags. You could insist on
> > using the term "dynamically tagged languages", but this wouldn't change
> > a lot. Exactly _because_ it doesn't make sense in a statically typed
> > setting, the term "dynamically typed language" is good enough to
> > communicate what we are talking about - i.e. not (static) typing.
>
> Oh, but it *does* make sense to talk about dynamic tagging in a statically
> typed language.
Though I'm *seriously* reluctant to encourage this thread...
A prime example of this is Perl, which has both static and dynamic
typing. Variables are statically typed scalar/array/hash, and then
scalars are dynamically typed string/int/unsigned/float/ref.
> That's part of what makes the term "dynamically typed" harmful: it implies
> a dichotomy between "dynamically typed" and "statically typed" languages,
> when in fact dynamic tagging and static typing are (mostly) independent
> features.
Nevertheless, I see no problem in calling both of these 'typing'. They
are both means to the same end: causing a bunch of bits to be
interpreted in a meaningful fashion. The only difference is whether the
distinction is made a compile- or run-time. The above para had no
ambiguities...
Ben
--
Every twenty-four hours about 34k children die from the effects of poverty.
Meanwhile, the latest estimate is that 2800 people died on 9/11, so it's like
that image, that ghastly, grey-billowing, double-barrelled fall, repeated
twelve times every day. Full of children. [Iain Banks] benmorrow@tiscali.co.uk
------------------------------
Date: Wed, 21 Jun 2006 04:19:10 GMT
From: David Hopwood <david.nospam.hopwood@blueyonder.co.uk>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <2N3mg.462963$xt.331923@fe3.news.blueyonder.co.uk>
Pascal Costanza wrote:
> Rob Thorpe wrote:
>> Pascal Costanza wrote:
>>> Matthias Blume wrote:
>>>> Pascal Costanza <pc@p-cos.net> writes:
>>>>
>>>>> (slot-value p 'address) is an attempt to access the field 'address in
>>>>> the object p. In many languages, the notation for this is p.address.
>>>>>
>>>>> Although the class definition for person doesn't mention the field
>>>>> address, the call to (eval (read)) allows the user to change the
>>>>> definition of the class person and update its existing
>>>>> instances. Therefore at runtime, the call to (slot-value p 'adress)
>>>>> has a chance to succeed.
>>>>
>>>> I am quite comfortable with the thought that this sort of evil would
>>>> get rejected by a statically typed language. :-)
>>>
>>> This sort of feature is clearly not meant for you. ;-P
>>
>> To be fair though that kind of thing would only really be used while
>> debugging a program.
>> Its no different than adding a new member to a class while in the
>> debugger.
>>
>> There are other places where you might add a slot to an object at
>> runtime, but they would be done in tidier ways.
>
> Yes, but the question remains how a static type system can deal with
> this kind of updates.
It's not difficult in principle:
- for each class [*], define a function which converts an 'old' value of
that class to a 'new' value (the ability to do this is necessary anyway
to support some kinds of upgrade). A default conversion function may be
autogenerated if the class definition has changed only in minor ways.
- typecheck the new program and the conversion functions, using the old
type definitions for the argument of each conversion function, and the
new type definitions for its result.
- have the debugger apply the conversions to all values, and then resume
the program.
[*] or nearest equivalent in a non-OO language.
--
David Hopwood <david.nospam.hopwood@blueyonder.co.uk>
------------------------------
Date: Wed, 21 Jun 2006 04:29:40 GMT
From: David Hopwood <david.nospam.hopwood@blueyonder.co.uk>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <UW3mg.463049$xt.149948@fe3.news.blueyonder.co.uk>
genea wrote:
> [...] NOW that being said, I think
> that the reason I like Haskell, a very strongly typed language, is that
> because of it's type system, the language is able to do things like
> lazy evaluation, [...]
Lazy evaluation does not depend on, nor is it particularly helped by
static typing (assuming that's what you mean by "strongly typed" here).
An example of a non-statically-typed language that supports lazy evaluation
is Oz. (Lazy functions are explicitly declared in Oz, as opposed to Haskell's
implicit lazy evaluation, but that's not because of the difference in type
systems.)
--
David Hopwood <david.nospam.hopwood@blueyonder.co.uk>
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 9329
***************************************