How to add a user to the friend list?
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: « previous | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | next »

  Top users: 
  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Ìîäåðàòîð:
Friday, 27 February 2009
r25629 - docs/Perl6/Spec Guest 21:43:29
 Author: lwall
Date: 2009-02-27 19:43:29 +0100 (Fri, 27 Feb 2009)
New Revision: 25629

Modified:
docs/Perl6/Spec/S06­-routines.pod
Log:
correct fossil


Modified: docs/Perl6/Spec/S06­-routines.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S06­-routines.pod 2009-02-27 18:28:01 UTC (rev 25628)
+++ docs/Perl6/Spec/S06­-routines.pod 2009-02-27 18:43:29 UTC (rev 25629)
@@ -288,7 +288,7 @@

This may then be invoked via the syntax for contextual variables:

- &+myfunc(42);
+ &*myfunc(42);

=head2 Lvalue subroutines


Add comment
r25627 - docs/Perl6/Spec Guest 21:27:22
 Author: lwall
Date: 2009-02-27 19:27:22 +0100 (Fri, 27 Feb 2009)
New Revision: 25627

Modified:
docs/Perl6/Spec/S04­-control.pod
Log:
off-by-one on the year


Modified: docs/Perl6/Spec/S04­-control.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S04­-control.pod 2009-02-27 18:24:47 UTC (rev 25626)
+++ docs/Perl6/Spec/S04­-control.pod 2009-02-27 18:27:22 UTC (rev 25627)
@@ -12,7 +12,7 @@

Maintainer: Larry Wall <larry@wall.org>
Date: 19 Aug 2004
- Last Modified: 27 Feb 2008
+ Last Modified: 27 Feb 2009
Number: 4
Version: 72


Add comment
Re: how to require() a file? Gunnar Hjalmarsson 20:54:04
 Stanis aw T. Findeisen wrote:
I am trying to require() a file using its absolute name. In command line
mode everything works fine, but not in Apache:
[Fri Feb 27 17:45:07 2009] [error] Can't locate
/home/stf/public_ht­ml/test/arcv/public_­html/../common.pl in @INC (@INC
contains: /usr/lib/perl5/site­_perl/5.8.8/i386-lin­ux-thread-multi

<snip>

/usr/lib/perl5/5.8.­8 . /etc/httpd) at
-------------------­----^

How can I require() a file when using Perl in CGI mode? Do I have to
modify @INC?

Based on your reply (to an answer that I not saw) it seems like giving
the web server read access to common.pl solved your problem. Together
with the fact that the current directory is included in @INC, it
indicates that you are not running the script under mod_perl.

I guess I am using mod_perl:

Guess?? You really, really ought to know! What happens if you add this
line to the script:

print "Not mod_perl\n" unless $ENV{MOD_PERL};

--
Gunnar Hjalmarsson
Email: http://www.gunnar.c­c/cgi-bin/contact.pl­
comment 1 answer | Add comment
DBI: misuse of %lx and %ld formats Charles Jardine 18:59:36
 I have built a 64 bit version of Perl 5.10.0 under SLES 10 (x86-64).
I am now installing DBI and DBD::Oracle.

Both of these modules produce alarming warnings at compile time.
E.g.

DBI.xs: In function ‘dbih_setup_fbav’:
DBI.xs:1549: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘int’

I have pasted a transcript of the DBI compilation below. The DBD::Oracle
warnings are similar, but more numerous.

I have looked at the source, and it seems to me that these warnings
are genuine. 32 bit integers are being passed to PerlIO_printf
where the format requires 64 bits. This is incorrect C. The effects
will be architecture dependent, and may include incorrect output and
even core dumps.

That said, the modules pass their tests and seem to work. However,
the incorrect code is mostly only exercised when tracing is turned on.

I wondered why I had never seen this before. It turns out that
Perl 5.10.0 has an improvement in this area. For gcc, the
declaration of PerlIO_printf has been enhanced by the addition
of '__attribute__((for­mat(__printf__,2,3))­)'. This, for the
first time, allows gcc to check the types of PerlIO_printf's arguments.

Do others agree with me that these format errors constitute a bug
which needs fixing? If so I will attempt a patch.

In the meanwhile I will retreat to a 32 bit perl.

===================­============
transcript follows
===================­============
+ perl -V
Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
Platform:
osname=linux, osvers=2.6.16.60-0.­34-smp, archname=x86_64-lin­ux-thread-multi
uname='linux ruff 2.6.16.60-0.34-smp #1 smp fri jan 16 14:59:01 utc 2009 x86_64 x86_64 x86_64 gnulinux '
config_args='-des -Dprefix=/usr/local­/perl/5.10.0-B -Dusethreads -Duse64bitall -Dlibpth=/lib64 /usr/lib64 /usr/local/lib64 -Dlocincpth=/usr/lo­cal/include -A define:libc=/lib64/­libc-2.4.so -Uinstallusrbinperl­ -Dman1dir=none -Dman3dir=none -Duseshrplib -Uperladmin -Dotherlibdirs=/usr­/local/perl5lib'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define,­ usemultiplicity=def­ine
useperlio=define, d_sfio=undef, uselargefiles=defin­e, usesocks=undef
use64bitint=define,­ use64bitall=define,­ uselongdouble=undef­
usemymalloc=n, bincompat5005=undef­
Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasin­g -pipe -I/usr/local/includ­e -D_LARGEFILE_SOURCE­ -D_FILE_OFFSET_BITS­=64',
optimize='-O2',
cppflags='-D_REENTR­ANT -D_GNU_SOURCE -fno-strict-aliasin­g -pipe -I/usr/local/includ­e'
ccversion='', gccversion='4.1.2 20070115 (SUSE Linux)', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='cc', ldflags =''
libpth=/lib64 /usr/lib64 /usr/local/lib64
libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib64/libc-2.­4.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.­4'
Dynamic Linking:
dlsrc=dl_dlopen.xs,­ dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/loc­al/perl/5.10.0-B/lib­/5.10.0/x86_64-linux­-thread-multi/CORE'
cccdlflags='-fPIC',­ lddlflags='-shared -O2'


Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GV­SV
PERL_IMPLICIT_CONTE­XT PERL_MALLOC_WRAP USE_64_BIT_ALL
USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
USE_PERLIO USE_REENTRANT_API
Built under linux
Compiled at Feb 26 2009 10:00:29
@INC:
/usr/local/perl/5.1­0.0-B/lib/5.10.0/x86­_64-linux-thread-mul­ti
/usr/local/perl/5.1­0.0-B/lib/5.10.0
/usr/local/perl/5.1­0.0-B/lib/site_perl/­5.10.0/x86_64-linux-­thread-multi
/usr/local/perl/5.1­0.0-B/lib/site_perl/­5.10.0
/usr/local/perl5lib­
.
+ perl Makefile.PL

*** Your LANG environment variable is set to 'en_GB.UTF-8'
*** This may cause problems for some perl installations.
*** If you get test failures, please try again with LANG unset.
*** If that then works, please email dbi-dev@perl.org with details
*** including the output of 'perl -V'


*** You are using a perl configured with threading enabled.
*** You should be aware that using multiple threads is
*** not recommended for production environments.

Your perl was compiled with gcc (version 4.1.2 20070115 (SUSE Linux)), okay.
Creating test wrappers for DBI::PurePerl:
t/zvp_01basics.t
t/zvp_02dbidrv.t
t/zvp_03handle.t
t/zvp_04mods.t
t/zvp_05concathash.­t
t/zvp_06attrs.t
t/zvp_07kids.t
t/zvp_08keeperr.t
t/zvp_09trace.t
t/zvp_10examp.t
t/zvp_11fetch.t
t/zvp_12quote.t
t/zvp_13taint.t
t/zvp_14utf8.t
t/zvp_15array.t
t/zvp_19fhtrace.t
t/zvp_20meta.t
t/zvp_30subclass.t
t/zvp_35thrclone.t (use threads)
t/zvp_40profile.t
t/zvp_41prof_dump.t­
t/zvp_42prof_data.t­
t/zvp_43prof_env.t
t/zvp_50dbm.t
t/zvp_60preparse.t
t/zvp_65transact.t
t/zvp_70callbacks.t­
t/zvp_72childhandle­s.t
t/zvp_80proxy.t
t/zvp_85gofer.t
t/zvp_86gofer_fail.­t
t/zvp_87gofer_cache­.t
Creating test wrappers for DBD::Gofer:
t/zvg_01basics.t
t/zvg_02dbidrv.t
t/zvg_03handle.t
t/zvg_04mods.t
t/zvg_05concathash.­t
t/zvg_06attrs.t
t/zvg_07kids.t
t/zvg_08keeperr.t
t/zvg_09trace.t
t/zvg_10examp.t
t/zvg_11fetch.t
t/zvg_12quote.t
t/zvg_13taint.t
t/zvg_14utf8.t
t/zvg_15array.t
t/zvg_19fhtrace.t
t/zvg_20meta.t
t/zvg_30subclass.t
t/zvg_35thrclone.t (use threads)
t/zvg_40profile.t
t/zvg_41prof_dump.t­
t/zvg_42prof_data.t­
t/zvg_43prof_env.t
t/zvg_50dbm.t
t/zvg_60preparse.t
t/zvg_65transact.t
t/zvg_70callbacks.t­
t/zvg_72childhandle­s.t
t/zvg_80proxy.t
t/zvg_85gofer.t
t/zvg_86gofer_fail.­t
t/zvg_87gofer_cache­.t
Creating test wrappers for PurePerl & Gofer:
t/zvxgp_01basics.t
t/zvxgp_02dbidrv.t
t/zvxgp_03handle.t
t/zvxgp_04mods.t
t/zvxgp_05concathas­h.t
t/zvxgp_06attrs.t
t/zvxgp_07kids.t
t/zvxgp_08keeperr.t­
t/zvxgp_09trace.t
t/zvxgp_10examp.t
t/zvxgp_11fetch.t
t/zvxgp_12quote.t
t/zvxgp_13taint.t
t/zvxgp_14utf8.t
t/zvxgp_15array.t
t/zvxgp_19fhtrace.t­
t/zvxgp_20meta.t
t/zvxgp_30subclass.­t
t/zvxgp_35thrclone.­t (use threads)
t/zvxgp_40profile.t­
t/zvxgp_41prof_dump­.t
t/zvxgp_42prof_data­.t
t/zvxgp_43prof_env.­t
t/zvxgp_50dbm.t
t/zvxgp_60preparse.­t
t/zvxgp_65transact.­t
t/zvxgp_70callbacks­.t
t/zvxgp_72childhand­les.t
t/zvxgp_80proxy.t
t/zvxgp_85gofer.t
t/zvxgp_86gofer_fai­l.t
t/zvxgp_87gofer_cac­he.t
Checking if your kit is complete...
Looks good

I see you're using perl 5.010000 on x86_64-linux-thread­-multi, okay.
Remember to actually *read* the README file!
Use 'make' to build the software (dmake or nmake on Windows).
Then 'make test' to execute self tests.
Then 'make install' to install the DBI and then delete this working
directory before unpacking and building any DBD::* drivers.

Writing Makefile for DBI
+ make
/usr/local/perl/5.1­0.0-B/bin/perl "-MExtUtils::Comman­d" -e mkpath blib/lib/DBI
rm -f blib/lib/DBI/Change­s.pm
cp Changes blib/lib/DBI/Change­s.pm
/usr/local/perl/5.1­0.0-B/bin/perl "-MExtUtils::Comman­d" -e mkpath blib/lib/DBI
rm -f blib/lib/DBI/Roadma­p.pm
cp Roadmap.pod blib/lib/DBI/Roadma­p.pm
cp Driver_xst.h blib/arch/auto/DBI/­Driver_xst.h
cp lib/DBD/Proxy.pm blib/lib/DBD/Proxy.­pm
cp lib/DBI/Gofer/Respo­nse.pm blib/lib/DBI/Gofer/­Response.pm
cp lib/DBI/Gofer/Trans­port/Base.pm blib/lib/DBI/Gofer/­Transport/Base.pm
cp lib/DBI/Util/_acces­sor.pm blib/lib/DBI/Util/_­accessor.pm
cp lib/DBD/DBM.pm blib/lib/DBD/DBM.pm­
cp DBIXS.h blib/arch/auto/DBI/­DBIXS.h
cp Roadmap.pod blib/lib/Roadmap.po­d
cp dbixs_rev.pl blib/lib/dbixs_rev.­pl
cp lib/DBI/Const/GetIn­foType.pm blib/lib/DBI/Const/­GetInfoType.pm
cp lib/DBI/Gofer/Seria­lizer/DataDumper.pm blib/lib/DBI/Gofer/­Serializer/DataDumpe­r.pm
cp lib/DBI/DBD/Metadat­a.pm blib/lib/DBI/DBD/Me­tadata.pm
cp lib/DBD/Gofer/Trans­port/pipeone.pm blib/lib/DBD/Gofer/­Transport/pipeone.pm­
cp lib/DBI/Const/GetIn­fo/ODBC.pm blib/lib/DBI/Const/­GetInfo/ODBC.pm
cp lib/DBI/ProfileDump­er/Apache.pm blib/lib/DBI/Profil­eDumper/Apache.pm
cp Driver.xst blib/arch/auto/DBI/­Driver.xst
cp lib/DBD/File.pm blib/lib/DBD/File.p­m
cp lib/DBI/Util/CacheM­emory.pm blib/lib/DBI/Util/acheMemory.pm
cp lib/DBD/NullP.pm blib/lib/DBD/NullP.­pm
cp lib/DBI/ProfileSubs­.pm blib/lib/DBI/Profil­eSubs.pm
cp dbi_sql.h blib/arch/auto/DBI/­dbi_sql.h
cp lib/DBD/Gofer.pm blib/lib/DBD/Gofer.­pm
cp dbivport.h blib/arch/auto/DBI/­dbivport.h
cp dbd_xsh.h blib/arch/auto/DBI/­dbd_xsh.h
cp dbixs_rev.h blib/arch/auto/DBI/­dbixs_rev.h
cp lib/DBD/Gofer/Trans­port/Base.pm blib/lib/DBD/Gofer/­Transport/Base.pm
cp lib/DBI/FAQ.pm blib/lib/DBI/FAQ.pm­
cp lib/DBD/Gofer/Polic­y/rush.pm blib/lib/DBD/Gofer/­Policy/rush.pm
cp lib/DBI/SQL/Nano.pm­ blib/lib/DBI/SQL/Na­no.pm
cp lib/DBI/Gofer/Reque­st.pm blib/lib/DBI/Gofer/­Request.pm
cp lib/DBI/Const/GetIn­fo/ANSI.pm blib/lib/DBI/Const/­GetInfo/ANSI.pm
cp lib/DBD/Gofer/Trans­port/stream.pm blib/lib/DBD/Gofer/­Transport/stream.pm
cp lib/DBD/Gofer/Polic­y/classic.pm blib/lib/DBD/Gofer/­Policy/classic.pm
cp lib/DBI/Const/GetIn­foReturn.pm blib/lib/DBI/Const/­GetInfoReturn.pm
cp lib/DBD/Gofer/Polic­y/Base.pm blib/lib/DBD/Gofer/­Policy/Base.pm
cp DBI.pm blib/lib/DBI.pm
cp lib/DBI/Gofer/Seria­lizer/Storable.pm blib/lib/DBI/Gofer/­Serializer/Storable.­pm
cp lib/DBI/Gofer/Trans­port/stream.pm blib/lib/DBI/Gofer/­Transport/stream.pm
cp lib/DBD/Sponge.pm blib/lib/DBD/Sponge­.pm
cp lib/DBD/Gofer/Polic­y/pedantic.pm blib/lib/DBD/Gofer/­Policy/pedantic.pm
cp lib/DBI/W32ODBC.pm blib/lib/DBI/W32ODB­C.pm
cp lib/DBI/Gofer/Trans­port/pipeone.pm blib/lib/DBI/Gofer/­Transport/pipeone.pm­
cp lib/DBD/Gofer/Trans­port/null.pm blib/lib/DBD/Gofer/­Transport/null.pm
cp lib/Bundle/DBI.pm blib/lib/Bundle/DBI­.pm
cp TASKS.pod blib/lib/TASKS.pod
cp lib/DBI/Profile.pm blib/lib/DBI/Profil­e.pm
cp lib/DBI/ProfileDump­er.pm blib/lib/DBI/Profil­eDumper.pm
cp lib/DBI/ProxyServer­.pm blib/lib/DBI/ProxyS­erver.pm
cp lib/DBI/Gofer/Seria­lizer/Base.pm blib/lib/DBI/Gofer/­Serializer/Base.pm
cp dbipport.h blib/arch/auto/DBI/­dbipport.h
cp lib/DBI/Gofer/Execu­te.pm blib/lib/DBI/Gofer/­Execute.pm
cp lib/DBI/DBD.pm blib/lib/DBI/DBD.pm­
cp lib/Win32/DBIODBC.p­m blib/lib/Win32/DBIO­DBC.pm
cp lib/DBI/PurePerl.pm­ blib/lib/DBI/PurePe­rl.pm
cp lib/DBD/ExampleP.pm­ blib/lib/DBD/Exampl­eP.pm
cp lib/DBI/ProfileData­.pm blib/lib/DBI/Profil­eData.pm
/usr/local/perl/5.1­0.0-B/bin/perl -p -e "s/~DRIVER~/Perl/g"­ ./Driver.xst > Perl.xsi
/usr/local/perl/5.1­0.0-B/bin/perl /usr/local/perl/5.1­0.0-B/lib/5.10.0/Ext­Utils/xsubpp -typemap /usr/local/perl/5.1­0.0-B/lib/5.10.0/Ext­Utils/typemap -typemap typemap Perl.xs > Perl.xsc && mv Perl.xsc Perl.c
cc -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasin­g -pipe -I/usr/local/includ­e -D_LARGEFILE_SOURCE­ -D_FILE_OFFSET_BITS­=64 -O2 -DVERSION=\"1.607\"­ -DXS_VERSION=\"1.60­7\" -fPIC "-I/usr/local/perl/­5.10.0-B/lib/5.10.0/­x86_64-linux-thread-­multi/CORE" -W -Wall -Wpointer-arith -Wbad-function-cast­ -Wno-comment -Wno-sign-compare -Wno-cast-qual -Wmissing-noreturn -Wno-unused-paramet­er Perl.c
Perl.xsi: In function ‘XS_DBD__Perl__db_d­isconnect’:
Perl.xsi:306: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘I32’
Perl.xsi:306: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘I32’
Perl.xsi: In function ‘XS_DBD__Perl__db_D­ESTROY’:
Perl.xsi:352: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘I32’
Perl.xsi:352: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘I32’
Perl.xsi:380: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘I32’
Perl.xsi:380: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘I32’
Perl.xsi: In function ‘XS_DBD__Perl__st_f­inish’:
Perl.xsi:675: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘I32’
Perl.xsi:675: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘I32’
Perl.xsi: In function ‘XS_DBD__Perl__st_D­ESTROY’:
Perl.xsi:752: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘I32’
Perl.xsi:752: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘I32’
Perl.xsi:766: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘I32’
Perl.xsi:766: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘I32’
/usr/local/perl/5.1­0.0-B/bin/perl /usr/local/perl/5.1­0.0-B/lib/5.10.0/Ext­Utils/xsubpp -typemap /usr/local/perl/5.1­0.0-B/lib/5.10.0/Ext­Utils/typemap -typemap typemap DBI.xs > DBI.xsc && mv DBI.xsc DBI.c
cc -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasin­g -pipe -I/usr/local/includ­e -D_LARGEFILE_SOURCE­ -D_FILE_OFFSET_BITS­=64 -O2 -DVERSION=\"1.607\"­ -DXS_VERSION=\"1.60­7\" -fPIC "-I/usr/local/perl/­5.10.0-B/lib/5.10.0/­x86_64-linux-thread-­multi/CORE" -W -Wall -Wpointer-arith -Wbad-function-cast­ -Wno-comment -Wno-sign-compare -Wno-cast-qual -Wmissing-noreturn -Wno-unused-paramet­er DBI.c
DBI.xs: In function ‘set_err_sv’:
DBI.xs:623: warning: value computed is not used
DBI.xs: In function ‘set_trace’:
DBI.xs:888: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 6 has type ‘int’
DBI.xs:888: warning: format ‘%ld’ expects type ‘long int’, but argument 7 has type ‘unsigned int’
DBI.xs: In function ‘dbih_setup_handle’­:
DBI.xs:1289: warning: value computed is not used
DBI.xs:1290: warning: value computed is not used
DBI.xs:1295: warning: value computed is not used
DBI.xs:1298: warning: value computed is not used
DBI.xs: In function ‘dbih_setup_fbav’:
DBI.xs:1549: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘int’
DBI.xs:1549: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘I32’
DBI.xs:1556: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘I32’
DBI.xs:1570: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘int’
DBI.xs: In function ‘dbih_set_attr_k’:
DBI.xs:1717: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘I32’
DBI.xs:1717: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘I32’
DBI.xs:1724: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘I32’
DBI.xs:1724: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘I32’
DBI.xs:1926: warning: value computed is not used
DBI.xs: In function ‘dbih_get_attr_k’:
DBI.xs:2017: warning: value computed is not used
DBI.xs:2241: warning: value computed is not used
DBI.xs: In function ‘_profile_next_node­’:
DBI.xs:2447: warning: value computed is not used
DBI.xs: In function ‘XS_DBI_dispatch’:
DBI.xs:3000: warning: value computed is not used
DBI.xs:3062: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘I32’
DBI.xs:3062: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘I32’
DBI.xs:3075: warning: value computed is not used
DBI.xs: In function ‘XS_DBI__new_handle­’:
DBI.xs:4092: warning: value computed is not used
DBI.xs: In function ‘XS_DBD_____db_take­_imp_data’:
DBI.xs:4623: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘I32’
DBI.xs:4623: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘I32’
DBI.xs: In function ‘XS_DBD_____st_fetc­hrow_hashref’:
DBI.xs:4801: warning: value computed is not used
DBI.xs: In function ‘XS_DBD_____st_fini­sh’:
DBI.xs:4864: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘I32’
DBI.xs:4864: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘I32’
DBI.xs: In function ‘XS_DBD_____st_DEST­ROY’:
DBI.xs:4878: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘I32’
DBI.xs:4878: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘I32’
DBI.xs:4894: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘I32’
DBI.xs:4894: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘I32’
Running Mkbootstrap for DBI ()
chmod 644 DBI.bs
rm -f blib/arch/auto/DBI/­DBI.so
cc -shared -O2 DBI.o -o blib/arch/auto/DBI/­DBI.so \
\

chmod 755 blib/arch/auto/DBI/­DBI.so
cp DBI.bs blib/arch/auto/DBI/­DBI.bs
chmod 644 blib/arch/auto/DBI/­DBI.bs
/usr/local/perl/5.1­0.0-B/bin/perl "-Iblib/arch" "-Iblib/lib" dbiprof.PL dbiprof
Extracted dbiprof from dbiprof.PL with variable substitutions.
dbiprof syntax OK
cp dbiprof blib/script/dbiprof­
/usr/local/perl/5.1­0.0-B/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/dbiprof­
/usr/local/perl/5.1­0.0-B/bin/perl "-Iblib/arch" "-Iblib/lib" dbiproxy.PL dbiproxy
Extracted dbiproxy from dbiproxy.PL with variable substitutions.
dbiproxy syntax OK
cp dbiproxy blib/script/dbiprox­y
/usr/local/perl/5.1­0.0-B/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/dbiprox­y
/usr/local/perl/5.1­0.0-B/bin/perl "-Iblib/arch" "-Iblib/lib" dbilogstrip.PL dbilogstrip
Extracted dbilogstrip from dbilogstrip.PL with variable substitutions.
dbilogstrip syntax OK
cp dbilogstrip blib/script/dbilogs­trip
/usr/local/perl/5.1­0.0-B/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/dbilogs­trip

--
Charles Jardine - Computing Service, University of Cambridge
cj10@cam.ac.uk Tel: +44 1223 334506, Fax: +44 1223 334679

comment 3 answer | Add comment
r25623 - docs/Perl6/Spec Guest 15:41:26
 Author: wayland
Date: 2009-02-27 13:41:26 +0100 (Fri, 27 Feb 2009)
New Revision: 25623

Modified:
docs/Perl6/Spec/S16­-io.pod
Log:
Fixed name of NameServices. wayland-- for not picking this up before :)­.


Modified: docs/Perl6/Spec/S16­-io.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S16­-io.pod 2009-02-27 12:32:32 UTC (rev 25622)
+++ docs/Perl6/Spec/S16­-io.pod 2009-02-27 12:41:26 UTC (rev 25623)
@@ -75,21 +75,6 @@

=head1 Name Services

-=head NameServices role
-
-The NameServices role has a bunch of functions that between them will return the whole
-Name Services database between them, as lists of objects. The lists are specifically
-intended to be lazy.
-
-role NameServices {
- method List of User users() {...} # getpwent, setpwent, endpwent
- method List of Group groups() {...} # getgrent, setgrent, endgrent
- method List of Service services() {...} # getservent, setservent, endservent
- method List of Protocol protocols() {...} # getprotoent, setprotoent, endprotoent
- method List of Network networks() {...} # getnetent, setnetent, endnetent
- method List of Host hosts() {...} # gethostent, sethostent, endhostent
-}
-
=head2 User role

role User {
@@ -148,6 +133,21 @@

Tries to write the group entry into the system group database.

+=head OS::Unix::NameServi­ces role
+
+The NameServices role has a bunch of functions that between them will return the whole
+Name Services database between them, as lists of objects. The lists are specifically
+intended to be lazy.
+
+role NameServices {
+ method List of User users() {...} # getpwent, setpwent, endpwent
+ method List of Group groups() {...} # getgrent, setgrent, endgrent
+ method List of Service services() {...} # getservent, setservent, endservent
+ method List of Protocol protocols() {...} # getprotoent, setprotoent, endprotoent
+ method List of Network networks() {...} # getnetent, setnetent, endnetent
+ method List of Host hosts() {...} # gethostent, sethostent, endhostent
+}
+
=head1 Additions

Please post errors and feedback to perl6-language. If you are making

Add comment
r25622 - docs/Perl6/Spec Guest 15:32:32
 Author: wayland
Date: 2009-02-27 13:32:32 +0100 (Fri, 27 Feb 2009)
New Revision: 25622

Modified:
docs/Perl6/Spec/S16­-io.pod
docs/Perl6/Spec/S29­-functions.pod
Log:
Replaced iterators with NameServices role, based on an idea of ruoso++ (although I doubt
he wants credit for some of the things I've done with his ideas :)­ )


Modified: docs/Perl6/Spec/S16­-io.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S16­-io.pod 2009-02-27 12:06:57 UTC (rev 25621)
+++ docs/Perl6/Spec/S16­-io.pod 2009-02-27 12:32:32 UTC (rev 25622)
@@ -3,7 +3,7 @@

=head1 Title

-DRAFT: Synopsis 16: IO / User / Group
+DRAFT: Synopsis 16: IO / Name Services

=head1 Version

@@ -73,8 +73,23 @@
S32-setting-library­/IO.pod. The main functions used are listed in S29 with references to
S32-setting-library­/IO.pod.

-=head1 Users and Groups
+=head1 Name Services

+=head NameServices role
+
+The NameServices role has a bunch of functions that between them will return the whole
+Name Services database between them, as lists of objects. The lists are specifically
+intended to be lazy.
+
+role NameServices {
+ method List of User users() {...} # getpwent, setpwent, endpwent
+ method List of Group groups() {...} # getgrent, setgrent, endgrent
+ method List of Service services() {...} # getservent, setservent, endservent
+ method List of Protocol protocols() {...} # getprotoent, setprotoent, endprotoent
+ method List of Network networks() {...} # getnetent, setnetent, endnetent
+ method List of Host hosts() {...} # gethostent, sethostent, endhostent
+}
+
=head2 User role

role User {
@@ -115,13 +130,6 @@
All the information is naturally fetched from the system via getpwuid, getpwnam, or the
like.

-=head2 UserIterator role
-
-role UserIterator does Iterator {...}
-
-In the Unix implementation, this deals with getpwent, setpwent, and endpwent. Basically,
-it returns a User object with each iteration.
-
=head2 Group role

role Group {
@@ -140,13 +148,6 @@

Tries to write the group entry into the system group database.

-=head2 GroupIterator role
-
-role GroupIterator does Iterator {...}
-
-In the Unix implementation, this deals with getgrent, setgrent, and endgrent. Basically,
-it returns a Group object with each iteration.
-
=head1 Additions

Please post errors and feedback to perl6-language. If you are making

Modified: docs/Perl6/Spec/S29­-functions.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S29­-functions.pod 2009-02-27 12:06:57 UTC (rev 25621)
+++ docs/Perl6/Spec/S29­-functions.pod 2009-02-27 12:32:32 UTC (rev 25622)
@@ -777,9 +777,9 @@

See .pairs() method, above.

-=item endpwent, endgrent
+=item endpwent, endgrent, endservent, endprotoent, endnetent, endhostent

-The UserIterator and GroupIterator roles in S16 cover most of these.
+The NameServices role in S16 covers most of these.

=item format, formline

@@ -789,9 +789,9 @@

The User and Group roles in S16 cover most of these.

-=item getpwent, getgrent
+=item getpwent, getgrent, getservent, getnetent, gethostent

-The UserIterator and GroupIterator roles in S16 cover most of these.
+The NameServices role in S16 covers most of these.

=item length()

@@ -841,9 +841,9 @@

See IPC::SysV;

-=item setpwent, setgrent
+=item setpwent, setgrent, setservent, setprotoent, setnetent, sethostent

-The UserIterator and GroupIterator roles in S16 cover most of these.
+The NameServices role in S16 covers most of these.

=item shmctl, shmget, shmread, shmwrite

@@ -926,34 +926,18 @@
getservbyname
getservbyport

- getservent
- setservent
- endservent
-
--Protocol
getprotobyname
getprotobynumber

- getprotoent
- setprotoent
- endprotoent
-
--Network
getnetbyaddr
getnetbyname

- getnetent
- setnetent
- endnetent
-
--Host
gethostbyaddr
gethostbyname

- gethostent
- sethostent
- endhostent
-
=item Flow control

break

Add comment
r25614 - docs/Perl6/Spec/S32­-setting-library Guest 15:12:40
 Author: wayland
Date: 2009-02-27 10:19:30 +0100 (Fri, 27 Feb 2009)
New Revision: 25614

Modified:
docs/Perl6/Spec/S32­-setting-library/Str­.pod
Log:
Return type for subst


Modified: docs/Perl6/Spec/S32­-setting-library/Str­.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S32­-setting-library/Str­.pod 2009-02-27 08:29:42 UTC (rev 25613)
+++ docs/Perl6/Spec/S32­-setting-library/Str­.pod 2009-02-27 09:19:30 UTC (rev 25614)
@@ -509,7 +509,7 @@

=item subst

- method subst(Str $self: Regex $search, Str $replacement);
+ method Str subst(Str $self: Regex $search, Str $replacement);

XXX Does this return a Match? A Str?


comment 1 answer | Add comment
r25621 - docs/Perl6/Spec Guest 15:06:57
 Author: wayland
Date: 2009-02-27 13:06:57 +0100 (Fri, 27 Feb 2009)
New Revision: 25621

Modified:
docs/Perl6/Spec/S16­-io.pod
docs/Perl6/Spec/S29­-functions.pod
Log:
Created UserIterator and GroupIterator, and grouped some S29 functions together.


Modified: docs/Perl6/Spec/S16­-io.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S16­-io.pod 2009-02-27 11:57:30 UTC (rev 25620)
+++ docs/Perl6/Spec/S16­-io.pod 2009-02-27 12:06:57 UTC (rev 25621)
@@ -115,6 +115,13 @@
All the information is naturally fetched from the system via getpwuid, getpwnam, or the
like.

+=head2 UserIterator role
+
+role UserIterator does Iterator {...}
+
+In the Unix implementation, this deals with getpwent, setpwent, and endpwent. Basically,
+it returns a User object with each iteration.
+
=head2 Group role

role Group {
@@ -133,6 +140,13 @@

Tries to write the group entry into the system group database.

+=head2 GroupIterator role
+
+role GroupIterator does Iterator {...}
+
+In the Unix implementation, this deals with getgrent, setgrent, and endgrent. Basically,
+it returns a Group object with each iteration.
+
=head1 Additions

Please post errors and feedback to perl6-language. If you are making

Modified: docs/Perl6/Spec/S29­-functions.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S29­-functions.pod 2009-02-27 11:57:30 UTC (rev 25620)
+++ docs/Perl6/Spec/S29­-functions.pod 2009-02-27 12:06:57 UTC (rev 25621)
@@ -777,6 +777,10 @@

See .pairs() method, above.

+=item endpwent, endgrent
+
+The UserIterator and GroupIterator roles in S16 cover most of these.
+
=item format, formline

See Exegesis 7.
@@ -785,6 +789,10 @@

The User and Group roles in S16 cover most of these.

+=item getpwent, getgrent
+
+The UserIterator and GroupIterator roles in S16 cover most of these.
+
=item length()

This word is banned in Perl 6. You must specify units. In practise, this probably means
@@ -833,6 +841,10 @@

See IPC::SysV;

+=item setpwent, setgrent
+
+The UserIterator and GroupIterator roles in S16 cover most of these.
+
=item shmctl, shmget, shmread, shmwrite

See IPC::SysV;
@@ -896,42 +908,52 @@

=item OS or library related

-chroot
-crypt
-endgrent
-endhostent
-endnetent
-endprotoent
-endpwent
-endservent
-getgrent
-gethostbyaddr
-gethostbyname
-gethostent
-getlogin
-getnetbyaddr
-getnetbyname
-getnetent
-getpeername
-getpgrp
-getppid
-getpriority
-getprotobyname
-getprotobynumber
-getprotoent
-getpwent
-getservbyname
-getservbyport
-getservent
-setgrent
-sethostent
-setnetent
-setpgrp
-setpriority
-setprotoent
-setpwent
-setservent
+ chroot
+ crypt
+ getlogin
+ getpeername -- should this go on Pipe?

+OS objects:
+
+ --Process
+ getpgrp
+ getppid
+ getpriority
+ setpgrp
+ setpriority
+
+ --Service
+ getservbyname
+ getservbyport
+
+ getservent
+ setservent
+ endservent
+
+ --Protocol
+ getprotobyname
+ getprotobynumber
+
+ getprotoent
+ setprotoent
+ endprotoent
+
+ --Network
+ getnetbyaddr
+ getnetbyname
+
+ getnetent
+ setnetent
+ endnetent
+
+ --Host
+ gethostbyaddr
+ gethostbyname
+
+ gethostent
+ sethostent
+ endhostent
+
=item Flow control

break

Add comment
r25619 - docs/Perl6/Spec Guest 14:34:30
 Author: wayland
Date: 2009-02-27 12:34:30 +0100 (Fri, 27 Feb 2009)
New Revision: 25619

Modified:
docs/Perl6/Spec/S16­-io.pod
docs/Perl6/Spec/S29­-functions.pod
Log:
Did some work on users and groups


Modified: docs/Perl6/Spec/S16­-io.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S16­-io.pod 2009-02-27 11:10:45 UTC (rev 25618)
+++ docs/Perl6/Spec/S16­-io.pod 2009-02-27 11:34:30 UTC (rev 25619)
@@ -24,8 +24,10 @@
corresponding global function, it's merely an exported version of
the method.

-=head1 Overridable IO handles
+=head1 IO

+=head2 Overridable IO handles
+
In Perl 6, there are the I<standard> IO handles, and any number of overriding
inner filehandles for the same symbol.

@@ -65,15 +67,78 @@
}
# stdout reverts to outer scope's definition

-=head1 Roles and Classes
+=head2 Roles and Classes

The roles and classes that define most of the functionality for IO are defined in
S32-setting-library­/IO.pod. The main functions used are listed in S29 with references to
S32-setting-library­/IO.pod.

+=head1 Users and Groups
+
+=head2 User role
+
+role User {
+ has $username; # Username (some descendants(?) may want to implement a real $name)
+ has $id; # User ID
+ has $dir; # Home directory for files
+}
+
+=item new
+
+ method User new($Username?, $UID?) {...}
+
+Creates a new User object, fetching the information either by username or user ID.
+
+=item write
+
+ method write() {...}
+
+Tries to write the current User object to the user database. This may well fail.
+
+=item Str
+
+When converted to a Str, returns $username.
+
+=item Num
+
+When converted to a Num, returns $uid.
+
+=head2 OS::Unix::User role
+
+role OS::Unix::User does User {
+ has $password;
+ has $gid;
+ has $gecos;
+ has $shell;
+}
+
+All the information is naturally fetched from the system via getpwuid, getpwnam, or the
+like.
+
+=head2 Group role
+
+role Group {
+ has $name;
+ has $id;
+ has @members;
+}
+
+=item new
+
+ method Group new(:$Name, :$­ID);
+
+=item write
+
+ method write();
+
+Tries to write the group entry into the system group database.
+
=head1 Additions

Please post errors and feedback to perl6-language. If you are making
a general laundry list, please separate messages by topic.

=cut
+
+=encoding utf8
+

Modified: docs/Perl6/Spec/S29­-functions.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S29­-functions.pod 2009-02-27 11:10:45 UTC (rev 25618)
+++ docs/Perl6/Spec/S29­-functions.pod 2009-02-27 11:34:30 UTC (rev 25619)
@@ -420,53 +420,6 @@
my $address = gethost("foo.exampl­e.com").addr;
my $hostname = gethost(:­addr<"10.1­.2.3">);

-=item getpw
-
- our OS::PW multi getpw()
- our OS::PW multi getpw( Int $uid )
- our OS::PW multi getpw( Str $name )
-
- our OS::PW multi method OS::PWEnt::getpw( OS::PWEnt $pw: )
- our OS::PW multi method OS::PWEnt::getpw( OS::PWEnt $pw: Int $uid )
- our OS::PW multi method OS::PWEnt::getpw( OS::PWEnt $pw: Str $name )
-
-The C<getpw> function operates on system login information, returning
-data about users in the form of an C<OS::PW> object ("PW" refers
-to the historical C<getpw*> functions that are part of the POSIX
-standard, and stands for "password").
-
-When given no parameters, the "next" user entry is returned (C<undef> is
-returned when the list of users has been exhausted).
-
-When C<$uid> is provided, a user with the given UID is found and returned.
-C<undef> is returned if no matching entry is found.
-
-When C<$name> is provided, a user with the matching name is found and
-returned. C<undef> is returned if no matching entry is found.
-
-The return value is an object that represents the system-specific
-information about the user. When numified, this object returns the
-UID of the user. When stringified, this object returns the username.
-
-Therefore, the typical convention of:
-
- my Int $uid = getpw(~$name);
-
-and
-
- my Str $name = getpw(+$uid);
-
-Will work as expected.
-
-See the documentation for the C<OS::PW> and C<OS::PWEnt> classes for more
-information and the equivalent of the Perl 5 setpwent / endpwent functions.
-
-WARNING: Even when used as a method on an C<OS::PWEnt> object, there
-may be system-specific, global state associated with the implementation
-of these routines.
-
-[Note: TODO setpgrp setpriority times -ajs ]
-
=item chroot

our Bool multi chroot ( Str $path = CALLER::<$_> )
@@ -828,6 +781,10 @@

See Exegesis 7.

+=item getgrgid, getgrnam, getpwnam, getpwuid
+
+The User and Group roles in S16 cover most of these.
+
=item length()

This word is banned in Perl 6. You must specify units. In practise, this probably means
@@ -948,8 +905,6 @@
endpwent
endservent
getgrent
-getgrgid
-getgrnam
gethostbyaddr
gethostbyname
gethostent
@@ -965,8 +920,6 @@
getprotobynumber
getprotoent
getpwent
-getpwnam
-getpwuid
getservbyname
getservbyport
getservent

Add comment
r25616 - docs/Perl6/Spec Guest 12:58:10
 Author: wayland
Date: 2009-02-27 10:58:10 +0100 (Fri, 27 Feb 2009)
New Revision: 25616

Modified:
docs/Perl6/Spec/S16­-io.pod
docs/Perl6/Spec/S17­-concurrency.pod
Log:
Moved Signals and IPC from S16 to S17, which can now be processes and concurrency.


Modified: docs/Perl6/Spec/S16­-io.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S16­-io.pod 2009-02-27 09:33:12 UTC (rev 25615)
+++ docs/Perl6/Spec/S16­-io.pod 2009-02-27 09:58:10 UTC (rev 25616)
@@ -3,7 +3,7 @@

=head1 Title

-DRAFT: Synopsis 16: IPC / IO / Signals
+DRAFT: Synopsis 16: IO / User / Group

=head1 Version

@@ -71,127 +71,6 @@
S32-setting-library­/IO.pod. The main functions used are listed in S29 with references to
S32-setting-library­/IO.pod.

-=head1 POSIX Signals
-
-The %*SIG variable contains a Hash of Proc::Signals::Sign­al.
-
-class Signal {
- has $exception; # This specifies what exception will be raised when this signal is received
- has $interrupt; # See siginterrupt(3)
- has $blocked; # Is this signal blocked? cf. sigprocmask
-}
-
-The @*SIGQUEUE array contains a queue of the signals that are blocked and queued.
-
-The standard POSIX signals simply raise control exceptions that are handled as normal
-through the control signal handler, and caught by CONTROL blocks.
-
-=head2 Signal defaults
-
-The signals have defaults as specified in the table below. $blocked always defaults to
-false.
-
- Signal Default Exception
- ------ -----------------
- SIGHUP ControlExceptionSig­HUP
- SIGINT ControlExceptionSig­INT
- SIGQUIT ControlExceptionSig­QUIT
- SIGILL ControlExceptionSig­ILL
- SIGABRT ControlExceptionSig­ABRT
- SIGFPE ControlExceptionSig­FPE
- SIGKILL ControlExceptionSig­KILL
- SIGSEGV ControlExceptionSig­SEGV
- SIGPIPE ControlExceptionSig­PIPE
- SIGALRM ControlExceptionSig­ALRM
- SIGTERM ControlExceptionSig­TERM
- SIGUSR1 ControlExceptionSig­USR1
- SIGUSR2 ControlExceptionSig­USR2
- SIGCHLD ControlExceptionSig­CHLD
- SIGCONT ControlExceptionSig­CONT
- SIGSTOP ControlExceptionSig­STOP
- SIGTSTP ControlExceptionSig­TSTP
- SIGTTIN ControlExceptionSig­TTIN
- SIGTTOU ControlExceptionSig­TTOU
- SIGBUS ControlExceptionSig­BUS
- SIGPROF ControlExceptionSig­PROF
- SIGSYS ControlExceptionSig­SYS
- SIGTRAP ControlExceptionSig­TRAP
- SIGURG Undefined
- SIGVTALRM ControlExceptionSig­VTALRM
- SIGXCPU ControlExceptionSig­XCPU
- SIGXFSZ ControlExceptionSig­XFSZ
- SIGEMT ControlExceptionSig­EMT
- SIGSTKFLT ControlExceptionSig­STKFLT
- SIGIO ControlExceptionSig­IO
- SIGPWR ControlExceptionSig­PWR
- SIGLOST ControlExceptionSig­LOST
- SIGWINCH Undefined
-
-=head2 Signal exceptions
-
-A table below describes the exceptions.
-
-Each of these has a default action as well. The possible actions are:
-
- Term Default action is to terminate the process.
-
- Ign Default action is to ignore the signal ($signal.exception is undef by default)
-
- Core Default action is to terminate the process and dump core (see core(5)).
-
- Stop Default action is to stop the process.
-
- Cont Default action is to continue the process if it is currently stopped.
-
-Some actions do the Resumeable role. An exception listed in the table below that does the
-Resumeable role is marked with a * in the R column.
-
-The exceptions are:
-
- Signal Action R Comment
- -------------------­--------------------­--------------------­-----------
- ControlExceptionSig­HUP Term ? Hangup detected on controlling terminal or death of controlling process
- ControlExceptionSig­INT Term ? Interrupt from keyboard
- ControlExceptionSig­QUIT Core ? Quit from keyboard
- ControlExceptionSig­ILL Core ? Illegal Instruction
- ControlExceptionSig­ABRT Core ? Abort signal from abort(3)
- ControlExceptionSig­FPE Core ? Floating point exception
- ControlExceptionSig­KILL Term ? Kill signal
- ControlExceptionSig­SEGV Core Invalid memory reference
- ControlExceptionSig­PIPE Term ? Broken pipe: write to pipe with no readers
- ControlExceptionSig­ALRM Term ? Timer signal from alarm(2)
- ControlExceptionSig­TERM Term ? Termination signal
- ControlExceptionSig­USR1 Term ? User-defined signal 1
- ControlExceptionSig­USR2 Term ? User-defined signal 2
- ControlExceptionSig­CHLD Ign * Child stopped or terminated
- ControlExceptionSig­CONT Cont * Continue if stopped
- ControlExceptionSig­STOP Stop ? Stop process
- ControlExceptionSig­TSTP Stop ? Stop typed at tty
- ControlExceptionSig­TTIN Stop ? tty input for background process
- ControlExceptionSig­TTOU Stop ? tty output for background process
- ControlExceptionSig­BUS Core ? Bus error (bad memory access)
- ControlExceptionSig­PROF Term ? Profiling timer expired
- ControlExceptionSig­SYS Core ? Bad argument to routine (SVr4)
- ControlExceptionSig­TRAP Core ? Trace/breakpoint trap
- ControlExceptionSig­URG Ign ? Urgent condition on socket (4.2BSD)
- ControlExceptionSig­VTALRM Term ? Virtual alarm clock (4.2BSD)
- ControlExceptionSig­XCPU Core ? CPU time limit exceeded (4.2BSD)
- ControlExceptionSig­XFSZ Core ? File size limit exceeded (4.2BSD)
- ControlExceptionSig­EMT Term ?
- ControlExceptionSig­STKFLT Term ? Stack fault on coprocessor (unused)
- ControlExceptionSig­IO Term ? I/O now possible (4.2BSD)
- ControlExceptionSig­PWR Term ? Power failure (System V)
- ControlExceptionSig­LOST Term ? File lock lost
- ControlExceptionSig­WINCH Ign ? Window resize signal (4.3BSD, Sun)
-
-See L<S04-control> for details on how to handle exceptions.
-
-XXX I'm unsure how the actions in the table above can be made to make sense. The Ign
-actions are already dealt with because %SIG{CHLD}.exceptio­n already defaults to undef.
-The Term action will probably be self-solving (ie. will terminate the process). The
-others I'm just plain unsure about. XXX
-
-
=head1 Additions

Please post errors and feedback to perl6-language. If you are making

Modified: docs/Perl6/Spec/S17­-concurrency.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S17­-concurrency.pod 2009-02-27 09:33:12 UTC (rev 25615)
+++ docs/Perl6/Spec/S17­-concurrency.pod 2009-02-27 09:58:10 UTC (rev 25616)
@@ -2,33 +2,247 @@

=head1 TITLE

-DRAFT: Synopsis 17: Concurrency
+DRAFT: Synopsis 17: Processes and Concurrency

=head1 AUTHOR

-Elizabeth Mattijsen <liz@dijkmat.nl>
-Audrey Tang <audreyt@audreyt.or­g>
-
=head1 VERSION

+ Authors: Elizabeth Mattijsen <liz@dijkmat.nl>
+ Audrey Tang <audreyt@audreyt.or­g>
Maintainer: Elizabeth Mattijsen <liz@dijkmat.nl>
Contributions: Christoph Buchetmann
+ Tim Nelson <wayland@wayland.id­.au>
Date: 13 Jun 2005
- Last Modified: 4 Mar 2008
- Number 0
- Version: 3
+ Last Modified: 27 Feb 2009
+ Number 17
+ Version: 4

+This draft document is a paste together from various sources. The bulk of it is simply
+the old S17-concurrency.pod­, which dealt only with concurrency. Signals were added from
+S16-io, but haven't been merged with the conflicting S17 signals doco. An event loop
+section has been added here because a) Larry mentioned the idea, and b) Moritz suggested
+that http://www.seas.upe­nn.edu/~lipeng/homep­age/unify.html be our model for concurrency,
+and in that model, an event loop underlies the threads.
+
+=head1 Overview
+
+An event loop underlies everything in this document. POSIX signals can interact with
+this, and concurrency is built on top of it. Naturally, IPC (inter-process communication)
+is documented here too (XXX or should be :)­ ).
+
+=head1 The Event Loop
+
+=head1 POSIX Signals
+
+The %*SIG variable contains a Hash of Proc::Signals::Sign­al.
+
+class Proc::Signals::Sign­al {
+ has $exception; # This specifies what exception will be raised when this signal is received
+ has $interrupt; # See siginterrupt(3)
+ has $blocked; # Is this signal blocked? cf. sigprocmask
+}
+
+The @*SIGQUEUE array contains a queue of the signals that are blocked and queued.
+
+The standard POSIX signals simply raise control exceptions that are handled as normal
+through the control signal handler, and caught by CONTROL blocks, as specified in S04.
+
+To declare your main program catches INT signals, put a CONTROL block anywhere
+in the toplevel to handle exceptions like this:
+
+ CONTROL {
+ when Error::Signal::INT { ... }
+ }
+
+=head2 Signal defaults
+
+The signals have defaults as specified in the table below. $blocked always defaults to
+false.
+
+ Signal Default Exception
+ ------ -----------------
+ SIGHUP ControlExceptionSig­HUP
+ SIGINT ControlExceptionSig­INT
+ SIGQUIT ControlExceptionSig­QUIT
+ SIGILL ControlExceptionSig­ILL
+ SIGABRT ControlExceptionSig­ABRT
+ SIGFPE ControlExceptionSig­FPE
+ SIGKILL ControlExceptionSig­KILL
+ SIGSEGV ControlExceptionSig­SEGV
+ SIGPIPE ControlExceptionSig­PIPE
+ SIGALRM ControlExceptionSig­ALRM
+ SIGTERM ControlExceptionSig­TERM
+ SIGUSR1 ControlExceptionSig­USR1
+ SIGUSR2 ControlExceptionSig­USR2
+ SIGCHLD ControlExceptionSig­CHLD
+ SIGCONT ControlExceptionSig­CONT
+ SIGSTOP ControlExceptionSig­STOP
+ SIGTSTP ControlExceptionSig­TSTP
+ SIGTTIN ControlExceptionSig­TTIN
+ SIGTTOU ControlExceptionSig­TTOU
+ SIGBUS ControlExceptionSig­BUS
+ SIGPROF ControlExceptionSig­PROF
+ SIGSYS ControlExceptionSig­SYS
+ SIGTRAP ControlExceptionSig­TRAP
+ SIGURG Undefined
+ SIGVTALRM ControlExceptionSig­VTALRM
+ SIGXCPU ControlExceptionSig­XCPU
+ SIGXFSZ ControlExceptionSig­XFSZ
+ SIGEMT ControlExceptionSig­EMT
+ SIGSTKFLT ControlExceptionSig­STKFLT
+ SIGIO ControlExceptionSig­IO
+ SIGPWR ControlExceptionSig­PWR
+ SIGLOST ControlExceptionSig­LOST
+ SIGWINCH Undefined
+
+=head2 Signal exceptions
+
+A table below describes the exceptions.
+
+Each of these has a default action as well. The possible actions are:
+
+ Term Default action is to terminate the process.
+
+ Ign Default action is to ignore the signal ($signal.exception is undef by default)
+
+ Core Default action is to terminate the process and dump core (see core(5)).
+
+ Stop Default action is to stop the process.
+
+ Cont Default action is to continue the process if it is currently stopped.
+
+Some actions do the Resumeable role. An exception listed in the table below that does the
+Resumeable role is marked with a * in the R column.
+
+The exceptions are:
+
+ Signal Action R Comment
+ -------------------­--------------------­--------------------­-----------
+ ControlExceptionSig­HUP Term ? Hangup detected on controlling terminal or death of controlling process
+ ControlExceptionSig­INT Term ? Interrupt from keyboard
+ ControlExceptionSig­QUIT Core ? Quit from keyboard
+ ControlExceptionSig­ILL Core ? Illegal Instruction
+ ControlExceptionSig­ABRT Core ? Abort signal from abort(3)
+ ControlExceptionSig­FPE Core ? Floating point exception
+ ControlExceptionSig­KILL Term ? Kill signal
+ ControlExceptionSig­SEGV Core Invalid memory reference
+ ControlExceptionSig­PIPE Term ? Broken pipe: write to pipe with no readers
+ ControlExceptionSig­ALRM Term ? Timer signal from alarm(2)
+ ControlExceptionSig­TERM Term ? Termination signal
+ ControlExceptionSig­USR1 Term ? User-defined signal 1
+ ControlExceptionSig­USR2 Term ? User-defined signal 2
+ ControlExceptionSig­CHLD Ign * Child stopped or terminated
+ ControlExceptionSig­CONT Cont * Continue if stopped
+ ControlExceptionSig­STOP Stop ? Stop process
+ ControlExceptionSig­TSTP Stop ? Stop typed at tty
+ ControlExceptionSig­TTIN Stop ? tty input for background process
+ ControlExceptionSig­TTOU Stop ? tty output for background process
+ ControlExceptionSig­BUS Core ? Bus error (bad memory access)
+ ControlExceptionSig­PROF Term ? Profiling timer expired
+ ControlExceptionSig­SYS Core ? Bad argument to routine (SVr4)
+ ControlExceptionSig­TRAP Core ? Trace/breakpoint trap
+ ControlExceptionSig­URG Ign ? Urgent condition on socket (4.2BSD)
+ ControlExceptionSig­VTALRM Term ? Virtual alarm clock (4.2BSD)
+ ControlExceptionSig­XCPU Core ? CPU time limit exceeded (4.2BSD)
+ ControlExceptionSig­XFSZ Core ? File size limit exceeded (4.2BSD)
+ ControlExceptionSig­EMT Term ?
+ ControlExceptionSig­STKFLT Term ? Stack fault on coprocessor (unused)
+ ControlExceptionSig­IO Term ? I/O now possible (4.2BSD)
+ ControlExceptionSig­PWR Term ? Power failure (System V)
+ ControlExceptionSig­LOST Term ? File lock lost
+ ControlExceptionSig­WINCH Ign ? Window resize signal (4.3BSD, Sun)
+
+See L<S04-control> for details on how to handle exceptions.
+
+XXX I'm unsure how the actions in the table above can be made to make sense. The Ign
+actions are already dealt with because %SIG{CHLD}.exceptio­n already defaults to undef.
+The Term action will probably be self-solving (ie. will terminate the process). The
+others I'm just plain unsure about. XXX
+
+=head1 Alarm
+
+XXX Everything about Alarm is from the old S17-concurrency.pod­
+
+An alarm is just a pre-arranged exception to be delivered to your program.
+
+By the time alarm has arrived, the current block may have already finished
+executing, so you would need to set up CATCH blocks in places where an alarm
+can rise to handle it properly.
+
+You can request an alarm using the number of seconds, or with a target date.
+It returns a proxy alarm object that you can do interesting things with.
+
+ multi Alarm *alarm (Num $seconds = $CALLER::_, &do = {die Sig::ALARM}, :$­repeat = 1)
+ multi Alarm *alarm (Date $date, &do = {die Sig::ALARM}, :$­repeat = 1)
+
+Perl 6's C<alarm> has three additional features over traditional alarms:
+
+=head2 Multiple and Lexical Alarms
+
+One can set up multiple alarms using repeated alarm calls:
+
+ {
+ my $a1 = alarm(2);
+ my $a2 = alarm(2);
+ sleep 10;
+ CATCH {
+ is critical; # if you don't want $a2 to be raised inside this
+ when Sig::ALARM { ... }
+ }
+ }
+
+To stop an alarm, call C<$alarm.stop>. The C<alarms> method for Conc objects
+(including process and threads) returns a list of alarms currently scheduled
+for that concurrent context.
+
+When an alarm object is garbage collected, the alarm is stopped automatically.
+Under void context, the implicit alarm object can only be stopped by querying
+C<.alarms> on the current process.
+
+We are not sure what C<alarm(0)> would mean. Probably a deprecation warning?
+
+=head2 Repeated Alarms
+
+If you request a repeated alarm using the C<repeated> named argument, it will
+attempt to fire off the alarm that many times. However, the alarm will be
+suppressed when inside a C<CATCH> block that's already handling the exception
+raised by I<same> alarm.
+
+To repeat 0 times is to not fire off any alarms at all. To repeat +Inf times
+is to repeat over and over again.
+
+=head2 Callbacks in Alarms
+
+You can arrange a callback (like JavaScript's setTimeOut) in C<alarm>, which
+will then be invoked with the then-current code as caller.
+
+If you set up such a callback to another Conc object, what happens is just like
+when you called C<.die> on behalf of that object -- namely, the callback
+closure, along with anything it referenced, is shared to the target Conc
+context.
+
+Unlike in Perl 5's ithreads where you cannot share anything after the fact,
+this allows passing shared objects in an C<ad-hoc> fashion across concurrent
+parts of the program. Under the default (multiplexing) concurrency model, this
+is basically a no-op.
+
+=head1 IPC
+
+=head1 Concurrency
+
This is a draft document. After being some time under the surface of Perl 6
development this is a attempt to document working concurrency issues, list the
remaining todos and mark the probably obsolete and redundant points.

-=head1 Overview

+=head2 Overview
+
Concurrency can take many forms in Perl 6. With varying degrees of
explicitness and control capabilities. This document attempts to describe
what these capabilities are and in which form they can be accessed in Perl 6.

-=head2 Processes, threads, fibers?
+=head3 Processes, threads, fibers?

Concurrency comes in many shapes and forms. Most Perl users are used to
the concept of a "process" or a "thread" (usually depending on the OS they
@@ -55,7 +269,7 @@
And for sake of consistency, an unthreaded "normal" program is considered
to be also running in a single thread.

-=head2 Variables
+=head3 Variables

In the past, there have been two models for concurrent processes in Perl.
In general, these are referred to as "5.005 threads" (C<perldoc perlothrtut>)
@@ -80,9 +294,9 @@
access inside a thread, except for those with an explicit "is shared"
attribute?)

-=head1 Contend/Maybe/Defer­
+=head2 Contend/Maybe/Defer­

-=head2 No user accessible locks
+=head3 No user accessible locks

Differently from any current concurrent process implementation in Perl, there
are no user accessible locks. Instead, the concept of Software
@@ -110,7 +324,7 @@
(EM: maybe point out if / how old style locks can be "simulated", for those
needing a migration path?)

-=head2 Atomic Code blocks
+=head3 Atomic Code blocks

my ($x, $y);
sub c {
@@ -135,7 +349,7 @@
which execution can return (in exactly the same state) if a problem occurs
(a.k.a. a L<defer> is done) inside the scope of the Code block.

-=head3 defer
+=head4 defer

The C<defer> function basically restores the state of the thread at the
last checkpoint and will wait there until an external event allows it to
@@ -148,7 +362,7 @@
The last checkpoint is either the outermost C<contend> boundary, or
the most immediate caller constructed with C<maybe>.

-=head3 maybe
+=head4 maybe

The C<maybe> statement causes a checkpoint to be made for C<defer> for
each block in the C<maybe> chain, creating an alternate execution path to
@@ -169,7 +383,7 @@
If placed outside a C<contend> block, the C<maybe> statement creates its
own C<contend> barrier.

-=head3 limitations
+=head4 limitations

Because Perl 6 must be able to revert its state to the state it had at the
checkpoint, it is not allowed to perform any non-revertible actions. These
@@ -185,7 +399,7 @@
If you're not interested in revertability, but are interested in
uninterruptability,­ you could use the "is critical" trait.

-=head3 Critical Code blocks
+=head4 Critical Code blocks

sub tricky is critical {
# code accessing external info, not to be interrupted
@@ -201,7 +415,7 @@
non-seekable file handles), it cannot do a C<defer> as it would be impossible
to restore the state to the beginning of the Code block.

-=head3 Mixing Atomic and Critical
+=head4 Mixing Atomic and Critical

Both "atomic" as well as "critical" propagate down the call chain. This means
that any subroutine that in itself is not "atomic" or "critical" becomes
@@ -216,7 +430,7 @@
of an Atomic Code block.


-=head1 Co-Routines
+=head2 Co-Routines

There is no real difference between a subroutine (or method) and a so-called
'co-routine'. The only difference is how control is relinquished by the
@@ -244,7 +458,7 @@
looking at them, but will B<not> be handled automatically. It would seem that
the use of named parameters is therefore advisable.

-=head2 Coroutine attributes
+=head3 Coroutine attributes

=over

@@ -254,7 +468,7 @@

=back

-=head2 Coroutine methods
+=head3 Coroutine methods

=over

@@ -264,7 +478,7 @@

=back

-=head2 Coroutine examples
+=head3 Coroutine examples

=over

@@ -296,7 +510,7 @@

=back

-=head1 Threads
+=head2 Threads

All outside of a thread defined variables are
shared and transactional variables by default
@@ -305,7 +519,7 @@
Unjoined threads will be joined at the beginning of the END
block batch of the parent thread that spawned them

-=head2 Thread creation
+=head3 Thread creation

A thread will be created using the keyword C<async> followed by
a codeblock being executed in this thread.
@@ -316,7 +530,7 @@
};


-=head2 Thread status and attributes
+=head3 Thread status and attributes

=over

@@ -361,7 +575,7 @@

=back

-=head2 Thread operators
+=head3 Thread operators

=over

@@ -385,7 +599,7 @@

=back

-=head2 Thread methods
+=head3 Thread methods

=over

@@ -456,93 +670,16 @@
=back


-=head2 Signals
+=head3 Continuations

-Asynchronous exceptions are just like user-initiated exceptions with C<die>,
-so you can also catch it with regular C<CATCH> blocks as specified in S04.
-
-To declare your main program catches INT signals, put a CATCH block anywhere
-in the toplevel to handle exceptions like this:
-
- CATCH {
- when Error::Signal::INT { ... }
- }
-
-=head2 Alarm
-
-An alarm is just a pre-arranged exception to be delivered to your program.
-
-By the time alarm has arrived, the current block may have already finished
-executing, so you would need to set up CATCH blocks in places where an alarm
-can rise to handle it properly.
-
-You can request an alarm using the number of seconds, or with a target date.
-It returns a proxy alarm object that you can do interesting things with.
-
- multi Alarm *alarm (Num $seconds = $CALLER::_, &do = {die Sig::ALARM}, :$­repeat = 1)
- multi Alarm *alarm (Date $date, &do = {die Sig::ALARM}, :$­repeat = 1)
-
-Perl 6's C<alarm> has three additional features over traditional alarms:
-
-=head3 Multiple and Lexical Alarms
-
-One can set up multiple alarms using repeated alarm calls:
-
- {
- my $a1 = alarm(2);
- my $a2 = alarm(2);
- sleep 10;
- CATCH {
- is critical; # if you don't want $a2 to be raised inside this
- when Sig::ALARM { ... }
- }
- }
-
-To stop an alarm, call C<$alarm.stop>. The C<alarms> method for Conc objects
-(including process and threads) returns a list of alarms currently scheduled
-for that concurrent context.
-
-When an alarm object is garbage collected, the alarm is stopped automatically.
-Under void context, the implicit alarm object can only be stopped by querying
-C<.alarms> on the current process.
-
-We are not sure what C<alarm(0)> would mean. Probably a deprecation warning?
-
-=head3 Repeated Alarms
-
-If you request a repeated alarm using the C<repeated> named argument, it will
-attempt to fire off the alarm that many times. However, the alarm will be
-suppressed when inside a C<CATCH> block that's already handling the exception
-raised by I<same> alarm.
-
-To repeat 0 times is to not fire off any alarms at all. To repeat +Inf times
-is to repeat over and over again.
-
-=head3 Callbacks in Alarms
-
-You can arrange a callback (like JavaScript's setTimeOut) in C<alarm>, which
-will then be invoked with the then-current code as caller.
-
-If you set up such a callback to another Conc object, what happens is just like
-when you called C<.die> on behalf of that object -- namely, the callback
-closure, along with anything it referenced, is shared to the target Conc
-context.
-
-Unlike in Perl 5's ithreads where you cannot share anything after the fact,
-this allows passing shared objects in an C<ad-hoc> fashion across concurrent
-parts of the program. Under the default (multiplexing) concurrency model, this
-is basically a no-op.
-
-=head2 Continuations
-
TODO document

-=head2 Junctive Autothreading and Hyper Operations
+=head3 Junctive Autothreading and Hyper Operations

Live in userland for the time being.


-=head2 Still more or less unorganized stuff
+=head3 Still more or less unorganized stuff


### INTERFACE BARRIER ###
@@ -581,16 +718,12 @@
}
### INTERFACE BARRIER ###

-=head2 See also
+=head3 See also

=over

=item *

-L<S16/Interprocess­ Communication>
-
-=item *
-
L<S16/IE<sol>O Considerations>

=item *
@@ -605,4 +738,11 @@

=cut

+=head1 Additions
+
+Please post errors and feedback to perl6-language. If you are making
+a general laundry list, please separate messages by topic.
+
+=cut
+
=for vim:set expandtab sw=4:

Add comment
r25615 - docs/Perl6/Spec/S32­-setting-library Guest 12:33:13
 Author: wayland
Date: 2009-02-27 10:33:12 +0100 (Fri, 27 Feb 2009)
New Revision: 25615

Modified:
docs/Perl6/Spec/S32­-setting-library/Str­.pod
Log:
Typo, my bad. wayland-- Incidentally, I can karma myself here, I think :)­


Modified: docs/Perl6/Spec/S32­-setting-library/Str­.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S32­-setting-library/Str­.pod 2009-02-27 09:19:30 UTC (rev 25614)
+++ docs/Perl6/Spec/S32­-setting-library/Str­.pod 2009-02-27 09:33:12 UTC (rev 25615)
@@ -511,8 +511,6 @@

method Str subst(Str $self: Regex $search, Str $replacement);

-XXX Does this return a Match? A Str?
-
=item trans

method trans(Str $self: Str $key, Str $val);

Add comment
r25612 - in docs/Perl6/Spec: . S32-setting-library Guest 11:28:45
 Author: wayland
Date: 2009-02-27 09:28:45 +0100 (Fri, 27 Feb 2009)
New Revision: 25612

Modified:
docs/Perl6/Spec/S28­-special-names.pod
docs/Perl6/Spec/S32­-setting-library/IO.­pod
Log:
IO.pod/S28: Regularised %*PROTOCOLS


Modified: docs/Perl6/Spec/S28­-special-names.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S28­-special-names.pod 2009-02-27 08:26:45 UTC (rev 25611)
+++ docs/Perl6/Spec/S28­-special-names.pod 2009-02-27 08:28:45 UTC (rev 25612)
@@ -106,6 +106,7 @@
$*PID Int # system process id
%=POD S02 # (or some such)
$*PROGRAM_NAME Str # name of the Perl program being executed
+ %*PROTOCOLS S16 Hash of Method # Stores the methods needed for the uri() function
::?ROLE Str # current role (as package or type name)
$?ROLE Role # current role
&?ROUTINE S06 Routine # current sub or method (itself)

Modified: docs/Perl6/Spec/S32­-setting-library/IO.­pod
===================­====================­====================­========
--- docs/Perl6/Spec/S32­-setting-library/IO.­pod 2009-02-27 08:26:45 UTC (rev 25611)
+++ docs/Perl6/Spec/S32­-setting-library/IO.­pod 2009-02-27 08:28:45 UTC (rev 25612)
@@ -74,7 +74,7 @@

These can naturally be overridden or added to by other modules.

-=item %PROTOCOLS global variable
+=item %*PROTOCOLS global variable

For each protocol, stores a type name that should be instantiated by calling the .uri()
constructor on that type, and passing in the appropriate uri.

Add comment
r25610 - docs/Perl6/Spec/S32­-setting-library Guest 11:16:29
 Author: wayland
Date: 2009-02-27 09:16:28 +0100 (Fri, 27 Feb 2009)
New Revision: 25610

Modified:
docs/Perl6/Spec/S32­-setting-library/IO.­pod
Log:
IO.pod: Got rid of code, replaced it with spec


Modified: docs/Perl6/Spec/S32­-setting-library/IO.­pod
===================­====================­====================­========
--- docs/Perl6/Spec/S32­-setting-library/IO.­pod 2009-02-27 07:42:32 UTC (rev 25609)
+++ docs/Perl6/Spec/S32­-setting-library/IO.­pod 2009-02-27 08:16:28 UTC (rev 25610)
@@ -61,9 +61,10 @@
=item uri

IO::Streamable method uri(Str $uri);
+ IO::Streamable sub uri(Str $uri);

Returns an appropriate IO::Streamable descendant, with the type depending on the uri
-passed in. Here's the mapping:
+passed in. Here are some example mappings:

URI type IO type
======== =======
@@ -71,15 +72,12 @@
ftp: IO::Socket::TCP (data channel)
http: IO::Socket::TCP

-IO::Streamable method uri(Str $uri) {
- $uri.match(/^<alnum­>+\:/);
- return(&$PROTOCOLS{­$1}($uri));
-}
+These can naturally be overridden or added to by other modules.

=item %PROTOCOLS global variable

-For each protocol, stores a subroutine reference that returns the appropriate object when
-the URI is passed in.
+For each protocol, stores a type name that should be instantiated by calling the .uri()
+constructor on that type, and passing in the appropriate uri.

=back


Add comment
r25609 - docs/Perl6/Spec Guest 10:42:32
 Author: lwall
Date: 2009-02-27 08:42:32 +0100 (Fri, 27 Feb 2009)
New Revision: 25609

Modified:
docs/Perl6/Spec/S06­-routines.pod
Log:
typo


Modified: docs/Perl6/Spec/S06­-routines.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S06­-routines.pod 2009-02-27 07:40:26 UTC (rev 25608)
+++ docs/Perl6/Spec/S06­-routines.pod 2009-02-27 07:42:32 UTC (rev 25609)
@@ -240,7 +240,7 @@
Redefining a stub subroutine does not produce an error, but redefining
an already-defined subroutine does. If you wish to redefine a defined sub,
you must explicitly use the "C<supersede>" declarator. (The compiler may
-refuse to do this if it has already commited to the previous definition.)
+refuse to do this if it has already committed to the previous definition.)

The C<...> is the "yadayadayada" operator, which is executable but returns
a failure. You can also use C<???> to produce a warning, or C<!!!> to

Add comment
r25607 - docs/Perl6/Spec Guest 10:39:57
 Author: lwall
Date: 2009-02-27 08:39:57 +0100 (Fri, 27 Feb 2009)
New Revision: 25607

Modified:
docs/Perl6/Spec/S06­-routines.pod
docs/Perl6/Spec/S12­-objects.pod
Log:
deprecate "is also" and "is instead" in favor of augment and supersede declarators


Modified: docs/Perl6/Spec/S06­-routines.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S06­-routines.pod 2009-02-27 07:03:18 UTC (rev 25606)
+++ docs/Perl6/Spec/S06­-routines.pod 2009-02-27 07:39:57 UTC (rev 25607)
@@ -13,9 +13,9 @@

Maintainer: Larry Wall <larry@wall.org>
Date: 21 Mar 2003
- Last Modified: 24 Feb 2009
+ Last Modified: 26 Feb 2009
Number: 6
- Version: 103
+ Version: 104


This document summarizes Apocalypse 6, which covers subroutines and the
@@ -239,7 +239,8 @@

Redefining a stub subroutine does not produce an error, but redefining
an already-defined subroutine does. If you wish to redefine a defined sub,
-you must explicitly use the "C<is instead>" trait.
+you must explicitly use the "C<supersede>" declarator. (The compiler may
+refuse to do this if it has already commited to the previous definition.)

The C<...> is the "yadayadayada" operator, which is executable but returns
a failure. You can also use C<???> to produce a warning, or C<!!!> to

Modified: docs/Perl6/Spec/S12­-objects.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S12­-objects.pod 2009-02-27 07:03:18 UTC (rev 25606)
+++ docs/Perl6/Spec/S12­-objects.pod 2009-02-27 07:39:57 UTC (rev 25607)
@@ -14,7 +14,7 @@
Date: 27 Oct 2004
Last Modified: 26 Feb 2009
Number: 12
- Version: 70
+ Version: 71

=head1 Overview

@@ -1463,15 +1463,16 @@
you can add more methods to them, though you have to be explicit that
that is what you're doing:

- class Object is also {
+ augment class Object {
method wow () { say "Wow, I'm an object." }
}

Otherwise you'll get a class redefinition error. (Also, to completely
-replace a definition, use "C<is instead>" instead of "C<is also>"...but
-don't do that.)
+replace a definition, use "C<supersede>" instead of "C<augment>"...but
+don't do that, since the compiler may have already committed to
+optimizations based on the old definition.)

-In order to discourage casual misuse of these traits, they are not
+In order to discourage casual misuse of these declarators, they are not
allowed on global classes unless you put a special declaration at the top:

use MONKEY_PATCHING;

Add comment
r25606 - docs/Perl6/Spec Guest 10:03:18
 Author: lwall
Date: 2009-02-27 08:03:18 +0100 (Fri, 27 Feb 2009)
New Revision: 25606

Modified:
docs/Perl6/Spec/S02­-bits.pod
docs/Perl6/Spec/S12­-objects.pod
Log:
some enum cleanup


Modified: docs/Perl6/Spec/S02­-bits.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S02­-bits.pod 2009-02-27 06:46:09 UTC (rev 25605)
+++ docs/Perl6/Spec/S02­-bits.pod 2009-02-27 07:03:18 UTC (rev 25606)
@@ -12,9 +12,9 @@

Maintainer: Larry Wall <larry@wall.org>
Date: 10 Aug 2004
- Last Modified: 25 Feb 2009
+ Last Modified: 26 Feb 2009
Number: 2
- Version: 155
+ Version: 156

This document summarizes Apocalypse 2, which covers small-scale
lexical items and typological issues. (These Synopses also contain
@@ -2459,8 +2459,8 @@

Fat arrow Adverbial pair Paren form
========= ============== ==========
- a => 1 :a
- a => 0 :!a
+ a => True :a
+ a => False :!a
a => 0 :a(0)
a => $x :a($x)
a => 'foo' :a<foo> :a(<foo>)

Modified: docs/Perl6/Spec/S12­-objects.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S12­-objects.pod 2009-02-27 06:46:09 UTC (rev 25605)
+++ docs/Perl6/Spec/S12­-objects.pod 2009-02-27 07:03:18 UTC (rev 25606)
@@ -12,9 +12,9 @@

Maintainer: Larry Wall <larry@wall.org>
Date: 27 Oct 2004
- Last Modified: 12 Feb 2009
+ Last Modified: 26 Feb 2009
Number: 12
- Version: 69
+ Version: 70

=head1 Overview

@@ -1298,11 +1298,6 @@
my enum Day ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];
my enum Day <Sun Mon Tue Wed Thu Fri Sat>;

-For any enum value the C<.perl> method will return its long name.
-A numeric enum value numifies to its numeric value and stringifies to its short name.
-A string enum value has no special numeric value, and stringifies to its string value
-rather than its name. [XXX inconsistent]
-
If the first value is unspecified, it defaults to 0. To specify the
first value, use pair notation (see below).

@@ -1316,6 +1311,23 @@
my Int enum day ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];
my enum day of uint4 <Sun Mon Tue Wed Thu Fri Sat>;

+For any enum value of an object type, the object itself knows its own
+type, so the C<.perl> method will return its long name, while C<.name>
+returns its short name. Other than that, number valued enums act
+just like numbers, while string valued enums act just like strings.
+
+Enums based on native types may be used only for their value, since a
+native value doesn't know its own type. To translate such a value back to its name
+requires a call to the name method, which must be qualified by the type:
+
+ 3.day::name # returns "Wed"
+
+Alternatively, native types may be placed in a typed variable, which determines
+which method to call:
+
+ my day $d = 3;
+ $d.name # returns "Wed"
+
An anonymous enum just makes sure each string turns into a pair with
sequentially increasing values, so:

@@ -1414,11 +1426,11 @@

Two built-in enums are:

- our bit enum Bool <False True>;
- our bit enum Taint <Untainted Tainted>;
+ our Bit enum Bool <False True>;
+ our Bit enum Taint <Untainted Tainted>;

Note that C<Bool> and C<Taint> are really role names, and the enum
-values are really subset types of the C<bit> integer type. You can
+values are really subset types of the C<Bit> integer type. You can
call the C<.Bool> coercion or the C<true> function or the C<?>
prefix operator on any built-in type, but the value returned is of
type C<bit>. Never compare a value to "C<true>", or even "C<True>".

Add comment
r25605 - docs/Perl6/Spec/S32­-setting-library Guest 09:46:10
 Author: wayland
Date: 2009-02-27 07:46:09 +0100 (Fri, 27 Feb 2009)
New Revision: 25605

Modified:
docs/Perl6/Spec/S32­-setting-library/Con­tainers.pod
Log:
Typo. martin++


Modified: docs/Perl6/Spec/S32­-setting-library/Con­tainers.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S32­-setting-library/Con­tainers.pod 2009-02-27 05:04:59 UTC (rev 25604)
+++ docs/Perl6/Spec/S32­-setting-library/Con­tainers.pod 2009-02-27 06:46:09 UTC (rev 25605)
@@ -703,7 +703,7 @@

=head2 Junction

-All method calls on Junctions autohread if there's no such method in the
+All method calls on Junctions autothread if there's no such method in the
Junction class.

=over 4

Add comment
Rakudo Perl development release #14 ("Vienna") Patrick R. Michaud 09:05:17
 On behalf of the Rakudo development team, I'm pleased to announce
the February 2009 development release of Rakudo Perl #14 "Vienna".
Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1].
The tarball for the February 2009 release is available from

http://www.pmichaud­.com/perl6/rakudo-20­09-02.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.

This is the fourteenth development release of Rakudo Perl, but it's
the first release independent from Parrot releases. We will continue
to follow a monthly release cycle, with each release to be code named
after a Perl Mongers group. This release is named for Vienna.pm
(http://vienna.pm.o­rg), who have been sponsoring Jonathan Worthington's
work on Rakudo since April 2008. 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 [2] 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 7076 spectests. This is an increase of 796
passing tests since the January 2009 release.

* The Configure.pl script supports a "--gen-parrot" option to
automatically fetch and build the appropriate version of Parrot.

* The default make target now builds a binary executable directly, either
perl6 or perl6.exe. It's still a Parrot "fakecutable", but we think
we've made it more reliable so that it doesn't generate segmentation
faults on exits. (If you don't know what a "fakecutable" is you can
safely ignore this.)

* Many builtins are beginning to be written in pure Perl 6, or Perl 6
functions with inline PIR. These builtins are part of the core
"setting" for Perl 6, and appear in the src/setting/ directory.
Previously this was known as the "prelude".

* Improved Test.pm diagnostic output.

Also, Rakudo now implements the following Perl 6 features:

* Anonymous classes may be specified using ::
* Existing parameterized roles are now reused instead of creating new ones.
* Roles pun a class when .new is invoked on them.
* "proto" now marks all same-named routines as "multi".
* "XopX" is now "Xop".
* <-> (rw) pointy blocks.
* min= and max= metaoperators.
* Many many bugfixes and documentation improvements.

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


References:
[1] Parrot, http://parrot.org/
[2] Git version control system, http://git-scm.org/­
Add comment
r25604 - in docs/Perl6/Spec: . S32-setting-library Guest 08:05:00
 Author: wayland
Date: 2009-02-27 06:04:59 +0100 (Fri, 27 Feb 2009)
New Revision: 25604

Modified:
docs/Perl6/Spec/S16­-io.pod
docs/Perl6/Spec/S32­-setting-library/Str­.pod
Log:
Various small fixes, mostly to signals


Modified: docs/Perl6/Spec/S16­-io.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S16­-io.pod 2009-02-27 04:28:08 UTC (rev 25603)
+++ docs/Perl6/Spec/S16­-io.pod 2009-02-27 05:04:59 UTC (rev 25604)
@@ -106,7 +106,7 @@
SIGTERM ControlExceptionSig­TERM
SIGUSR1 ControlExceptionSig­USR1
SIGUSR2 ControlExceptionSig­USR2
- SIGCHLD undef
+ SIGCHLD ControlExceptionSig­CHLD
SIGCONT ControlExceptionSig­CONT
SIGSTOP ControlExceptionSig­STOP
SIGTSTP ControlExceptionSig­TSTP
@@ -116,7 +116,7 @@
SIGPROF ControlExceptionSig­PROF
SIGSYS ControlExceptionSig­SYS
SIGTRAP ControlExceptionSig­TRAP
- SIGURG undef
+ SIGURG Undefined
SIGVTALRM ControlExceptionSig­VTALRM
SIGXCPU ControlExceptionSig­XCPU
SIGXFSZ ControlExceptionSig­XFSZ
@@ -125,7 +125,7 @@
SIGIO ControlExceptionSig­IO
SIGPWR ControlExceptionSig­PWR
SIGLOST ControlExceptionSig­LOST
- SIGWINCH undef
+ SIGWINCH Undefined

=head2 Signal exceptions

@@ -163,7 +163,7 @@
ControlExceptionSig­TERM Term ? Termination signal
ControlExceptionSig­USR1 Term ? User-defined signal 1
ControlExceptionSig­USR2 Term ? User-defined signal 2
- ControlExceptionSig­CHLD Ign ? Child stopped or terminated
+ ControlExceptionSig­CHLD Ign * Child stopped or terminated
ControlExceptionSig­CONT Cont * Continue if stopped
ControlExceptionSig­STOP Stop ? Stop process
ControlExceptionSig­TSTP Stop ? Stop typed at tty

Modified: docs/Perl6/Spec/S32­-setting-library/Str­.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S32­-setting-library/Str­.pod 2009-02-27 04:28:08 UTC (rev 25603)
+++ docs/Perl6/Spec/S32­-setting-library/Str­.pod 2009-02-27 05:04:59 UTC (rev 25604)
@@ -3,7 +3,7 @@

=head1 Title

-DRAFT: Synopsis 32: Setting Library - Miscellaneous Scalars
+DRAFT: Synopsis 32: Setting Library - Str

=head1 Version


Add comment
r25573 - in docs/Perl6/Spec: . S32-setting-library Guest 08:03:55
 Author: wayland
Date: 2009-02-26 04:43:20 +0100 (Thu, 26 Feb 2009)
New Revision: 25573

Added:
docs/Perl6/Spec/S32­-setting-library/Exc­eption.pod
Modified:
docs/Perl6/Spec/S16­-io.pod
docs/Perl6/Spec/S32­-setting-library/Num­eric.pod
Log:
Numeric.pod: Added some notes on what needs to be documented here
S16 and Exception.pod: Did some work on turning signals into exceptions. I probably need
to pre-emptively ask for forgiveness for just making stuff up here :)­.


Modified: docs/Perl6/Spec/S16­-io.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S16­-io.pod 2009-02-26 02:46:46 UTC (rev 25572)
+++ docs/Perl6/Spec/S16­-io.pod 2009-02-26 03:43:20 UTC (rev 25573)
@@ -73,22 +73,125 @@

=head1 POSIX Signals

+The %*SIG variable contains a Hash of Proc::Signals::Sign­al.
+
+class Signal {
+ has $exception; # This specifies what exception will be raised when this signal is received
+ has $interrupt; # See siginterrupt(3)
+ has $blocked; # Is this signal blocked? cf. sigprocmask
+}
+
+The @*SIGQUEUE array contains a queue of the signals that are blocked and queued.
+
The standard POSIX signals simply raise control exceptions that are handled as normal
-through the signal handler, except for the fact that some of them are resumeable. The
-exception names are:
+through the control signal handler, and caught by CONTROL blocks.

-=over
+=head2 Signal defaults

-=item * ControlExceptionSig­HUP
+The signals have defaults as specified in the table below. $blocked always defaults to
+false.

-=item * ControlExceptionSig­TERM
+ Signal Default Exception
+ ------ -----------------
+ SIGHUP ControlExceptionSig­HUP
+ SIGINT ControlExceptionSig­INT
+ SIGQUIT ControlExceptionSig­QUIT
+ SIGILL ControlExceptionSig­ILL
+ SIGABRT ControlExceptionSig­ABRT
+ SIGFPE ControlExceptionSig­FPE
+ SIGKILL ControlExceptionSig­KILL
+ SIGSEGV ControlExceptionSig­SEGV
+ SIGPIPE ControlExceptionSig­PIPE
+ SIGALRM ControlExceptionSig­ALRM
+ SIGTERM ControlExceptionSig­TERM
+ SIGUSR1 ControlExceptionSig­USR1
+ SIGUSR2 ControlExceptionSig­USR2
+ SIGCHLD undef
+ SIGCONT ControlExceptionSig­CONT
+ SIGSTOP ControlExceptionSig­STOP
+ SIGTSTP ControlExceptionSig­TSTP
+ SIGTTIN ControlExceptionSig­TTIN
+ SIGTTOU ControlExceptionSig­TTOU
+ SIGBUS ControlExceptionSig­BUS
+ SIGPROF ControlExceptionSig­PROF
+ SIGSYS ControlExceptionSig­SYS
+ SIGTRAP ControlExceptionSig­TRAP
+ SIGURG undef
+ SIGVTALRM ControlExceptionSig­VTALRM
+ SIGXCPU ControlExceptionSig­XCPU
+ SIGXFSZ ControlExceptionSig­XFSZ
+ SIGEMT ControlExceptionSig­EMT
+ SIGSTKFLT ControlExceptionSig­STKFLT
+ SIGIO ControlExceptionSig­IO
+ SIGPWR ControlExceptionSig­PWR
+ SIGLOST ControlExceptionSig­LOST
+ SIGWINCH undef

-=item * ControlExceptionSig­INT
+=head2 Signal exceptions

-=back
+A table below describes the exceptions.

+Each of these has a default action as well. The possible actions are:
+
+ Term Default action is to terminate the process.
+
+ Ign Default action is to ignore the signal ($signal.exception is undef by default)
+
+ Core Default action is to terminate the process and dump core (see core(5)).
+
+ Stop Default action is to stop the process.
+
+ Cont Default action is to continue the process if it is currently stopped.
+
+Some actions do the Resumeable role. An exception listed in the table below that does the
+Resumeable role is marked with a * in the R column.
+
+The exceptions are:
+
+ Signal Action R Comment
+ -------------------­--------------------­--------------------­-----------
+ ControlExceptionSig­HUP Term ? Hangup detected on controlling terminal or death of controlling process
+ ControlExceptionSig­INT Term ? Interrupt from keyboard
+ ControlExceptionSig­QUIT Core ? Quit from keyboard
+ ControlExceptionSig­ILL Core ? Illegal Instruction
+ ControlExceptionSig­ABRT Core ? Abort signal from abort(3)
+ ControlExceptionSig­FPE Core ? Floating point exception
+ ControlExceptionSig­KILL Term ? Kill signal
+ ControlExceptionSig­SEGV Core Invalid memory reference
+ ControlExceptionSig­PIPE Term ? Broken pipe: write to pipe with no readers
+ ControlExceptionSig­ALRM Term ? Timer signal from alarm(2)
+ ControlExceptionSig­TERM Term ? Termination signal
+ ControlExceptionSig­USR1 Term ? User-defined signal 1
+ ControlExceptionSig­USR2 Term ? User-defined signal 2
+ ControlExceptionSig­CHLD Ign ? Child stopped or terminated
+ ControlExceptionSig­CONT Cont * Continue if stopped
+ ControlExceptionSig­STOP Stop ? Stop process
+ ControlExceptionSig­TSTP Stop ? Stop typed at tty
+ ControlExceptionSig­TTIN Stop ? tty input for background process
+ ControlExceptionSig­TTOU Stop ? tty output for background process
+ ControlExceptionSig­BUS Core ? Bus error (bad memory access)
+ ControlExceptionSig­PROF Term ? Profiling timer expired
+ ControlExceptionSig­SYS Core ? Bad argument to routine (SVr4)
+ ControlExceptionSig­TRAP Core ? Trace/breakpoint trap
+ ControlExceptionSig­URG Ign ? Urgent condition on socket (4.2BSD)
+ ControlExceptionSig­VTALRM Term ? Virtual alarm clock (4.2BSD)
+ ControlExceptionSig­XCPU Core ? CPU time limit exceeded (4.2BSD)
+ ControlExceptionSig­XFSZ Core ? File size limit exceeded (4.2BSD)
+ ControlExceptionSig­EMT Term ?
+ ControlExceptionSig­STKFLT Term ? Stack fault on coprocessor (unused)
+ ControlExceptionSig­IO Term ? I/O now possible (4.2BSD)
+ ControlExceptionSig­PWR Term ? Power failure (System V)
+ ControlExceptionSig­LOST Term ? File lock lost
+ ControlExceptionSig­WINCH Ign ? Window resize signal (4.3BSD, Sun)
+
See L<S04-control> for details on how to handle exceptions.

+XXX I'm unsure how the actions in the table above can be made to make sense. The Ign
+actions are already dealt with because %SIG{CHLD}.exceptio­n already defaults to undef.
+The Term action will probably be self-solving (ie. will terminate the process). The
+others I'm just plain unsure about. XXX
+
+
=head1 Additions

Please post errors and feedback to perl6-language. If you are making

Added: docs/Perl6/Spec/S32­-setting-library/Exc­eption.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S32­-setting-library/Exc­eption.pod (rev 0)
+++ docs/Perl6/Spec/S32­-setting-library/Exc­eption.pod 2009-02-26 03:43:20 UTC (rev 25573)
@@ -0,0 +1,52 @@
+
+=encoding utf8
+
+=head1 Title
+
+DRAFT: Synopsis 32: Setting Library - Exception
+
+=head1 Version
+
+ Author: Tim Nelson <wayland@wayland.id­.au>
+ Maintainer: Larry Wall <larry@wall.org>
+ Contributions: Tim Nelson <wayland@wayland.id­.au>
+ Date: 26 Feb 2009
+ Last Modified: 26 Feb 2009
+ Version: 1
+
+The document is a draft.
+
+If you read the HTML version, it is generated from the pod in the pugs
+repository under /docs/Perl6/Spec/S3­2-setting-library/Ex­ception.pod so edit it there in
+the SVN repository if you would like to make changes.
+
+=head1 Roles
+
+role Exception {
+# XXX How do we tell the difference between a warning and a fatal error?
+}
+
+role Resumeable {
+ method resume() {...}
+}
+
+role Failure {
+ method Bool {...} # XXX I'm hoping this worries about .defined and .true
+ method handled {...}
+}
+
+=head1 Classes
+
+class Failure does Failure {
+ has $.handled;
+}
+
+class ControlExceptionSig­HUP does Exception does Resumeable {}
+
+=head1 Additions
+
+Please post errors and feedback to perl6-language. If you are making
+a general laundry list, please separate messages by topic.
+
+
+

Modified: docs/Perl6/Spec/S32­-setting-library/Num­eric.pod
===================­====================­====================­========
--- docs/Perl6/Spec/S32­-setting-library/Num­eric.pod 2009-02-26 02:46:46 UTC (rev 25572)
+++ docs/Perl6/Spec/S32­-setting-library/Num­eric.pod 2009-02-26 03:43:20 UTC (rev 25573)
@@ -24,6 +24,10 @@
repository under /docs/Perl6/Spec/S3­2-setting-library/Nu­meric.pod so edit it there in
the SVN repository if you would like to make changes.

+This documents Bit, Int, Num, Rat, Complex, and Bool.
+
+XXX So where are Bit, Int, and Rat
+
=head1 Function Packages

=head2 Bool

comment 2 answer | Add comment
r25490 - docs/Perl6/Spec Guest 06:50:16
 Author: wayland
Date: 2009-02-23 04:47:22 +0100 (Mon, 23 Feb 2009)
New Revision: 25490

Added:
docs/Perl6/Spec/S28­-special-variables.p­od
Log:
Created the draft spec here. It's very drafty, but no more than some.

Also added the $*DEFIN, etc, as per S16.


Added: docs/Perl6/Spec/S28­-special-variables.p­od
===================­====================­====================­========
--- docs/Perl6/Spec/S28­-special-variables.p­od (rev 0)
+++ docs/Perl6/Spec/S28­-special-variables.p­od 2009-02-23 03:47:22 UTC (rev 25490)
@@ -0,0 +1,740 @@
+=head1 NAME
+
+ [DRAFT] Synopsis 28 - Special Variables [DRAFT]
+
+=head1 Version
+
+ Author: Larry Wall <larry@wall.org>
+ Maintainer: Larry Wall <larry@wall.org>
+ Contributions: Tim Nelson <wayland@wayland.id­.au>
+ Date: 23 Feb 2009, created from miscellaneous documents lying around
+ Last Modified: 23 Feb 2009
+ Version: 1
+
+=head1 INTRODUCTION
+
+This document serves as a collection point
+for what is known about special variables
+in Perl 6 and correlates them with the changes from Perl 5.
+
+If you are trying to find the Perl 6 equivalent of a Perl 5 special
+variable you know, try searching this file for the Perl 5 version.
+Each main entry is followed by a note containing the corresponding
+Perl 5 variable(s). The list of main entries is also followed by
+a table showing the 5 and 6 variables side-by-side.
+
+Most/All variables of the form $*SOMETHING should also work in the form
+$SOMETHING (without the '*') unless masked by "my $SOMETHING".
+
+=head1 DESCRIPTION
+
+=head2 Secondary Sigils (also known as "twigils"):
+
+ $+ # currently compiling scope (see S02)
+ $? # lexically-scoped (compile time, see S02)
+ $* # global (run time, see S02)
+ $= # file-scoped (see S02)
+ $^ # implicit block argument (see S06 placeholder variables)
+ $< # current $/ scope (see S02)
+ $. # public attribute (see S12 attributes)
+ $! # private attribute (see S12 attributes)
+
+
+=head2 Named variables (see S02):
+
+ $/ # match object from last rule
+ $0 # first captured value from match: $/.[0]
+ @*ARGS # command-line arguments
+ &?BLOCK # current block (itself, see S06)
+ @?BLOCK # current blocks (themselves, see S06)
+ $?BLOCKLABEL # label of current block (see S06)
+ # XXX redundant with $?LABEL?
+ ::?CLASS # current class (as package name)
+ $?CLASS # current class (as variable)
+ @?CLASS # current classes
+ %?CONFIG # configuration hash
+ $=DATA # data block handle (=begin DATA ... =end)
+ $*DEFIN # Default input file handle (see S16)
+ $*DEFOUT # Default output file handle (see S16)
+ $*DEFERR # Default error file handle (see S16)
+ $*EGID # effective group id
+ %*ENV # system environment
+ $*ERR # standard error handle (but you likely want $*DEFERR)
+ $*EUID # effective user id
+ $*EXECUTABLE_NAME # executable name
+ $?FILE # current file
+ $?GRAMMAR # current grammar
+ @?GRAMMAR # current grammars
+ $*GID # group id
+ $*IN # standard input handle (but you likely want $*DEFIN)
+ $?LABEL # label of current block
+ @?LABEL # labels of current blocks
+ $?LINE # current line
+ $?MODULE # current module
+ @?MODULE # current modules
+ $?OS # operating system compiled for
+ $*OS # operating system running under
+ $?OSVER # operating system version compiled for
+ $*OSVER # operating system version running under
+ $*OUT # standard output handle (but you likely want $*DEFOUT)
+ $?PACKAGE # current package (as object)
+ @?PACKAGE # current packages
+ $?PACKAGENAME # name of current package (see S10)
+ $?PERLVER # perl version compiled for
+ $*PERLVER # perl version running under
+ $*PROGRAM_NAME # name of the program being executed
+ $*PID # system process id
+ $?PUGS_VERSION # Pugs version (not canonical)
+ $*PUGS_HAS_HSPLUGIN­S # True if Pugs was compiled with support for hsplugins
+ # (not canonical)
+ ::?ROLE # current role (as package name)
+ $?ROLE # current role (as variable)
+ @?ROLE # current roles
+ &?ROUTINE # current sub or method (itself, see S06)
+ @?ROUTINE # current subs or methods (themselves)
+ $*UID # system user id
+
+There were threads on p6l about unifying all variables which concern the OS or
+the VM ($*UID, $*PROGRAM_NAME, etc.) into two variables, $?ENV (compile-time
+environment) and $*ENV (runtime environment). Larry did like the idea, but
+"ENV" is probably to overloaded to mean the hash of environment variables
+(which would be found under $*ENV.environment or some-such).
+
+
+XXX Everything below this line is older than everything above it. XXX
+
+=head1 NAME
+
+ [DRAFT] Synopsis 28 - Special Variables [DRAFT]
+
+=head1 OUTLINE
+
+ DRAFT NOTES
+ INTRODUCTION
+ SPECIAL VARIABLES
+ PERL 6 / PERL 5 COMPARISON
+ HISTORY
+ SOURCES
+
+=head1 DRAFT NOTES
+
+As of 2007-03-13:
+
+There is a more recent document at docs/Perl6/Overview­/Variable.pod
+which contains the bare bones of the next
+iteration of work on special variables in Perl 6.
+
+While the list there appears to be more complete, there remains information
+here that may still be of help in roughing in more details there.
+
+=head1 SPECIAL VARIABLES
+
+=over 8
+
+=item $*IN
+
+=item $*OUT
+
+=item $*ERR
+
+Predefined filehandles for STDIN, STDOUT, and STDERR.
+
+=over 4
+
+=item p5:
+
+Replace STDIN, STDOUT, and STDERR.
+
+=back
+
+=back
+
+=over 8
+
+=item $_
+
+The default input and pattern-searching space.
+Same as in Perl 5 but lexically scoped
+
+=over 4
+
+=item p5:
+
+$_ but more lexically aware.
+
+=back
+
+=back
+
+=over 8
+
+=item $a, $b, $c ...
+
+Parameters of the current closure (block
+or subroutine) by position in the invocation.
+
+=over 4
+
+=item p5:
+
+$_[0], $_[1], $_[2] ...
+
+=back
+
+=back
+
+=over 8
+
+=item $/
+
+Object containing the results of the last regular expression match.
+All match result info found in the contained data structure.
+This is available as the current state of the match in progress.
+
+=over 4
+
+=item p5:
+
+No direct parallel.
+
+=back
+
+=back
+
+=over 8
+
+=item $0,$1,$2...
+
+Objects containing information on any subpatterns
+from the corresponding set of capturing
+parentheses from the last pattern match, not counting patterns
+matched in nested blocks that have been exited already.
+These variables are all read-only and dynamically scoped to the
+current BLOCK. Shortcut to same info in $/ with data structures containing
+such things as .start and .end (Unicode level independent).
+
+=over 4
+
+=item p5:
+
+$1,$2,$3... but now as objects, and base zero instead of one.
+
+=back
+
+=back
+
+=over 8
+
+=item $0
+
+$0 (dollar-zero) is the string matched by the last successful
+pattern match (not counting any matches hidden within a BLOCK
+or eval() enclosed by the current BLOCK).
+This variable is read-only and dynamically scoped to the current BLOCK.
+What would be returned by $1 if you had
+put parens around the entire match. $0 is not bound until
+the match succeeds.
+
+=over 4
+
+=item p5:
+
+$&, $MATCH
+
+=back
+
+=back
+
+=over 8
+
+=item $*MOST_RECENT_CAPTU­RED_MATCH
+=item $/[-1]
+=item $/[-$n]
+
+It's not clear yet which of these would be used.
+Or whether to drop this.
+
+=over 4
+
+=item p5:
+
+$^N
+
+=back
+
+=back
+
+=over 8
+
+=item $.
+
+=item $IN_FH.input_line_n­umber ...or some such
+
+May-be. Current line number for the filehandle.
+Each filehandle in Perl counts the number of lines
+that have been read from it.
+(Depending on the value of $IN_FH.input_rec_se­parator,
+Perl's idea of what constitutes a line may not match yours.)
+When a line is read from a filehandle,
+or when tell() or seek() is called on it,
+$IN_FH.input_rec_s­eparator becomes an alias to the
+line counter for that filehandle.
+
+=over 4
+
+=item p5:
+
+$. $NR $INPUT_LINE_NUMBER HANDLE->input_line_­number(EXPR)
+But now with cleaned-up localization usage.
+
+=back
+
+=back
+
+=over 8
+
+=item $IN_FH.input_rec_se­parator ...or some such
+
+The input record separator, newline by default.
+This influences Perl's idea of what a ``line'' is.
+Works like awk's RS variable, including treating empty lines
+as a terminator if set to the null string.
+(An empty line cannot contain any spaces or tabs.)
+You may set it to a multi-character string to match a multi-character
+terminator, or to undef to read through the end of file.
+Setting it to "\n\n" means something slightly different
+than setting to "", if the file contains consecutive empty lines.
+Setting to "" will treat two or more consecutive empty lines
+as a single empty line. Setting to "\n\n" will blindly assume
+that the next input character belongs to the next paragraph,
+even if it's a newline.
+(Mnemonic: / delimits line boundaries when quoting poetry.)
+
+Remember: the value of $/ is a string, not a regex.
+awk has to be better for something. :-)­
+
+=over 4
+
+=item p5:
+
+$/ $RS $INPUT_RECORD_SEPAR­ATOR
+IO::Handle->input_­record_separator(EXP­R)
+
+=back
+
+=back
+
+=over 8
+
+=item $OUT_FH.autoflush ...or some such
+
+If set to nonzero, forces a flush right away and after every write
+or print on the currently selected output channel.
+Default is 0 (regardless of whether the channel is really buffered
+by the system or not;
+$OUT_FH.autoflush tells you only whether you've asked Perl
+explicitly to flush after each write).
+$*OUT will typically be line buffered if output is to the
+terminal and block buffered otherwise.
+Setting this variable is useful primarily when you are
+outputting to a pipe or socket,
+such as when you are running a Perl program under rsh
+and want to see the output as it's happening.
+This has no effect on input buffering.
+(Mnemonic: when you want your pipes to be piping hot.)
+
+=over 4
+
+=item p5:
+
+$| $OUTPUT_AUTOFLUSH HANDLE->autoflush(E­XPR)
+
+=back
+
+=back
+
+
+. . . More to come here . . .
+
+
+=head1 PERL 6 / PERL 5 COMPARISON
+
+=over 4
+
+Because a blank entry in either column could be taken to mean either
+"not in Perl 6" or "unknown", the information as presented
+below presumes an entry in both columns for every entry.
+Options are:
+
+=over 6
+
+thing as the var in question
+
+- for "not in this Perl"
+
+? for "don't know yet"
+
+=back
+
+Other organizational
+schemes may become appropriate when the table is more complete.
+
+=back
+
+ Perl 5 Perl 6 Comment
+ ----------- ----------- -------------------­----
+ STDIN $*IN
+
+ STDOUT $*OUT
+
+ STDERR $*ERR
+
+ $_ $_
+
+ $_[1],$_[2].. $^a,$^b..
+
+ $a,$b - Just params to anonymous block
+
+ - $/ Object with results of last regex match
+
+ $1,$2,$3... $1,$2,$3...
+
+ $& $<>
+
+ $` $<pre>
+
+ $' $<post>
+
+ $+ - But info can now be retrieved from $/
+
+ $^N $*MOST_RECENT_CAPTU­RED_MATCH ...or some such.
+ or $/[-1] ...or omit
+ or $/[-$n]
+
+ @+ $1.end, etc.
+
+ $* -
+
+ $. $IN_FH.input_line_n­umber ...or some such
+
+ $/ $IN_FH.input_rec_se­parator ...or some such
+
+ ******* XXX the columns seem to have switched! *********
+
+ $OUT_FH.autoflush ...or some such
+ $| $OUTPUT_AUTOFLUSH
+ HANDLE->autoflush(E­XPR)
+
+ $OUT_FH.output_fiel­d_separator ...or some such
+ $, $OFS $OUTPUT_FIELD_SEPAR­ATOR
+ IO::Handle->output_­field_separator
+
+ $OUT_FH.output_reco­rd_separator ...or some such
+ $\ $ORS $OUTPUT_RECORD_SEPA­RATOR
+ IO::Handle->output_­record_separator
+
+ - $" $LIST_SEPARATOR
+
+ - $; $SUBSEP $SUBSCRIPT_SEPARATO­R
+
+ - $# Output format for printed numbers.
+
+ - $% $FORMAT_PAGE_NUMBER­
+ - HANDLE->format_page­_number(EXPR)
+
+ - $= $FORMAT_LINES_PER_P­AGE
+ - HANDLE->format_line­s_per_page(EXPR)
+
+ - $- $FORMAT_LINES_LEFT
+ - HANDLE->format_line­s_left(EXPR)
+
+ $1.start, etc. @- @LAST_MATCH_START
+
+ - $~ $FORMAT_NAME
+ - HANDLE->format_name­(EXPR)
+
+ - $^ $FORMAT_TOP_NAME
+ - HANDLE->format_top_­name(EXPR)
+
+ - $: $FORMAT_LINE_BREAK_­CHARACTERS
+ - IO::Handle->format_­line_break_character­s
+
+ - $^L $FORMAT_FORMFEED
+ - IO::Handle->format_­formfeed
+
+ - $^A $ACCUMULATOR
+
+
+ ? ${^ENCODING}
+
+ $! Universal error object with as much info as
+ you'd like on the current exception (unthrown
+ outside of CATCH, thrown inside). Unthrown
+ exceptions are typically interesting values
+ of undef.
+ - $! $ERRNO $OS_ERROR
+ - $? $CHILD_ERROR
+ - $@ $EVAL_ERROR
+ - $^E $EXTENDED_OS_ERROR
+
+ - %!
+
+ $*PID $$ $PID $PROCESS_ID
+
+ $*UID ...or some such
+ $< $UID $REAL_USER_ID
+ $*EUID ...or some such
+ $> $EUID $EFFECTIVE_USER_ID
+ $*GID ...or some such
+ $( $GID $REAL_GROUP_ID
+ $*EGID ...or some such
+ $) $EGID $EFFECTIVE_GROUP_ID­
+
+ $*PROGRAM_NAME ...or some such
+ $0 $PROGRAM_NAME
+
+ - $[ Index of the first element in an array,
+ and of the first character in a substring.
+
+
+ - $^V $PERL_VERSION
+ - $] version + patchlevel / 1000 of Perl interpreter
+ Replacement for the above two is unclear.
+
+ $*COMPILING ...or some such
+ $^C $COMPILING
+
+ $*DEBUGGING ...or some such
+ $^D $DEBUGGING
+
+ $*SYS_FD_MAX ...or some such
+ $^F $SYSTEM_FD_MAX
+
+ - $^H
+ - %^H
+
+ $*INPLACE_EDIT ...or some such
+ $^I $INPLACE_EDIT
+
+ $*EMERGENCY_MEMORY ...or some such (or omit)
+ $^M
+
+ $*OSNAME ...or some such
+ $^O $OSNAME
+
+ - ${^OPEN}
+
+ $*PERLDB ...or some such
+ $^P $PERLDB
+
+ $*LAST_REGEXP_CODE_­RESULT ...or some such. Or omit.
+ $^R $LAST_REGEXP_CODE_R­ESULT
+
+ $*BASETIME ...or some such
+ $^T $BASETIME
+
+ ? ${^TAINT}
+ ? ${^UNICODE}
+
+ - $^W $WARNING Probably gone. But we need a reasonably
+ granular way to suppress specific (groups
+ of) warnings within both lexical and
+ dynamic scopes.
+
+ $?WARNINGS ${^WARNING_BITS}
+
+ $*EXECUTABLE_NAME ...or some such
+ $^X $EXECUTABLE_NAME
+
+ ? $ARGV
+
+ $*ARGS ARGV Note the P6 idiom:
+ for =$*ARGS {
+ # each time through loop
+ # proc a line from files named in ARGS
+ }
+
+ @*ARGS @ARGV
+
+ $*ARGVOUT
+ ARGVOUT
+
+ @*INPLACE_AUTOSPLIT­_FIELDS ..or some such
+ @F
+
+ ? @INC Uncertain but we need a way to add to search path
+ ? %INC Uncertain but we need a way to add to search path
+
+ ? @_
+
+
+ %*ENV %ENV Or %ENV
+
+ %*SIG %SIG Or possibly &*ON_SIGINT, etc. But then we'd need
+ to add some signal introspection in another way.
+
+ &*ON_WARN __WARN__
+ &*ON_DIE __DIE__
+ &*ON_PARSEERROR
+ - $^S $EXCEPTIONS_BEING_C­AUGHT
+
+=head1 HISTORY
+
+ 2007-03-13 dvergin Reference to docs/Perl6/Overview­/Variable.pod
+ 2005-04-11 dvergin Filling in more pieces
+ 2005-04-10 dvergin Roughed in main table
+ 2005-04-02 anonpugster Placeholder file containing Larry's email
+
+=head1 SOURCES
+
+At its present stage of development this file
+draws on a few key sources: Perl 5's perlvar.pod (for a full list of special
+vars in Perl 5) and a perl6-language list thread documented
+below. E02 and S02 have also been helpful in several cases.
+
+A key resource in compiling the new material above
+has been a thread on the perl6-language
+email list which can be found at:
+
+ http://www.mail-arc­hive.com/perl6-langu­age@perl.org/msg1860­9.html
+
+For our present purposes, the most helpful item in that thread is the
+head post found at the url given above.
+It is an item by Larry Wall which is reproduced here:
+__________________­____________________­____________________­_______
+
+ Mailing-List: contact perl6-language-help­@perl.org; run by ezmlm
+ Date: Sat, 26 Mar 2005 00:27:24 -0800
+ From: Larry Wall <larry@wall.org>
+ To: perl6-compiler@perl­.org
+ Cc: perl6-language@perl­.org
+ Subject: S28ish [was: [Pugs] A couple of string interpolation edge cases]
+
+ On Sat, Mar 26, 2005 at 02:11:29PM +0800, Audrey Tang wrote:
+ : On Fri, Mar 25, 2005 at 10:03:45PM -0800, Larry Wall wrote:
+ : > Hmm, well, if it got that far. Given strict being on by default,
+ : > this particular example should probably just die on the fact that $"
+ : > isn't declared, since there's no $" in Perl 6.
+ :
+ : Is $" okay as a variable name? Is everything from perlvar.pod legal? :)­
+
+ Considering nobody's written perlvar.pod for Perl 6 yet, yeah, everything
+ in that pod is legal. :-)­
+
+ : my $" = 3;
+ :
+ : Pugs parses that because it only considers $! and $/ as legal
+ : symbolic variable names.
+
+ $! will be a legal variable name. $/ is going away, as is $", which
+ means they fail under "use strict", but they'd still autocreate
+ globals under laxity as Perl 5 does. (I know Perl 5 exempted all
+ special variables from strict, but I don't see why we have to do
+ that for Perl 6. Merely having $_ in the lexical scope or $*! in the
+ global scope should be sufficient declaration to get around strict.
+ Though perhaps we can exempt people from having to write $*! under
+ strict. In fact, that probably goes for all predeclared $* names,
+ so $IN is legal for $*IN as long as you don't have "my $IN" hiding
+ it. Another way to look at it is that * variables are basically
+ autodeclared "our" implicitly in the outermost lexical scope.)
+
+ Sigh, I'd better rough it all in here, even if I don't have time to
+ do a good job on it. Maybe somebody can beat this into a real S28 pod.
+
+ $? and $@ are gone, merged in with $!. (Frees up ? twigil for $?FOO
+ syntax.) $^E is merged too. $! is an object with as much info as
+ you'd like on the current exception (unthrown outside of CATCH, thrown
+ inside). Unthrown exceptions are typically interesting values of undef.
+
+ $$ is now $*PID. ($$foo is now unambiguous.)
+
+ $0 is gone in favor of $*PROGRAM_NAME or some such.
+
+ Anything that varied with the selected output filehandle like $|
+ is now a method on that filehande, and the variables don't exist.
+ (The p5-to-p6 translator will probably end up depending on some
+ $Perl5ish::selected­_output_filehandle variable to emulate Perl 5's
+ single-arg select().) Likewise $/ and $. should be attached to
+ a particular input filehandle. (In fact, $/ is now the result of
+ the last regular expression match, though we might keep the idea of
+ $. around in some form or other just because it's awfully handy for
+ error messages. But the localizing $. business is yucky. We have
+ to clean that up.)
+
+ All the special format variables ($%, $=, $-, $:, $~, $^, $^A, $^L)
+ are gone. (Frees up the = twigil for %= POD doc structures and
+ old __DATA__ stream, the : twigil for private attributes, and the ~
+ twigil for autodeclared parameters.)
+
+ $`, $', and $+ don't exist any more, but you can dig that info out
+ of $/'s structures. Shortcuts into $/ include $1, $2, and such, and
+ the newfangled $<foo> things. Also, $& is changed to $0 for the whole
+ matched string. $` and $' may be $<pre> and $<post>, but you probably
+ have to explicitly match <pre> and <post> to get them remembered,
+ so we don't have a repeat of the Perl 5 sawampersand fiasco. <pre>
+ and <post> would automatically exclude themselves from $0. Or you
+ need some special flag to remember them, maybe.
+
+ %+ and %- are gone. $0, $1, $2, etc. are all objects that know
+ where they .start and .end. (Mind you, those methods return magical
+ positions that are Unicode level independent.)
+
+ $* and $# have been deprecated half of forever and are gone. $[
+ is a fossil that I suppose could turn into an evil pragma, if we
+ try to translate it at all. (Frees up * twigil for $*FOO syntax.)
+
+ $(, $), $<, and $> should all change to various $*FOO names. $] is either
+ something in $* or a trait of the Perl namespace. Likewise $^V, if
+ they aren't in fact merged.
+
+ ${...} is reserved for hard refs only now. ($::(...) must be used
+ for symbolics refs.) ${^foo} should just change to $*foo or $*_foo
+ or some such.
+
+ $; is gone because the multidim hash hack is gone. $" is gone,
+ replaced by @foo.join(":") or some such. Likewise for $, in print
+ statements.
+
+ We never did find a use for $}, thank goodness.
+
+ And we still are keeping $_ around, though it's lexically scoped.
+
+ Let's see, what other damage can we do to perlvar. $a and $b are
+ no longer special. No bareword filehandles. $*IN, $*OUT, $*ERR.
+ Args come in @*ARGS rather than @ARGV. (Environment still in %ENV,
+ will wonders never cease.) I don't know whether @INC and %INC will
+ make as much sense when we're looking installed modules in a database,
+ though I suppose you still have to let the user add places to look.
+
+ %SIG is now %*SIG. The __DIE__ and __WARN__ hooks should be brought
+ out as separate &*ON_DIE and &*ON_WARN variables--they really
+ have nothing to do with signals. I suppose we could even do away
+ with %SIG and replace it with &*ON_SIGINT and such, though then we'd
+ lose a bit of signal introspection which would have to be provided
+ some other way. Oh, and we probably ought to split out &?ON_PARSEERROR
+ from $*ON_DIE to get rid of the $^S fiasco of Perl 5.
+
+ $^C, $^D, $^F, $^I, $^M, $^O, $^P, $^S, $^T, $^V, $^X are all renamed
+ to something $*FOOish, at least the ones that aren't going away entirely.
+
+ $^W is is too blunt an instrument even in Perl 5, so it's probably gone.
+
+ I'm not quite sure what to do with $^N or $^R yet. Most likely they
+ end up as something $<foo>ish, if they stay.
+
+ You weren't ever supposed to know about $^H and %^H. Or %{^FNORD}...
+
+ Other things might show up as global variables in support of
+ command-line options, like $*ARGVOUT or @*F. Some of the special
+ variables we've blissfull relegated to the trash heap might
+ creep back in as global variables that just happen to know about
+ $*Perl5ish::current­_selected_filehandle­ and such, but we should
+ probably try to keep them as lvalue subs in &Perl5ish::ors() and such.
+
+ Anyway, it's all negotiable, except for the parts that aren't.
+
+ Larry
+
+=cut
+
+

comment 10 answers | Add comment
Comparing inexact values (was "Re: Temporal changes") David Green 04:27:57
 On 2009-Feb-23, at 10:09 am, TSa wrote:
I also think that time and numbers in general should be treated in
a fuzzy way by smart match.

My thought is to have == take a :within adverb, at least for imprecise
types like Num, that could be used to specify how close values need to
come in order to be considered equal.

So instead of:
if abs($x-$y)<$epsilon­ { ... }

you could say:
if $x==$y :within($epsilon) { ... }

which makes your tests for equality look like tests for equality.

I'd even suggest that the :within be mandatory, to guarantee that the
coder is aware that "$x==$y" is probably not DWIM. Of course, there
should also be an easy way to set epsilon across a scope, like:

use Num :p­recision(0); # force exact matches in this block



-David

comment 32 answer | Add comment
Thursday, 26 February 2009
Retrieving Cookies does not return all domain values Thomas Hilbig 21:50:42
 
I am in the process of changing my cookies (stored on my users’ browsers) so they can be shared across multiple servers under my domain. So, instead of writing cookies with domain ‘www.mydomain.com’,­ I am writing them to ‘.mydomain.com’ so they can be read by www.mydomain.com, www2.mydomain.com etc. During the transition, I need to be able to retrieve cookie valuesstored forthe main domain and the subdomain.

Browsers will store cookies from ‘www.mydomain.com’ and ‘.mydomain.com’ separately, and return multiple values if the target servername matches the hierarchy. However, I cannot find a way under CGI.pm or CGI::Cookie to retrieve these multiple values – only one value is ever returned.

Example, I can set 2 cookies from server www.mydomain.comusi­ng:
my $cookieShort = cookie(-name=>'var'­, -value=>’hello_shor­t’, -expires=>'+1M', -domain=>’.mydomain­.com’)
my $cookieLong = cookie(-name=>'var'­, -value=>’hello_long­’, -expires=>'+1M', -domain=>’www.mydom­ain.com’)
print $q->header({-cookie­=>[$cookieShort, $cookieLong], -type=>'text/html',­ -expires=>'-1d'}) ;

The client returns both values properly to this server, and I can see these passed to the ENV environment variable:
print ENV{'HTTP_COOKIE'} ;
var=hello_short; var=hello_long

However, using CGI.pm or CGI::Cookie only one value (the highest level domain ) is ever returned:
Print $q->cookie(-name=>'­var') ;
hello_short

my @arrayCookies = $q->cookie(-name=>'­var') ; # using array context
foreach (@arrayCookies) {
print "$_\n" ;
}
hello_short

Is there a method to get CGI.pm to fetch all the values in the request, or am I forced to use the environment variable? Fetching cookies using an array context will only bring back multiple values if they are set under a single domain.




comment 1 answer | Add comment

Add new topic:

How:  Register )
 
Login:   Password:   
Comments by: Premoderation:
Topic:
  
 
Ïîæàëóéñòà, îòíîñèòåñü ê ñîáåñåäíèêàì óâàæèòåëüíî, íå èñïîëüçóéòå íåöåíçóðíûå ñëîâà, íå çëîóïîòðåáëÿéòå çàãëàâíûìè áóêâàìè, íå ïóáëèêóéòå ðåêëàìó è îáúÿâëåíèÿ î êóïëå/ïðîäàæå, à òàêæå ìàòåðèàëû íàðóøàþùèå ñåòåâîé ýòèêåò èëè çàêîíû ÐÔ. Âàø ip-àäðåñ çàïèñûâàåòñÿ.


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

see also:
Check For Space
One form - two db's?
imap mail() problems
pass tests:
see also:
How to Convert and Burn AVI Video to…
How to Play and Convert WMV Video to…
How to Burn MP4 (iPod, iPhone, Google…

  Copyright © 2001—2010 QAIX
Èäåÿ: Ìîíàø¸â Ìèõàèë.
Àâòîðàìè òåêñòîâ, èçîáðàæåíèé è âèäåî, ðàçìåù¸ííûõ íà ýòîé ñòðàíèöå, ÿâëÿþòñÿ ïîëüçîâàòåëè ñàéòà.
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.
Ïèøèòå íàì íà .
If you would like to report an abuse of our service, such as a spam message, please .
Åñëè Âû õîòèòå ïîæàëîâàòüñÿ íà ñîäåðæèìîå ýòîé ñòðàíèöû, ïîæàëóéñòà .