[30864] in Perl-Users-Digest
Perl-Users Digest, Issue: 2109 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 9 11:14:21 2009
Date: Fri, 9 Jan 2009 08:14:12 -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 Fri, 9 Jan 2009 Volume: 11 Number: 2109
Today's topics:
Installing Tk under Solaris 10 and ActivePerl 5.10 <usenet05@drabble.me.uk>
Re: mail address validation <g_m@remove-comcast.net>
Re: opening a file <rvtol+usenet@xs4all.nl>
Re: regexp format for SQL <tadmc@seesig.invalid>
Re: Regular Expression Question <no@spam.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 09 Jan 2009 15:41:30 GMT
From: Graham Drabble <usenet05@drabble.me.uk>
Subject: Installing Tk under Solaris 10 and ActivePerl 5.10
Message-Id: <Xns9B8E9FA03F8AFgrahamdrabblelineone@ID-77355.user.dfncis.de>
Hi,
I'm trying to install Tk under Solaris 10. Install has to work
without a connection to the internet and I can't find a pre-built ppd
to download. Because I also have to make this script work under
Windows I'm using the ActivePerl5.10 solaris build, I have the
ActivePerl 5.10 Windows build working. Can change if needed but would
rather not.
I'm therefore trying to install it using Makefile.PL and make .
Unfortunately make is failing. Can anyone give me any pointers as to
why?
Below is the output from perl Makefile.pl and make. It makes no
difference if I use /usr/ccs/bin/make or /usr/xpg4/bin/make
Any suggestions greatfully received. I'm not particularly
knowledgeable on Unix, not really sure what this is meant to do or
what the error means. Process works for XML::Simple,
Config::IniFiles, Net::IP and Net:TFTP.
bash-3.00# cd /tmp/bfu-1.0.0-sol10/InstallSolaris/Tk-804.028
bash-3.00# /opt/ActivePerl-5.10/bin/perl Makefile.PL
/opt/ActivePerl-5.10/bin/perl is installed in /opt/ActivePerl-
5.10/lib okay
PPM for perl5.010000
Test Compiling config/perlrx.c
Test Compiling config/pmop.c
Test Compiling config/pregcomp2.c
Test Compiling config/signedchar.c
Test Compile/Run config/unsigned.c
Test Compiling config/Ksprintf.c
Test Compiling -DSPRINTF_RETURN_CHAR config/Ksprintf.c
Test Compiling config/tod.c
Test Compiling -DTIMEOFDAY_TZ config/tod.c
Test Compiling -DTIMEOFDAY_NO_TZ config/tod.c
Test Compiling -DTIMEOFDAY_DOTS config/tod.c
Problem gettimeofday()
/usr/openwin/bin/xmkmf suggests /usr/openwin
Using -L/usr/openwin/lib to find /usr/openwin/lib/libX11.so.4
Using -L/usr/lib to find /usr/lib/libX11.so.5
Using -I/usr/include to find /usr/include/X11/Xlib.h
XFT not requested
WARNING: DISTVNAME is not a known parameter.
'DISTVNAME' is not a known MakeMaker parameter name.
Generating Dependencies for solaris, win_arch=x
Test Compiling config/Hstrtoul.c
Test Compiling config/Hstrdup.c
Test Compiling config/Hstrcasecmp.c
Finding dependencies for ClientWin.c
Finding dependencies for Lang_f.c
Finding dependencies for Xlib_f.c
Finding dependencies for XrmOption.c
Finding dependencies for imgBMP.c
Finding dependencies for imgInit.c
Finding dependencies for imgInt_f.c
Finding dependencies for imgObj.c
Finding dependencies for imgUtil.c
Finding dependencies for imgWindow.c
Finding dependencies for imgXBM.c
Finding dependencies for imgXPM.c
Finding dependencies for ptkCanvGrid.c
Finding dependencies for ptkCanvGroup.c
Finding dependencies for stbDItem.c
Finding dependencies for stbDashCustom.c
Finding dependencies for stbDiStyle.c
Finding dependencies for strGlue.c
Finding dependencies for strcasecmp.c
Finding dependencies for strdup.c
Finding dependencies for strtoul.c
Finding dependencies for tclAsync.c
Finding dependencies for tclDecls_f.c
Finding dependencies for tclEvent.c
Finding dependencies for tclHash.c
Finding dependencies for tclNotify.c
Finding dependencies for tclPreserve.c
Finding dependencies for tclTimer.c
Finding dependencies for tclUnixEvent.c
Finding dependencies for tclUnixNotfy.c
Finding dependencies for tclUnixTime.c
Finding dependencies for tixCompat.c
Finding dependencies for tixDItem.c
Finding dependencies for tixDiITxt.c
Finding dependencies for tixDiImg.c
Finding dependencies for tixDiStyle.c
Finding dependencies for tixDiText.c
Finding dependencies for tixDiWin.c
Finding dependencies for tixError.c
Finding dependencies for tixForm.c
Finding dependencies for tixFormMisc.c
Finding dependencies for tixGrData.c
Finding dependencies for tixGrFmt.c
Finding dependencies for tixGrRC.c
Finding dependencies for tixGrSel.c
Finding dependencies for tixGrSort.c
Finding dependencies for tixGrUtl.c
Finding dependencies for tixGrid.c
Finding dependencies for tixHLCol.c
Finding dependencies for tixHLHdr.c
Finding dependencies for tixHLInd.c
Finding dependencies for tixHList.c
Finding dependencies for tixImgCmp.c
Finding dependencies for tixImgXpm.c
Finding dependencies for tixImgXpm_f.c
Finding dependencies for tixInputO.c
Finding dependencies for tixInt_f.c
Finding dependencies for tixList.c
Finding dependencies for tixMwm.c
Finding dependencies for tixNBFrame.c
Finding dependencies for tixScroll.c
Finding dependencies for tixSmpLs.c
Finding dependencies for tixTList.c
Finding dependencies for tixUnixDraw.c
Finding dependencies for tixUnixWm.c
Finding dependencies for tixUnixXpm.c
Finding dependencies for tixUtils.c
Finding dependencies for tixVars.c
Finding dependencies for tix_f.c
Finding dependencies for tk3d.c
Finding dependencies for tkAtom.c
Finding dependencies for tkBind.c
Finding dependencies for tkBitmap.c
Finding dependencies for tkButton.c
Finding dependencies for tkCanvArc.c
Finding dependencies for tkCanvBmap.c
Finding dependencies for tkCanvImg.c
Finding dependencies for tkCanvLine.c
Finding dependencies for tkCanvPoly.c
Finding dependencies for tkCanvPs.c
Finding dependencies for tkCanvText.c
Finding dependencies for tkCanvUtil.c
Finding dependencies for tkCanvWind.c
Finding dependencies for tkCanvas.c
Finding dependencies for tkClipboard.c
Finding dependencies for tkCmds.c
Finding dependencies for tkColor.c
Finding dependencies for tkConfig.c
Finding dependencies for tkCursor.c
Finding dependencies for tkDecls_f.c
Finding dependencies for tkEntry.c
Finding dependencies for tkError.c
Finding dependencies for tkEvent.c
Finding dependencies for tkEvent_f.c
Finding dependencies for tkFileFilter.c
Finding dependencies for tkFocus.c
Finding dependencies for tkFont.c
Finding dependencies for tkFrame.c
Finding dependencies for tkGC.c
Finding dependencies for tkGeometry.c
Finding dependencies for tkGet.c
Finding dependencies for tkGrab.c
Finding dependencies for tkGrid.c
Finding dependencies for tkImage.c
Finding dependencies for tkImgBmap.c
Finding dependencies for tkImgGIF.c
Finding dependencies for tkImgPPM.c
Finding dependencies for tkImgPhoto.c
Finding dependencies for tkImgPhoto_f.c
Finding dependencies for tkIntDecls_f.c
Finding dependencies for tkIntPlatDecls_f.c
Finding dependencies for tkIntXlibDecls_f.c
Finding dependencies for tkInt_f.c
Finding dependencies for tkListbox.c
Finding dependencies for tkMenu.c
Finding dependencies for tkMenuDraw.c
Finding dependencies for tkMenubutton.c
Finding dependencies for tkMessage.c
Finding dependencies for tkObj.c
Finding dependencies for tkOldConfig.c
Finding dependencies for tkOption.c
Finding dependencies for tkOption_f.c
Finding dependencies for tkPack.c
Finding dependencies for tkPanedWindow.c
Finding dependencies for tkPlace.c
Finding dependencies for tkPlatDecls_f.c
Finding dependencies for tkPointer.c
Finding dependencies for tkProperty.c
Finding dependencies for tkRectOval.c
Finding dependencies for tkScale.c
Finding dependencies for tkScrollbar.c
Finding dependencies for tkSelect.c
Finding dependencies for tkSquare.c
Finding dependencies for tkStubImg.c
Finding dependencies for tkStyle.c
Finding dependencies for tkText.c
Finding dependencies for tkTextBTree.c
Finding dependencies for tkTextDisp.c
Finding dependencies for tkTextImage.c
Finding dependencies for tkTextIndex.c
Finding dependencies for tkTextMark.c
Finding dependencies for tkTextTag.c
Finding dependencies for tkTextWind.c
Finding dependencies for tkTrig.c
Finding dependencies for tkUndo.c
Finding dependencies for tkUnix.c
Finding dependencies for tkUnix3d.c
Finding dependencies for tkUnixButton.c
Finding dependencies for tkUnixColor.c
Finding dependencies for tkUnixConfig.c
Finding dependencies for tkUnixCursor.c
Finding dependencies for tkUnixDialog.c
Finding dependencies for tkUnixDraw.c
Finding dependencies for tkUnixEmbed.c
Finding dependencies for tkUnixEvent.c
Finding dependencies for tkUnixFocus.c
Finding dependencies for tkUnixFont.c
Finding dependencies for tkUnixInit.c
Finding dependencies for tkUnixKey.c
Finding dependencies for tkUnixMenu.c
Finding dependencies for tkUnixMenubu.c
Finding dependencies for tkUnixScale.c
Finding dependencies for tkUnixScrlbr.c
Finding dependencies for tkUnixSelect.c
Finding dependencies for tkUnixSend.c
Finding dependencies for tkUnixWm.c
Finding dependencies for tkUnixXId.c
Finding dependencies for tkUnixXft.c
Finding dependencies for tkUtil.c
Finding dependencies for tkVisual.c
Finding dependencies for tkWindow.c
Finding dependencies for tk_f.c
Writing Makefile for Tk::pTk
Writing Makefile for Tk::pod
Writing Makefile for Tk::demos
Finding dependencies for X.xs
Writing Makefile for Tk::X
Finding dependencies for Xlib.xs
Writing Makefile for Tk::Xlib
Finding dependencies for WinPhoto.xs
Writing Makefile for Tk::WinPhoto
Writing Makefile for Tk::Tixish
Finding dependencies for Pixmap.xs
Writing Makefile for Tk::Pixmap
Finding dependencies for TixGrid.xs
Writing Makefile for Tk::TixGrid
Writing Makefile for Tk::TextList
Finding dependencies for Text.xs
Writing Makefile for Tk::Text
Finding dependencies for TList.xs
Writing Makefile for Tk::TList
Finding dependencies for Scrollbar.xs
Writing Makefile for Tk::Scrollbar
Finding dependencies for Scale.xs
Writing Makefile for Tk::Scale
Test Compile/Run config/has_png.c
Building libpng.a
Using scripts/makefile.solaris for solaris
If make fails read PNG/libpng/INSTALL
Building static library libz.a version 1.2.3 with cc.
Checking for unistd.h... No.
Checking whether to use vs[n]printf() or s[n]printf()... using s[n]
printf()
Checking for snprintf() in stdio.h... No.
WARNING: snprintf() not found, falling back to sprintf(). zlib
can build but will be open to possible buffer-overflow security
vulnerabilities.
Checking for return value of sprintf()... No.
WARNING: apparently sprintf() does not return a value. zlib
can build but will be open to possible string-format security
vulnerabilities.
Checking for errno.h... No.
Checking for mmap support... No.
Finding dependencies for PNG.xs
Finding dependencies for imgPNG.c
Missing ')'
trailing: L) && defined(PNG_MAX_MALLOC_64K) at /tmp/bfu-1.0.0-
sol10/InstallSolaris/Tk-804.028/Tk/MakeDepend.pm line 104,
<libpng/pngconf.h> line 1423.
Writing Makefile for Tk::PNG
Finding dependencies for NBFrame.xs
Writing Makefile for Tk::NBFrame
Finding dependencies for Mwm.xs
Writing Makefile for Tk::Mwm
Finding dependencies for Menubutton.xs
Writing Makefile for Tk::Menubutton
Finding dependencies for Listbox.xs
Writing Makefile for Tk::Listbox
Test Compile/Run jpeg/has_jpeg.c
Building jpeg/libjpeg.a
checking for gcc... cc
checking whether the C compiler (cc -D_REENTRANT -DUSE_SITECUSTOMIZE
-DPRIVLIB_LAST_IN_INC -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -
KPIC -D_REENTRANT -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -
D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -L/usr/lib -L/usr/ccs/lib
-L/opt/SUNWspro/prod/lib ) works... no
configure: error: installation or configuration problem: C compiler
cannot create executables.
Finding dependencies for JPEG.xs
Finding dependencies for imgJPEG.c
Writing Makefile for Tk::JPEG
Finding dependencies for InputO.xs
Writing Makefile for Tk::InputO
Finding dependencies for IO.xs
Writing Makefile for Tk::IO
Finding dependencies for HList.xs
Writing Makefile for Tk::HList
Finding dependencies for Event.xs
Finding dependencies for eventWin32Dll.c
Finding dependencies for pTkCallback.c
Finding dependencies for tclAsync.c
Finding dependencies for tclEvent.c
Finding dependencies for tclNotify.c
Finding dependencies for tclPlatEvent.c
Finding dependencies for tclPlatNotfy.c
Finding dependencies for tclPlatTime.c
Finding dependencies for tclTimer.c
Writing Makefile for Tk::Event
Finding dependencies for Entry.xs
Writing Makefile for Tk::Entry
Skip Win32Site on x
Writing Makefile for Tk::DragDrop
Finding dependencies for Compound.xs
Writing Makefile for Tk::Compound
Finding dependencies for Canvas.xs
Writing Makefile for Tk::Canvas
Finding dependencies for Tk.xs
Finding dependencies for chnGlue.c
Finding dependencies for encGlue.c
Finding dependencies for evtGlue.c
Finding dependencies for objGlue.c
Finding dependencies for tixGlue.c
Finding dependencies for tkGlue.c
Finding dependencies for tkGlue_f.c
Finding dependencies for tkWin32Dll.c
Tests in PNG
Tests in JPEG
Tests in Event
Writing Makefile for Tk
bash-3.00# /usr/ccs/bin/make
cd pTk && /usr/ccs/bin/make DEFINE="" LIBPERL_A="libperl.a"
LINKTYPE="dynamic" OPTIMIZE="-O" PREFIX="/opt/ActivePerl-5.10/site"
PASTHRU_DEFINE="" PASTHRU_INC=""
cc -c -I.. -I. -Ibitmaps -D_REENTRANT -DUSE_SITECUSTOMIZE -
DPRIVLIB_LAST_IN_INC -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O
-DVERSION=\"804.028\" -DXS_VERSION=\"804.028\" -KPIC "-
I/opt/ActivePerl-5.10/lib/CORE" ClientWin.c
/usr/ucb/cc: language optional software package not installed
*** Error code 1
make: Fatal error: Command failed for target `ClientWin.o'
Current working directory /tmp/bfu-1.0.0-sol10/InstallSolaris/Tk-
804.028/pTk
*** Error code 1
make: Fatal error: Command failed for target `pTk/libpTk.a'
bash-3.00#
bash-3.00# /opt/ActivePerl-5.10/bin/perl -V
Summary of my perl5 (revision 5 version 10 subversion 0)
configuration:
Platform:
osname=solaris, osvers=2.8, archname=sun4-solaris-thread-multi
uname='sunos machete 5.8 generic_117350-38 sun4u sparc sunw,sun-
blade-100 '
config_args='-ders -Dcc=cc -Dusethreads -Duseithreads -
Ud_sigsetjmp -Uinstallusrbinperl -Ulocincpth= -Uloclibpth= -
Ud_strerror_r -Ud_signbit -Accflags=-DUSE_SITECUSTOMIZE -
Duselargefiles -Accflags=-DPRIVLIB_LAST_IN_INC -
Dprefix=/opt/ActivePerl-5.10 -Dprivlib=/opt/ActivePerl-5.10/lib -
Darchlib=/opt/ActivePerl-5.10/lib -Dsiteprefix=/opt/ActivePerl-
5.10/site -Dsitelib=/opt/ActivePerl-5.10/site/lib -
Dsitearch=/opt/ActivePerl-5.10/site/lib -Dsed=/usr/bin/sed -
Duseshrplib -Dcf_by=ActiveState -Dcf_email=support@ActiveState.com'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define,
usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-D_REENTRANT -DUSE_SITECUSTOMIZE -
DPRIVLIB_LAST_IN_INC -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O',
cppflags='-D_REENTRANT -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC'
ccversion='Forte Developer 7 C 5.4 2002/03/09', gccversion='',
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=
16
ivtype='long', ivsize=4, nvtype='double', nvsize=8,
Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/lib -L/usr/ccs/lib -
L/opt/SUNWspro/prod/lib '
libpth=/usr/lib /usr/ccs/lib /opt/SUNWspro/prod/lib
/usr/local/lib
libs=-lsocket -lnsl -ldl -lm -lpthread -lc
perllibs=-lsocket -lnsl -ldl -lm -lpthread -lc
libc=, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -R
/opt/ActivePerl-5.10/lib/CORE'
cccdlflags='-KPIC', lddlflags='-G -L/usr/lib -L/usr/ccs/lib -
L/opt/SUNWspro/prod/lib'
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
USE_ITHREADS
USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API
USE_SITECUSTOMIZE
Locally applied patches:
ActivePerl Build 1004 [287188]
33741 avoids segfaults invoking S_raise_signal() (on Linux)
32809 Load 'loadable object' with non-default file extension
32728 64-bit fix for Time::Local
Built under solaris
Compiled at Sep 3 2008 17:20:47
@INC:
/opt/ActivePerl-5.10/site/lib
/opt/ActivePerl-5.10/lib
.
bash-3.00#
Thanks,
--
Graham Drabble
http://www.drabble.me.uk/
------------------------------
Date: Fri, 9 Jan 2009 07:10:32 -0500
From: "~greg" <g_m@remove-comcast.net>
Subject: Re: mail address validation
Message-Id: <ZqydncNkZvLyo_rUnZ2dnUVZ_gOdnZ2d@giganews.com>
Petr Vileta > ...
> ~greg > ...
>>>> http://community.opensourcedotnet.info/blogs/computer/archive/2006/09/16/Email-Address-Format-Myths.aspx
>>>
>>> Thanks a lot. This is exactly what I need.
>>> --
>>
>> probably you should try to stay off his "plus-haters list of shame".
>> :)
>
> Hi greg
> I need this mail validation for webform only, not for my MTA. I do validation with
>
> ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.!#$%&"*+-/=?^_`{|}~
>
> in left part and
>
> ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.-
>
> in domain part. In addition to this I check if mail address end with DOT + minimally 2 characters, so
> user@example.c - invalid
> user@example.cz - valid
>
> I do this validation because many users make typing errors, webform try to send message for these nonsensical addressess
> (every 4 hours again for 4 days) and my MTA gasp :-)
> --
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Petr,
That poster said that his "plus-haters list of shame" was about websites that:
"... inexplicably reject valid email addresses.
This infuriates part of their audience, who are rejected with a message
such as "Please enter a valid email". Users may try again, carefully
(and correctly) entering their (valid) email address several times,
before they realize that the stubborn website will never accept them,
usually without even bothering explaining why or providing a means
to contact the webmaster. Most users will just take their business
elsewhere rather than try to complain."
His main beef is about addresses being rejected
because they contain characters on the left side of the @ (+ in particular)
that happen to be illegal on the right side. Whereas, in fact,
they are perfectly legal on the left side.
So, if you do as you say, then you shouldn't find yourself on his list.
At least for that reason.
However, I suspect that people frequently, accidentally, enter
a wrong addresses, but that happens to be syntactically valid.
And, of course, evil people will always enter bogus syntactically
valid addresses --just for the hell of it.
I think that the best solution is for you to immediately send
a confirmation-request email to the given address, containing a return link.
If the link is used, the address is valid. Otherwise it isn't.
(I don't know how that's done, but it's very common, and I think it's ideal.)
~~~
Incidentally, a page I linked to before, about "RFC 1036, the Usenet article format",
is at a site:
( http://www.cs.tut.fi/~jkorpela/ )
that turns out to contains a number of rather clear discussions about various things.
In particular, this page:
http://www.cs.tut.fi/~jkorpela/rfc/822addr.html
on "Internet E-mail address format (RFC 822) explained"
is a very clear walk-through of the pseudo Backus-Naur notation
specifications in RFC 822. And it really is quite readable. So, if
you have the time, and interest, you'll want to read it.
(Myself, I have no need for such things.
The first script I ever learned to read was Backus-Naur notation.
And my native language is context-free. Although I only use it
these days to sing to atonal music.)
~greg
------------------------------
Date: Fri, 09 Jan 2009 12:09:43 +0100
From: "Dr.Ruud" <rvtol+usenet@xs4all.nl>
Subject: Re: opening a file
Message-Id: <49673077$0$195$e4fe514c@news.xs4all.nl>
George wrote:
> I thought I would use perl instead of fortran to parse a text file, what
> with the new m// s/// capabilities at my fingertips.
>
> So it is that I need to open a text file and send it to STDOUT.
You don't, because you can let your OS do that for you:
./filter.pl < input-file > output-file
In your filter.pl you put something like:
#/usr/bin/perl
use strict;
use warnings;
while ( <> ) {
substr $_, 50, -1, "..."
if length > 50;
}
__END__
--
Ruud
------------------------------
Date: Fri, 9 Jan 2009 07:46:58 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: regexp format for SQL
Message-Id: <slrngmelai.j42.tadmc@tadmc30.sbcglobal.net>
ELI <brian.eliason@gmail.com> wrote:
> #want to format the following:
> select
> --to_char(last_analyzed,'HH:MI:SS PM')
> *
> from
> user_indexes ui
> where
> UPPER(ui.index_name) = UPPER('fact_cnpt_pat_enct_idx')
> group by
> some column
> order by
> some other column
>
> #to be converted to the following format:
>
> select
> --to_char(last_analyzed,'HH:MI:SS PM')
> *
> from
> user_indexes ui
> where
> UPPER(ui.index_name) = UPPER('fact_cnpt_pat_enct_idx')
> group by
> some column
> order by
> some other column
> #QUESTION -----------------
> # is there a way to say "give me everything (in a backreference) that
> is NOT found within the expression" -
No.
But there is a way to say "match where the following does not match".
It is called a "negative look-ahead assertion" (perldoc perlre).
> # basically it needs to be the opposite of it's current logic, but I'm
> not sure how to do that. Suggestions?
s/^(?!(select|from|where|order|group)\b)/\t/gm;
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Fri, 9 Jan 2009 12:23:31 +0100
From: "Börni" <no@spam.com>
Subject: Re: Regular Expression Question
Message-Id: <gk7c3p$53i$1@atlas.ip-plus.net>
Thank you very much for your help everybody! (Of course my problem was the
">" character)
"Börni" <no@spam.com> schrieb im Newsbeitrag
news:gk5crn$k5$1@atlas.ip-plus.net...
> Hi
>
> This is probably very easy, but I don't get it.
>
> Example:
> #!perl -w
> use strict;
>
> my $string = '<meta name="Keywords" content="" lang="fr">';
>
> my ($keywords) = $string =~ /.*?meta name="Keywords".*?content="(.*?)">/;
>
> print "[$keywords]\n";
> exit 0;
>
>
> In the Example above I'd expect $keywords to be empty. Instead it is ["
> lang="fr].
>
> What is the correct expression to match everything
> <meta name="Keywords" content="-->IN HERE<--" lang="fr">
> even when it's empty?
>
> Regards Bernard
>
------------------------------
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 2109
***************************************