[16951] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4363 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 18 18:10:47 2000

Date: Mon, 18 Sep 2000 15:10:25 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <969315025-v9-i4363@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 18 Sep 2000     Volume: 9 Number: 4363

Today's topics:
        GLOBAL TELECOMMUTE PROGRAMMERS PERL - JAVA -JS-CSS-HTML INTERNATIONALTeleCommuter@AllWorldint.com
    Re: GLOBs v references to GLOBs (was: using filehandles (Tom Christiansen)
    Re: HELP  on  NetServer::Generic <tzz@iglou.com>
    Re: How to do that ? <tim@ipac.caltech.edu>
    Re: How to sort a comma delimited file on the Nth field <rc@telus.net>
        installing dbi hao7@yahoo.com
    Re: One program w/ many languages <KQuitt@IEEInc.com>
    Re: Parse::RecDescent: Problem with a Grammar <stephen@twocats.dont-spam.demon.co.uk>
    Re: Parse::RecDescent: Problem with a Grammar (Abigail)
    Re: Perl and Databases FAQ <mikempx@hotmail.com>
    Re: perl and web (brian d foy)
        perl expect module problems <debtman@my-deja.com>
    Re: Perl hases and memory djernaes@my-deja.com
        Perl Praise & This Newsgroup rathmore@tierceron.com
        Please explain how this filename extraction works? ladesigner1@my-deja.com
    Re: Please explain how this filename extraction works? <theglauber@my-deja.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 18 Sep 2000 16:59:10 -0500
From: INTERNATIONALTeleCommuter@AllWorldint.com
Subject: GLOBAL TELECOMMUTE PROGRAMMERS PERL - JAVA -JS-CSS-HTML-DREAMWEAVER
Message-Id: <39c6902e$1_4@goliath.newsfeeds.com>

         *** TELE COMMUTE ONLY  ****  
      
             WEB PAGE PROGRAMMER

HIGH EXPERIENCE WITH DREAMWEAVER PREFERRED
KNOWLEDGE OF DHTML AND CSS CAPABILITIES OF DREAMWEAVER A+
KNOWLEDGE OF WINDOWS NT 4.0 IIS (server) A+
KNOWLEDGE OF WEB PROGRAMMING: PERL / CGI / JavaScript A +
Knowledge of programming: C / Java  A+

15 TO 40 HOURS PER WEEK  

$15.00 to $25.00 per hour commensurate with experience.

Using a Remote Control software utility called TIMBUKTU,
2 people can work on the same computer simultaneously.

Specific "Log-On' Schedule required. Flexible. 
Prefer Mornings (PST), but afternoons, ok.
2 to 3 hours per remomte 'log-on' session.
2 to 3 times per week. 
Timbuktu has an audio channel and chat features.
High-Bandwidth Not necessary, but PREFERRED. 

Some work done off-line, but this is PRIMARILY a 
real-time, log-on position. Instead of having a
specific schedule at an office, a specific computer
log-on schedule is required.

Please respond directly to:
TeleComMuter@Law.com



-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


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

Date: 18 Sep 2000 12:08:33 -0700
From: tchrist@perl.com (Tom Christiansen)
Subject: Re: GLOBs v references to GLOBs (was: using filehandles in strict mode)
Message-Id: <39c65a21@cs.colorado.edu>

In article <u9d7i1hcoh.fsf_-_@wcl-l.bham.ac.uk>,  <nobull@mail.com> wrote:
>> >Why does ref() tell me that a scalar containing a typeglob is a plain
>> >scalar?

Because it is.  *FOO is not \*FOO.  I said that before.

>> Because a typeglob is not a reference to a typeglob.

Yes, right there.

>I realise all the above, I was really asking a deeper and more
>philosophical "why?" about the rationale for the semantics, not the
>mechanism.

Old stuff.

>
>There are lots of thingies in Perl, scalar, hash, array, glob, file
>handle, directory handles, subroutines...

A scalar can contain the name of something.

>This I assume is a hang-over from the Perl4 days when typeglobs were
>the poor-hacker's references.  Typeglobs are references to symbol
>table entries.

No, they *ARE* symbol table entries.

>On a related matter, given a scalar containing a GLOB is it possible
>to obtain a reference to that glob other than by going via a symbolic
>reference?
>
>my $glob = *A;
>my $globref = \*{$glob}; # Fails
>my $globref = \*{"$glob"}; # Works under no strict 'refs'

If you expect to talk about the symbol table without talking
about the symbol table, you're trying too hard.

Contrary to popular belief, some things in Perl require accessing
the symbol table, and there is NOTHING WRONG WITH THIS.  Subroutine names
are another such, or package names, or globals for import/export.  The
'no strict refs' pragma is there to help you not do this by accident.
It is not *wrong* to do what you need to do.

--tom


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

Date: 18 Sep 2000 15:41:16 -0500
From: Ted Zlatanov <tzz@iglou.com>
Subject: Re: HELP  on  NetServer::Generic
Message-Id: <969305789.21407@iglou.com>

In article <hOPFOcWESZFqTMGde=SBsLx+XSFa@4ax.com>, MegaNerd wrote:
>Trying to build a server which responses on requests to a specific
>TCP-port.
>
>I saw that NetServer::Generic can provide such a service. Has anyone a
>working script? I can't get the examples in the documention to work.

The code following works OK.  Though it is not mentioned in the docs, the
hostname('') invocation must be done before things will work - the default is
to reject connections, I think.  Corrections are welcome :)

#!/usr/bin/perl -w
use strict;
use NetServer::Generic;

my $server_cb = sub 
{
 my $s = shift;
 # just use STDIN and STDOUT here to read/write from the socket
 # the child process will exit at the end of the subroutine
};

my $server = new NetServer::Generic;
# for debugging:
#$NetServer::Debug = 1;
$server->hostname(''); # allow all hosts to connect
$server->port(5555);
$server->callback($server_cb);
$server->mode("forking");
$server->run();

-- 
Teodor Zlatanov <tzz@iglou.com>
"Brevis oratio penetrat colos, longa potatio evacuat ciphos." -Rabelais


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

Date: Mon, 18 Sep 2000 12:31:41 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: How to do that ?
Message-Id: <39C66D9D.EDB49855@ipac.caltech.edu>

Ken Hu wrote:
> 
> Dear Friends :
> 
>     I am trying to write a code that will scan a specific directly
> iteratively and each time it finds a
>     new file coming , it will do something on that new file.

Something like (untested):

my %then;
while(1) {
  my @now = glob "$my_target_dir/*";
  for my $newfile (grep ! exists $then{$_}, @now) {
	# $newfile contains, in turn, files not seen before.
	# Operate, fork/exec, whatever ...
  }
  $then{@now} = ();
  sleep $check_interval;
}

> 
>     I guess it should be something like a daemon to do that , and after
> finding a new file , it create
>     a new thread to do some tasks , does it make any sense ?

If the operation on the new file is time consuming, this might be a good plan,
though "new process" is better than "new thread" since Perl threads aren't
stable.

perldoc -q 'daemon'

--

-- Tim Conrow         tim@ipac.caltech.edu                           |


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

Date: Mon, 18 Sep 2000 12:57:00 -0700
From: Rob Carraretto <rc@telus.net>
Subject: Re: How to sort a comma delimited file on the Nth field?
Message-Id: <39C6738C.B0107BB0@telus.net>

Alec Kelingos wrote:
> 
> I have a comma delimited file.  e.g.
> 
> "alec","10001","42159","michigan"
> "bob","801","42002","ohio"
> "fred","55891","42159","oklahoma"
> 
> How can I sort this file using the 3rd column and write out to a new file?
> I can create a hash using the 3rd column as keys and the entire record as
> the value, then sort the keys and write each element to a new file . is that
> the best way or is there some other way?
> 
> Thanks in advance,
> Alec

Hi,

The CPAN module Sort::Fields is probably what you want.

Rob.


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

Date: Mon, 18 Sep 2000 17:57:14 GMT
From: hao7@yahoo.com
Subject: installing dbi
Message-Id: <8q5l1c$vj4$1@nnrp1.deja.com>

Hi,
I try to install dbi on sunos 5.6 but got problems.
I use DBI-1.13, gcc-2.8.1-sol26-sparc-local, perl version 5.005_03
build for Sun4-solaris, Unix SunOS 5.6.

perl Makefile.PL   sucess
make    error

mkdir blib
mkdir blib/lib
mkdir blib/arch
mkdir blib/arch/auto
mkdir blib/arch/auto/DBI
mkdir blib/lib/auto
mkdir blib/lib/auto/DBI
mkdir blib/man1
mkdir blib/man3
cp lib/DBI/W32ODBC.pm blib/lib/DBI/W32ODBC.pm
cp lib/DBD/ExampleP.pm blib/lib/DBD/ExampleP.pm
cp lib/DBI/FAQ.pm blib/lib/DBI/FAQ.pm
cp lib/DBI/Shell.pm blib/lib/DBI/Shell.pm
cp lib/DBI/ProxyServer.pm blib/lib/DBI/ProxyServer.pm
cp lib/Bundle/DBI.pm blib/lib/Bundle/DBI.pm
cp lib/DBD/Proxy.pm blib/lib/DBD/Proxy.pm
cp DBIXS.h blib/arch/auto/DBI/DBIXS.h
cp dbd_xsh.h blib/arch/auto/DBI/dbd_xsh.h
cp dbi_sql.h blib/arch/auto/DBI/dbi_sql.h
cp lib/DBD/NullP.pm blib/lib/DBD/NullP.pm
cp lib/DBD/Sponge.pm blib/lib/DBD/Sponge.pm
cp lib/DBI/Format.pm blib/lib/DBI/Format.pm
cp Driver.xst blib/arch/auto/DBI/Driver.xst
cp lib/DBI/DBD.pm blib/lib/DBI/DBD.pm
cp lib/Win32/DBIODBC.pm blib/lib/Win32/DBIODBC.pm
cp DBI.pm blib/lib/DBI.pm
cp lib/DBD/ADO.pm blib/lib/DBD/ADO.pm
/usr/local/bin/perl -p -e "s/~DRIVER~/Perl/g" <
blib/arch/auto/DBI/Driver.xst >
Perl.xsi
/usr/local/bin/perl -I/ymstools/NoArch/packages/perl/perl-
5.00503/lib/perl5/5.00
503/sun4-solaris -I/ymstools/NoArch/packages/perl/perl-
5.00503/lib/perl5/5.00503
 /ymstools/NoArch/packages/perl/perl-
5.00503/lib/perl5/5.00503/ExtUtils/xsubpp
-typemap /ymstools/NoArch/packages/perl/perl-
5.00503/lib/perl5/5.00503/ExtUtils/
typemap Perl.xs >xstmp.c && mv xstmp.c Perl.c
gcc -B/usr/ccs/bin/ -c  -I/ymstools/SunOS_5.5/site/include -O     -
DVERSION=\"1.
13\"  -DXS_VERSION=\"1.13\" -fPIC -I/ymstools/NoArch/packages/perl/perl-
5.00503/
lib/perl5/5.00503/sun4-solaris/CORE -DDBI_NO_THREADS Perl.c
In file included from Perl.xs:1:
DBIXS.h:244: parse error before `U32'
DBIXS.h:244: stray '\' in program
DBIXS.h:245: stray '\' in program
DBIXS.h:265: stray '\' in program
DBIXS.h:266: stray '\' in program
DBIXS.h:267: stray '\' in program
DBIXS.h:268: stray '\' in program
DBIXS.h:269: stray '\' in program
DBIXS.h:270: stray '\' in program
DBIXS.h:271: parse error before `->'
DBIXS.h:271: stray '\' in program
DBIXS.h:274: stray '\' in program
DBIXS.h:275: stray '\' in program
DBIXS.h:276: stray '\' in program
DBIXS.h:277: stray '\' in program
DBIXS.h:278: stray '\' in program
DBIXS.h:279: stray '\' in program
DBIXS.h:280: stray '\' in program
DBIXS.h:281: parse error before `->'
DBIXS.h:281: stray '\' in program
DBIXS.h:341: stray '\' in program
DBIXS.h:342: stray '\' in program
DBIXS.h:343: stray '\' in program
DBIXS.h:385: parse error before `}'
DBIXS.h:385: warning: data definition has no type or storage class
DBIXS.h:410: parse error before `='
DBIXS.h:410: stray '\' in program
DBIXS.h:411: stray '\' in program
DBIXS.h:412: stray '\' in program
DBIXS.h:413: stray '\' in program
DBIXS.h:414: stray '\' in program
DBIXS.h:415: stray '\' in program
DBIXS.h:423: parse error before `&&'
DBIXS.h:429: stray '\' in program
DBIXS.h:430: stray '\' in program
DBIXS.h:431: stray '\' in program
DBIXS.h:432: stray '\' in program
DBIXS.h:436: stray '\' in program
DBIXS.h:436: stray '\' in program
DBIXS.h:437: stray '\' in program
DBIXS.h:441: stray '\' in program
DBIXS.h:441: stray '\' in program
DBIXS.h:445: stray '\' in program
DBIXS.h:445: stray '\' in program
DBIXS.h:450: warning: This file contains more `}'s than `{'s.
Perl.xs:15: parse error before `*'
Perl.xs:15: warning: data definition has no type or storage class
Perl.xsi: In function `XS_DBD__Perl__dr_discon_all_':
Perl.xsi:36: request for member `getcom' in something not a structure
or union
Perl.xsi: In function `XS_DBD__Perl__db__login':
Perl.xsi:57: request for member `getcom' in something not a structure
or union
Perl.xsi: In function `XS_DBD__Perl__db_commit':
Perl.xsi:72: request for member `getcom' in something not a structure
or union
Perl.xsi: In function `XS_DBD__Perl__db_rollback':
Perl.xsi:81: request for member `getcom' in something not a structure
or union
Perl.xsi: In function `XS_DBD__Perl__db_disconnect':
Perl.xsi:90: request for member `getcom' in something not a structure
or union
Perl.xsi:109: stray '\' in program
Perl.xsi: In function `XS_DBD__Perl__db_STORE':
Perl.xsi:118: request for member `getcom' in something not a structure
or union
Perl.xsi:123: request for member `set_attr_k' in something not a
structure or un
ion
Perl.xsi: In function `XS_DBD__Perl__db_FETCH':
Perl.xsi:131: request for member `getcom' in something not a structure
or union
Perl.xsi:134: request for member `get_attr_k' in something not a
structure or un
ion
Perl.xsi: In function `XS_DBD__Perl__db_DESTROY':
Perl.xsi:142: request for member `getcom' in something not a structure
or union
Perl.xsi:146: request for member `debug' in something not a structure
or union
Perl.xsi:147: request for member `logfp' in something not a structure
or union
Perl.xsi:158: stray '\' in program
Perl.xsi:169: request for member `debug' in something not a structure
or union
Perl.xsi:171: request for member `debug' in something not a structure
or union
Perl.xsi:172: request for member `logfp' in something not a structure
or union
Perl.xsi:177: stray '\' in program
Perl.xsi: In function `XS_DBD__Perl__st__prepare':
Perl.xsi:199: request for member `getcom' in something not a structure
or union
Perl.xsi:200: stray '\' in program
Perl.xsi: In function `XS_DBD__Perl__st_bind_param':
Perl.xsi:226: request for member `getcom' in something not a structure
or union
Perl.xsi:236: stray '\' in program
Perl.xsi:238: stray '\' in program
Perl.xsi: In function `XS_DBD__Perl__st_bind_param_inout':
Perl.xsi:256: request for member `getcom' in something not a structure
or union
Perl.xsi:272: stray '\' in program
Perl.xsi:273: stray '\' in program
Perl.xsi: In function `XS_DBD__Perl__st_execute':
Perl.xsi:285: request for member `getcom' in something not a structure
or union
Perl.xsi: In function `XS_DBD__Perl__st_fetchrow_arrayref':
Perl.xsi:327: request for member `getcom' in something not a structure
or union
Perl.xsi: In function `XS_DBD__Perl__st_fetchrow_array':
Perl.xsi:340: request for member `getcom' in something not a structure
or union
Perl.xsi: In function `XS_DBD__Perl__st_finish':
Perl.xsi:357: request for member `getcom' in something not a structure
or union
Perl.xsi:358: stray '\' in program
Perl.xsi:363: `imp_dbh' undeclared (first use in this function)
Perl.xsi:363: (Each undeclared identifier is reported only once
Perl.xsi:363: for each function it appears in.)
Perl.xsi:366: stray '\' in program
Perl.xsi: In function `XS_DBD__Perl__st_blob_read':
Perl.xsi:386: request for member `getcom' in something not a structure
or union
Perl.xsi: In function `XS_DBD__Perl__st_STORE':
Perl.xsi:401: request for member `getcom' in something not a structure
or union
Perl.xsi:406: request for member `set_attr_k' in something not a
structure or un
ion
Perl.xsi: In function `XS_DBD__Perl__st_FETCH_attrib':
Perl.xsi:418: request for member `getcom' in something not a structure
or union
Perl.xsi:423: request for member `get_attr_k' in something not a
structure or un
ion
Perl.xsi: In function `XS_DBD__Perl__st_DESTROY':
Perl.xsi:431: request for member `getcom' in something not a structure
or union
Perl.xsi:435: request for member `debug' in something not a structure
or union
Perl.xsi:436: request for member `logfp' in something not a structure
or union
Perl.xsi:442: stray '\' in program
Perl.xsi:445: stray '\' in program
Perl.xsi:446: `imp_dbh' undeclared (first use in this function)
Perl.xsi:454: stray '\' in program
Perl.xsi: In function `boot_DBD__Perl':
Perl.xsi:15: stray '\' in program
Perl.xsi: In function `boot_DBD__Perl':
Perl.xsi:15: stray '\' in program
Perl.c:699: parse error at end of input
gcc: file path prefix `/usr/ccs/bin/' never used
*** Error code 1
make: Fatal error: Command failed for target `Perl.o'


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 18 Sep 2000 13:24:08 -0700
From: Kevin D. Quitt <KQuitt@IEEInc.com>
Subject: Re: One program w/ many languages
Message-Id: <21852E5475F0BDB8.0DE96104EEEB7FCB.39687E3F2187DCA2@lp.airnews.net>

I didn't get the original post, but here you go.  Replace each ^ with a
space, and do not tabify.  I apologize for the necessity, but my
*@#$^%&^%! newsreader insists on folding lines.  If you want you can get
if from ftp://ftp.quitt./net/outgoing/polyglot

-----------------------------8<------------------------


^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(*O/*_/
Cu^^#%*^)pop^mark/CuG^4^def/#^2^def%%%%@@P[TX---P\P_SXPY!Ex(mx2ex("SX!Ex4P)Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*------------------------------------------------------------------*+Ex=
CuG^#%*^^^POLYGLOT^-^a^program^in^seven^languages^^^^^^15^February^1991^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^Written^by^Kevin^Bungard,^Peter^Lisle,^and^Chris^Tham^^^^^^^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^We^have^successfully^run^this^program^using^the^following:^^^^^*+Ex=
CuG^#%*^^^^^ANSI^COBOL:^^^^^^^^^^^^MicroFocus^COBOL85^(not^COBOL74)^^^^^^*+Ex=
CuG^#%*^^^^^ISO^^Pascal:^^^^^^^^^^^Turbo^Pascal^(DOS^&^Mac),^Unix^PC,^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^AIX^VS^Pascal^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^ANSI^Fortran:^^^^^^^^^^Unix^f77,^AIX^VS^Fortran^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^ANSI^C^(lint^free):^^^^Microsoft^C,^Unix^CC,^GCC,^Turbo^C++,^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^Think^C^(Mac)^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^PostScript:^^^^^^^^^^^^GoScript,^HP/Adobe^cartridge,^^^^^^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^Apple^LaserWriter^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^Shell^script:^^^^^^^^^^gnu^bash,^sh^(SysV,^BSD,^MKS),^ksh^^^^*+Ex=
CuG^#%*^^^^^8086^machine^language:^MS-DOS^2.00,^3.03,^4.01,^5.00^beta^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^VPix^&^DOS^Merge^(under^unix)^^^^^^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^SoftPC^(on^a^Mac),^MKS^shell^^^^^^^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^Usage:^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^1.^Rename^this^file^to^polyglot.[cob|pas|f77|c|ps|sh|com]^^^^*+Ex=
CuG^#%*^^^^^2.^Compile^and/or^run^with^appropriate^compiler^and^^^^^^^^^^*+Ex=
CuG^#%*^^^^^^^^operating^system^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^Notes:^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^1.^We^have^attempted^to^use^only^standard^language^features.^*+Ex=
CuG^#%*^^^^^^^^Without^the^-traditional^flag^gcc^will^issue^a^warning.^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^2.^This^text^is^a^comment^block^in^all^seven^languages.^^^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^3.^When^run^as^a^.COM^file^with^MS-DOS^it^makes^certain^^^^^^*+Ex=
CuG^#%*^^^^^^^^(not^unreasonable)^assumptions^about^the^contents^of^^^^^^*+Ex=
CuG^#%*^^^^^^^^the^registers.^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^4.^When^transfering^from^Unix^to^DOS^make^sure^that^a^LF^^^^^*+Ex=
CuG^#%*^^^^^^^^is^correctly^translated^into^a^CR/LF.^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^Please^mail^any^comments,^corrections^or^additions^to^^^^^^^^^^*+Ex=
CuG^#%*^^^peril@extro.ucc.su.oz.au^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*------------------------------------------------------------------*QuZ=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*!Mx)ExQX4ZPZ4SP5n#5X!)Ex+ExPQXH,B+ExP[-9Z-9Z)GA(W@'UTTER_XYZZY'CPK*+
CuG^#(*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*(
C^^^#^*/);^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/*(
C^^^#^*)^^program^^^^^^^^polyglot^(output);^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(*+
C^^^#^^^^^identification^division.
C^^^#^^^^^program-id.^^^^polyglot.
C^^^#
C^^^#^^^^^data^^^^^^^^^^^division.
C^^^#^^^^^procedure^^^^^^division.
C^^^#
C^^^#^*^))cleartomark^^^/Bookman-Demi^findfont^36^scalefont^setfont^^^^^(
C^^^#^*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(
C^^^#
C^^^#^*^^^^^^^^^^^^^^^^^^hello^polyglots$
C^^^#^^^^^main.
C^^^#^^^^^^^^^perform
C^^^^^*^)^2>_$$;^echo^^^"hello^polyglots";^rm^_$$;^exit
^^^^^^^^^^^^^^print
C^^^^^^^^^^^^^stop^run.
^^^^^-*,^^^^^^^^^^^^^^^^'hello^polyglots'
C
C^^^^^^^^^print.
C^^^^^^^^^^^^^display^^^"hello^polyglots".^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(
C^^^^^*/^^int^i;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/*
C^^^^^*/^^main^()^{^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/*
C^^^^^*/^^^^^^i=printf^("hello^polyglots\n");^^^^^^^^^^^^^^^^^^^^^^^^^^^/*
C^^^^^*)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(*
C^^^^^*)^^begin^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(*
C^^^^^*)^^^^^^writeln^^('hello^polyglots');^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(*
C^^^^^*)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(*^)
C^^^^^*^)^pop^60^360^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(
C^^^^^*^)^pop^moveto^^^^(hello^polyglots)^show^^^^^^^^^^^^^^^^^^^^^^^^^^(
C^^^^^*^)^pop^showpage^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^((
C^^^^^*)
^^^^^^^^^^^end^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^.(*^)
C)pop%^^^^^program^^^^^^^polyglot.^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*){*/}

-- 
#include <standard.disclaimer>
 _
Kevin D Quitt  USA 91351-4454           96.37% of all statistics are made up
Per the FCA, this email address may not be added to any commercial mail list


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

Date: Mon, 18 Sep 2000 22:01:11 +0100
From: "Stephen Collyer" <stephen@twocats.dont-spam.demon.co.uk>
Subject: Re: Parse::RecDescent: Problem with a Grammar
Message-Id: <969311029.15144.0.nnrp-09.9e98901a@news.demon.co.uk>

> Are you sure that is the code? Because it doesn't look compilable >to me.

I'm sure it's not the code. It seems that MS Outlook screws up
some of the braces in this for some reason. Apologies. I've
manually reinserted them below.

===================================================

 my $func_grammar = q{

     Function: <rulevar: local @Args>

     Function: Identifier ArgList
                   {
                     return { FuncName => $item[1],
                               ArgNames => [ @Args ] };
                   }

     ArgList: '(' Arg(?) (Sep Arg)(s?) ')'

     Arg:  Quote
                       {
                         push @Args, $item[1];
                       }
         | Function
         | Identifier
                       {
                         push @Args, $item[1];
                       }
}

====================================================

And to restate the problem: I expect this grammar to match
something like:

abc(def())

with the nested "def()" being matched by the Function subrule
of the Arg rule. The RD_TRACE output (which I find rather *too*
detailed to follow easily) suggests to me that everything's going
fine until the final ')' must be matched (i.e. the rest of the text
"abc(def()" has been consumed by the grammar as expected).
As far as I can see the Function subrule consumes the "def()" text
and matches successfully, and I can't see why it should fail
thereafter.

Steve Collyer.




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

Date: 18 Sep 2000 21:33:40 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Parse::RecDescent: Problem with a Grammar
Message-Id: <slrn8sd2ff.5fq.abigail@alexandra.foad.org>

Stephen Collyer (stephen@twocats.dont-spam.demon.co.uk) wrote on MMDLXXV
September MCMXCIII in <URL:news:969311029.15144.0.nnrp-09.9e98901a@news.demon.co.uk>:
`` 
``      Function: Identifier ArgList
``                    {
``                      return { FuncName => $item[1],
``                                ArgNames => [ @Args ] };
``                    }
                        ^^^^^^

This is causing you trouble. What you want is:

                      { $return = { FuncName => $item[1],
                                    ArgNames => [ @Args ] }
                      }

Or just:

                      { {FuncName => $item[1],
                         ArgNames => [ @Args ]}
                      }



Abigail
-- 
perl -weprint\<\<EOT\; -eJust -eanother -ePerl -eHacker -eEOT
#    Seven butterflies
#    crawling in the branches of an
#    oak. Joshu. A lark.


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

Date: Mon, 18 Sep 2000 19:30:05 -0000
From: Michael Johnson <mikempx@hotmail.com>
Subject: Re: Perl and Databases FAQ
Message-Id: <sscr9tqcl3df14@corp.supernews.com>

I have a quick question regarding the Perl ODBC module, Oracle 8.04, and 
Windows NT's "AT" batch command:

When I try to access data using the Perl ODBC module in a perl script, 
everything goes great (it's a simple sql query).  However, if I put the 
same script into a batch process, I cannot connect to the database.  The 
environment variables in the batch process have been set to the same env 
variables as I had when starting the script from a DOS prompt.  Any ideas 
what could be causing the problem??

Don't know if this is a FAQ or not, but I thought someone out there may 
have been in this same situation before...

Thanks much - Cheers!
Mike




pohanl wrote:
> 
> 
> 
> 
> The following is a Mini-FAQ on...
> 
> Perl and Databases
> 
> It is released into the public domain.
> 
> 
> =====================================================
> 1) How Does Perl store information?
> =====================================================
> 
> 1) Perl stores information like any other language,
>    though file system calls or custom modules that
>    talk to databases.
> 
> As we all know the most common database API is (was?) ODBC,
> which provided a level of abstraction for you to talk to many
> different types of databases.  Basically, how this works is,
> you install the ODBC driver on the same machine where your
> program is stored (the program that is going to connect to
> the database).  The database can be located anywhere like
> a remote server half way around the world.  In order for your
> program to talk to the ODBC interface, you must link against
> an ODBC header file, or if in Java, use the JDBC api built-in
> class files.  The ODBC bascially takes your commands and
> converts them into calls the database understands.
> 
> In Perl, you can either open a file and write to it like any
> old programming technique, or you can use some of the built-in
> database support, or lastly go for the DBI (an ODBC type of
> technology).  Perl has built-in support for tied hashes, which
> means whenever you change a hash variabled, it is persistently
> stored automatically in a database.  This is a type of
> automatic serialization of variables that can be implemented
> in Java or C++.
> 
> Tied database uses a special type of database: a hash (key, value)
> database.  There are built-in support for these in Perl, mainly
> DB_File, SDBM_File, etc.  There are the two that you should be
> aware of.  SDBM_File is built into all Perl binaries, so you can
> use it if you have Perl.  DB_File is sometimes not included, but
> it is the only version that supports unlimited Key/Value length.
> If you use SDBM_File, if your value exceeds 1024 characters for
> any Key, it becomes empty (horrible I know, with no errors).
> This is known as the Bucket_size.  DB_File support unlimited
> characters/value per Key.  So if you start playing with tied
> hashes, start with SDBM_File, then convert to DB_File when
> you need larger storage needs.  But before long, you will
> find that DB_File is not suitable either, because it has
> its own paging cache, and there is no way it can support
> concurrent users.  It is so unpredictable that you can
> corrupt your database just by having multiple perl scripts
> write things into the DB_File.  Even if you have extensive
> locking mechanism, eventually, you database will get corrupted.
> What you need is concurrent support with built-in locking.
> 
> Most databases these days are separated into two parts, the
> Daemon, which is the sole gateway into the data.  So two people
> wanting to writing things to the data must go through the daemon
> (a background process on its own).  DB_File and SDBM_File
> are basically just files.  If you have two perl programs writing
> to a file, there is no gateway daemon to schedule the writes,
> which will end up clobbering each other as they write to the
> database.  It is extremely dangerous to write web-cgi applications
> using solely a tied hash, as your data will get corrupted in no time
> at all.  This is an inherent technology problem with SDBM_File and
> DB_File.
> 
> DB_File is the perl module to access the Berkeley DB version 1.x.
> There are newer versions of BerkeleyDB namely 2.x and 3.x.
> 3.x support concurrent access (writes), but requires setting up
> a third virtual memory pool, which you can't do in perl.  So
> what does this mean?  To write any web stuff with multiple
> perl scripts sharing a database, you CANT use DB_File, DBM databases,
> BerkeleyDB, and the rest.  If you know for sure only one script
> is going to use the database, and it happens serially, then go ahead,
> but otherwise, stay AWAY from tied hashes.  Eventually your
> database will get corrupted, and there is no current fix.
> 
> The third option is to go with a regular database.  For these,
> Perl comes with DBI, which is like the header file you link
> in your C++ programs to call the ODBC driver.  It is also like
> the Built-in API on java (JDBC api classes).  The actual
> ODBC library you install on your client is synonymous with a
> DBD driver for you database.  So if you are using a perl script
> or module that needs to store and retrieve data from a database,
> then it needs to have a DBI module and the appropriate DBD for
> the database installed.  There are DBD drivers for Oracle,
> mySQL, SqlServer, and many many others.  You just need to find
> the drivers and install them after installing the DBI module.
> You still talk to the database using the database's native
> SQL syntax.  The DBI/DBD is only an interface to the database's
> SQL engine.
> 
> mySQL happens to be the fastest database in the world.  So I
> will concentrate on this database.  You can write cross platform
> perl code for mySQL (running on linux, windows, etc).  but you
> must note the differences between mySQL on both of these popular
> plateforms.
> 
> For linux and unix variants, if you type a show tables,
> you will find that the tables are case sensitive when they
> are displayed.
> 
> If you do this on the windows mysql, they are all in lowercase.
> 
> There is a call: show tables like "name".
> Which is a way to see if a table exists.  Well, in order
> for this line of code to work on multiple platforms,
> you need to convert all table creation to use lowercase.
> I wont go into too much detail, but certain SQL syntax calls in mySQL
> are case sensitive and certain calls are not, and in order to
> make your code work on both platforms, you need to make ALL
> your table names lowercase.  Juse do a lc($theTableName) on
> all table names in SQL and you should be fine.
> 
> As for fields and values in the tables, you can continue using
> variable cases, as they should be portable anyways.
> 
> One final note: On windows a carriage return is "\r\n", while
> in Unix its "\n".  If you vi a DOS file in unix you will see
> ^M that ^M is \r, which Unix doesn't understand.
> 
> mySQL runs as a daemon, so it is safe for concurrent users.
> you can lock and unlock databases using SQL calls.  Most
> calls are atomic, and autocommit, so no need to worry about
> corruptions.
> 
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.


--
Posted via CNET Help.com
http://www.help.com/


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

Date: Mon, 18 Sep 2000 15:38:53 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: perl and web
Message-Id: <brian-ya02408000R1809001538530001@news.panix.com>

In article <39C64B76.8A6D8C5E@shentel.net>, Albert Dewey <timewarp@shentel.net> posted:

> daud11@hotmail.com wrote:

> Have you set the permissions to execute only?

> I set all my scripts to the bare minimum and that is chmod 711 on a unix
> machine.

that's not the bare minimum.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>


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

Date: Mon, 18 Sep 2000 20:56:26 GMT
From: debtman <debtman@my-deja.com>
Subject: perl expect module problems
Message-Id: <8q5vhe$d6s$1@nnrp1.deja.com>



I can't seem to get a script to work with the perl expect module, even
the ones included don't work for me. When I try and send data to the
process it just sits there until it times out. I'm just trying to do a
simple script that will su to a user and run passwd, basically so I can
have a script where users can change their password from the web without
any root scripts running. Here's the first part

#!/usr/bin/perl

$Expect::Debug =1;

$user = $ARGV[0];
$old = $ARGV[1];
$new = $ARGV[2];

($pass = Expect->spawn("/bin/su $user -c /usr/bin/passwd")) || die
"Couldn't spawn passwd program, $!";

unless ($link->expect(15, "Password: ")) {
	die "Error: ". $link->exp_error()."\n";
}

print $pass "$old\r";

unless ($pass->expect(15, "(current) UNIX password:")) {
	die "Error: ". $pass->exp_error()."\n";
}

print $pass "$old\r";

At this point it just sits there after writing out the old password. The
debug output looks like it's trying to match the data I'm sending to the
process... Here it is in full (assume oldpass is the password I'm
sending).

Spawned '/bin/su test -c /usr/bin/passwd' (spawn id(3))
        Pid: 15333
        Tty: /dev/pts/8
Beginning expect from spawn id(3).
Accumulator: ''
Expect timeout time: 15 seconds.
expect: Pty=spawn id(3), time=969310575, loop_time=15
Expecting from spawn id(3): 'Password: '
Does ''
from spawn id(3) match:
        pattern 1 ('Password: ')? No.
expect: handle spawn id(3) ready.
expect: read 10 byte(s) from spawn id(3).
Password: Does 'Password: '
from spawn id(3) match:
        pattern 1 ('Password: ')? Yes!
Matched pattern 1 ('Password: ')!
        Before match string: ''
        Match string: 'Password: '
        After match string: ''
Returning from expect successfully.
Accumulator: ''
Beginning expect from spawn id(3).
Accumulator: ''
Expect timeout time: 15 seconds.
expect: Pty=spawn id(3), time=969310575, loop_time=15
Expecting from spawn id(3): '(current) UNIX password:'
Does ''
from spawn id(3) match:
        pattern 1 ('(current) UNIX password:')? No.
expect: handle spawn id(3) ready.
expect: read 9 byte(s) from spawn id(3).
oldpass
Does 'oldpass\r\n'
from spawn id(3) match:
        pattern 1 ('(current) UNIX password:')? No.
Returning from expect unsuccessfully. Error: 1:TIMEOUT.
Accumulator: 'oldpass\r\n'
Error: 1:TIMEOUT

So I'm not sure what's going on, it seems that the oldpass isn't being
sent to the process or something. Anyone familiar with this have any
ideas?


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 18 Sep 2000 20:35:39 GMT
From: djernaes@my-deja.com
Subject: Re: Perl hases and memory
Message-Id: <8q5uao$bnf$1@nnrp1.deja.com>



> tim@ipac.caltech.edu wrote:
> Throw us a bone: Can you pare down your script
> to a very small sample program
> that shows your data structures and your use of
> recursion? Can you specify what
> you mean by "won't run"? Can you tell us what
> you've done to try and solve the
> problem?
>
> Without that concreteness it's going to be hard
> for us to give you suggestions.

You are right but "just for fun" I created a Linux
with a 486 with 20 MB of RAM - and it works as a
charm slow, but without any problems.

See now I'm sure that my perl code is not the best
in the world (as I said I'm new to perl), but now
I feel pretty sure that it's a memory/system problem.

Thanks for taking a look, and I might post again
with an example.

Martin


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 18 Sep 2000 20:28:02 GMT
From: rathmore@tierceron.com
Subject: Perl Praise & This Newsgroup
Message-Id: <8q5trl$b1m$1@nnrp1.deja.com>

<!--Begin Mawkish Praise Here--!>

I just wanted to take a minute and thank everyone in this newsgroup who
took the time to respond to the inquiries that I posted to this
newsgroup. Everyone was helpful and considerate. When I was learning
another language, which I won't mention (C++), I went to a newsgroup
associated with that language, which I also won't mention
(comp.lang.c++) and got lambasted after my first two posts. This wasn't
an isolated occurrence--I took the time to read other questions and
responses because my experience was so poor.

I was a little leery about posting here, but I wanted to give everyone
the benefit of the doubt. I'm glad I did, I'm sticking around, and I
hope to eventually be good enough with Perl to assist others who are
trying to learn the language.

As far as Perl goes, I love it! I've had a lot of fun with this
project, I've learned a lot about the language, and I'm going to stick
with this language. I hope to earn the classification of guru!

I've found that Perl does what you want it to. When I wasn't sure of an
exact syntax, or how to code a particular algorithm, I would write up a
test script and see what happens. About 80% of the time the script
would work just like I wanted it to. That same technique, when applied
to C++, had about a 25% success rate. There was always something I
forgot (usually had to do with deallocating memory or pointer cleanup).

Thanks all! And, thanks to everyone who reads this message who has had
a hand in the development of this very cool programming language!

Rathmore

<!--End Mawkishness Here--!>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 18 Sep 2000 20:47:47 GMT
From: ladesigner1@my-deja.com
Subject: Please explain how this filename extraction works?
Message-Id: <8q5v1b$cg5$1@nnrp1.deja.com>

I have this snippet of Perl code that I hope someone can explain (in
simple English terms) how it works. It works great for extracting
filenames within a URL:

if (m|^.*/(\w+).html|) {
      print "Extracted $1 from $_\n";

Please explain what the pattern matching process is doing to take the
mystery out of recognizing the filenames of any character length...

Thanks.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 18 Sep 2000 21:43:16 GMT
From: The Glauber <theglauber@my-deja.com>
Subject: Re: Please explain how this filename extraction works?
Message-Id: <8q629f$gh1$1@nnrp1.deja.com>

In article <8q5v1b$cg5$1@nnrp1.deja.com>,
  ladesigner1@my-deja.com wrote:
> I have this snippet of Perl code that I hope someone can explain (in
> simple English terms) how it works. It works great for extracting
> filenames within a URL:
>
> if (m|^.*/(\w+).html|) {
>       print "Extracted $1 from $_\n"
>
> Please explain what the pattern matching process is doing to take the
> mystery out of recognizing the filenames of any character length...


It's looking for alphanumeric characters or "_" between the last "/" and
".html".

Log in to the system where perl is installed, type "perldoc perlre" in the
command line and read that documentation. It's important stuff if you want to
program in Perl.


> Thanks.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

--
Glauber Ribeiro
theglauber@my-deja.com    http://www.myvehiclehistoryreport.com
"Opinions stated are my own and not representative of Experian"


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 4363
**************************************


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