XML escaping, etc..

2002-07-03 Thread Josh Wilmes


I've been meaning to ask- is there any plan to add special support for XML 
features such as string escaping?  It would be very useful, IMHO, to have 
something analogous to the \Q feature in perl5 for escaping regexps, but 
which would do XML-style  and  escaping.

I'm specifically interested in how features like this might be applicable 
to the problem of Cross-Site Scripting security vulnerabilities in 
perl-based web applications.

The types of escaping which are necessary for this are described at
  http://www.cert.org/tech_tips/malicious_code_mitigation.html

I think tainting is a BIG part of the solution.  But is there more that 
might make sense to provide in the language?   With XML generation and 
parsing becoming so common, it seems to me that an argument could be made 
that low-level mechanisms for properly parsing and generating XML/HTML 
content in a flexible way belongs in the core libraries, if not the language
itself. 

--Josh

-- 
Josh Wilmes  ([EMAIL PROTECTED]) | http://www.hitchhiker.org






Re: 6PAN (was: Half measures all round)

2002-06-06 Thread Josh Wilmes



For the record, you will hear no disagreement from me.  I recognize that 
this is a HARD problem.  Nonetheless, I think it's an important one, and 
solving it (even imperfectly, by only supporting well-defined platforms)
would be a major coup.

--Josh

At 23:31 on 06/05/2002 BST, Nicholas Clark [EMAIL PROTECTED] wrote:

 On Wed, Jun 05, 2002 at 12:55:36AM -0400, Josh Wilmes wrote:
  
  Good stuff.  Sounds halfway between CPAN.pm and activestate's ppm.  See 
  also debian's apt-get.
  
  Which brings me to my pet peeve-  I think it's time to start doing binary 
  packaging in CPAN, for those who don't want to bother with compilation.
  
  That has interesting implications for how we deal with paths, but still, I 
  think it's worthwhile.
  
  Of course you would want to support source as well, but having binary 
  available for those who want it just seems like a darn good idea.
 
 OK. Say I want binaries for my 3 boxes:
 
 On Bagpuss /usr/local/bin/perl -v says:
 
 This is perl, v5.8.0 built for armv4l-linux
 (with 1 registered patch, see perl -V for more detail)
 
 but you had better actually build that with -v3 flags on your ARM compiler
 because my machine's hardware can't cope with the v4 instructions on the CPU
 
 On Thinking-Cap /usr/local/bin/perl -v says:
 
 This is perl, version 5.004_05 built for i386-freebsd
 
 Copyright 1987-1998, Larry Wall
 
 5.004 is officially still supported, and some modules do build on 5.004
 
 [Third box, Marvellous-Mechanical-Mouse-Organ is an SGI Indy and doesn't
 doesn't want to power up for some reason, probably because it's been off
 for about 12 months]
 
 I presume you're going to suggest that they are too obscure for binary CPAN
 to support them. So limit things to the most recent perl. But having
 experimented with trying to ship 5.8.0-RC1 between FreeBSD versions, there
 are sufficient changes between libc on 4.4 STABLE and 4.5 STABLE such that
 you can't run a binary compiled on 4.5 on a 4.4 box due to missing symbols.
 So you're starting to enter version compatibility nightmare.
 
 And if you have module needing a C++ compiler, are you going to ship your
 x86 linux binaries using RedHat's 2.96, or a real gcc?
 
 And are you doing dependencies, or are you interfacing with the OS package
 manager? And if you're not interfacing, but you are adding modules to the
 OS perl, then what do you do if one of your dependency modules is already
 there? Do you just go oh good, have binary CPAN say nothing, and then
 hope that the OS packaging system doesn't remove the dependency module from
 under you?
 
 I believe that binary CPAN would have problems that scale as the number
 of OS subversions that binary CPAN would try to support.
 
 This may sound rather negative, but it basically means that I'm feeling
 sufficiently pessimistic that I don't think there are reasonable solutions
 to the problems. However, that's only my opinion, and others' will differ.
 
 On the other hand, I think the idea of multiple platforms automatic CPAN
 testing is a very good idea.
 
 Nicholas Clark
 -- 
 Even better than the real thing:  http://nms-cgi.sourceforge.net/





Re: 6PAN (was: Half measures all round)

2002-06-05 Thread Josh Wilmes


Good stuff.  Sounds halfway between CPAN.pm and activestate's ppm.  See 
also debian's apt-get.

Which brings me to my pet peeve-  I think it's time to start doing binary 
packaging in CPAN, for those who don't want to bother with compilation.

That has interesting implications for how we deal with paths, but still, I 
think it's worthwhile.

Of course you would want to support source as well, but having binary 
available for those who want it just seems like a darn good idea.

Of course there would be issues of who's providing the binaries, how they 
are built, how external dependencies on third-party libraries are managed,
etc, but still, I think it's worth looking into.  It might not be a 
problem that's worth solving, in the end, but I think it's one worth 
giving serious thought to.

--Josh

At 23:38 on 06/04/2002 EDT, Miko O'Sullivan [EMAIL PROTECTED] wrote:

 [This seems like a good time to post something that's been on my mind for
 some time.]
 
 SUMMARY
 
 The world needs a really easy CPAN client.  Here's one design for such a
 thing.
 
 DETAILS
 
 A few brief philosphical points:
 
   1) People like languages that have tons of built-in
   doohickeys. See PHP and Java.
 
   2) Instead of a huge standard library, a really easy to use CPAN
   client allows programmers to have the world of modules almost
   as easily as built-in, and with the advantage of up-to-date-ness
   and quantity.
 
   3) The current CPAN.pm isn't really easy to use. Now matter how
   simple it may seem to the Perl Guru community, inexperienced
   users find it intimidating to download CPAN modules.
   Remember: beginners end up ruling the world.  See Microsoft.
 
 Solution: a simple program that is called from the command line.  Here's a
 brief tour:
 
 Download and install a module from CPAN. Loading a module also automatically
 loads its dependencies.
 
cpan load Date::EzDate
 
 The command above would ask the user if they want to install using the
 current directory as the root of library tree, and is also mentions that if
 they want to specify another dir they can use this command:
 
cpan --lib ~/lib load Date::EzDate
 
 Update a module.
 
cpan update Date::EzDate
 
 Don't download dependencies:
 
cpan --dep 0 load Date::EzDate
 
 Update all currently installed modules:
 
cpan update *
 
 Update a namespace:
 
cpan update Date::*
 
 Get help on using cpan:
 
cpan help
 
 No configuration files (.e.g .cpan) are necessary.  However, you can use a
 configuration file if you want tp indicate a .cpan-like file
 
cpan --conf ~/.cpan load Date::EzDate
 
 Get from a particular FTP server
 
cpan --server cpan.idocs.com load Date::EzDate
 
 By default, progress messages are kept to a minimum.  No more of those
 hundreds of lines of bewildering make messages.
 
cpan --lib ~/perllib load Date::EzDate
finding server
downloading module
determining dependencies
downloading dependencies
installing
done
 
 Optional verbose mode
cpan --verbose load Date::EzDate
(hundreds of lines of lovely make messages)
 
 Request particular operating system compilation (e.g. Win32)
 (usually not needed explicitly because cpan.pl will know which compilation
 to ask for)
 
cpan --compile win32 load Date::EzDate
 
 Indicate latest development vs. latest stable
 
cpan --latest beta load Date::EzDate
 
 Remove a module
cpan remove Date::EzDate
 
 
 -
 Other Misc CPAN Ideas
 
 - Authors don't need to indicate dependencies.  CPAN figures it out from the
 use's and require's.  CPAN will not accept modules that depend on other
 modules that aren't on CPAN.  (Yes, there might be a chicken and egg problem
 there, I'm sure we can find a solution.) This leads me to...
 
 - Run-time dependencies: Dependencies can be indicated explicitly with
 something like this:
 
  use Dependency Date::Language::French;
 
 - CPAN conformity: All modules served from CPAN must meet certain
 specifications.  They must include a version, POD, license statement, and
 probably other meta-info.  The meta-info would be standardized so that the
 system could tell that the module conforms.
 
 - Automated load balancing: cpan.perl.org doesn't have to pay for the
 bandwidth of the whole world. cpan.pl should recognize a command from
 CPAN.org to redirect to another server.
 
 - 6pan.org: The domain name 6pan.org is available as of this writing. Larry,
 are you planning on saying 6PAN enough to merit somebody registering
 6pan.org?