How to insert a reference to a user in my entry?
Perl web-programming
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What is interesting here?
• Duels
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Ñîîáùåñòâà
• Talxy Chat
• Horoscope
• Online
 
Register!

QAIX > Perl web-programmingGo to page: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | next »

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Ìîäåðàòîð:
Wednesday, 3 June 2009
DBD-Oracle Robert 12:51:40
 Hi list,I was able to install DBI module but DBD is giving the following error:C:\download\d­bd1>ppm install DBD-Oracle
Error: PPD for 'DBD-Oracle.ppd' could not be found. What am I missing? Thanks in advance




-------------------­--------------
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
comment 51 answer | Add comment
Friday, 29 May 2009
DBD::Oracle / ORACLE_HOME="/app/l­ocal/oracle/product/­9.2.0" / Solaris-2.8 / ... Jochen Hayek 12:07:07
 Hi!

I do experience problems when I try to install an uptodate version of DBD::Oracle.

So far we have been using this oracle: ORACLE_HOME="/app/l­ocal/oracle/product/­8.1.7",
but now the company installed 9.2.0 on all devopment and production machines,
so my boss told me to get DBD::Oracle running with 9.2.0, both on the client and on the server side.

Alright, first, this is "my context":

===================­====================­====================­====================­=
cronus@rsx94220 $ perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
Platform:
osname=solaris, osvers=2.8, archname=sun4-solar­is
uname='sunos rsx94220 5.8 generic_112953-02 sun4u sparc '
config_args='-de -Dusemymalloc=n -Duseshrplib=n -Dprefix=/app/idsp2­2/cronus1/usr/local'­
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=unde­f useithreads=undef usemultiplicity=und­ef
useperlio=undef d_sfio=undef uselargefiles=defin­e usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef­
Compiler:
cc='gcc', ccflags ='-fno-strict-alias­ing -I/usr/local/includ­e -D_LARGEFILE_SOURCE­ -D_FILE_OFFSET_BITS­=64',
optimize='-O',
cppflags='-fno-stri­ct-aliasing -I/usr/local/includ­e'
ccversion='', gccversion='3.2', gccosandvers='solar­is2.8'
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, usemymalloc=n, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib '
libpth=/usr/local/l­ib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldl -lm -lc
perllibs=-lsocket -lnsl -ldl -lm -lc
libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs,­ dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-fPIC',­ lddlflags='-G -L/usr/local/lib'


Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under solaris
Compiled at Jan 15 2003 03:22:35
@INC:
/app/idsp22/cronus1­/usr/local/lib/perl5­/5.6.1/sun4-solaris
/app/idsp22/cronus1­/usr/local/lib/perl5­/5.6.1
/app/idsp22/cronus1­/usr/local/lib/perl5­/site_perl/5.6.1/sun­4-solaris
/app/idsp22/cronus1­/usr/local/lib/perl5­/site_perl/5.6.1
/app/idsp22/cronus1­/usr/local/lib/perl5­/site_perl
.
===================­====================­====================­====================­=

First I simply tried this:

perl -MCPAN -e 'install DBD::Oracle'

but this is how it ended:

===================­====================­====================­====================­=
LD_RUN_PATH="/app/l­ocal/oracle/product/­9.2.0/lib:/app/local­/oracle/product/9.2.­0/rdbms/lib" gcc -G -L/usr/local/lib Oracle.o dbdimp.o oci7.o oci8.o -L/opt/SUNWcluster/­lib -R/opt/SUNWcluster/­lib -o build -L/app/local/oracle­/product/9.2.0/rdbms­/lib/ -L/app/local/oracle­/product/9.2.0/lib/ -lclntsh -lnbeq9 -lnhost9 -lnus9 -lnldap9 -lldapclnt9 -lnsslb9 -lnnis9 -lnoname9 -lntcp9 -lntcps9 -lnsslb9 -lntcp9 -lntns9 -lnsl -lsocket -lgen -ldl -R/app/local/oracle­/product/9.2.0/lib -laio -lposix4 -lkstat -lm -lthread -o blib/arch/auto/DBD/­Oracle/Oracle.so
ld: warning: option -o appears more than once, first setting taken
ld: fatal: file /app/local/oracle/p­roduct/9.2.0/lib//li­bclntsh.so: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to build
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/DBD/­Oracle/Oracle.so] Error 1
/app/idse22/cronus/­usr/local/bin/make -- NOT OK
===================­====================­====================­====================­=

Bad, right?!

So I followed the README, now have a look at this, pls:

===================­====================­====================­====================­=
cronus@rsx94220 $ perl Makefile.PL -p
Using DBI 1.38 installed in /app/idsp22/cronus1­/usr/local/lib/perl5­/site_perl/5.6.1/sun­4-solaris/auto/DBI

Configuring DBD::Oracle ...
Remember to actually *READ* the README file!
Especially if you have any problems.

Using Oracle in /app/local/oracle/p­roduct/9.2.0

Oracle version 9.2.0.0.0
Found header files in rdbms/public rdbms/demo.
Found /app/local/oracle/p­roduct/9.2.0/rdbms/d­emo/demo_rdbms.mk
Found /app/local/oracle/p­roduct/9.2.0/otrace/­demo/atmoci.mk
Using /app/local/oracle/p­roduct/9.2.0/rdbms/d­emo/demo_rdbms.mk
Reading /app/local/oracle/p­roduct/9.2.0/rdbms/d­emo/demo_rdbms.mk
Reading /app/local/oracle/p­roduct/9.2.0/rdbms/l­ib/env_rdbms.mk
Deleting ORA_NLS = $(ORACLE_HOME)/ocom­mon/nls/admin/data/
because it is not already set in the environment
and it can cause ORA-01019 errors.
Deleting ORA_NLS33 = $(ORACLE_HOME)/ocom­mon/nls/admin/data/
because it is not already set in the environment
and it can cause ORA-01019 errors.

Attempting to discover Oracle OCI build rules
gcc -c -I/app/local/oracle­/product/9.2.0/rdbms­/demo -I/app/local/oracle­/product/9.2.0/rdbms­/public -I/app/local/oracle­/product/9.2.0/plsql­/public -I/app/local/oracle­/product/9.2.0/netwo­rk/public -I/app/local/oracle­/product/9.2.0/rdbms­/demo -I/app/local/oracle­/product/9.2.0/rdbms­/public -I/app/local/oracle­/product/9.2.0/rdbms­/demo -I/app/idsp22/cronu­s1/usr/local/lib/per­l5/site_perl/5.6.1/s­un4-solaris/auto/DBI­ -fno-strict-aliasin­g -I/usr/local/includ­e -D_LARGEFILE_SOURCE­ -D_FILE_OFFSET_BITS­=64 -O -DVERSION=\"1.14\" -DXS_VERSION=\"1.14­\" -fPIC -I/app/idsp22/cronu­s1/usr/local/lib/per­l5/5.6.1/sun4-solari­s/CORE -DUTF8_SUPPORT DBD_ORA_OBJ.c
cc1: warning: changing search order for system directory "/usr/local/include­"
cc1: warning: as it has already been specified as a non-system directory
by executing: (make -f /app/local/oracle/p­roduct/9.2.0/rdbms/d­emo/demo_rdbms.mk build ECHODO=echo ECHO=echo GENCLNTSH='echo genclntsh' CC=echo OPTIMIZE= CCFLAGS= EXE=DBD_ORA_EXE OBJS=DBD_ORA_OBJ.o)­
Oracle oci build command:
+ -L/opt/SUNWcluster/­lib -R/opt/SUNWcluster/­lib -o build -L/app/local/oracle­/product/9.2.0/rdbms­/lib/ -L/app/local/oracle­/product/9.2.0/lib/ -o DBD_ORA_EXE DBD_ORA_OBJ.o -lclntsh -lnbeq9 -lnhost9 -lnus9 -lnldap9 -lldapclnt9 -lnsslb9 -lnnis9 -lnoname9 -lntcp9 -lntcps9 -lnsslb9 -lntcp9 -lntns9 -lnsl -lsocket -lgen -ldl -R/app/local/oracle­/product/9.2.0/lib -laio -lposix4 -lkstat -lm -lthread



System: perl5.006001 sunos rsx94220 5.8 generic_112953-02 sun4u sparc
Compiler: gcc -O -fno-strict-aliasin­g -I/usr/local/includ­e -D_LARGEFILE_SOURCE­ -D_FILE_OFFSET_BITS­=64
Linker: /usr/ccs/bin/ld
Sysliblist: -lnsl -lsocket -lgen -ldl
Oracle makefiles would have used these definitions but we override them:
CC: cc

CFLAGS: $(GFLAG) $(OPTIMIZE) $(CDEBUG) $(CCFLAGS) $(PFLAGS)\
$(SHARED_CFLAG) $(USRFLAGS)
[$(GFLAG) -xO3 $(CDEBUG) -Xa $(PROFILE) -xstrconst -dalign -xF $(XS) $(MR) -xildoff -errtags=yes -v -xarch=v9 -xchip=ultra3 -W2,-AKNR_S -Wd,-xsafe=unboundsym -Wc,-Qiselect-funcalign=32 -xcode=abs44 -Wc,-Qgsched-trace_late=1 -Wc,-Qgsched-T5 -xalias_level=weak -D_REENTRANT -DSS_64BIT_SERVER -DBIT64 -DMACHINE64 -K PIC -I/app/local/oracle/product/9.2.0/rdbms/demo -I/app/local/oracle/product/9.2.0/rdbms/public -I/app/local/oracle/product/9.2.0/plsql/public -I/app/local/oracle/product/9.2.0/network/public -DSLMXMX_ENABLE -DSLTS_ENABLE -D_SVID_GETTOD -D_REENTRANT $(LPFLAGS) $(USRFLAGS)]

LDFLAGS: -o $@ $(LDPATHFLAG)$(PROD­LIBHOME) $(LDPATHFLAG)$(LIBH­OME)
[-o $@ -L/app/local/oracle/product/9.2.0/rdbms/lib/ -L$(LIBHOME)]


Linking with OTHERLDFLAGS = -L/opt/SUNWcluster/­lib -R/opt/SUNWcluster/­lib -o build -L/app/local/oracle­/product/9.2.0/rdbms­/lib/ -L/app/local/oracle­/product/9.2.0/lib/ -lclntsh -lnbeq9 -lnhost9 -lnus9 -lnldap9 -lldapclnt9 -lnsslb9 -lnnis9 -lnoname9 -lntcp9 -lntcps9 -lnsslb9 -lntcp9 -lntns9 -lnsl -lsocket -lgen -ldl -R/app/local/oracle­/product/9.2.0/lib -laio -lposix4 -lkstat -lm -lthread
[from 'build' rule]

Argument "9.200.0.0" isn't numeric in numeric ge (>=) at Makefile.PL line 669.

Warning: If you have problems you may need to rebuild perl with threading enabled.

LD_RUN_PATH=/app/lo­cal/oracle/product/9­.2.0/lib:/app/local/­oracle/product/9.2.0­/rdbms/lib
Using DBD::Oracle 1.14.
Using DBI 1.38 installed in /app/idsp22/cronus1­/usr/local/lib/perl5­/site_perl/5.6.1/sun­4-solaris/auto/DBI
Writing Makefile for DBD::Oracle

*** If you have problems...
read all the log printed above, and the README and README.help files.
(Of course, you have read README by now anyway, haven't you?)

===================­====================­====================­====================­=


The "perl -MCPAN -e 'install DBD::Oracle'" simply ignored that problem, but I am not sure, I really should, so I lay this case before you, hoping for a hint or two, or maybe a patch.

I am quite willing to try a lot -- if you give me hints what to try.

Cheers,
Jochen - wasting his life in the autumnly sad Munich

comment 9 answers | Add comment
Friday, 8 May 2009
setuid question: "insecure dependency"? Andria Thomas 13:13:57
 Hi all --

I'm trying to write a setuid script to change passwords on a machine via
the web. I am not trying to change the local passwords (i.e. *not*
modifying /etc/password), but I do need the script to be run as root so
it can call another password-changing utility which is doing the actual
work.

When run from the command line as root, the script works fine. However,
when run as myself (after setting the script to be setuid root) I get
the following error generated from the script's system call:

"Insecure dependency in system while running setuid at ./chpass_web.pl
line 159."

Perl is installed on this system to use suid emulation, so it's calling
the 'suidperl' binary. The problem originates from the following line
of code:

system "/bin/echo $new_password1 | /usr/local/sbin/sas­lpasswd -p
$in_username";

The documentation I've seen implies that variables can't be passed
directly into the shell, as they are above, but I couldn't reword the
system call in any way that still enabled it to work.

Can anyone help with this? Or lead me to any pointers on suidperl?
I've already read the perlsec manpage, and searched through the mailing
list archives...

Thanks!
Andria

--
-------------------­--------------------­-------
Andria Thomas andria@tovaris.com
System Administrator -- Tovaris, Inc.
(434) 245-5309 x 105

comment 3 answer | Add comment
Wednesday, 29 April 2009
How to get Text::Iconv on Windows Steve Tolkin 01:30:23
 Summary:
XML::SAX::Writer depends on Text::Iconv but I have been
unable to install this on Windows XP
despite trying three different ways.

1. The perl CPAN Iconv distribution is missing iconv.h,
so install Text::Iconv via CPAN fails.

2. I tried running ppm to download
a precompiled Iconv, but got a failure in ppm.bat.
(This might be the easiest fix.)
The ActiveState directory says that Iconv has status FAIL.
But http://theoryx5.uwi­nnipeg.ca/ppmpackage­s/ has
Text-Iconv.ppd 19-Dec-2003 00:50 418
Unfortunately this is just the metadata
and I cannot find the actual precompiled module.

3. I tried compiling the gnu programs libiconv and gettext
and got different failures there.

Or, is there any way to turn off this dependency, or
a different module that is similar but which does not have this
dependency.

Please help!

Details:

I am trying to follow the suggestion Kip made below (thanks Kip)
to use XML::SAX::Writer, but this depends on Text::Iconv.

My environment:
I am running perl 5.8.0 and MS VC 98 compiler and tools.
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
My "shell" is just cmd.exe aka command prompt aka the plain old DOS box.

1. I try to install using: perl -MCPAN -e shell
When I say
install XML::SAX::Writer
everything is fine until it stops with:
---- Unsatisfied dependencies detected during
[R/RB/RBERJON/XML-SAX-Writer-0.44.
tar.gz] -----
Text::Iconv
Shall I follow them and prepend them to the queue

If I say yes it fails due to missing iconv.h, as follows
...
CPAN.pm: Going to build M/MP/MPIOTR/Text-Ic­onv-1.2.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for Text::Iconv

Microsoft (R) Program Maintenance Utility Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

cp Iconv.pm blib\lib\Text\Iconv­.pm
AutoSplitting blib\lib\Text\Iconv­.pm (blib\lib\auto\Text­\Iconv)
C:\bin\perl.exe C:\Perl\lib\ExtUtil­s/xsubpp -typemap
C:\Perl\lib\ExtUti
ls\typemap -typemap typemap Iconv.xs > Iconv.xsc && C:\bin\perl.exe
-MExtUtils:
:Command -e mv Iconv.xsc Iconv.c
cl -c -nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE
-DNO_ST
RICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CON­TEXT -DPERL_IMPLICIT_SYS­
-DUSE_PERLIO
-DPERL_MSVCRT_READF­IX -MD -Zi -DNDEBUG -O1 -DVERSION=\"1.2\"
-DXS_VERSION=\"
1.2\" "-IC:\Perl\lib\CORE­" Iconv.c
Iconv.c
Iconv.xs(15) : fatal error C1083: Cannot open include file: 'iconv.h': No
such f
ile or directory
NMAKE : fatal error U1077: 'C:\WINDOWS\system3­2\cmd.exe' : return code '0x2'
Stop.
C:\perl\bin\nmake.E­XE -- NOT OK
Running make test
Can't test without successful make

2. Then I tried to get Iconv from the ppm shell
(which in this case is the ppm.bat file in my c:\perl\bin\).
But I hit this problem:
C:\TEMP>ppm
Can't locate XML/ValidatingEleme­nt.pm in @INC (@INC contains: c:/Perl/lib
c:/Per
l/site/lib .) at c:/Perl/site/lib/XM­L/PPD.pm line 8.
BEGIN failed--compilation­ aborted at c:/Perl/site/lib/XM­L/PPD.pm line 8.

It looks like it is off a level,
and/or my @INC needs to be modified. So I tried
cd \perl\site\lib\PPM
and then ran it again and got this error:

Can't locate object method "rvalidate" via package
"XML::PPMConfig::PP­MCONFIG" a
t c:/Perl/site/lib/PP­M.pm line 1620.

3. So I downloaded the gnu versions of libiconv and gettext and
followed the instructions in README.woe32 in libiconv and
successfully make libiconv using
nmake Makefile.msvc -NONLS=1
as stated in step 1.

Most of gettext compiled OK, but then it died,
whle trying to compile msgmerge.c (in gettest-tools/src/)­
I think because of a problem in obstack.h.
the make ending with this:

/out:msgfmt.exe
msgfmt.obj
write-mo.obj
write-java.obj
write-csharp.obj
write-resources.obj­
write-tcl.obj
write-qt.obj
plural-eval.obj
gettextsrc.lib
..\lib\gettextlib.l­ib
..\intl\intl.lib
c:\usr\lib\iconv.li­b
cl -I. -I.. -I..\libuniname -I..\lib -I..\intl
-I..\..\gettext-run­time\i
ntl -I..\windows -Ic:\usr\include -W1 -D_NDEBUG -O1 -DHAVE_CONFIG_H
-DLOCALEDIR
=\"c:\\usr\\share\\­locale\" -DLOCALE_ALIAS_PATH­=\"\"
-DGETTEXTJAR=\"c:\\­usr\\sha
re\\gettext\\gettex­t.jar\" -DLIBDIR=\"c:\\usr\­\lib\"
-DGETTEXTDATADIR=\"­c:\\usr\
\share\\gettext\" -DPROJECTSDIR=\"c:\­\usr\\share\\gettext­\\projects\"
-DINSTALLP
REFIX=\"c:\\usr\" -DINSTALLDIR=\"c:\\­usr\\bin\" -c -Tp msgmerge.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

msgmerge.c
msgmerge.c(413) : warning C4508: 'main' : function should return a value;
'void'
return type assumed
msgmerge.c(677) : error C2660: '_obstack_begin' : function does not take 5
param
eters
msgmerge.c(693) : error C2660: '_obstack_newchunk'­ : function does not take
2 pa
rameters
msgmerge.c(722) : error C2660: '_obstack_newchunk'­ : function does not take
2 pa
rameters
msgmerge.c(752) : error C2660: '_obstack_newchunk'­ : function does not take
2 pa
rameters
msgmerge.c(782) : error C2660: '_obstack_newchunk'­ : function does not take
2 pa
rameters
msgmerge.c(824) : error C2660: '_obstack_free' : function does not take 2
parame
ters
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS­~3\VC98\BIN\NMAKE.EX­E' :
return co
de '0x2'
Stop.
NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS­~3\VC98\BIN\NMAKE.EX­E' :
return co
de '0x2'
Stop.

But note that obstack.c did build succesfully.
(I do wonder why obstack.h is in the lib directory.)

Directory of C:\TEMP\gettext-0.1­4.1\gettext-tools\li­b

11/05/2002 11:41 AM 19,711 obstack.c
08/24/2003 10:05 AM 23,630 obstack.h
03/07/2004 12:48 AM 3,104 obstack.obj


Thanks-in-advance-a­gain-ly yours,
Steve

-----Original Message-----> From: Kip Hampton [mailto:khampton@totalcinema.com] > Sent: Sunday, March 07, 2004 3:07 AM> To: Tolkin, Steve> Cc: 'perl-xml@listserv.­ActiveState.com'> Subject: Re: Parsing a record oriented file into XML>
Tolkin, Steve wrote:>
<snip/>>
Kip Hampton's 2001 article "Writing SAX Drivers for Non-XML Data"> > _http://www.xml.com­/lpt/a/2001/09/19/sa­x-non-xml-data.html_­> > suggests a general technique, but there does not seem to be > a module > > that does this.>
Try XML::Generator::Per­lData (that generates SAX2 events from > Perl data > structures) and connect it up to any SAX2 Writer.>
For example, using PerlData's "Stream Style" processing:>
use XML::Generator::Per­lData;> use XML::SAX::Writer;>
my $writer = XML::SAX::Writer->n­ew();> my $generator = XML::Generator::Pel­Data->new( Handler =? $writer );>
open(FH, "your.wacky.file") || die "Nope: $!";>
$generator->parse_s­tarr();>
while (<FH>) {> # process and munge each line from the> # file into some perl data structure-->
my $hash_ref = process_record($_);­> $generator->parse_c­hunk( $hash_ref );> }>
$generator->parse_e­nd();>
close FH;>
That's it. Generator::PerlData­ also offers a ton of options > to control > how your data gets translated; check out the perldoc for details.>
Cheers,> -kip>
___________________­____________________­________
Perl-XML mailing list
Perl-XML@listserv.A­ctiveState.com
To unsubscribe: http://listserv.Act­iveState.com/mailman­/mysubs

comment 5 answers | Add comment
Thursday, 16 April 2009
Trouble to load the XML::LibXML::Common­ module Kenneth Chan 20:31:50
 ____________________­____________________­_______
ActivePerl mailing list
ActivePerl@listserv­.ActiveState.com
To unsubscribe: http://listserv.Act­iveState.com/mailman­/mysubs
comment 9 answers | Add comment
Saturday, 21 March 2009
I can not build blead on VMS - Missing files, NNTP newsgroups not updating. John Malmberg 22:20:07
 I can not build blead on VMS after synchronizing with rsync.

The files:
ext/IO-Compress/MAN­IFEST
lib/perl5db/t/eval-­line-bug
lib/perl5db/t/lvalu­e-bug
t/Module_Pluggable/­lib/EditorJunk/Plugi­n/Bar.pm~,Bar.pm_

I have tried using rsync to pull down new copies of the MANIFEST and the
missing files and am getting a report that the files are not present in
the repository, and that my copy of the MANIFEST is up to date.

The perl5.porters news group and the perl5.changes newsgroups stopped
updating on March 12th.

-John
Personal Opinion Only
Add comment
r25960 - docs/Perl6/Spec/S32­-setting-library Guest 14:50:43
 Author: masak
Date: 2009-03-21 12:50:43 +0100 (Sat, 21 Mar 2009)
New Revision: 25960

Modified:
docs/Perl6/Spec/S32­-setting-library/Con­tainers.pod
Log:
Merge branch 'typo'

Modified: docs/Perl6/Spec/S32­-setting-library/Con­tainers.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S32­-setting-library/Con­tainers.pod 2009-03-21 10:41:53 UTC (rev 25959)
+++ docs/Perl6/Spec/S32­-setting-library/Con­tainers.pod 2009-03-21 11:50:43 UTC (rev 25960)
@@ -713,7 +713,7 @@

Returns an unordered list of the values that constitute the junction (formerly
called C<.values>). It flattens nested junctions of the same type, so
-C<(1|(2|3)).eigens­tate> returns an arbitrary permutation of the list
+C<(1|(2|3)).eigens­tates> returns an arbitrary permutation of the list
C<1, 2, 3>.

Note this is a private method; you must arrange for yourself to be trusted

Add comment
routine arrow syntax and return/of types Darren Duncan 07:37:55
 I have a question and a request.

In http://perlcabal.or­g/syn/S06.html#Named­_subroutines it says:

The general syntax for named subroutines is any of:

my RETTYPE sub NAME ( PARAMS ) TRAITS {...} # lexical only
our RETTYPE sub NAME ( PARAMS ) TRAITS {...} # also package-scoped
sub NAME ( PARAMS ) TRAITS {...} # same as "our"

The return type may also be put inside the parentheses:

sub NAME (PARAMS --> RETTYPE) {...}

In http://perlcabal.or­g/syn/S06.html#Subro­utine_traits there is a distinguishing
between 'of' and 'returns', such that 'of' is part of the external routine
signature and 'returns' is just an internal constraint.

Now first of all I wanted to ask/clarify, are all of the above forms, the
"RETTYPE sub" and "--> RETTYPE", equivalent to the "of" trait, meaning they are
part of the external signature, and that none are like "returns" being internal
to the routine only? That's how I hope it is.

Second, since the "sub NAME (PARAMS --> RETTYPE) {...}" form looks nice
visually, I would like to request a variant of that form, that flips the arrow:

sub NAME (RETTYPE <-- PARAMS) {...}

I ask because I like to declare my result type before my parameters, since the
declaration then reads in the same order as corresponding invocation items, as
well as having the shorter and more important declaration appearing first
(result type vs parameters):

my $result = myfunc( $arg1, $arg2 );

And at the same time it has the visually distinctive arrow syntax which is very
easy to read.

While "RETTYPE sub" and "of RETTYPE" provides the first advantage, it doesn't
provide the second.

Also providing both versions gives symmetry in the way that you have both of the
<== and ==> feed operators so users can order operations visually as per their
preference.

I also don't believe you are already using <-- for anything so it is free.

And I don't believe that there should be any problem incorporating this option
given the other issues like named invocants or longname parameters; you just
keep those with PARAMS as you did before, putting the lot on the right side of
the <--.

Note that this request is only useful to me if the existing --> means 'of' and
not 'returns'.

Thank you in advance for considering this request.

-- Darren Duncan
comment 4 answer | Add comment
Friday, 20 March 2009
Rakudo Perl development release #15 ("Oslo") Patrick R. Michaud 20:16:20
 On behalf of the Rakudo development team, I'm pleased to announce
the March 2009 development release of Rakudo Perl #15 "Oslo".
Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1].
The tarball for the March 2009 release is available from

http://www.pmichaud­.com/perl6/rakudo-20­09-03.tar.gz

However, because of the rapid pace of Rakudo development and addition
of new features, we still recommend that people wanting to use or work
with Rakudo obtain the latest version directly from the main repository
at github -- more on this in a bit.

Rakudo Perl follows a monthly release cycle, with each release code named
after a Perl Mongers group. This release is named "Oslo" in honor of
the organizers of the 2009 Nordic Perl Workshop [2], April 16-17, 2009.
The 2009 Nordic Perl Workshop will have a special focus on Perl 6,
Rakudo Perl, and Parrot, including Perl 6 tutorials and hackathons
after the conference itself.

A list of the other planned release dates and codenames for 2009 is
available in the "docs/release_guide­.pod" file. In general, Rakudo
development releases are scheduled to occur two days after each
Parrot monthly release. Parrot releases the third Tuesday of each month.

Rakudo Perl now uses git [3] for its version control system, hosted
at http://github.com/r­akudo/rakudo . The README file there is kept
up-to-date with the latest instructions for obtaining and building
Rakudo Perl.

In this release of Rakudo Perl, we've made the following major changes
and improvements:

* Rakudo is now passing 7273 spectests. This is an increase of 197
passing tests since the February 2009 release.

* The eval() construct now understands lexical variables from an
outer scope.

* More of the builtin functions ("settings") are being written in Perl 6.

* Rakudo supports the "R" (reverse) metaoperator.

* Parsing of if, unless, while, until, etc. statements after blocks
now works correctly.

* The Q quote operator is now implemented, along with several adverbial
forms. In particular, the Q:P­IR form allows inline PIR to be
included in Perl 6 code.

* Multi-method dispatch now works with inheritance also.

The development team thanks all of our contributors and sponsors for
making Rakudo Perl possible. The next release of Rakudo (#16) is
scheduled for April 23, 2009.


References:
[1] Parrot, http://parrot.org/
[2] Nordic Perl Workshop 2009, http://www.perlwork­shop.no/npw2009/
[3] Git version control system, http://git-scm.org/­
Add comment
Dallas.p6m fREW Schmidt 12:25:02
 Hello friends!
s1n and I decided that we would start Dallas.p6m as we are close to each
other geographically speaking. We are meeting tomorrow (Thursday, March 19,
7:00PM) at a coffee shop with free wifi. The address is 985 W Bethany Dr
Allen, TX 75013.

So far it looks like it will be s1n, me, and two or three of my co-workers.
We don't really have an agenda, but I figure I will ask s1n about some PIR
stuff and if he wants I can chat about some perl 6 stuff (although he may
know more about that as well.)

Anyway, you are invited to come and have a good time! We will probably be
more organized in the future, but for now this will work :-)­



--
fREW Schmidt
http://blog.afoolis­hmanifesto.com
comment 3 answer | Add comment
r25933 - docs/Perl6/Spec Guest 00:38:42
 Author: lwall
Date: 2009-03-20 00:05:55 +0100 (Fri, 20 Mar 2009)
New Revision: 25933

Modified:
docs/Perl6/Spec/S06­-routines.pod
Log:
make as trait consistent with as/of in S02


Modified: docs/Perl6/Spec/S06­-routines.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S06­-routines.pod 2009-03-19 22:57:34 UTC (rev 25932)
+++ docs/Perl6/Spec/S06­-routines.pod 2009-03-19 23:05:55 UTC (rev 25933)
@@ -13,9 +13,9 @@

Maintainer: Larry Wall <larry@wall.org>
Date: 21 Mar 2003
- Last Modified: 18 Mar 2009
+ Last Modified: 19 Mar 2009
Number: 6
- Version: 106
+ Version: 107


This document summarizes Apocalypse 6, which covers subroutines and the
@@ -1582,7 +1582,7 @@
The signature of a subroutine. Normally declared implicitly, by providing a
parameter list and/or return type.

-=item C<returns>/C<is returns>
+=item C<as>/C<is as>

The C<inner> type constraint that a routine imposes on its return value.


Add comment
install DBD::Oracle on oracle application server Joe Bayer 00:38:42
 dear group

I am trying to install DBD::Oracle on a box that has oracle application server. The sqlplus works fine, but i got error

Unable to locate an oracle.mk, proc.mk or other suitable *.mk
file in your Oracle installation. (I looked in
/usr/local/app/orac­le/product/10.2.0/Or­a10gSSB_1/rdbms/demo­/demo_xe.mk /usr/local/app/orac­le/product/10.2.0/Or­a10gSSB_1/rdbms/lib/­oracle.mk /usr/local/app/orac­le/product/10.2.0/Or­a10gSSB_1/rdbms/demo­/oracle.mk /usr/local/app/orac­le/product/10.2.0/Or­a10gSSB_1/rdbms/demo­/demo_rdbms.mk /usr/local/app/orac­le/product/10.2.0/Or­a10gSSB_1/precomp/de­mo/proc/proc.mk /usr/local/app/orac­le/product/10.2.0/Or­a10gSSB_1/precomp/de­mo/proc/demo_proc.mk­ /usr/local/app/orac­le/product/10.2.0/Or­a10gSSB_1/proc/lib/roc.mk /usr/local/app/orac­le/product/10.2.0/Or­a10gSSB_1/proc16/lib­/proc16.mk under /usr/local/app/orac­le/product/10.2.0/Or­a10gSSB_1)

Is it a must that I have to install Oracle client for DBD to compile?

Thanks for your help






comment 4 answer | Add comment
Thursday, 19 March 2009
r25911 - docs/Perl6/Spec Guest 23:35:30
 Author: lwall
Date: 2009-03-19 21:35:30 +0100 (Thu, 19 Mar 2009)
New Revision: 25911

Modified:
docs/Perl6/Spec/S12­-objects.pod
Log:
mark recent remarks as only for post-6.0.0


Modified: docs/Perl6/Spec/S12­-objects.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S12­-objects.pod 2009-03-19 19:14:28 UTC (rev 25910)
+++ docs/Perl6/Spec/S12­-objects.pod 2009-03-19 20:35:30 UTC (rev 25911)
@@ -14,7 +14,7 @@
Date: 27 Oct 2004
Last Modified: 19 Mar 2009
Number: 12
- Version: 78
+ Version: 79

=head1 Overview

@@ -1335,6 +1335,19 @@
preferred if the constraint matches, and otherwise the second is
preferred.

+=head2 Multiple constraints
+
+[Conjecture: This entire section is considered a guess at our
+post-6.0.0 direction. For 6.0.0 we will allow only a single constraint
+before the variable, and post constraints will all be considered
+"epsilon" narrower than the single type on the left. The single
+constraint on the left may, however, be a value like 0 or a named
+subset type. Such a named subset type may be predeclared with an
+arbitrarily complex C<where> clause; for 6.0.0 any structure type
+information inferrable from the C<where> clause will be ignored,
+and the declared subset type will simply be considered nominally
+derived from the C<of> type mentioned in the same declaration.]
+
More generally, a parameter can have a set of constraints, and
the set of constraints defines the formal type of the parameter,
as visible to the signature. (No one constraint is priviledged as
@@ -1349,7 +1362,7 @@
The sigil is actually a constraint on the container, so the actual
type of the parameter above is something like:

- Positional[role { does Foo; does Bar; }]
+ Positional[subset :: of Any where Foo & Bar }]

Static C<where> clauses also count as part of the official type.
A C<where> clause is considered static if it can be applied to

Add comment
r25909 - docs/Perl6/Spec Guest 21:28:28
 Author: lwall
Date: 2009-03-19 19:28:28 +0100 (Thu, 19 Mar 2009)
New Revision: 25909

Modified:
docs/Perl6/Spec/S12­-objects.pod
Log:
clarify container constraint meaning of sigil as requested by jnthn++


Modified: docs/Perl6/Spec/S12­-objects.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S12­-objects.pod 2009-03-19 18:13:13 UTC (rev 25908)
+++ docs/Perl6/Spec/S12­-objects.pod 2009-03-19 18:28:28 UTC (rev 25909)
@@ -1346,7 +1346,11 @@
Bar Foo @x

The constraint implied by the sigil also counts as part of the official type.
+The sigil is actually a constraint on the container, so the actual
+type of the parameter above is something like:

+ Positional[role { does Foo; does Bar; }]
+
Static C<where> clauses also count as part of the official type.
A C<where> clause is considered static if it can be applied to
the types to the left of it at compile time to produce a known finite set

Add comment
r25908 - docs/Perl6/Spec Guest 21:13:13
 Author: lwall
Date: 2009-03-19 19:13:13 +0100 (Thu, 19 Mar 2009)
New Revision: 25908

Modified:
docs/Perl6/Spec/S12­-objects.pod
Log:
[S12] attempt to clarify type narrowness of multiple constraints, enums, and where clauses


Modified: docs/Perl6/Spec/S12­-objects.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S12­-objects.pod 2009-03-19 13:29:43 UTC (rev 25907)
+++ docs/Perl6/Spec/S12­-objects.pod 2009-03-19 18:13:13 UTC (rev 25908)
@@ -12,9 +12,9 @@

Maintainer: Larry Wall <larry@wall.org>
Date: 27 Oct 2004
- Last Modified: 14 Mar 2009
+ Last Modified: 19 Mar 2009
Number: 12
- Version: 77
+ Version: 78

=head1 Overview

@@ -1308,7 +1308,7 @@
You can leave out the block when matching against a literal value of some
kind:

- multi sub fib ($n where 0|1) { return $n }
+ multi sub fib (Int $n where 0|1) { return $n }
multi sub fib (Int $n) { return fib($n-1) + fib($n-2) }

In fact, you can leave out the 'where' declaration altogether:
@@ -1335,6 +1335,111 @@
preferred if the constraint matches, and otherwise the second is
preferred.

+More generally, a parameter can have a set of constraints, and
+the set of constraints defines the formal type of the parameter,
+as visible to the signature. (No one constraint is priviledged as
+the storage type of the actual argument, unless it is a native type.)
+All constraints considered in type narrowness.
+That is, these are equivalently narrow:
+
+ Foo Bar @x
+ Bar Foo @x
+
+The constraint implied by the sigil also counts as part of the official type.
+
+Static C<where> clauses also count as part of the official type.
+A C<where> clause is considered static if it can be applied to
+the types to the left of it at compile time to produce a known finite set
+of values. For instance, a subset of an enum type is a static set
+of values. Hence
+
+ Day $d where 'Mon'..'Fri'
+
+is considered equivalent to
+
+ subset Weekday of Day where 'Mon'..'Fri';
+ Weekday $d
+
+Types mentioned in a dynamic C<where> class are not considered part of the official
+type, except insofar as the type includes the notion: "is also constrained
+by a dynamic C<where> clause", which narrows it by epsilon over the equivalent
+type without a C<where> clause.
+
+ Foo Bar @x # type is Foo & Bar & Positional
+ Foo Bar @x where Baz # slightly tighter than Foo Bar Positional
+
+The set of constraints for a parameter creates a subset type that implies
+some set of allowed values for the parameter. The set of allowed values
+may or may not be determinable at compile time. When the set of allowed
+values is determinable at compile time, we call it a static subtype.
+
+Type constraints that resolve to a static subtype (that is, with a
+fixed set of elements knowable (if not known) at compile time) are
+considered to be narrower than type constraints that involve run-time
+calculation, or are otherwise intractable at compile time.
+Note that all values such as 0 or "foo" are considered
+singleton static subtypes. Singleton values are considered narrower
+than a subtype with multiple values, even if the subtype contains
+the value in question. This is because, for enumerable types, type
+narrowness is defined by doing set theory on the set of enumerated values.
+
+So assuming:
+
+ my enum Day ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];
+ subset Weekday of Day where 'Mon' .. 'Fri'; # considered static
+ subset Today of Day where *.today;
+
+we have the following pecking order:
+
+ Parameter # Set of possible values
+ ========= ===================­=====
+ Int $n # Int
+
+ Int $n where Today # Int plus dynamic where
+ Int $n where 1 <= * <= 5 # Int plus dynamic where
+
+ Day $n # 0..6
+
+ Day $n where Today # 0..6 plus dynamic where
+
+ Day $n where 1 <= * <= 5 # 1..5
+ Int $n where Weekday # 1..5
+ Day $n where Weekday # 1..5
+ Weekday $n # 1..5
+
+ Tue # 2
+
+Note the difference between:
+
+ Int $n where 1 <= * <= 5 # Int plus dynamic where
+ Day $n where 1 <= * <= 5 # 1..5
+
+The first C<where> is considered dynamic not because of the nature
+of the comparsons but because C<Int> is not finitely enumerable.
+Our C<Weekday> subset type can calculate the set membership at compile
+time because it is based on the C<Day> enum, and hence is considered
+static despite the use of a C<where>. Had we based C<Weekday> on
+C<Int> it would have been considered dynamic. Note, however, that
+with "anded" constraints, any enum type governs looser types, so
+
+ Int Day $n where 1 <= * <= 5
+
+is considered static, since C<Day> is an enum, and cuts down the
+search space.
+
+The basic principle we're trying to get at is this: in comparing
+two parameter types, the narrowness is determined by the subset
+relationships on the sets of possible values, not on the names of
+constraints, or the method by which those constraints are specified.
+For practical reasons, we limit our subset knowledge to what can be
+easily known at compile time, and consider the presence of one or
+more dynamic constraints to be epsilon narrower than the same set of
+possible values without a dynamic constraint.
+
+As a first approximation for 6.0.0, subsets of enums are static,
+and other subsets are dynamic. We may refine this in subsequent
+versions of Perl.
+
=head1 Enums

An enum is a low-level class that can function as a role or property.

Add comment
Logout from Apache Khalid Naji 19:19:48
 Hi,

How can I logout via a perl-script from Apache?

Thank you
KN


comment 1 answer | Add comment
r25821 - docs/Perl6/Spec Guest 12:01:27
 Author: masak
Date: 2009-03-14 13:34:42 +0100 (Sat, 14 Mar 2009)
New Revision: 25821

Modified:
docs/Perl6/Spec/S12­-objects.pod
Log:
specced syntactic 'where' sugar in param lists

Modified: docs/Perl6/Spec/S12­-objects.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S12­-objects.pod 2009-03-13 15:44:50 UTC (rev 25820)
+++ docs/Perl6/Spec/S12­-objects.pod 2009-03-14 12:34:42 UTC (rev 25821)
@@ -12,9 +12,9 @@

Maintainer: Larry Wall <larry@wall.org>
Date: 27 Oct 2004
- Last Modified: 12 Mar 2009
+ Last Modified: 14 Mar 2009
Number: 12
- Version: 76
+ Version: 77

=head1 Overview

@@ -1305,6 +1305,18 @@
since all the type constraints in a signature parameter are just
anded together anyway.

+You can leave out the block when matching against a literal value of some
+kind:
+
+ multi sub fib ($n where 0|1) { return $n }
+ multi sub fib (Int $n) { return fib($n-1) + fib($n-2) }
+
+In fact, you can leave out the 'where' declaration altogether:
+
+ multi sub fib (0) { return 0 }
+ multi sub fib (1) { return 1 }
+ multi sub fib (Int $n) { return fib($n-1) + fib($n-2) }
+
Subtype constraints are used as tiebreakers in multiple dispatch:

use Rules::Common :p­rofanity;

comment 6 answers | Add comment
r25902 - docs/Perl6/Spec Guest 03:43:53
 Author: lwall
Date: 2009-03-19 01:43:53 +0100 (Thu, 19 Mar 2009)
New Revision: 25902

Modified:
docs/Perl6/Spec/S05­-regex.pod
Log:
[S05] define .caps and .chunks methods on match objects


Modified: docs/Perl6/Spec/S05­-regex.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S05­-regex.pod 2009-03-18 23:02:41 UTC (rev 25901)
+++ docs/Perl6/Spec/S05­-regex.pod 2009-03-19 00:43:53 UTC (rev 25902)
@@ -16,7 +16,7 @@
Date: 24 Jun 2002
Last Modified: 18 Mar 2009
Number: 5
- Version: 92
+ Version: 93

This document summarizes Apocalypse 5, which is about the new regex
syntax. We now try to call them I<regex> rather than "regular
@@ -1705,14 +1705,14 @@
=item * before C<pattern>

Perform lookahead -- i.e., check if we're at a position where
-C<pattern> matches. Returns a zero-width Match object on
+C<pattern> matches. Returns a zero-width C<Match> object on
success.

=item * after C<pattern>

Perform lookbehind -- i.e., check if the string before the
current position matches <pattern> (anchored at the end).
-Returns a zero-width Match object on success.
+Returns a zero-width C<Match> object on success.

=item * <?>

@@ -2385,7 +2385,7 @@

=item *

-A match always returns a Match object, which is also available
+A match always returns a C<Match> object, which is also available
as C<$/>, which is a contextual lexical declared in the outer
subroutine that is calling the regex. (A regex declares its own
lexical C<$/> variable, which always refers to the most recent
@@ -2547,6 +2547,9 @@
$/.chars # $/.to - $/.from
$/.orig # the original match string
$/.Str # substr($/.orig, $/.from, $/.chars)
+ $/.ast # the abstract result associated with this node
+ $/.caps # sequential captures
+ $/.chunks # sequential tokenization

Within the regex the current match state C<$ > also provides

@@ -2558,6 +2561,18 @@

=item *

+As described above, a C<Match> in list context returns its positional
+captures. However, sometimes you'd rather get a flat list of tokens in
+the order they occur in the text. The C<.caps> method returns a list
+of every captured item, regardless of how it was otherwise bound into
+named or numbered captures. The C<.chunks> method returns the captures
+as well as all the interleaved "noise" between the captures. [Conjecture:
+we could also have C<.deepcaps> and C<.deepchunks> that recursively expand
+any capture containing submatches. Presumably each returned chunk would
+come equipped with some method to discover its "pedigree" in the parse tree.]
+
+=item *
+
All match attempts--successfu­l or not--against any regex, subrule, or
subpattern (see below) return an object of class C<Match>. That is:

@@ -2566,8 +2581,8 @@

=item *

-This returned object is also automatically assigned to the lexical
-C<$/> variable of the current surroundings. That is:
+This returned object is also automatically bound to the lexical
+C<$/> variable of the current surroundings regardless of success. That is:

$str ~~ /pattern/;
say "Matched" if $/;
@@ -3122,7 +3137,7 @@
# | |
mm/ $<key>=[ (<[A..E]>) (\d**3..6) (X?) ] /;

-then the corresponding C<< $/<key> >> Match object contains only the string
+then the corresponding C<< $/<key> >> C<Match> object contains only the string
matched by the non-capturing brackets.

=item *

Add comment
Wednesday, 18 March 2009
r25895 - docs/Perl6/Spec Guest 23:10:41
 Author: coke
Date: 2009-03-18 21:10:41 +0100 (Wed, 18 Mar 2009)
New Revision: 25895

Modified:
docs/Perl6/Spec/S02­-bits.pod
Log:
Correct minor typo in metadata.
(... unless that's Welsh, in which case my bad.)



Modified: docs/Perl6/Spec/S02­-bits.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S02­-bits.pod 2009-03-18 20:10:33 UTC (rev 25894)
+++ docs/Perl6/Spec/S02­-bits.pod 2009-03-18 20:10:41 UTC (rev 25895)
@@ -12,7 +12,7 @@

Maintainer: Larry Wall <larry@wall.org>
Date: 10 Aug 2004
- Lwst Modified: 18 Mar 2009
+ Last Modified: 18 Mar 2009
Number: 2
Version: 160


Add comment
r25890 - docs/Perl6/Spec Guest 22:04:17
 Author: lwall
Date: 2009-03-18 20:04:16 +0100 (Wed, 18 Mar 2009)
New Revision: 25890

Modified:
docs/Perl6/Spec/S03­-operators.pod
Log:
kill off int as a prefix operator to avoid confusion with the type name


Modified: docs/Perl6/Spec/S03­-operators.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S03­-operators.pod 2009-03-18 18:24:25 UTC (rev 25889)
+++ docs/Perl6/Spec/S03­-operators.pod 2009-03-18 19:04:16 UTC (rev 25890)
@@ -12,9 +12,9 @@

Maintainer: Larry Wall <larry@wall.org>
Date: 8 Mar 2004
- Last Modified: 17 Mar 2009
+ Last Modified: 18 Mar 2009
Number: 3
- Version: 159
+ Version: 160

=head1 Overview

@@ -991,7 +991,6 @@

Functions of one argument

- int
sleep
abs
sin
@@ -1000,9 +999,16 @@
Note that, unlike in Perl5, you must use the C<.meth> forms to default
to C<$_> in Perl6.

-There is no unary C<rand> function in Perl 6, though there is a C<.rand>
-method call and an argumentless C<rand> term.
+There is no unary C<rand> prefix in Perl 6, though there is a C<.rand>
+method call and an argumentless C<rand> term. There is no unary C<int>
+prefix either; you must use a typecast to a type such as C<Int> or C<int>.
+(Typecasts require parentheses and may not be used as prefix operators.)
+In other words:

+ my $i = int $x; # ILLEGAL
+
+is a syntax error (two terms in a row), because C<int> is a type name now.
+
=over

=item *

Add comment
r25889 - docs/Perl6/Spec Guest 21:24:25
 Author: lwall
Date: 2009-03-18 19:24:25 +0100 (Wed, 18 Mar 2009)
New Revision: 25889

Modified:
docs/Perl6/Spec/S05­-regex.pod
Log:
Destroy the term "result object" in favor of "abstract object" and AST-Think.


Modified: docs/Perl6/Spec/S05­-regex.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S05­-regex.pod 2009-03-18 18:14:09 UTC (rev 25888)
+++ docs/Perl6/Spec/S05­-regex.pod 2009-03-18 18:24:25 UTC (rev 25889)
@@ -14,9 +14,9 @@
Maintainer: Patrick Michaud <pmichaud@pobox.com­> and
Larry Wall <larry@wall.org>
Date: 24 Jun 2002
- Last Modified: 11 Mar 2009
+ Last Modified: 18 Mar 2009
Number: 5
- Version: 91
+ Version: 92

This document summarizes Apocalypse 5, which is about the new regex
syntax. We now try to call them I<regex> rather than "regular
@@ -774,15 +774,21 @@
\s+ { print "but does contain whitespace\n" }
/

-An B<explicit> reduction using the C<make> function sets the I<result object>
+An B<explicit> reduction using the C<make> function generates the
+I<abstract syntax tree> object (I<abstract object> or I<ast> for short)
for this match:

/ (\d) { make $0.sqrt } Remainder /;

-This has the effect of capturing the square root of the numified string,
-instead of the string. The C<Remainder> part is matched but is not returned
-as part of the result object unless the first C<make> is later overridden by another C<make>.
+This has the effect of capturing the square root of the numified
+string, instead of the string. The C<Remainder> part is matched and
+returned as part of the C<Match> object but is not returned
+as part of the abstract object. Since the abstract object usually
+represents the top node of an abstract syntax tree, the abstract object
+may be extracted from the C<Match> object by use if the C<.ast> method.

+A second call to C<make> overrides any previous call to C<make>.
+
These closures are invoked with a topic (C<$_>) of the current match
state (a C<Cursor> object). Within a closure, the instantaneous
position within the search is denoted by the C<.pos> method on
@@ -1331,7 +1337,7 @@
time you use it unless the string changes. (Any external lexical
variable names must be rebound each time though.) Subrules may not be
interpolated with unbalanced bracketing. An interpolated subrule
-keeps its own inner match result as a single item, so its parentheses never count toward the
+keeps its own inner match results as a single item, so its parentheses never count toward the
outer regexes groupings. (In other words, parenthesis numbering is always
lexically scoped.)

@@ -1585,7 +1591,7 @@

=item *

-A C<< <( >> token indicates the start of a result capture, while the
+A C<< <( >> token indicates the start of the match's overall capture, while the
corresponding C<< )> >> token indicates its endpoint. When matched,
these behave as assertions that are always true, but have the side
effect of setting the C<.from> and C<.to> attributes of the match
@@ -1600,8 +1606,9 @@
except that the scan for "C<foo>" can be done in the forward direction,
while a lookbehind assertion would presumably scan for C<\d+> and then
match "C<foo>" backwards. The use of C<< <(...)> >> affects only the
-meaning of the I<result object> and the positions of the beginning and
-ending of the match. That is, after the match above, C<$()> contains
+meaning the positions of the beginning and
+ending of the match, and anything calculated based on those positions.
+For instance, after the match above, C<$()> contains
only the digits matched, and C<$/.to> is pointing to after the digits.
Other captures (named or numbered) are unaffected and may be accessed
through C<$/>.
@@ -2389,8 +2396,9 @@
=item *

Notionally, a match object contains (among other things) a boolean
-success value, a scalar I<result object>, an array of ordered submatch
-objects, and a hash of named submatch objects. To provide convenient
+success value, an array of ordered submatch objects, and a hash of named
+submatch objects. (It also optionally carries an I<abstract object> normally
+used to build up an abstract syntax tree,) To provide convenient
access to these various values, the match object evaluates differently
in different contexts:

@@ -2433,10 +2441,12 @@

When used as a scalar, a C<Match> object evaluates to itself.

-However, sometimes you would like an alternate scalar value to ride
-along with the match. This is called a I<result> object, and it rides
-along is an attribute of the C<Match> object.
-C<$()> is a shorthand for C<$($/.rob)>.
+However, sometimes you would like an alternate scalar value to
+ride along with the match. The C<Match> object itself describes
+a concrete parse tree, so this extra value is called an I<abstract>
+object; it rides along as an attribute of the C<Match> object. C<$()>
+is a shorthand for C<$($/.ast)>. The C<.ast> method by default just
+returns the string between the C<$/.from> and C<$/.to> positions.

Therefore C<$()> is usually just the entire match string, but
you can override that by calling C<make> inside a regex:
@@ -2447,19 +2457,19 @@
# match succeeds -- ignore the rest of the regex
});

-This puts the result object into C<$/.rob>. If a result object is
+This puts the new abstract node into C<$/.ast>. If the abstract object is
returned that way, it may be of any type, not just a string.
This makes it convenient to build up an abstract syntax tree of
arbitrary node types.

-You may also capture a subset of the match as the result object using
+You may also capture a subset of the match as the abstract object using
the C<< <(...)> >> construct:

"foo123bar" ~~ / foo <( \d+ )> bar /
say $(); # says 123

-In this case the result object is always a string when doing string
-matching, and a list of one or more elements when doing array matching.
+In this case the abstract object is always a string when doing string
+matching, and a list of one or more elements when doing list matching.

=item *

@@ -2564,15 +2574,15 @@

=item *

-Inside a regex, the C<$_> variable holds the current regex's incomplete
-C<Match> object, known as a match state. Generally this should not
+Inside a regex, the C<$ > variable holds the current regex's incomplete
+C<Match> object, known as a match state (of type C<Cursor>). Generally this should not
be modified unless you know how to create and propagate match states.
All regexes actually return match states even when you think they're
returning something else, because the match states keep track of
the success and failures of the pattern for you.

-Fortunately, when you just want to return a different result object instead
-of the default C<Match> object, you may associate your return value with
+Fortunately, when you just want to return a different abstract result along with
+the default concrete C<Match> object, you may associate your return value with
the current match state using the C<make> function, which works something
like a C<return>, but doesn't clobber the match state:

@@ -2581,7 +2591,7 @@
/;
say $(); # says 'bar'

-The result object is available in the C<Match> object via a C<< .rob >> lookup.
+The abstract object of any C<Match> object is available via the C<< .ast >> method.

=back

@@ -3942,8 +3952,9 @@
method call.)

You'll note from the last example that substitutions only happen on
-the "official" string result of the match, that is, the C<$()> value.
-(Here we captured C<$()> using the C<< <(...)> >> pair; otherwise we
+the "official" string result of the match, that is, the portion of
+the string between the C<$/.from> and C<$/.to> positions.
+(Here we set those explicitly using the C<< <(...)> >> pair; otherwise we
would have had to use lookbehind to match the C<$>.)

=head1 Positional matching, fixed width types

Add comment
DBD::Pg's $dbh->func( "/path/to/file", 'lo_import' ) fails silently Kynn Jones 20:52:48
 Hi! I'm trying to use DBD::Pg to import a Unix file as a large object. For
this I'm using the following:
my $oid = $dbh->func( "/absolute/path/to/­file", 'lo_import' );

When I do this, a new record is added to pg_largeobject, with a
proper-looking non-null loid, but the data field remains empty, and the
variable $oid above gets a return value of undef, i.e. the call to func
fails. No error or warning is ever emitted, as far as I can tell.
($dbh->errstr returns undef.) FWIW, the file passed as the first argument is
world-readable, and the full path to it is world-accessible.

I've consulted the documentation for DBI and DBD::Pg modules, but I can't
find any information that will enable me to troubleshoot/debug this further.
Any suggestions would be greatly appreciated!

TIA!

Kynn
Add comment
a junction or not Richard Hainsworth 19:09:41
 The following (the n:> is to mark the lines) are legal:

1:> my @x = 1,2,3,4; ([+] @x).say; # output 10
2:> my @x = 1|11,2,3,4; ([+] @a).perl.say; # output any(10,20)
3:> my @x = 1|11,2,3,4; ([+] @a).eigenstates.min­.say; # output 10

However, the next line isnt
4:> my @x = 1,2,3,4; ([+] @a).eigenstates.min­.say; # Method
'eigenstates' not found for invocant of class 'Integer'

But suppose I dont know until runtime whether @x contains a junction or
not, eg.,

my @s = 1|11,2,3,4,5,6,7; # as in the value of an ace in 21
my @x;
loop {
@x = @s.pick(3);
([+] @x).eigenstates.min­.say;
};

Eg.
$ perl6
my @s=1|11,2,3,4,5,6;m­y @x; loop {@x=@s.pick(3);([+]
@x).eigenstates.min­.say}
8
6
Method 'eigenstates' not found for invocant of class 'Integer'

I suggested to Masak on irc that an integer is a singleton, hence a
degenerate Junction. He said not.

So, how to determine whether a junction is being used or not?

Richard
comment 18 answers | Add comment
r25880 - docs/Perl6/Spec Guest 04:28:40
 Author: lwall
Date: 2009-03-18 02:28:39 +0100 (Wed, 18 Mar 2009)
New Revision: 25880

Modified:
docs/Perl6/Spec/S03­-operators.pod
docs/Perl6/Spec/S04­-control.pod
Log:
create more semantic distance between terms and 0-ary functions


Modified: docs/Perl6/Spec/S03­-operators.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S03­-operators.pod 2009-03-18 01:03:18 UTC (rev 25879)
+++ docs/Perl6/Spec/S03­-operators.pod 2009-03-18 01:28:39 UTC (rev 25880)
@@ -12,9 +12,9 @@

Maintainer: Larry Wall <larry@wall.org>
Date: 8 Mar 2004
- Last Modified: 12 Mar 2009
+ Last Modified: 17 Mar 2009
Number: 3
- Version: 158
+ Version: 159

=head1 Overview

@@ -303,14 +303,6 @@
its left, so it binds tighter than comma on the left but looser than
comma on the right--see List prefix precedence below.

-=item *
-
-0-ary functions
-
- self
- undef
- rand
-
=back

=head2 Method postfix precedence
@@ -1009,7 +1001,7 @@
to C<$_> in Perl6.

There is no unary C<rand> function in Perl 6, though there is a C<.rand>
-method call and a 0-ary C<rand> term.
+method call and an argumentless C<rand> term.

=over

@@ -1746,7 +1738,7 @@

The function can be 0-ary as well:

- () ... &rand # list of random numbers
+ () ... { rand } # list of random numbers

The function may also be slurpy (*-ary), in which case all the
preceding values are passed in (which means they must all be cached
@@ -3627,7 +3619,7 @@
then you shouldn't worry about it, because unlike previous versions,
Perl6 never guesses whether the next thing is a term or operator.
In this case it is always expecting a term unless C<foo> is predeclared
-to be a 0-ary sub.]
+to be a type or value name.]

The upgrade never happens on the "blunt" end of a hyper. If you write


Modified: docs/Perl6/Spec/S04­-control.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S04­-control.pod 2009-03-18 01:03:18 UTC (rev 25879)
+++ docs/Perl6/Spec/S04­-control.pod 2009-03-18 01:28:39 UTC (rev 25880)
@@ -12,9 +12,9 @@

Maintainer: Larry Wall <larry@wall.org>
Date: 19 Aug 2004
- Last Modified: 4 Mar 2009
+ Last Modified: 17 Mar 2009
Number: 4
- Version: 73
+ Version: 74

This document summarizes Apocalypse 4, which covers the block and
statement syntax of Perl.
@@ -95,7 +95,7 @@
a variable in the current package.

The new C<constant> declarator introduces a lexically scoped name
-for a compile-time constant, either a variable or a 0-ary sub, which
+for a compile-time constant, either a variable or named value, which
may be initialized with a pseudo-assignment:

constant Num $pi = 3;

Add comment

Add new topic:

How:  Register )
 
Login:   Password:   
Comments by: Premoderation:
Topic:
  
 
respect your talk pals, avoid using obscene language, typing entire messages in CAPS, posting buy/sell ads or violating netiquette or the RF Criminal Code..


QAIX > Perl web-programmingGo to page: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | next »

see also:
[SMARTY] smarty date format error (on…
[ANNOUNCEMENT] Smarty-2.6.7 (stable)…
pass tests:
You and sex.
see also:
For iphone fans: A nice method to enjoy…
Enjoy video on iPod, iPhone, Archos...
China toner cartridge exporter…

  Copyright © 2001—2009 QAIX
Idea: Miñhael Monashev
See Help and FAQ in the community support.qaix.com.
Write in the community about the bugs you have noticedbugs.qaix.com.
Write your offers and comments in the communities suggest.qaix.com.
Information for parents.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .