[31579] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2838 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Feb 27 03:09:26 2010

Date: Sat, 27 Feb 2010 00:09:07 -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           Sat, 27 Feb 2010     Volume: 11 Number: 2838

Today's topics:
    Re: FEAR::API <sopan.shewale@gmail.com>
    Re: OT, blowing off steam <cartercc@gmail.com>
    Re: OT, blowing off steam <sreservoir@gmail.com>
    Re: Requesting regular expression help <smallpond@juno.com>
    Re: Requesting regular expression help <jimsgibson@gmail.com>
    Re: Requesting regular expression help <tadmc@seesig.invalid>
    Re: Requesting regular expression help <ben@morrow.me.uk>
    Re: Requesting regular expression help <ben@morrow.me.uk>
    Re: Requesting regular expression help <uri@StemSystems.com>
    Re: Requesting regular expression help <tadmc@seesig.invalid>
    Re: Requesting regular expression help <uri@StemSystems.com>
    Re: Requesting regular expression help sln@netherlands.com
    Re: Requesting regular expression help <tadmc@seesig.invalid>
    Re: Requesting regular expression help <derykus@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 26 Feb 2010 19:27:50 -0800 (PST)
From: "sopan.shewale@gmail.com" <sopan.shewale@gmail.com>
Subject: Re: FEAR::API
Message-Id: <6861a7ac-a902-40b5-9ac9-1d3c03f73cf3@z10g2000prh.googlegroups.com>

On Feb 26, 10:58=A0pm, Christian Winter <thepoet_nos...@arcor.de> wrote:
> sopan.shew...@gmail.com schrieb:
>
> > Does any one know abotu FEAR::API? i saw nice article at
> >http://www.perl.com/lpt/a/980but the module does not exist in CPAN.
>
> > Tried searching on google -but did not get hold of the =A0code.
>
> Looks like it has been removed from CPAN, but from the looks of
> it, the "Scrapar" dist might be its successor.
>
> -Chris

Thanks Chris,

Scraper sounds to be interesting.




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

Date: Fri, 26 Feb 2010 17:15:42 -0800 (PST)
From: ccc31807 <cartercc@gmail.com>
Subject: Re: OT, blowing off steam
Message-Id: <1cc5e6ce-48db-40b0-8865-789488084255@33g2000yqj.googlegroups.com>

On Feb 26, 1:54=A0pm, sreservoir <sreserv...@gmail.com> wrote:
> > Typing control-k, LF in vim inserts ^@. Typing control-k, NU inserts
> > ^U.
>
> > Look at the symbols using the :digraphs command.
>
> NU ^@
>
> ?

I'm using gVim on Windows XP at work, and I'm not at that machine so I
can't check it now. I could have made a mistake, and if so I'll admit
it. But I did check it twice, and it's LF =3D ^@ and NU =3D ^U.

Like I said, if I made a mistake, I'll let you know on Monday.

CC.


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

Date: Fri, 26 Feb 2010 20:34:17 -0500
From: sreservoir <sreservoir@gmail.com>
Subject: Re: OT, blowing off steam
Message-Id: <hm9sr8$hap$1@speranza.aioe.org>

On 2/26/2010 8:15 PM, ccc31807 wrote:
> On Feb 26, 1:54 pm, sreservoir<sreserv...@gmail.com>  wrote:
>>> Typing control-k, LF in vim inserts ^@. Typing control-k, NU inserts
>>> ^U.
>>
>>> Look at the symbols using the :digraphs command.
>>
>> NU ^@
>>
>> ?
>
> I'm using gVim on Windows XP at work, and I'm not at that machine so I
> can't check it now. I could have made a mistake, and if so I'll admit
> it. But I did check it twice, and it's LF = ^@ and NU = ^U.
>
> Like I said, if I made a mistake, I'll let you know on Monday.

it's probably a system inconsistency.

my output:

NU ^@  10  SH ^A   1  SX ^B   2  EX ^C   3  ET ^D   4  EQ ^E   5
AK ^F   6  BL ^G   7  BS ^H   8  HT ^I   9  LF ^@  10  VT ^K  11
FF ^L  12  CR ^M  13  SO ^N  14  SI ^O  15  DL ^P  16  D1 ^Q  17
D2 ^R  18  D3 ^S  19  D4 ^T  20  NK ^U  21  SY ^V  22  EB ^W  23
CN ^X  24  EM ^Y  25  SB ^Z  26  EC ^[  27  FS ^\  28  GS ^]  29
RS ^^  30  US ^_  31  SP     32  Nb #   35  DO $   36  At @   64
<( [   91  // \   92  )> ]   93  '> ^   94  '! `   96  (! {  123
!! |  124  !) }  125  '? ~  126  DT ^? 127  PA ~@ 128  HO ~A 129
BH ~B 130  NH ~C 131  IN ~D 132  NL ~E 133  SA ~F 134  ES ~G 135
HS ~H 136  HJ ~I 137  VS ~J 138  PD ~K 139  PU ~L 140  RI ~M 141
S2 ~N 142  S3 ~O 143  DC ~P 144  P1 ~Q 145  P2 ~R 146  TS ~S 147
CC ~T 148  MW ~U 149  SG ~V 150  EG ~W 151  SS ~X 152  GC ~Y 153
SC ~Z 154  CI ~[ 155  ST ~\ 156  OC ~] 157  PM ~^ 158  AC ~_ 159
NS |  160  !I ¡  161  Ct ¢  162  Pd £  163  Cu ¤  164  Ye ¥  165
BB ¦  166  SE §  167  ': ¨  168  Co ©  169  -a ª  170  << «  171
NO ¬  172  -- ­  173  Rg ®  174  'm ¯  175  DG °  176  +- ±  177
2S ²  178  3S ³  179  '' ´  180  My µ  181  PI ¶  182  .M ·  183
', ¸  184  1S ¹  185  -o º  186  >> »  187  14 ¼  188  12 ½  189
34 ¾  190  ?I ¿  191  A! À  192  A' Á  193  A> Â  194  A? Ã  195
A: Ä  196  AA Å  197  AE Æ  198  C, Ç  199  E! È  200  E' É  201
E> Ê  202  E: Ë  203  I! Ì  204  I' Í  205  I> Î  206  I: Ï  207
D- Ð  208  N? Ñ  209  O! Ò  210  O' Ó  211  O> Ô  212  O? Õ  213
O: Ö  214  *X ×  215  O/ Ø  216  U! Ù  217  U' Ú  218  U> Û  219
U: Ü  220  Y' Ý  221  TH Þ  222  ss ß  223  a! à  224  a' á  225
a> â  226  a? ã  227  a: ä  228  aa å  229  ae æ  230  c, ç  231
e! è  232  e' é  233  e> ê  234  e: ë  235  i! ì  236  i' í  237
i> î  238  i: ï  239  d- ð  240  n? ñ  241  o! ò  242  o' ó  243
o> ô  244  o? õ  245  o: ö  246  -: ÷  247  o/ ø  248  u! ù  249
u' ú  250  u> û  251  u: ü  252  y' ý  253  th þ  254  y: ÿ  255
~! ¡  161  c| ¢  162  $$ £  163  ox ¤  164  Y- ¥  165  || ¦  166
cO ©  169  -, ¬  172  -= ¯  175  ~o °  176  22 ²  178  33 ³  179
pp ¶  182  ~. ·  183  11 ¹  185  ~? ¿  191  A` À  192  A^ Â  194
A~ Ã  195  A" Ä  196  A@ Å  197  E` È  200  E^ Ê  202  E" Ë  203
I` Ì  204  I^ Î  206  I" Ï  207  N~ Ñ  209  O` Ò  210  O^ Ô  212
O~ Õ  213  /\ ×  215  U` Ù  217  U^ Û  219  Ip Þ  222  a` à  224
a^ â  226  a~ ã  227  a" ä  228  a@ å  229  e` è  232  e^ ê  234
e" ë  235  i` ì  236  i^ î  238  n~ ñ  241  o` ò  242  o^ ô  244
o~ õ  245  u` ù  249  u^ û  251  y" ÿ  255


so yes, LF does produce ^@, but I only have NK for ^U.

-- 

   "Six by nine. Forty two."
   "That's it. That's all there is."
   "I always thought something was fundamentally wrong with the universe"


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

Date: Fri, 26 Feb 2010 18:36:10 -0500
From: Steve C <smallpond@juno.com>
Subject: Re: Requesting regular expression help
Message-Id: <hm9ltv$fkt$1@news.eternal-september.org>

David G wrote:
> I'm not any kind or perl expert, but have still managed to inherit a
> number of perl scripts in a project.  The original author is long
> gone, and we don't have any perl expertise in house.
> 
> The problem is that one of the scripts reads in a text file, and
> performs a translation operation on strings it finds enclosed in
> double quotes.  The perl in question is as follows:
> 
> {
> 	open(INPUT, "$infile") or die "Can't open $infile: $!\n";
> 	local $/ = undef;
> 	$inputText = <INPUT>;
> 	close(INPUT);
> }
> 
> $inputText =~ s/"([^"]*)"/Translate(*TRANS, $1, "Generic String")/ieg;
> 
> OpenMakeDir(*OUTPUT, "$outfile") or die "Can't write $outfile \n";
> print OUTPUT $inputText;
> close(OUTPUT);
> 
> As far as I can tell, the entire operation is done in one go by the
> line that starts "$input =~ ..."
> 
> The problem is that we need to have the operation not be performed if
> the quoted string is itself enclosed in double angle brackets.
> 
> "This string is translated"
> <<..."This string isn't"...>>
> 
> shows what is needed.  If it makes any difference, angle bracket
> enclosed sequences will never cross a line boundary.
> 
> For what it's worth I got the job because I'd mentioned that I do know
> awk reasonably well.  Ironically, this would be trivial for me to
> craft in awk, but that doesn't help here.
> 
> So, is there any way to get the behavior we want?  If it means
> processing each line of the file in isolation, I'm 100% on board with
> that, I just need to find a working solution.
> 

Nesting is not something that you can do in the general case in a regexp.
You could change quotes within angle brackets to something else that doesn't
match and also doesn't appear in your text, then do your existing regexp,
then change them back.



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

Date: Fri, 26 Feb 2010 17:07:59 -0800
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: Requesting regular expression help
Message-Id: <260220101707590083%jimsgibson@gmail.com>

In article
<86109fe4-3e34-4a48-ae98-18c4c84633a6@t9g2000prh.googlegroups.com>,
David G <dgnuff@gmail.com> wrote:

> I'm not any kind or perl expert, but have still managed to inherit a
> number of perl scripts in a project.  The original author is long
> gone, and we don't have any perl expertise in house.
> 
> The problem is that one of the scripts reads in a text file, and
> performs a translation operation on strings it finds enclosed in
> double quotes.  The perl in question is as follows:
> 
> {
>   open(INPUT, "$infile") or die "Can't open $infile: $!\n";
>   local $/ = undef;
>   $inputText = <INPUT>;
>   close(INPUT);
> }
> 
> $inputText =~ s/"([^"]*)"/Translate(*TRANS, $1, "Generic String")/ieg;
> 
> OpenMakeDir(*OUTPUT, "$outfile") or die "Can't write $outfile \n";
> print OUTPUT $inputText;
> close(OUTPUT);
> 
> As far as I can tell, the entire operation is done in one go by the
> line that starts "$input =~ ..."
> 
> The problem is that we need to have the operation not be performed if
> the quoted string is itself enclosed in double angle brackets.
> 
> "This string is translated"
> <<..."This string isn't"...>>

See the advice given by 'perldoc -q balanced' "Can I use Perl regular
expressions to match balanced text?" This has changed in Perl 5.10.

Consider using the Text::Balanced module.

-- 
Jim Gibson


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

Date: Fri, 26 Feb 2010 19:29:17 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Requesting regular expression help
Message-Id: <slrnhogt4c.spq.tadmc@tadbox.sbcglobal.net>

David G <dgnuff@gmail.com> wrote:

> {
> 	open(INPUT, "$infile") or die "Can't open $infile: $!\n";

    perldoc -q vars

        What's wrong with always quoting "$vars"?

So make that:

    open(INPUT, $infile) or die "Can't open $infile: $!\n";


> $inputText =~ s/"([^"]*)"/Translate(*TRANS, $1, "Generic String")/ieg;
                                                                    ^
                                                                    ^
Ignoring case on a pattern that contains no letters is
a pretty silly thing to do...


> OpenMakeDir(*OUTPUT, "$outfile") or die "Can't write $outfile \n";


     OpenMakeDir(*OUTPUT, $outfile) or die "Can't write $outfile \n";


> As far as I can tell, the entire operation is done in one go by the
> line that starts "$input =~ ..."


Right.


> The problem is that we need to have the operation not be performed if
> the quoted string is itself enclosed in double angle brackets.
>
> "This string is translated"
><<..."This string isn't"...>>
>
> shows what is needed.


Match *either* a double-brackety string or a double-quoted
string, and if it is double-brackety just put it back in unchanged:

    $inputText =~ s{
                     (<<.+?>>)      # double brackety
                     |
                     "([^"]*)"      # double quotey
                   }
                   {$1 ?            # IF there's anything in $1
                    $1 :            # THEN just put it back
                    Translate($2)   # ELSE do the translation
                   }sexg;


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"


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

Date: Sat, 27 Feb 2010 01:57:29 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Requesting regular expression help
Message-Id: <9pam57-mfd1.ln1@osiris.mauzo.dyndns.org>


Quoth David G <dgnuff@gmail.com>:
> I'm not any kind or perl expert, but have still managed to inherit a
> number of perl scripts in a project.  The original author is long
> gone, and we don't have any perl expertise in house.
> 
> The problem is that one of the scripts reads in a text file, and
> performs a translation operation on strings it finds enclosed in
> double quotes.  The perl in question is as follows:
> 
> {
> 	open(INPUT, "$infile") or die "Can't open $infile: $!\n";

I don't know if you realise this, but the trailing "\n" will cause perl
not to print the file and line number where the error occurred. This may
be what you want (if the message is intended for an end-user) but can
make debugging harder.

> 	local $/ = undef;

The '= undef' is redundant, since 'local' sets the variable to undef
anyway.

> 	$inputText = <INPUT>;
> 	close(INPUT);
> }
> 
> $inputText =~ s/"([^"]*)"/Translate(*TRANS, $1, "Generic String")/ieg;

Where does Translate come from? Where does *TRANS come from? You should
post complete programs. If necessary replace the Translate function with
one that does something else, and check to make sure your problem still
occurs with the replacement.

Don't quote variables unless you need to.

Start your program with
    
    use warnings;
    use strict;

and fix all the resulting errors. Usually these will be about variables
that haven't been declared; you fix these by adding 'my' before the
first use. Sometimes you will find you need a standalone 'my $foo'
before a block, if the variable needs to be visible afterwards.

This is probably a little over your head ATM, but I'll say it anyway:
don't use global bareword filehandles (the INPUT and *TRANS, assuming
that's a filehandle and not a perl4ish ref-substitute), use properly-
scoped variables instead. 

Don't use 2-arg open with untrusted input, since it may do unexpected
things. 

In your case, this means you want

    my $inputText;
    {
        open(my $INPUT, "<", $infile)
            or die "can't open $infile: $!\n";
        local $/;
        $inputText = <$INPUT>;

        # there's no need to close, since the filehandle will be closed
        # when the variable goes out of scope.
    }

I would also use the 'autodie' module (installed from CPAN), which will
handle the 'or die' part for you, and use a 'do' block rather than an
assignment at the end:

    use autodie;

    my $inputText = do {
        open(my $INPUT, "<", $infile);
        <$INPUT>;
    };

or actually I'd just use the File::Slurp module from CPAN:

    use File::Slurp qw/read_file/;

    my $inputText = read_file $infile;

> OpenMakeDir(*OUTPUT, "$outfile") or die "Can't write $outfile \n";
> print OUTPUT $inputText;
> close(OUTPUT);
> 
> As far as I can tell, the entire operation is done in one go by the
> line that starts "$input =~ ..."
> 
> The problem is that we need to have the operation not be performed if
> the quoted string is itself enclosed in double angle brackets.
> 
> "This string is translated"
> <<..."This string isn't"...>>
> 
> shows what is needed.  If it makes any difference, angle bracket
> enclosed sequences will never cross a line boundary.
> 
> For what it's worth I got the job because I'd mentioned that I do know
> awk reasonably well.  Ironically, this would be trivial for me to
> craft in awk, but that doesn't help here.

How would you do it in awk? I believe perl can do anything awk can do,
but I'm prepared to be proven wrong. (You may need to explain in English
rather than awk, since I don't know awk.)

Anyway, something like

    s{ (<<.*?>>) | "([^"]*)" | (.) }{
        $1 // $3 // Translate(*TRANS, $1, "GenericString")
    }iegx;

should work. If you don't have perl 5.10 (check the first line of 
'perl -v') then you won't have the '//' operator so you'll need something
uglier like

    s{ (<<.*?>>) | "([^"]*)" | (.) }{
        defined($1) ? $1 :
        defined($3) ? $3 :
        Translate(*TRANS, $1, "GenericString")
    }iegx;

The /x modifier (the 'x' in 'iegx') let me use some whitespace in the
pattern for clarity: I highly recommend using it for complicated
patterns.

Ben



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

Date: Sat, 27 Feb 2010 01:59:47 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Requesting regular expression help
Message-Id: <jtam57-mfd1.ln1@osiris.mauzo.dyndns.org>


Quoth Tad McClellan <tadmc@seesig.invalid>:
> 
> Match *either* a double-brackety string or a double-quoted
> string, and if it is double-brackety just put it back in unchanged:
> 
>     $inputText =~ s{
>                      (<<.+?>>)      # double brackety
>                      |
>                      "([^"]*)"      # double quotey
>                    }
>                    {$1 ?            # IF there's anything in $1

It's worth pointing out that in general you need 'defined $1' here. It's
safe in this case, since a string containing '<<>>' cannot be false, but
it's not a good habit to get into.

Ben



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

Date: Fri, 26 Feb 2010 22:00:32 -0500
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Requesting regular expression help
Message-Id: <87y6ifjsbz.fsf@quad.sysarch.com>

>>>>> "BM" == Ben Morrow <ben@morrow.me.uk> writes:


  BM> or actually I'd just use the File::Slurp module from CPAN:

  BM>     use File::Slurp qw/read_file/;

no need to explicitly import read_file. it and write_file are exported
by default.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Fri, 26 Feb 2010 21:15:01 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Requesting regular expression help
Message-Id: <slrnhoh3ak.t4t.tadmc@tadbox.sbcglobal.net>

Uri Guttman <uri@StemSystems.com> wrote:
>>>>>> "BM" == Ben Morrow <ben@morrow.me.uk> writes:
>
>
>  BM> or actually I'd just use the File::Slurp module from CPAN:
>
>  BM>     use File::Slurp qw/read_file/;
>
> no need to explicitly import read_file. 


He isn't explicitly importing read_file...


> it and write_file are exported
> by default.


 ... he is suppressing the importing of write_file. :-)

I nearly always explicitly name only the funcs I plan to use like that.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"


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

Date: Sat, 27 Feb 2010 00:39:58 -0500
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Requesting regular expression help
Message-Id: <87pr3rjky9.fsf@quad.sysarch.com>

>>>>> "TM" == Tad McClellan <tadmc@seesig.invalid> writes:

  TM> Uri Guttman <uri@StemSystems.com> wrote:
  >>>>>>> "BM" == Ben Morrow <ben@morrow.me.uk> writes:
  >> 
  >> 
  BM> or actually I'd just use the File::Slurp module from CPAN:
  >> 
  BM> use File::Slurp qw/read_file/;
  >> 
  >> no need to explicitly import read_file. 


  TM> He isn't explicitly importing read_file...


  >> it and write_file are exported
  >> by default.


  TM> ... he is suppressing the importing of write_file. :-)

yeah, i know that. but that isn't so harmful to default to the
imports. not that you would create a conflicting write_file sub too often.

  TM> I nearly always explicitly name only the funcs I plan to use like that.

depends on the module and how it sets up its export lists and such.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Fri, 26 Feb 2010 22:50:54 -0800
From: sln@netherlands.com
Subject: Re: Requesting regular expression help
Message-Id: <v2bho55d0q7un62gjuednnhg464q792cpk@4ax.com>

On Sat, 27 Feb 2010 01:59:47 +0000, Ben Morrow <ben@morrow.me.uk> wrote:

>
>Quoth Tad McClellan <tadmc@seesig.invalid>:
>> 
>> Match *either* a double-brackety string or a double-quoted
>> string, and if it is double-brackety just put it back in unchanged:
>> 
>>     $inputText =~ s{
>>                      (<<.+?>>)      # double brackety
>>                      |
>>                      "([^"]*)"      # double quotey
>>                    }
>>                    {$1 ?            # IF there's anything in $1
>
>It's worth pointing out that in general you need 'defined $1' here. It's
>safe in this case, since a string containing '<<>>' cannot be false, but
                                                       ^^^^^^^^^^
This would seem to be understated since ($1 being a string) only the
lone character '0' and undef will be false for condition  if( $1 ){};

But, defined $1 is the intention and its easier to read.
This condition is a trap though, one would want to block
against a while($var = '0') condition since '0' might be
valid as text data, not to be discarded (depending on usage).

Kind of odd, only if the scalar is marked undefined
or is the code for '0' is it false. Not false for '00'.

print "'00'  yes \n" if ('00');
print "'0'   no  \n" if (not '0');
print "undef no  \n" if (not undef);
print "'a'   yes \n" if ('a');

while(not $var = '0') {
    print "while (not \$var = '0'){}  yes\n";
    last;
}

I probably got this all wrong but have been bitten
by this before, so I don't do it.
In this context though, it is still valid.

-sln


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

Date: Sat, 27 Feb 2010 01:02:58 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Requesting regular expression help
Message-Id: <slrnhohgm0.u89.tadmc@tadbox.sbcglobal.net>

sln@netherlands.com <sln@netherlands.com> wrote:

> one would want to block
> against a while($var = '0') condition


There is no need to worry about that, as it generates a rather 
clear warning message.  (and all sensible Perl programmers enable warnings) 

:-)


> Kind of odd, only if the scalar is marked undefined
> or is the code for '0' is it false. 


The "Truth and Falsehood" section in

    perldoc perlsyn

states rather clearly what is considered false:

    The number 0, the strings C<'0'> and C<''>, the empty list C<()>, and
    C<undef> are all false in a boolean context. All other values are true.


> Not false for '00'.


That isn't in the list from the docs quoted above, so it is "true".


> I probably got this all wrong 


The World is astounded at such a rare occurrence!


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"


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

Date: Fri, 26 Feb 2010 23:36:16 -0800 (PST)
From: "C.DeRykus" <derykus@gmail.com>
Subject: Re: Requesting regular expression help
Message-Id: <3e6f7fb0-3be2-4abf-9f3e-0b8977e6c92d@k6g2000prg.googlegroups.com>

On Feb 26, 5:57=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth David G <dgn...@gmail.com>:
>
> ...
> Anyway, something like
>
> =A0 =A0 s{ (<<.*?>>) | "([^"]*)" | (.) }{
> =A0 =A0 =A0 =A0 $1 // $3 // Translate(*TRANS, $1, "GenericString")
> =A0 =A0 }iegx;
>

Did you mean to leave the (.) alternative in the solution?

--
Charles DeRykus


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

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:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#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 2838
***************************************


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