[30121] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1364 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 15 11:09:44 2008

Date: Sat, 15 Mar 2008 08:09:07 -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           Sat, 15 Mar 2008     Volume: 11 Number: 1364

Today's topics:
    Re: command output <dalessio@motorola.NOSPAM.com>
        handle tab-delimited file <ela@yantai.org>
    Re: handle tab-delimited file <noreply@gunnar.cc>
    Re: handle tab-delimited file <tadmc@seesig.invalid>
        new CPAN modules on Sat Mar 15 2008 (Randal Schwartz)
    Re: P~(ptilde) 0.9 released, new scripting language wit <brian.d.foy@gmail.com>
    Re: P~(ptilde) 0.9 released, new scripting language wit <ptilderegex@gmail.com>
    Re: P~(ptilde) 0.9 released, new scripting language wit <brian.d.foy@gmail.com>
    Re: try to use "locale" with german and coepage 437 (do <wuendi@googlemail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 14 Mar 2008 08:20:33 -0500
From: "Mario D'Alessio" <dalessio@motorola.NOSPAM.com>
Subject: Re: command output
Message-Id: <frduik$cva$1@newshost.mot.com>


"jammer" <jameslockie@mail.com> wrote in message 
news:b871b4f6-a12a-46c7-8d0e-f366d94e3b6b@s13g2000prd.googlegroups.com...
> There is no output from this:
>                `/usr/bin/ls -l "$backupDir/$backupName"`;
>
> This shows correct values:
>                print "/usr/bin/ls -l $backupDir/$backupName";

Assuming you provide the complete lines:

In the first line, you gather data via the backticks, but you
don't do anything with the returned data. It's like having
a line like these:

    "blah";
    1;

You need to do something with the data; e.g., print it:

    print `/usr/bin/ls -l "$backupDir/$backupName"`;

In the second line, you are printing the command itself and
not executing it.

Mario 




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

Date: Sat, 15 Mar 2008 08:57:24 +0800
From: "Ela" <ela@yantai.org>
Subject: handle tab-delimited file
Message-Id: <frf6te$8qi$1@ijustice.itsc.cuhk.edu.hk>

\t matches BOTH tab and space.

How can I split the following line into 2 words instead of 5?

1234\tI am a boy\n




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

Date: Sat, 15 Mar 2008 02:22:02 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: handle tab-delimited file
Message-Id: <640mltF29e7d6U1@mid.individual.net>

Ela wrote:
> \t matches BOTH tab and space.

No, it doesn't.

> How can I split the following line into 2 words instead of 5?
> 
> 1234\tI am a boy\n

     split /\t/, "1234\tI am a boy\n"

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Sat, 15 Mar 2008 14:10:12 GMT
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: handle tab-delimited file
Message-Id: <slrnftnll8.hti.tadmc@tadmc30.sbcglobal.net>

Ela <ela@yantai.org> wrote:

> \t matches BOTH tab and space.


No it doesn't.

\s matches tab and space (and 3 other characters).

Is that what you meant?

(we wouldn't need to ask this if you had posted real Perl code.)


> How can I split the following line into 2 words instead of 5?
>
> 1234\tI am a boy\n


use PSI::ESP;

   By spliting on \t rather than spliting on \s


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Sat, 15 Mar 2008 04:42:19 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat Mar 15 2008
Message-Id: <Jxr92J.194B@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.

Acme-Gosub-0.1.3
http://search.cpan.org/~shlomif/Acme-Gosub-0.1.3/
Implement BASIC-like "gosub" and "greturn" in Perl 
----
Acme-POE-Acronym-Generator-1.10
http://search.cpan.org/~bingos/Acme-POE-Acronym-Generator-1.10/
Generate random POE acronyms. 
----
Acme-Shukugawa-Atom-0.00003
http://search.cpan.org/~dmaki/Acme-Shukugawa-Atom-0.00003/
??????????????? 
----
Acme-Shukugawa-Atom-0.00004
http://search.cpan.org/~dmaki/Acme-Shukugawa-Atom-0.00004/
??????????????? 
----
Asterisk-config-0.94
http://search.cpan.org/~hoowa/Asterisk-config-0.94/
the Asterisk config read and write module. 
----
Atompub-0.3.0
http://search.cpan.org/~takeru/Atompub-0.3.0/
Atom Publishing Protocol implementation 
----
Authen-TacacsPlus-0.18
http://search.cpan.org/~mikem/Authen-TacacsPlus-0.18/
Perl extension for authentication using tacacs+ server 
----
BatchSystem-SBS-0.41
http://search.cpan.org/~alexmass/BatchSystem-SBS-0.41/
a Simple Batch System 
----
Bio-Das-ProServer-2.8
http://search.cpan.org/~rpettett/Bio-Das-ProServer-2.8/
----
Bit-MorseSignals-0.05
http://search.cpan.org/~vpit/Bit-MorseSignals-0.05/
The MorseSignals protocol. 
----
CGI-Application-Plugin-HelpMan-1.09
http://search.cpan.org/~leocharre/CGI-Application-Plugin-HelpMan-1.09/
man lookup and help doc for your cgi app 
----
CPAN-Faker-0.001
http://search.cpan.org/~rjbs/CPAN-Faker-0.001/
build a bogus CPAN instance for testing 
----
Catalyst-View-Download-0.04
http://search.cpan.org/~gaudeon/Catalyst-View-Download-0.04/
----
Chart-OFC-0.07
http://search.cpan.org/~drolsky/Chart-OFC-0.07/
Generate data files for use with Open Flash Chart 
----
Class-MOP-0.54
http://search.cpan.org/~stevan/Class-MOP-0.54/
A Meta Object Protocol for Perl 5 
----
Coro-4.45
http://search.cpan.org/~mlehmann/Coro-4.45/
coroutine process abstraction 
----
Danga-Socket-1.59
http://search.cpan.org/~msergeant/Danga-Socket-1.59/
Event loop and event-driven async socket base class 
----
Data-Serializer-0.44
http://search.cpan.org/~neely/Data-Serializer-0.44/
Modules that serialize data structures 
----
DateTime-Format-Natural-0.68_01
http://search.cpan.org/~schubiger/DateTime-Format-Natural-0.68_01/
Create machine readable date/time with natural parsing logic 
----
DateTime-WorkingHours-0.01
http://search.cpan.org/~jkutej/DateTime-WorkingHours-0.01/
proportional shift DateTime to a working hours and few working hours routines 
----
Eludia-08.03.13.1198
http://search.cpan.org/~dmow/Eludia-08.03.13.1198/
----
ExtUtils-FakeMaker-0.001
http://search.cpan.org/~rjbs/ExtUtils-FakeMaker-0.001/
build fake dists for testing CPAN tools 
----
ExtUtils-FakeMaker-0.002
http://search.cpan.org/~rjbs/ExtUtils-FakeMaker-0.002/
build fake dists for testing CPAN tools 
----
ExtUtils-PkgConfig-1.11
http://search.cpan.org/~tsch/ExtUtils-PkgConfig-1.11/
simplistic interface to pkg-config 
----
File-Find-Node-0.02
http://search.cpan.org/~scl/File-Find-Node-0.02/
Recursively traverses a directory tree and processes each item using callback functions supplied by the user. 
----
File-PerlMove-0.05
http://search.cpan.org/~jv/File-PerlMove-0.05/
Rename files using Perl expressions 
----
Flickr-Upload-Dopplr-0.3
http://search.cpan.org/~ascope/Flickr-Upload-Dopplr-0.3/
Flickr::Upload subclass to assign location information using Dopplr 
----
Form-Processor-Model-DBIC-0.01
http://search.cpan.org/~gshank/Form-Processor-Model-DBIC-0.01/
Model class for Form Processor using DBIx::Class 
----
Fukurama-Class-0.029
http://search.cpan.org/~tobiwan/Fukurama-Class-0.029/
Pragma to extend the Perl-OO (in native Perl) 
----
Glib-1.181
http://search.cpan.org/~tsch/Glib-1.181/
Perl wrappers for the GLib utility and Object libraries 
----
Gtk2-Ex-Geo-0.61
http://search.cpan.org/~ajolma/Gtk2-Ex-Geo-0.61/
The main module to use for geospatial applications 
----
HTML-GenerateUtil-1.09
http://search.cpan.org/~robm/HTML-GenerateUtil-1.09/
Routines useful when generating HTML output 
----
HTML-Latemp-GenMakeHelpers-0.1.9
http://search.cpan.org/~shlomif/HTML-Latemp-GenMakeHelpers-0.1.9/
A Latemp Utility Module. 
----
HTML-Seamstress-5.0b
http://search.cpan.org/~tbone/HTML-Seamstress-5.0b/
HTML::Tree subclass for HTML templating via tree rewriting 
----
HTTP-Server-Simple-Dispatched-0.02
http://search.cpan.org/~frodwith/HTTP-Server-Simple-Dispatched-0.02/
Django-like regex dispatching with request and response objects - no CGI.pm cruft! 
----
HTTP-Server-Simple-Dispatched-0.03
http://search.cpan.org/~frodwith/HTTP-Server-Simple-Dispatched-0.03/
Django-like regex dispatching with request and response objects - no CGI.pm cruft! 
----
IPC-Concurrency-0.01
http://search.cpan.org/~bbkr/IPC-Concurrency-0.01/
concurrency guard for processes. 
----
IPC-Concurrency-0.02
http://search.cpan.org/~bbkr/IPC-Concurrency-0.02/
Concurrency guard for processes. 
----
Image-Magick-Square-1.003
http://search.cpan.org/~leocharre/Image-Magick-Square-1.003/
Takes image and crops trims to a square shape 
----
JS-0.14
http://search.cpan.org/~ingy/JS-0.14/
JavaScript Modules on CPAN 
----
KSx-Highlight-Summarizer-0.03
http://search.cpan.org/~sprout/KSx-Highlight-Summarizer-0.03/
KinoSearch Highlighter subclass that provides more comprehensive summaries 
----
Locale-PO-0.18
http://search.cpan.org/~ken/Locale-PO-0.18/
Perl module for manipulating .po entries from GNU gettext 
----
Locale-PO-0.19
http://search.cpan.org/~ken/Locale-PO-0.19/
Perl module for manipulating .po entries from GNU gettext 
----
MIME-EncWords-1.003
http://search.cpan.org/~nezumi/MIME-EncWords-1.003/
deal with RFC 2047 encoded words (improved) 
----
Metadata-DB-1.10
http://search.cpan.org/~leocharre/Metadata-DB-1.10/
----
Metadata-DB-Analizer-1.02
http://search.cpan.org/~leocharre/Metadata-DB-Analizer-1.02/
methods to analize database metadata table entries 
----
Metadata-DB-Search-1.02
http://search.cpan.org/~leocharre/Metadata-DB-Search-1.02/
search the indexed metadata 
----
Metadata-DB-WUI-1.16
http://search.cpan.org/~leocharre/Metadata-DB-WUI-1.16/
minimal search interface example 
----
Module-Faker-0.003
http://search.cpan.org/~rjbs/Module-Faker-0.003/
build fake dists for testing CPAN tools 
----
Module-Install-0.69
http://search.cpan.org/~adamk/Module-Install-0.69/
Standalone, extensible Perl module installer 
----
Moose-0.39
http://search.cpan.org/~stevan/Moose-0.39/
A postmodern object system for Perl 5 
----
MooseX-Getopt-0.12
http://search.cpan.org/~stevan/MooseX-Getopt-0.12/
A Moose role for processing command line options 
----
MooseX-Storage-0.12
http://search.cpan.org/~stevan/MooseX-Storage-0.12/
An serialization framework for Moose classes 
----
MySpam-0.08
http://search.cpan.org/~mlawren/MySpam-0.08/
Database operations for the MySpam application 
----
NET-Sieve-Script-0.01
http://search.cpan.org/~yvesago/NET-Sieve-Script-0.01/
parse and write sieve scripts 
----
NET-Sieve-Script-0.02
http://search.cpan.org/~yvesago/NET-Sieve-Script-0.02/
parse and write sieve scripts 
----
Net-MirrorDir-0.16
http://search.cpan.org/~knorr/Net-MirrorDir-0.16/
Perl extension for compare local-directories and remote-directories with each other 
----
Net-Plesk-0.03
http://search.cpan.org/~jef/Net-Plesk-0.03/
Perl extension for Plesk XML Remote API 
----
Net-Prizm-0.04
http://search.cpan.org/~jef/Net-Prizm-0.04/
Perl client interface to Motorola Canopy Prizm 
----
Net-Whois-Raw-1.50
http://search.cpan.org/~despair/Net-Whois-Raw-1.50/
Get Whois information for domains 
----
OODoc-1.03
http://search.cpan.org/~markov/OODoc-1.03/
object oriented production of code related documentation 
----
OpenResty-0.1.1
http://search.cpan.org/~agent/OpenResty-0.1.1/
General-purpose web service platform for web applications 
----
OpenResty-0.1.2
http://search.cpan.org/~agent/OpenResty-0.1.2/
General-purpose web service platform for web applications 
----
OpenResty-0.1.3
http://search.cpan.org/~agent/OpenResty-0.1.3/
General-purpose web service platform for web applications 
----
OpenResty-0.1.4
http://search.cpan.org/~agent/OpenResty-0.1.4/
General-purpose web service platform for web applications 
----
OpenResty-0.1.5
http://search.cpan.org/~agent/OpenResty-0.1.5/
General-purpose web service platform for web applications 
----
POE-0.9999_01
http://search.cpan.org/~rcaputo/POE-0.9999_01/
portable multitasking and networking framework for Perl 
----
POE-Component-IRC-Plugin-CPAN-LinksToDocs-No404s-0.002
http://search.cpan.org/~zoffix/POE-Component-IRC-Plugin-CPAN-LinksToDocs-No404s-0.002/
link to http://search.cpan.org/ documentation from IRC (and check that all links lead to existing docs) 
----
POE-Component-SmokeBox-Recent-0.04
http://search.cpan.org/~bingos/POE-Component-SmokeBox-Recent-0.04/
A POE component to retrieve recent CPAN uploads. 
----
POE-Component-Win32-ChangeNotify-1.14
http://search.cpan.org/~bingos/POE-Component-Win32-ChangeNotify-1.14/
A POE wrapper around Win32::ChangeNotify. 
----
POE-Component-Win32-EventLog-1.20
http://search.cpan.org/~bingos/POE-Component-Win32-EventLog-1.20/
A POE component that provides non-blocking access to Win32::EventLog. 
----
POE-Component-Win32-Service-1.20
http://search.cpan.org/~bingos/POE-Component-Win32-Service-1.20/
A POE component that provides non-blocking access to Win32::Service. 
----
Parallel-SubFork-0.04
http://search.cpan.org/~potyl/Parallel-SubFork-0.04/
Manage Perl functions in forked processes. 
----
Parse-IASLog-1.04
http://search.cpan.org/~bingos/Parse-IASLog-1.04/
A parser for Microsoft IAS-formatted log entries. 
----
Parse-IRC-1.10
http://search.cpan.org/~bingos/Parse-IRC-1.10/
A parser for the IRC protocol. 
----
RDF-Query-2.000_06
http://search.cpan.org/~gwilliams/RDF-Query-2.000_06/
An RDF query implementation of SPARQL/RDQL in Perl for use with RDF::Redland and RDF::Core. 
----
RDF-Trine-0.104
http://search.cpan.org/~gwilliams/RDF-Trine-0.104/
An RDF Framework for Perl. 
----
RT-Authen-CookieAuth-0.01
http://search.cpan.org/~zordrak/RT-Authen-CookieAuth-0.01/
Pulls a Cookie and checks it against an External DB 
----
RT-Authen-ExternalAuth-0.01
http://search.cpan.org/~zordrak/RT-Authen-ExternalAuth-0.01/
RT Authentication using External Sources 
----
Run-Env-0.01_03
http://search.cpan.org/~jkutej/Run-Env-0.01_03/
running environment detection 
----
SQL-Bibliosoph-1.5
http://search.cpan.org/~matiu/SQL-Bibliosoph-1.5/
A SQL Statements Library 
----
Safe-2.16
http://search.cpan.org/~rgarcia/Safe-2.16/
Compile and execute code in restricted compartments 
----
Spreadsheet-XLSX-0.01
http://search.cpan.org/~dmow/Spreadsheet-XLSX-0.01/
Perl extension for reading MS Excel 2007 files; 
----
Task-Moose-0.01
http://search.cpan.org/~stevan/Task-Moose-0.01/
Moose in a box 
----
Test-Aggregate-0.10
http://search.cpan.org/~ovid/Test-Aggregate-0.10/
Aggregate *.t tests to make them run faster. 
----
Test-Count-0.02
http://search.cpan.org/~shlomif/Test-Count-0.02/
Module for keeping track of the number of tests in a test script. 
----
Test-Count-0.03
http://search.cpan.org/~shlomif/Test-Count-0.03/
Module for keeping track of the number of tests in a test script. 
----
Test-Count-0.0301
http://search.cpan.org/~shlomif/Test-Count-0.0301/
Module for keeping track of the number of tests in a test script. 
----
Test-Server-0.03
http://search.cpan.org/~jkutej/Test-Server-0.03/
what about test driven administration? 
----
Test-Server-0.04
http://search.cpan.org/~jkutej/Test-Server-0.04/
what about test driven administration? 
----
Test-WWW-Mechanize-1.20
http://search.cpan.org/~petdance/Test-WWW-Mechanize-1.20/
Testing-specific WWW::Mechanize subclass 
----
Text-DHCPLeases-v0.3
http://search.cpan.org/~cvicente/Text-DHCPLeases-v0.3/
Parse DHCP leases file from ISC dhcpd. 
----
Text-Tmpl-0.31
http://search.cpan.org/~dlowe/Text-Tmpl-0.31/
Templating system perl library 
----
WWW-PasteCSSStandardsOrg-Create-0.001
http://search.cpan.org/~zoffix/WWW-PasteCSSStandardsOrg-Create-0.001/
create new pastes on http://paste.css-standards.org website 
----
WWW-PastebinCa-Create-0.001
http://search.cpan.org/~zoffix/WWW-PastebinCa-Create-0.001/
create new pastes on http://pastebin.ca from Perl 
----
WWW-Search-RPMPbone-1.0
http://search.cpan.org/~samy/WWW-Search-RPMPbone-1.0/
class for searching rpm.pbone.net 
----
WWW-Selenium-Utils-0.09
http://search.cpan.org/~lukec/WWW-Selenium-Utils-0.09/
helper functions for working with Selenium 
----
WWW-Spinn3r-2.00100302
http://search.cpan.org/~vipul/WWW-Spinn3r-2.00100302/
An interface to the Spinn3r API (http://www.spinn3r.com) 
----
WebService-RTMAgent-0.5
http://search.cpan.org/~rutschle/WebService-RTMAgent-0.5/
UserAgent for the RememberTheMilk API 
----
XML-Compile-0.70
http://search.cpan.org/~markov/XML-Compile-0.70/
Compilation based XML processing 
----
XML-Compile-SOAP-0.68
http://search.cpan.org/~markov/XML-Compile-SOAP-0.68/
base-class for SOAP implementations 
----
XML-DTD-0.07
http://search.cpan.org/~wohl/XML-DTD-0.07/
Perl module for parsing XML DTDs 
----
ack-1.77_04
http://search.cpan.org/~petdance/ack-1.77_04/
grep-like text finder 
----
enum-0.01
http://search.cpan.org/~roode/enum-0.01/
Yet Another enumeration class implementation. 
----
pQuery-0.03
http://search.cpan.org/~ingy/pQuery-0.03/
Perl Port of jQuery.js 


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: Fri, 14 Mar 2008 12:01:17 -1000
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: P~(ptilde) 0.9 released, new scripting language with novel regex
Message-Id: <140320081201172836%brian.d.foy@gmail.com>

In article
<059caf0a-65e4-44da-bb38-7c159a99dc8f@m3g2000hsc.googlegroups.com>,
ptilderegex <ptilderegex@gmail.com> wrote:

>  This
> decision opens the door to more powerful side-effects than even
> possible in Perl

That's a pretty bold statement considering that Perl can execute
arbitrary code from within a regular expression.


> While P~ makes it easy to grapple with matching and transformation
> problems that are hard for even Perl programmers, 

Perhaps you can list a couple of examples. People in this newsgroup
love showing others how easy it is to get things done with regular
expressions. :)


Most of the examples I saw on your website have problems. For instance,
you have a transformation to strip C++ style comments:

function Pattern Comment1 ()
{
    return strip("//" + *'[^\r\n]') + eoleof;
}

You fail to distinguish between code and string literals though.
There's an answerin perlfaq6 that addresses this. Your C style comment
stripper is similarly flawed.

In your examples page, you talk about stripping HTML tags, and say that
there isn't an equivalent Perl solution. I guess you missed the one in
perlfaq9.

Although your new language might be nice, don't ignorantly compare it
to any language you don't know. :)


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

Date: Sat, 15 Mar 2008 05:53:20 -0700 (PDT)
From: ptilderegex <ptilderegex@gmail.com>
Subject: Re: P~(ptilde) 0.9 released, new scripting language with novel regex
Message-Id: <f8b25af9-ff95-40e3-8457-1ebec32ee96e@d45g2000hsc.googlegroups.com>

On Mar 14, 5:01 pm, brian d  foy <brian.d....@gmail.com> wrote:
> In article
> <059caf0a-65e4-44da-bb38-7c159a99d...@m3g2000hsc.googlegroups.com>,
>
> ptilderegex <ptildere...@gmail.com> wrote:
> >  This
> > decision opens the door to more powerful side-effects than even
> > possible in Perl
>
> That's a pretty bold statement considering that Perl can execute
> arbitrary code from within a regular expression.

Correct me if I'm wrong but don't Perl code assertions fire as
encountered by the NFA engine.  This means that they could fire even
if the regex was ultimately not found to match.  This was discussed on
the documentation site years ago when I looked, but I'm not up to
date.  Anyway, this fire as you go approach is useful for debugging,
but not as powerful as a true "side-effect".

>
> > While P~ makes it easy to grapple with matching and transformation
> > problems that are hard for even Perl programmers,
>
> Perhaps you can list a couple of examples. People in this newsgroup
> love showing others how easy it is to get things done with regular
> expressions. :)

A simple example: lets say that in Perl you have a regex but you don't
know what it is.  Its held in a string passed by some function and
needs to be a parameter.  Now, you want to strip everything but what
matches each time.  Or better yet, output what does match to one
stream, and output what doesn't match to another (in one pass).

>
> Most of the examples I saw on your website have problems. For instance,
> you have a transformation to strip C++ style comments:
>
> function Pattern Comment1 ()
> {
>     return strip("//" + *'[^\r\n]') + eoleof;
>
> }
>
> You fail to distinguish between code and string literals though.
> There's an answerin perlfaq6 that addresses this. Your C style comment
> stripper is similarly flawed.

The overall example does handle this.  The base class parses string
literals and char literals (Java targets have no code literals), and
the base class includes these in its recognition units.  Thus in the
subclass, you only need to polymorphically change the behavior of
match-a-comment, to match-and-strip-a-comment.

>
> In your examples page, you talk about stripping HTML tags, and say that
> there isn't an equivalent Perl solution. I guess you missed the one in
> perlfaq9.
>

I'll check to see if this Perl solution is a single pass regex, and if
so, amend the comment!  Thanks.

> Although your new language might be nice, don't ignorantly compare it
> to any language you don't know. :)


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

Date: Sat, 15 Mar 2008 07:52:14 -0700
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: P~(ptilde) 0.9 released, new scripting language with novel regex
Message-Id: <150320080752146339%brian.d.foy@gmail.com>

In article
<f8b25af9-ff95-40e3-8457-1ebec32ee96e@d45g2000hsc.googlegroups.com>,
ptilderegex <ptilderegex@gmail.com> wrote:


> > Perhaps you can list a couple of examples. People in this newsgroup
> > love showing others how easy it is to get things done with regular
> > expressions. :)
> 
> A simple example: lets say that in Perl you have a regex but you don't
> know what it is.  Its held in a string passed by some function and
> needs to be a parameter.  Now, you want to strip everything but what
> matches each time.  Or better yet, output what does match to one
> stream, and output what doesn't match to another (in one pass).

It sounds like most of your problem has little to do with regular
expressions and more to do with I/O management. 

   while( <$fh> )
      {
      if( m/$regex/ ) { print $out "$`$'"; print $out2 $& }
      else                      { print $out }
      }


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

Date: Sat, 15 Mar 2008 04:52:05 -0700 (PDT)
From: =?ISO-8859-1?Q?mathias_w=FCndisch?= <wuendi@googlemail.com>
Subject: Re: try to use "locale" with german and coepage 437 (dos)
Message-Id: <83766985-c372-44e4-b92f-ef1b93b2df7c@d62g2000hsf.googlegroups.com>


> What's about using Encode module, with decode function to transform your
> IBM/CP 437 data to utf-8, and then using utf-8 (transparently) behaviour
> of perl regex?

dear jm, ok this is a good idea! i will try this. thanks for
suggestion. m.


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

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 V11 Issue 1364
***************************************


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