[32304] in Perl-Users-Digest
Perl-Users Digest, Issue: 3571 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 19 09:09:28 2011
Date: Mon, 19 Dec 2011 06:09:10 -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 Mon, 19 Dec 2011 Volume: 11 Number: 3571
Today's topics:
Re: CGI alternatives/replacements xhoster@gmail.com
Does an "external authentication" package exist? (Otto J. Makela)
I want to offer two Perl programs... <aminer68@gmail.com>
Re: I want to offer two Perl programs... <aminer68@gmail.com>
Re: I want to offer two Perl programs... <tadmc@seesig.invalid>
Re: Problem configuring OS/2 for installing CPAN packag <dave@invalid.invalid>
Re: Question on using perl in a cgi script <hjp-usenet2@hjp.at>
Re: Question on using perl in a cgi script <mvdwege@mail.com>
Re: Question on using perl in a cgi script <cartercc@gmail.com>
Re: Question on using perl in a cgi script mittra@juno.com
Re: Question on using perl in a cgi script <hjp-usenet2@hjp.at>
Regex, replacing THIS|THAT <jwcarlton@gmail.com>
Re: Regex, replacing THIS|THAT <jurgenex@hotmail.com>
Re: Regex, replacing THIS|THAT <jwkrahn@example.com>
Re: Use of uninitialized value: when don't you get that (Tim McDaniel)
Re: vi regex to preserve interior commas in CSV string <cartercc@gmail.com>
Re: vi regex to preserve interior commas in CSV string <adscriven@gmail.com>
Re: vi regex to preserve interior commas in CSV string <adscriven@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 Dec 2011 03:13:53 GMT
From: xhoster@gmail.com
Subject: Re: CGI alternatives/replacements
Message-Id: <20111216221352.957$Xz@newsreader.com>
Justin C <justin.1111@purestblue.com> wrote:
> I visited a perl irc channel recently to try to get a quick answer to a
> problem, the solution was found eventually. Part of the discussion led
> to the suggestion that I shouldn't be using CGI.pm, but one of the web
> frameworks: Catalyst, CGI::Application, Jifty, Continuity, Mojolicious,
> Dancer, etc.
>
> I don't find irc the best medium for a decent discussion, it's not easy
> for people to reply with well considered thoughts, just snippets and
> sound-bites, so I thought I'd ask about these web-frameworks here.
>
> Has CGI.pm come to the end of it's usefulness?
Not for me.
> The company intranet site
> has about a dozen or so pages, a couple of them static HTML ... but
> using CGI to ensure consistent styling (CGI does the start and end html
> stuff, between that is sub that opens the page body and prints that to
> the browser). I can see that if I were to start this task again I would
> do it differently, perhaps use a web-app, and the whole site driven by
> one cgi - instead of clicking a link for, say, prospect management and
> being taken to a page that actually manages that, having the web-app
> return the functions needed for that choice. At least, that's what I
> understand these frameworks to enable, and how the web-apps work.
I don't see the advantage of having a single CGI do a bunch of unrelated
stuff. That seems like a disadvantage to me.
> Have I got that right? I know TMTOWTDI, but what is the 'usual' way
> these days?
If you want to spend 5 minutes writing a new form, and have it look like it
was written in 5 minutes, I'd stick with CGI.pm. If you want your forms to
look like they were designed by a professional graphics artist with a lot
of time on their hands (and are actually willing to hire one to spend that
time!) then I certainly wouldn't CGI.pm, although I don't exactly what to
recommend instead.
I'm from the get-er-done school myself.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
------------------------------
Date: Sun, 18 Dec 2011 00:31:57 +0200
From: om@iki.fi (Otto J. Makela)
Subject: Does an "external authentication" package exist?
Message-Id: <m3ty4y25k2.fsf@tigger.otto.net>
Is there a package implementing generalized "external authentication",
which would combine multiple alternatives like OpenID (including Google
identity), Facebook, Twitter etc.?
--
/* * * Otto J. Makela <om@iki.fi> * * * * * * * * * */
/* Phone: +358 40 765 5772, ICBM: N 60 10' E 24 55' */
/* Mail: Mechelininkatu 26 B 27, FI-00100 Helsinki */
/* * * Computers Rule 01001111 01001011 * * * * * * */
------------------------------
Date: Fri, 16 Dec 2011 15:02:06 -0800 (PST)
From: aminer <aminer68@gmail.com>
Subject: I want to offer two Perl programs...
Message-Id: <87465b43-f152-40f9-814f-2843d004f018@e2g2000vbb.googlegroups.com>
Hello,
If you have looked at my following graph:
http://pages.videotron.com/aminer/parallelqueue/parallelqueue1.htm
I have done it with an OLE automation Perl program that i have wrote,
so i have decided to offer to you those Perl programs that i have
wrote
that easy for you the ploting of very nice graphs:
Here they are:
http://pages.videotron.com/aminer/zip/ok1.pl
and
http://pages.videotron.com/aminer/zip/ok.pl
Just look at them and hope that you will find them very nice...
And you can download Perl from the ActiveState website here:
http://www.activestate.com/activeperl/downloads/thank-you?dl=http://downloads.activestate.com/ActivePerl/releases/5.14.2.1402/ActivePerl-5.14.2.1402-MSWin32-x86-295342.msi
You can download also my other module AdvNotify from:
http://pages.videotron.com/aminer/
thank you.
Amine Moulay Ramdane.
------------------------------
Date: Fri, 16 Dec 2011 15:06:16 -0800 (PST)
From: aminer <aminer68@gmail.com>
Subject: Re: I want to offer two Perl programs...
Message-Id: <99096e0b-da7b-4047-9adf-a4f20750f3be@t16g2000vba.googlegroups.com>
Hello again,
of course if you don't want to see Excel on the screen and you want
to
completly automate the ploting and the saving of your GIF file, just
set $app->{'Visible'} to 0 inside ok1.pl and ok.pl; like this:
$app->{'Visible'} =3D 0;
That's all.
Thank you,
Amine Moulay Ramdane.
On Dec 16, 6:02=A0pm, aminer <amine...@gmail.com> wrote:
> Hello,
>
> If you have looked at my following graph:
>
> http://pages.videotron.com/aminer/parallelqueue/parallelqueue1.htm
>
> I have done it with an OLE automation Perl program that i have wrote,
> so i have decided to offer to you those Perl programs that i have
> wrote
> that easy for you the ploting of very nice graphs:
>
> Here they are:
>
> http://pages.videotron.com/aminer/zip/ok1.pl
>
> and
>
> http://pages.videotron.com/aminer/zip/ok.pl
>
> Just look at them and hope that you will find them very nice...
>
> And you can download Perl from the ActiveState website here:
>
> http://www.activestate.com/activeperl/downloads/thank-you?dl=3Dhttp://d..=
.
>
> You can download also my other module =A0AdvNotify from:
>
> http://pages.videotron.com/aminer/
>
> thank you.
>
> Amine Moulay Ramdane.
------------------------------
Date: Fri, 16 Dec 2011 18:51:57 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: I want to offer two Perl programs...
Message-Id: <slrnjenq58.a60.tadmc@tadbox.sbcglobal.net>
aminer <aminer68@gmail.com> wrote:
> so i have decided to offer to you those Perl programs that i have
> wrote
It is very nice of you to offer to share.
I encourage your good attitude!
> Just look at them and hope that you will find them very nice...
I was disappointed by the first thing I looked for. :-(
They do not have both of these in them:
use warnings;
use strict;
Please update your programs to work silently with both of those enabled.
More people will be willing to try it then.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.
------------------------------
Date: Sat, 17 Dec 2011 08:58:22 +0000 (UTC)
From: "Dave Saville" <dave@invalid.invalid>
Subject: Re: Problem configuring OS/2 for installing CPAN packages
Message-Id: <fV45K0OBJxbE-pn2-lNtt0QdLGnCr@localhost>
On Fri, 16 Dec 2011 19:42:21 UTC, Ilya Zakharevich
<nospam-abuse@ilyaz.org> wrote:
> On 2011-12-15, Ben Morrow <ben@morrow.me.uk> wrote:
<snip>
> >> I would not be surprised if this test passes on OS/2 + EMX.
> >
> > I am beginning to seriously get the impression the OP would be much
> > better off starting with (real) EMX and the 5.14.4 tarball and building
> > a normal perl with -Dprefix=q:/programs/perl. Do you happen to know if
> > that is an easy thing to do?
>
> I did not try...
>
> Ilya
In trying to recompile SSHD and friends from the tarball I ran into
problems of TTY type stuff that is just not in the current libc - but
*is* in EMX. So I tried compling with EMX - Got so many errors I gave
up. :-(
--
Regards
Dave Saville
------------------------------
Date: Sat, 17 Dec 2011 10:03:13 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Question on using perl in a cgi script
Message-Id: <slrnjeommh.h4o.hjp-usenet2@hrunkner.hjp.at>
On 2011-12-14 09:27, Mart van de Wege <mvdwege@mail.com> wrote:
> "Peter J. Holzer" <hjp-usenet2@hjp.at> writes:
>> On 2011-12-14 07:41, Mart van de Wege <mvdwege@mail.com> wrote:
>>> q-rious <mittra@juno.com> writes:
>>>> I want to build a cgi script using perl that will continously loop
>>>> through the following:
[...]
>>>> I can do this for one iteration of the loop. But how do I update the
>>>> browser screen for multiple iterations? For other restrictions, I can
>>>> not reload the entire page each time the script goes through the
>>>> loop. I can only update the drawing (Step b).
>>>>
>>> You can't do that with static HTML and CGI, period.
>>
>> Yes, you can. Just include a Refresh header in the HTTP response.
>>
> Nope.
>
> Note that OP specifies that he can't reload the entire page.
I guess you didn't read the second paragraph before replying.
Here is a simple demonstration:
http://www.hjp.at/tests/refresh_html2.cgi
hp
--
_ | Peter J. Holzer | Deprecating human carelessness and
|_|_) | Sysadmin WSR | ignorance has no successful track record.
| | | hjp@hjp.at |
__/ | http://www.hjp.at/ | -- Bill Code on asrg@irtf.org
------------------------------
Date: Sat, 17 Dec 2011 16:39:53 +0100
From: Mart van de Wege <mvdwege@mail.com>
Subject: Re: Question on using perl in a cgi script
Message-Id: <86hb0zdx6e.fsf@gaheris.avalon.lan>
"Peter J. Holzer" <hjp-usenet2@hjp.at> writes:
> On 2011-12-14 09:27, Mart van de Wege <mvdwege@mail.com> wrote:
>> "Peter J. Holzer" <hjp-usenet2@hjp.at> writes:
>>> On 2011-12-14 07:41, Mart van de Wege <mvdwege@mail.com> wrote:
>>>> q-rious <mittra@juno.com> writes:
>>>>> I want to build a cgi script using perl that will continously loop
>>>>> through the following:
> [...]
>>>>> I can do this for one iteration of the loop. But how do I update the
>>>>> browser screen for multiple iterations? For other restrictions, I can
>>>>> not reload the entire page each time the script goes through the
>>>>> loop. I can only update the drawing (Step b).
>>>>>
>>>> You can't do that with static HTML and CGI, period.
>>>
>>> Yes, you can. Just include a Refresh header in the HTTP response.
>>>
>> Nope.
>>
>> Note that OP specifies that he can't reload the entire page.
>
> I guess you didn't read the second paragraph before replying.
>
> Here is a simple demonstration:
>
> http://www.hjp.at/tests/refresh_html2.cgi
>
OK, so at least Firefox refetches and redraws just the image when you
serve it up with Refresh header.
Huh. Didn't know that one. Live and learn, I guess.
Mart
--
"We will need a longer wall when the revolution comes."
--- AJS, quoting an uncertain source.
------------------------------
Date: Sat, 17 Dec 2011 14:55:47 -0800 (PST)
From: ccc31807 <cartercc@gmail.com>
Subject: Re: Question on using perl in a cgi script
Message-Id: <284d6ab6-290a-4f21-9e47-e3a33cd26417@o7g2000yqk.googlegroups.com>
On Dec 16, 11:36=A0am, Ted Zlatanov <t...@lifelogs.com> wrote:
> Please try to post complete working examples. =A0This one was nearly so
> which is much more confusing than actual pseudocode.
I couldn't post a working example because I have no idea of the kind
of file the OP wanted to print. In my example, I assumed that it was
some kind of ASCII file (maybe ASCII are) but it could have been
something else.
Working code also requires a working HTTP server set up to serve CGI
scripts. I just dashed this off at work, while waiting on some other
processes to complete, and didn't have access to such. If I had, I
would have picked up on the omission of the Copntent-type header right
away.
Still, none of that prevented me from making the point that the OP
really couldn't use CGI for doing what he said he wanted to do. I just
wanted to illustrate that point as well as I could while taking a
short break at work.
CC.
------------------------------
Date: Sat, 17 Dec 2011 23:27:14 -0800 (PST)
From: mittra@juno.com
Subject: Re: Question on using perl in a cgi script
Message-Id: <18238918.588.1324193234752.JavaMail.geo-discussion-forums@yqcs5>
Hi Peter,
Thanks for your reply and example. Will you be able to post the code for refresh_img.cgi so that I or if anyone else who may have similar question inthe future understand the process better?
Thanks again.
------------------------------
Date: Sun, 18 Dec 2011 11:48:33 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Question on using perl in a cgi script
Message-Id: <slrnjerh81.tal.hjp-usenet2@hrunkner.hjp.at>
On 2011-12-18 07:27, mittra@juno.com <mittra@juno.com> wrote:
> Hi Peter,
>
> Thanks for your reply and example. Will you be able to post the code
> for refresh_img.cgi so that I or if anyone else who may have similar
> question inthe future understand the process better?
The code is really trivial, but here it is:
#!/usr/bin/perl
# refresh_html2.cgi
use warnings;
use strict;
print "Content-Type: text/html; charset=utf-8\n";
print "\n";
print "<html>\n";
print " <head>\n";
print " <title>Refresh header test</title>\n";
print " </head>\n";
print " <body>\n";
print " <h1>Refresh header test</h1>\n";
print " <p>This script tests the effect of a Refresh header on an\n";
print " embedded image. The page should not be reloaded, but the\n";
print " image should.</p>\n";
print " <p>Time: ", scalar(gmtime), "</p>\n";
print " <iframe width='200', height='200' src='refresh_img.cgi'></iframe>\n";
print " <p>Time: ", scalar(gmtime), "</p>\n";
print " </body>\n";
print "</html>\n";
__END__
#!/usr/bin/perl
# refresh_img.cgi
use warnings;
use strict;
use Imager;
use Math::Trig qw(deg2rad);
print "Content-Type: image/png\n";
print "Refresh: 1\n";
print "\n";
my $img = Imager->new(xsize=>200, ysize=>200, channels=>4);
my ($sec, $min, $hour) = gmtime;
my $red = Imager::Color->new(255, 0, 0);
my $black = Imager::Color->new(0, 0, 0);
$img->circle(x => 100, y => 100, r => 99, color => $black, filled => 0);
$img->line(x1 => 100, y1 => 100,
x2 => 100 + sin(deg2rad($sec * 6)) * 90,
y2 => 100 - cos(deg2rad($sec * 6)) * 90,
color => $red);
$img->line(x1 => 100, y1 => 100,
x2 => 100 + sin(deg2rad($min * 6)) * 80,
y2 => 100 - cos(deg2rad($min * 6)) * 80,
color => $red);
$img->line(x1 => 100, y1 => 100,
x2 => 100 + sin(deg2rad($hour * 15)) * 70,
y2 => 100 - cos(deg2rad($hour * 15)) * 70,
color => $red);
$img->write(fh => \*STDOUT, type => 'png');
__END__
The relevant parts are the use of an iframe in the first script (it
doesn't work with <img/>, at least not with Firefox) and the Refresh
header in the second script.
hp
--
_ | Peter J. Holzer | Deprecating human carelessness and
|_|_) | Sysadmin WSR | ignorance has no successful track record.
| | | hjp@hjp.at |
__/ | http://www.hjp.at/ | -- Bill Code on asrg@irtf.org
------------------------------
Date: Fri, 16 Dec 2011 20:34:56 -0800 (PST)
From: Jason C <jwcarlton@gmail.com>
Subject: Regex, replacing THIS|THAT
Message-Id: <18952555.623.1324096496252.JavaMail.geo-discussion-forums@vbmi7>
Before putting this into production, can you guys confirm if the logic here=
is correct?
my $lt =3D chr(1);
my $gt =3D chr(2);
$text =3D~ s/<(\/{0,1})(div|span|table|tr|td|font|img)(.*?)>/$lt$1$2$3$gt/g=
si;
What I'm not sure about is if (div|span...) will work correctly, or if it's=
going to read "di, followed by either v or s, followed by pa", and so on.
(FWIW, the next step in the process is to remove all other HTML code, so th=
at only these tags are allowed. Then, I go back and change $lt and $gt back=
to < and >. This concept works well, so my only real question is whether t=
he regex will work as expected.)
------------------------------
Date: Sat, 17 Dec 2011 00:48:12 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Regex, replacing THIS|THAT
Message-Id: <q2loe710dkbpou2ffqhmesop7girdvs99h@4ax.com>
Jason C <jwcarlton@gmail.com> wrote:
[misguided attempt at using REs to manage HTML snipped]
>(FWIW, the next step in the process is to remove all other HTML code, so that only these tags are allowed. Then, I go back and change $lt and $gt back to < and >. This concept works well, so my only real question is whether the regex will work as expected.)
No, it doesn't work at all. You are aware of 'perldoc -q "remove HTML"'?
The examples given there for why REs are not suitable to parse HTML
apply just as well for your limited scope of only 7 tags.
If you want to parse HTML then use a parser for HTM but don't dwadle
with home-brewn RE approaches. Those can't work as has been discussed ad
nauseam before.
jue
------------------------------
Date: Sat, 17 Dec 2011 02:12:52 -0800
From: "John W. Krahn" <jwkrahn@example.com>
Subject: Re: Regex, replacing THIS|THAT
Message-Id: <FWZGq.25483$LO2.8126@newsfe13.iad>
Jason C wrote:
> Before putting this into production, can you guys confirm if the logic here is correct?
>
> my $lt = chr(1);
> my $gt = chr(2);
>
> $text =~ s/<(\/{0,1})(div|span|table|tr|td|font|img)(.*?)>/$lt$1$2$3$gt/gsi;
You have nothing between $1 and $2 or between $2 and $3 so why not just
use one pair of capturing parentheses:
$text =~ s/<(\/?(?:div|span|table|tr|td|font|img).*?)>/$lt$1$gt/gsi;
> What I'm not sure about is if (div|span...) will work correctly,
Yes, that is how alternation works. Each alternative can be any valid
pattern, including strings.
> or if it's going to read "di, followed by either v or s,
> followed by pa", and so on.
No, that would not make sense.
John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction. -- Albert Einstein
------------------------------
Date: Fri, 16 Dec 2011 22:03:13 +0000 (UTC)
From: tmcd@panix.com (Tim McDaniel)
Subject: Re: Use of uninitialized value: when don't you get that?
Message-Id: <jcgf71$3mn$1@reader1.panix.com>
In article <jcdo8q$doi$1@reader1.panix.com>,
Tim McDaniel <tmcd@panix.com> wrote:
>Is there a more complete listing of conditions that cause the warning
>and/or those that do not?
I hit on the right search terms (if only I knew what they were).
http://www.perlmonks.org/?node_id=862 by ambrus, from 2005, points to
perlsyn. The current version says
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Declarations
The only things you need to declare in Perl are report formats and
subroutines (and sometimes not even subroutines). A variable holds
the undefined value ("undef") until it has been assigned a defined
value, which is anything other than "undef". When used as a number,
"undef" is treated as 0; when used as a string, it is treated as the
empty string, ""; and when used as a reference that isn't being
assigned to, it is treated as an error. If you enable warnings,
you'll be notified of an uninitialized value whenever you treat
"undef" as a string or a number. Well, usually. Boolean contexts,
such as:
my $a;
if ($a) {}
are exempt from warnings (because they care about truth rather than
definedness). Operators such as "++", "--", "+=", "-=", and ".=",
that operate on undefined left values such as:
my $a;
$a++;
are also always exempt from such warnings.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I would put it as: A Boolean context is a scalar context, but it does
not convert values to be either string or a number. Therefore, undef
in a boolean context evaluates as false without producing a
uninitialized warning.
Also, "when used as a reference that isn't being assigned to, it is
treated as an error" does not appear to be accurate.
$x = undef;
if (exists $x->{notdef}) {
print "Huh?\n";
}
printf "after bad ref #3 [%s] [%d] [%s]\n", ref $x,
scalar keys %{$x}, join(',', keys %{$x});
produces only
after bad ref #3 [HASH] [0] []
That is, it doesn't create a something->{notdef} element, but it does
assign $x a reference to a new hash, and there's no error or warning.
I need to go read up on autovivification.
--
Tim McDaniel, tmcd@panix.com
------------------------------
Date: Fri, 16 Dec 2011 14:22:25 -0800 (PST)
From: ccc31807 <cartercc@gmail.com>
Subject: Re: vi regex to preserve interior commas in CSV string
Message-Id: <98be32bc-a3fe-4a48-9f75-819d33510180@u32g2000yqe.googlegroups.com>
On Dec 15, 6:22=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:
> 'In order to learn Perl one must eat; therefore cookery is on-topic in
> clpmisc.'
Eating is common across every field of human endeavor. Mastery of a
programming environment seems common only in programming.
'Rudeness' is much a matter of convention. I certainly did not
perceive myself as rude in my original post. I'm sorry if others did,
but I don't control how others feel.
In any case, my comment about penumbras stands. There is no bright
line between things that are 'clearly' off topic and those that
'clearly' on topic. In any case, I strongly disagree that IN THE
GENERAL CASE questions relating to regular expressions are ALWAYS off
topic. I just did a search for regex questions in clpm, and found
thousands of them. If I hadn't mentioned vi probably no one would have
had hurt feelings, but I can't figure out why mentioning vi caused
such an uproar.
CC.
------------------------------
Date: Sun, 18 Dec 2011 12:25:07 -0800 (PST)
From: Antony Scriven <adscriven@gmail.com>
Subject: Re: vi regex to preserve interior commas in CSV string
Message-Id: <a1482512-882f-434f-9482-37df913dcd7d@l19g2000yqc.googlegroups.com>
On Dec 13, 3:59 pm, ccc31807 wrote:
> I have CSV file with rows that looks like this:
>
> ROW EXAMPLE 1
> fieldA,fieldB,fieldC,George,Washington,President,"1600 Pennsylvania
> Avenue, Washington, D.C. 55554",
202-555-1212,fieldX,fieldY,fieldZ<EOL>
>
> I want to preserve the interior commas from the double quoted
portion
> of the string, perhaps turning it into something like this:
>
> ROW EXAMPLE 2
> 'fieldA','fieldB','fieldC','George','Washington,President','1600
> Pennsylvania Avenue, Washington, D.C.
> 55554','202-555-1212,','fieldX',;fieldY',;fieldZ'<EOL>
>
> where each value is single quoted and the values are separated by
> commas.
>
> I wanted (past tense) to do this with one vi (vim) regex and spend
> about an hour trying different ones before giving up in failure. I
use
> three different regexes to do what I wanted, so I don't have the
> problem anymore, but I still have the question.
>
> What one regex can I use (in vi/vim) to transform EXAMPLE 1 to
EXAMPLE
> 2?
>
> Thanks, CC.
1) Why?
2) Newlines are also valid within a CSV field. Use a proper parser.
--Antony
------------------------------
Date: Sun, 18 Dec 2011 12:26:58 -0800 (PST)
From: Antony Scriven <adscriven@gmail.com>
Subject: Re: vi regex to preserve interior commas in CSV string
Message-Id: <4379ffb5-6418-4c3e-a1fc-6dbe56b16fd1@b32g2000yqn.googlegroups.com>
On Dec 13, 3:59 pm, ccc31807 wrote:
> I have CSV file with rows that looks like this:
>
> [...]
>
> What one regex can I use (in vi/vim) to transform EXAMPLE
> 1 to EXAMPLE 2?
And why does it have to be *one* regexp? --Antony
------------------------------
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 3571
***************************************