[9701] in Perl-Users-Digest

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

Resend: Perl-Users Digest, Issue: 3295 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 1 18:04:48 1998

Date: Sat, 1 Aug 98 15:00:07 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 1 Aug 1998     Volume: 8 Number: 3295

Today's topics:
    Re: "use" in expressions. (Kjetil Skotheim)
    Re: # in a print statement nikkim@my-dejanews.com
    Re: # in a print statement (Larry Rosler)
    Re: # in a print statement (Larry Rosler)
    Re: # in a print statement (Abigail)
        -w warning ??? (Todd "Waxahachiefortudinouslyexportitionismistically" Hartman)
    Re: -w warning ??? (Michael J Gebis)
    Re: -w warning ??? <*@qz.to>
        ...and the winner is... <REPLY_TO_damonbrent@earthlink.net>
    Re: ...and the winner is... (Gabor)
    Re: ...maybe not (Brian Jepson)
        3 more questions for perl win32 officianados (KHeise)
    Re: 3 more questions for perl win32 officianados <thomas@daimi.aau.dk>
        [ANNOUNCE] VCS::PVCS - Perl interface to PVCS Version M (Bill Middleton)
        [Q] STDOUT to screen and file on Win32 <jhempe@crossroute.com>
        [Q]s on non-blocking system calls ("forks") <kj0@mailcity.com>
    Re: [Q]s on non-blocking system calls ("forks") (Andrew M. Langmead)
        Announce PQEdit 1.50 and RDBAL 1.10 <brian@ibc.wustl.edu>
        ANNOUNCE: Parse::Yapp 0.14 released <desar@club-internet.fr>
        Associative array of associative arrays h_o_t_r_o_d@my-dejanews.com
    Re: Associative array of associative arrays <zenin@bawdycaste.org>
    Re: Associative array of associative arrays <quednauf@nortel.co.uk>
    Re: Associative array of associative arrays <thomas@daimi.aau.dk>
        binary uploading.. <rosadi@students.uiuc.edu>
    Re: Calling a dll from Perl (Tye McQueen)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 31 Jul 1998 19:15:30 GMT
From: kjetil.skotheim@usit.uio.no (Kjetil Skotheim)
Subject: Re: "use" in expressions.
Message-Id: <6pt54i$4ud$3@readme.uio.no>

In article <6pn46d$7jk$3@rznews.rrze.uni-erlangen.de>, 
ws97-868@wsrz1.wiso.uni-erlangen.de says...
>
>Hello,
>
>What I would like to be able to do is the following:
>
>use XXX if $condition1;
>use YYY if $condition2;
>
>or something like :
>
>use $x,where $x is a string.
>Whenever I try this,perl complains.
>
>Can anyone help me?
>
>Thank you in advance. 
>

Since 'use $x' is executed before other code, you must
add a BEGIN-block before 'use $x' to initialise $x.

BEGIN{$x="brbrbrbrbr"}
use $x;

 ....or maybe  eval{use $x};  will do what you want.




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

Date: Thu, 30 Jul 1998 13:28:41 GMT
From: nikkim@my-dejanews.com
Subject: Re: # in a print statement
Message-Id: <6ppse9$pul$1@nnrp1.dejanews.com>

In article <MPG.1029d29520ddf7629897a1@nntp.hpl.hp.com>,
  lr@hpl.hp.com (Larry Rosler) wrote:
> In article <1dcy04p.1kh7u371ia3kwmN@bay1-90.quincy.ziplink.net> on Wed,
> 29 Jul 1998 20:34:10 -0400, Ronald J Kimball <rjk@coos.dartmouth.edu>
> says...
> > <nikkim@my-dejanews.com> wrote:
> ...
> > > print GUEST "<IMG id=\"Picture2\" HEIGHT=88 WIDTH=562
SRC=\"./bbstop8.jpg\"
> > > BORDER=0 USEMAP="#map5" > etc, etc ...
> >                   ^     ^
> >
> > Backslash the quotes so the # is within the string, instead of outside
> > it.
>
> Better yet, use the qq quoting method and get rid of all those
> backslashes.
>

What is the qq quoting method in perl?  I guess I have not heard of that or it
is not in the books I have.  I am fairly new to perl, although I am not a
beginner at it seeing as how I have written many programs already.
I guess I haven't come across this method yet.

Thanks,
Nikki Michalowske
Minnesota State Senate



-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Thu, 30 Jul 1998 07:31:18 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: # in a print statement
Message-Id: <MPG.102a238f11665649897a3@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <6ppse9$pul$1@nnrp1.dejanews.com> on Thu, 30 Jul 1998 13:28:41 
GMT, nikkim@my-dejanews.com <nikkim@my-dejanews.com> says...
 ... 
> What is the qq quoting method in perl?  I guess I have not heard of that or it
> is not in the books I have.  I am fairly new to perl, although I am not a
> beginner at it seeing as how I have written many programs already.
> I guess I haven't come across this method yet.

First look in perlop for the subject qq{Quote and Quote-like Operators}.  
Then add q!Programming Perl! to your collection of books.  It is 
indispensable.

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 30 Jul 1998 07:24:06 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: # in a print statement
Message-Id: <MPG.102a21e02a80b3799897a2@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <6pp3sd$37q@mozo.cc.purdue.edu> on 30 Jul 1998 06:29:33 GMT, 
Michael J Gebis <gebis@albrecht.ecn.purdue.edu> says...
 ...
> I might add:
>   print GUEST qq/<IMG id="Picture2" HEIGHT=88 WIDTH=562 SRC="./bbstop8.jpg" BORDER=0 USEMAP="#map5">/;

Er, I don't think you chose the best character to delimit that quote! :-)

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 30 Jul 1998 16:47:30 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: # in a print statement
Message-Id: <6pq832$p1l$2@client3.news.psi.net>

nikkim@my-dejanews.com (nikkim@my-dejanews.com) wrote on MDCCXCIV
September MCMXCIII in <URL: news:6ppse9$pul$1@nnrp1.dejanews.com>:
++ 
++ What is the qq quoting method in perl?  I guess I have not heard of that or i
++ is not in the books I have.

Then you need better books.

++                              I am fairly new to perl, although I am not a
++ beginner at it seeing as how I have written many programs already.


Being new is not an excuse for not reading the manuals. It's in perlop.



Abigail
-- 
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT


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

Date: 31 Jul 1998 18:14:12 GMT
From: thartman@xxxx.xx (Todd "Waxahachiefortudinouslyexportitionismistically" Hartman)
Subject: -w warning ???
Message-Id: <6pt1hk$1efq$1@ausnews.austin.ibm.com>

I've got a question about a -w warning:

here's a sample script:

---- BEGIN ww.p ----
#!/usr/local/bin/perl -w

my ($line);

open(FIN,"<ww.p") or die("cannot open ww.p:  $!");
while ($line = <FIN>) {
  print "$line";
}
---- END ww.p ----

When I run it, I get:
---- BEGIN session ----
prompt> ww.p
Value of <HANDLE> construct can be "0"; test with defined() at ww.p line 65535.
#!/usr/local/bin/perl -w

my ($line);

open(FIN,"<ww.p") or die("cannot open ww.p:  $!");
while ($line = <FIN>) {
  print "$line";
}
---- END session ----

I've tried adding an `if defined(FIN)' after the open, but that doesn't
make any difference.

This warning goes away if I use the default scalar inside the while
conditional (i.e. `while (<FIN>) {').

I assume that -w warnings are things that are good ideas to clear up,
but I can't figure out why `while ($var = <FILEHANDLE>)' is questionable.

The fact that 65535 (perhaps an unsigned, 16-bit `-1') is used as the
line number suggests to me that this warning might be some sort of internal
error, but I haven't looked at the source, and I don't want to assume
that because something doesn't seem to work for me that it must be broken.

I'm running perl "version 5.004_04 built for aix".
Any suggestions would be appreciated.


todd.

--
Todd Hartman           thartman@austin.ibm.cNOSPAMom      (512)838-8789
The opinions which may or may not be explicitly implied in this document
are completely my own and are not necessarily those of my employer.
(remove NOSPAM from e-mail address to mail)


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

Date: 31 Jul 1998 21:47:22 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: -w warning ???
Message-Id: <6pte1a$9qk@mozo.cc.purdue.edu>

thartman@xxxx.xx (Todd "Waxahachiefortudinouslyexportitionismistically" Hartman) writes:
}Value of <HANDLE> construct can be "0"; test with defined() at ww.p line 65535.
}I'm running perl "version 5.004_04 built for aix".
}Any suggestions would be appreciated.

This warning has been removed (well, at least, it wouldn't have shown
up with the code you posted) in 5.005.  (I'm not suggesting you have
to upgrade; I'm just saying you have something to look forward to.)


-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: 31 Jul 1998 18:31:19 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: -w warning ???
Message-Id: <eli$9807311426@qz.little-neck.ny.us>

In comp.lang.perl.misc, Todd "Waxahachiefortudinouslyexportitionismistically"
Hartman <thartman@xxxx.xx> wrote:

Please put invalid addresses in the top level domain .invalid.

> I've got a question about a -w warning:
> prompt> ww.p
> Value of <HANDLE> construct can be "0"; test with defined() at ww.p line 65535.

Use this:

	while( defined( $line = <FIN> ))

Instead of just:

	while( $line = <FIN> )

> This warning goes away if I use the default scalar inside the while
> conditional (i.e. `while (<FIN>) {').

Yes. That is the same as:

	while( defined( $_ = <FIN> )) {

> The fact that 65535 (perhaps an unsigned, 16-bit `-1') is used as the
> line number suggests to me that this warning might be some sort of internal

That bit seems odd.

Elijah
------
wonders if there are "# line <num>" statements in the orignal source


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

Date: Fri, 31 Jul 1998 12:56:04 -0400
From: "Brent Verner" <REPLY_TO_damonbrent@earthlink.net>
Subject: ...and the winner is...
Message-Id: <6pspf6$ub$1@oak.prod.itd.earthlink.net>

redhat!

thanks to all.

brent



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

Date: 31 Jul 1998 21:23:11 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: ...and the winner is...
Message-Id: <slrn6s4dim.1p2.gabor@localhost.vmunix.com>

In comp.lang.perl.misc, Brent Verner <REPLY_TO_damonbrent@earthlink.net> wrote :
# redhat!

Hmm, I would say FreeBSD.  Or maybe NetBSD. ;)


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

Date: 30 Jul 1998 19:35:04 GMT
From: bjepson@ids.net (Brian Jepson)
Subject: Re: ...maybe not
Message-Id: <slrn6s1iof.2iq.bjepson@gelvis.ids.net>

On Thu, 30 Jul 1998 11:52:11 -0400, Brent Verner wrote:
>

> brian Jepson wrote:
>>
>>The ActivePerl distribution at http://www.ActiveState.com is based on
>>5.005.
>>
>>Hope this helps,
>
>unlikely. -- the following was cut from activestate's website
>
>8<----------------------------
>The ActivePerl package contains all you'll need to get Perl up and
>running -- even with a Web server! ActivePerl includes:
>
[...]

>
>Build information
>The latest build of Perl for Win32, Perl for ISAPI and PerlScript is Build
>316.
>This is based on 5.003_07 Core Perl code.

Are these quotes on the same page?  ActivePerl is build 471, not 316.  
I should have posted that ActivePerl is based on a prerelease version 
of 5.005, which I believe is numbered 5.00471.  

If you want the build of ActivePerl that is based on this version, go to:

   http://www.activestate.com/ActivePerl/download.htm

ActivePerl is a beta, which I also should have mentioned.  The latest
stable build of Perl for Win32 is indeed 316, but if you need to start
working with 5.005, you should check out ActivePerl.  Since 5.005 is out,
I would expect that a build of ActivePerl that is based on it will be 
released at some point in the near future.

I think the confusion may have been caused by the fact that I didn't 
explain the distinction between ActivePerl and Perl for Win32. Perl for
Win32 is ActiveState's name for their distribution of Perl that is based
on earlier releases of core Perl.  ActivePerl is the new term for their
distribution, which is based on the merge of Win32 and core Perl, and
includes some of ActiveState's software like Perl for ISAPI, PerlScript,
and the Perl Package Manager (previously, Perl for ISAPI and PerlScript
were distributed separately from Perl for Win32).

Sorry about the ambiguity in my previous post!

-- 
Brian Jepson * (bjepson@ids.net)  * http://users.ids.net/~bjepson
              Choosy mothers choose to chew Chew-Z


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

Date: 30 Jul 1998 15:44:43 GMT
From: kheise@aol.com (KHeise)
Subject: 3 more questions for perl win32 officianados
Message-Id: <1998073015444400.LAA24352@ladder03.news.aol.com>

i am a novice working with perl in an NT 3.51 environment. i mostly use it to
process large fixed-length data files. i have the following qustions:

1) when i do a binary read on files with a line-feed (hex 0D) in the middle of
a record it prints to file with a carriage-return inserted in front of it. i
can't have this happen because the records are no longer fixed-length. i asked
about this at the beginning of this week and a couple of generous folks
recommended the binmode(HANDLE) command. i used this and, though it solved
several other problems, the carriage return still appears. any suggestions?

2) how can i print a report in perl win32 after processing a file?

3) what is a spammer? this probably is a somewhat humorous question that
exposes my ignorance about the perl community, but i need to know.

thanks for any assistance,

jay o.


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

Date: Fri, 31 Jul 1998 22:34:57 +0200
From: Thomas Jespersen <thomas@daimi.aau.dk>
Subject: Re: 3 more questions for perl win32 officianados
Message-Id: <35C22A71.B0E2B7B4@daimi.aau.dk>

KHeise wrote:
> 3) what is a spammer? this probably is a somewhat humorous question that
> exposes my ignorance about the perl community, but i need to know.

spammers are people who believe they can make a lot of money by putting
advertisments on newsgroups totally unrelated to what they are selling.
Usually spammers are also people who believe they can make a lot of
money on "Multi-Level-Marketing" and "Chain-Letters" which is mainly
what you see spammers advertise.

Look at http://www.cauce.org and see what you can do about it


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

Date: 31 Jul 1998 18:14:13 -0500
From: wjm@fohnix.metronet.com (Bill Middleton)
Subject: [ANNOUNCE] VCS::PVCS - Perl interface to PVCS Version Mgr
Message-Id: <6ptj45$7nq@fohnix.metronet.com>


I just uploaded to PAUSE a new module called VCS::PVCS.

You can get it also at http://www.metronet.com/~wjm

Attached is the README.

Enjoy!

Bill

----


VCS::PVCS - A Perl interface to the PVCS Version Manager

Copyright (c) 1998  Bill Middleton

This is the VCS::PVCS module, a suite of perl packages which provide
an interface to the Intersolv PVCS Version Control tools, folders,
files, archives, and access-control mechanisms. 

DESCRIPTION

  This module gives the PVCS user/admin a simple (hopefully), 
object-oriented interface to the various components of a PVCS Project, 
including the Project itself, it's folders, archives, and the 
attributes for each of these members, as designated by the project's 
administrator(s).

  You can operate on existing projects and their members, or create 
new projects, folders and archives using the methods defined in
the interface.  Operations on archive objects, in particular, use the
PVCS Command-Line tools, VCS, GET, PUT, VDIFF, and VLOG.  (others
may be supported in the future).

  The preferred method for operating within PVCS is to use Folders,
and the interface provides you with the ability to perform command-line
actions to some or all of a folder's members at once, simplifying the
process of release-tagging and making releases, nightly builds, version
history for metrics, and many other operations on the archives, which
may be performed in an automated fashion using cron or some other
time-scheduling tool.  You can also operate on entire projects at once,
or individually on archive objects by themselves.  Additionally, the
Commands.pm exports all of it's methods for a simple, if slightly more
complicated, interface to the PVCS commands directly (you supply the
file/archive names).

Here's an example:


use VCS::PVCS::Project;
use Cwd;

# Open a project
my $proj = new VCS::PVCS::Project("Existing Project");

# Open all of the "docs" folders and return ref to array
@folders  = $proj->openFolders("docs");

foreach $folder (@folders){
    # Checkout all files in the folder
    $folder->checkout("-l");  # Checkout all archives with lock

    # Populate the attributes object for each file in the folder
    $folder->getAttributes;

    # Get a list of archive object members of the folder and ck for locks
    @members = $folder->members;
    foreach $member (@members){
        $attributes = $member->attributes;  # Get the attributes object
        print $attributes->Workfile," : ",$attributes->Locks,"\n";
    }

    $folder->checkin('-f','-M"Checked in from test"');  # Checkin all archives 

    # Reload the attributes for all files  (with 1 as argument)
    $folder->getAttributes(1);

    foreach $member (@members){
        $attributes = $member->attributes;  # Get the attributes hash
        print $attributes->Workfile," : ",$attributes->Last_trunk_rev,"\n";
    }

    # Add/change/delete some version labels

    # add foobar to the tip
    $folder->addVersionLabel("foobar");

    # Add a version label to an earlier version
    $folder->addVersionLabel("bazbar:1.0");
    
    # Convert a version label to floating
    $folder->transformVersionLabel("foobar");
    
    # delete a version label
    $folder->deleteVersionLabel("foobar");

    # Rename a version label
    $folder->replaceVersionLabel("blahblek","bazbar");

    # Promote all of the 1.0 revisions to the Prodtest group
    $folder->addPromoGroup("Prodtest:1.0");

    # take a diff on all members against the two versions (default)
    foreach $member (@members){
        $member->vdiff("-R1.0 -R1.1");
        print $PVCSOUTPUT;
    }
}



WARNING:

    This is ALPHA SOFTWARE. You should consider the interface methods,
inheritance heirarchy, parameters, and objects to be in a unfinis

:-)

QUICK START GUIDE

  This VCS::PVCS module must make several assumptions about your
PVCS environment.  You must have the following ENVIRONMENT variables
set, in order for things to work "out of the box".

$PVCS_BINDIR - this is where the PVCS binaries all live.  It can
(and should) be hardwired in the VCS/PVCS.pm file before installation.

$ISLVINI - this per-user environment variable is the location of
the .islvrc (islv.ini on WINDOWS) file.  This file should specify
locations for at least the following:

    PVCSPROJ=/path/to/pvcs/projects/master/directory  # Master PVCS dir
    NFSMAP=/path/to/directory/where/nfsmap/is/located  # unix dir for nfsmap

Normally, this file is found in the HOME or C:\WINNT directory under
unix/Win respectively.  If not, you'll have to hardwire it or set
it in the environment.  The example script shows you how to do this.

The other variable which may have to be hand configured is the location
of the MASTER.CFG file, which has information about the default
configuration for PVCS.  When we created our setup here, it was
named MASTER.CFG, and found in $PVCSPROJ.  I've hardcoded this into
the PVCS.pm module. If this convention is non-standard, or not the 
way it works on UNIX-only environments, you'll need to change it, 
and please let me know at wjm@metronet.com ASAP.  Just search PVCS.pm 
for $PVCSMASTERCFG and change it in the locations you find.  You
wont need to change it anywhere else.

Once you've set these, you can install the package, and run the
test scripts.  Note that the test scripts make attempts to configure
themselves automatically and create and use a COMPLETELY SEPARATE
PVCSPROJ directory.  Running the test scripts will, in no way affect
your PVCS installation.

    perl Makefile.PL
    make
    make test
    make install


DOCUMENTATION

  The documentation, except for this file, is embedded POD, and
found in the .pm files themselves.  You can run pod2html against
them to get HTML documentation, and the manpages are created automatically
by the make.

  The documentation can be found also at my web site,

  http://www.metronet.com/~wjm/PVCS

MORE INFORMATION - Mailing List, etc.

While it doesn't actually exist yet, I plan to implement a mailing
list for this module.  For more information and to keep informed 
about new developments with this module suite, you can join the 
a mailing list (pvcs-perl@w5.metronet.com) by sending a subscribe to 
pvcs-perl-request@w5.metronet.com, or drop me a line at 
wjm@metronet.com, and I'll add your name.

IF YOU HAVE PROBLEMS

I'm pretty busy.  You can drop me a line, or send a note to the
mailing list (once it exists..) and I'll try to help when I can.  
Patches are gratefully accepted.

DESIGN

  The components of PVCS, namely PROJECTS, FOLDERS, ARCHIVES,
and ATTRIBUTES, lend nicely to an OO design.  e.g. - Archives
inherit from Attributes, Folders inherit from Archives, and
Projects inherit from both folders and archives.  I've tried to
implement this in this package, so that you can operate on a
given component and rely on the fact that all  of it's subcomponents
will be properly handled.

HOWEVER, and thats a BIG HOWEVER, IMHO, the best and only way
to use PVCS is through folders.  Many of our projects here where
I work have dozens of folders, some mapping to TEST directories,
some mapping to DEVELOPMENT directories (sometimes on the local
disk), and some designated for RELEASE folders as readonly checkouts.
I recommend that you use the folder objects liberally,
and possibly, exclusively, when operating on your PVCS project.

See the test scripts for complete examples of how to use folder
objects, and operate on folder members (archives) in a nice way.

NOTES

  The PVCS crossplatform capability gives rise to some interesting
problems.  Namely, all paths in the config files and paths for documents,
folders, etc, are stored as Windows paths, if the project was created
on windows, or if the project was created on UNIX using an NFSMAP.
(See the PVCS GUI documentation/README for details on the NFSMAP)
Thus, when we find and NFSMAP, we assume that ALL output must be
translated to WINDOWS format when creating new folders, archives,
or doing queries using the SQL components.  


SECURITY

  I like PVCS. I've administered and used ClearCase, PVCS, CVS and
SourceSafe, and PVCS seems to be the best choice for an environment
of developers that aren't all kernel hackers, but are interested
in establishing a sound CM process. It's easy to learn, without
having to take courses, safe (NO DATABASE, YEA!), and relatively
powerful, with triggers, promotion groups, and other features to
help you implement your site policy. 

 On the other hand, I'm not too fond of the PVCS GUI.  On the third hand,
the GUI does keep the user at a (usually) safe distance from the
filesystem, with some security mechanisms (depending on how you
set it up).  This module lets the user get much closer to the filesystem,
and doesn't give a whit (yet) about the access permissions, except to
code in a default parameter for all commands which includes the access 
permissions in (-C MASTER.CFG) if they are defined.  This, of course, 
can be hacked around, and the user can perform any operation on an archive 
that the filesystem will let him/her get away with. Caveat scriptor.

Best regards, and happy CM'ing!

Bill


----
Bill Middleton
wjm@metronet.com



-- 
Bill Middleton - wjm@metronet.com



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

Date: Fri, 31 Jul 1998 19:43:17 -0700
From: "John A. Hempe" <jhempe@crossroute.com>
Subject: [Q] STDOUT to screen and file on Win32
Message-Id: <6ptvof$8hq$1@pornstorm.geo.net>


Greetings,

Subject says it all:  I want to duplicate STDOUT to a file, yet still spew
it out to the screen at the same time.

I've heard rumors of using Tied Filehandles, but the Man page for Perl
5.00471 says "this is PARTIALLY implemented now" (emphasis mine) and all the
stuff I can find on DejaNews is confusing and complicated.

Anybody have a simple, canned way of letting me get STDOUT to go to the
screen and a file simultaneously?

Thanks much,


--John Hempe
(Please cc my email:  jhempe@crossroute.com)





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

Date: 30 Jul 1998 16:56:30 GMT
From: k y n n <kj0@mailcity.com>
Subject: [Q]s on non-blocking system calls ("forks")
Message-Id: <6pq8ju$a19@news1.panix.com>





The problem: to start a non-blocking process frobozz using system()
(I'm on Unix here), and then have the parent (perl) process find out
frobozz's pid, so that the parent can suspend/restart it as necessary.

My duct-tape-&-buble-gum solution: 1) use perl's fork() to spawn a
child perl process; 2) have this child issue the system("frobozz")
call; 3) have the parent perform several chancy, totally non-portable
manipulations with the output of ps and the child's pid to figure out
frobozz's pid (it turns out to be a greatgrandchild process).

(I also reap the child and grandchild once the greatgrandchild--
frobozz--is up and running, but this is a secondary clutter-control
issue).

It works, this "solution", but I can't believe it is anywhere near the
best one can do in perl.

Can someone clue me in on a better (i.e. more robust) approach?

Thanks,

K.



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

Date: Fri, 31 Jul 1998 18:16:56 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: [Q]s on non-blocking system calls ("forks")
Message-Id: <Ewz1G8.KsL@world.std.com>

k y n n <kj0@mailcity.com> writes:

>My duct-tape-&-buble-gum solution: 1) use perl's fork() to spawn a
>child perl process; 2) have this child issue the system("frobozz")
>call; 3) have the parent perform several chancy, totally non-portable
>manipulations with the output of ps and the child's pid to figure out
>frobozz's pid (it turns out to be a greatgrandchild process).

Why not have your script just fork() and exec() "frobozz" directly?
Then the PID of 'frobozz" is the return value of fork().
-- 
Andrew Langmead


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

Date: Fri, 31 Jul 1998 18:14:01 -0500
From: "Brian H Dunford-Shore" <brian@ibc.wustl.edu>
Subject: Announce PQEdit 1.50 and RDBAL 1.10
Message-Id: <6ptj5j$5fu$1@newsreader.wustl.edu>

Version 1.50 of PQEdit and version 1.10 of RDBAL are now available.

They are available on CPAN under authors/id/B/BR/BRIAN/
or at: http://www.ibc.wustl.edu/download/perl/index.html

These versions includes numerous bug fixes as well as:

For RDBAL:
     Added alpha level support for mSQL using DBI.
For PQEdit:
     Frame (windows) per PQ Edit of a table.
     A 'View Search Set' for an overview window.
     A new parameter, pk_value, for passing a tab delimited tuple for
          specifying the record to edit.  Must have a value for
          each of the primary key fields (or all fields if there
          is no primary key).
     Passing pq_* and pqsearch_* through the login screen
          (so that PQ Edit can be called from other pages to edit
          a particular record but still have logon validation).
     Alpha level support for mSQL using DBI.
     Dumping out parameters if pqdebug=1.
     Javascript Help on Search button for help window.
     A new parameter, auto_field, blank field replacement mechanisms
          for inserts and updates.
     A new parameter, replace_field, field replacement mechanisms
          for inserts and updates.
     Readonly fields.
     Implemented nondisplay fields.

What they are:

PQ Edit is a Perl CGI script that provides general purpose,
client-independent,
web-based database table editing for relational database tables using
automatically generated CGI forms.  PQ Edit allows the editing of any
database
table as it currently exists despite any changes made to the definition
(schema) of the tables. PQ Edit provides a reasonable entry form so that the
(re)writing of data entry forms for relational databases is unnecessary most
of the time.  PQ Edit is based on the RDBAL Schema Object-a general purpose
Perl library for retrieving database definitions and for searching or
manipulating data.

RDBAL is an abstraction layer for relational (SQL) databases, which allows
middleware independent SQL execution and database schema (catalog)
information
retrieval.  RDBAL tries to 'hide' details of implementation for scripts so
that
they need no changes to run on different platforms such as Linux, Solaris,
or
Windows NT and Sybase/MS SQL server or Oracle.  The RDBAL Perl library uses
Perl 5 objects to make it easy to retrieve information about a particular
database's schema.  The database connection is cached in the schema object.
Database entities (tables, views, and procedures), their field's properties
and
their index information are retrieved when the schema object is created.
Table
primary and foreign key relationship information is also retrieved for all
tables in a database.

Currently PQ Edit and RDBAL support Transact-SQL (Sybase and MS SQL),
Oracle,
and (as an alpha release) mSQL relational database servers via SybaseDBlib,
ODBC, or DBI/DBD drivers. Other types of data sources, such as AceDB, are
possible.  PQ Edit and RDBAL have been tested and used on the Apache and
MS IIS web servers and on Solaris and Windows NT.


Name:  Brian H. Dunford-Shore
Email:  brian@ibc.wustl.edu
Homepage: http://www.ibc.wustl.edu/~brian





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

Date: Thu, 30 Jul 1998 22:07:57 +0200
From: Francois Desarmenien <desar@club-internet.fr>
Subject: ANNOUNCE: Parse::Yapp 0.14 released
Message-Id: <35C0D29D.E84D470E@club-internet.fr>

I am pleased to announce that Parse::Yapp alpha release 0.14 has been
uploaded to CPAN. It is on its way and should be available soon on 
CPAN mirror sites.

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

Parse::Yapp - Parse::Yapp  Yet Another Perl Parser compiler

Compiles yacc-like LALR grammars to generate Perl OO parser modules.

COPYRIGHT

(c) 1998 Francois Desarmenien, all rights reserved.
(see the Copyright section in Yapp.pm for usage and distribution rights)

IMPORTANT NOTES

THIS IS ALPHA SOFTWARE.

Though it has been tested a lot, there are probably bugs in it ;-)

I need FEEDBACK for every problem or bug you could encounter so I can
fix
them in the next release. Comments are welcome too.
But I also need FEEDBACK if you use it and have it work fine so I can
step
to beta and production releases. Just drop me a mail.

The Parse::Yapp pod section is the main documentation and it assumes
you already have a good knowledge of yacc. If not, I suggest the GNU
Bison manual which is a very good tutorial to LALR parsing and yacc's
grammar syntax.

The documentation is only a draft and should be rewritten (I think).
Any help on this issue would be very welcome.

DESCRIPTION

This is the alpha release 0.14 of the Parse::Yapp parser generator.

It lets you create Perl OO fully reentrant LALR(1) parser
modules (see the Yapp.pm pod pages for more details) and has
been designed to be functionnaly as close as possible to yacc,
but using the full power of Perl and opened for enhancements.

REQUIREMENTS

Requires perl5.004 or better :)

It is written only in Perl, with standard distribution modules,
so you don't need any compiler nor special modules.

INSTALLATION

perl Makefile.PL
make
make test
make install

WARRANTY

This software comes with absolutly NO WARRANTY of any kind.
I just hope it can be useful.


FEEDBACK

Send feedback, comments and bug reports to:

Francois Desarmenien
desar@club-internet.fr



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

Date: Thu, 30 Jul 1998 14:23:41 GMT
From: h_o_t_r_o_d@my-dejanews.com
Subject: Associative array of associative arrays
Message-Id: <6ppvlc$u4r$1@nnrp1.dejanews.com>

Does anyone know if it's possible to create an associative array of
associative arrays?  If so, could you give me an example?  I've tried, but it
doesn't seem to be working.  Please reply by e-mail.  Thanks,

Andrew

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 30 Jul 1998 14:50:29 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Associative array of associative arrays
Message-Id: <901810833.280407@thrush.omix.com>

[posted & mailed]

h_o_t_r_o_d@my-dejanews.com wrote:
: Does anyone know if it's possible to create an associative array of
: associative arrays?  If so, could you give me an example?  I've tried, but it
: doesn't seem to be working.  Please reply by e-mail.  Thanks,

	RTFantasticM: perlref perllol perldsc

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Thu, 30 Jul 1998 15:51:05 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Associative array of associative arrays
Message-Id: <35C08859.87FF78D4@nortel.co.uk>

h_o_t_r_o_d@my-dejanews.com wrote:
> 
> Does anyone know if it's possible to create an associative array of
> associative arrays?  If so, could you give me an example?  I've tried, but it
> doesn't seem to be working.  Please reply by e-mail.  Thanks,
> 

%hash1 = qw/1 Thou 2 shalt 3 read/;
%hash2 = qw/1 the 2 perldsc 3 documentation!/;

%main = ('*groan*' => \%hash1, '*sigh*' => \%hash2);

foreach $key(sort keys %main) {
  print "$key\n";
  foreach $key2(keys %{$main{$key}}) {
    print "$main{$key}{$key2} ";
  }
  print "\n";
}

-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


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

Date: Fri, 31 Jul 1998 21:59:41 +0200
From: Thomas Jespersen <thomas@daimi.aau.dk>
Subject: Re: Associative array of associative arrays
Message-Id: <35C2222D.C05B0B57@daimi.aau.dk>

Zenin wrote:
> 
> [posted & mailed]
> 
> h_o_t_r_o_d@my-dejanews.com wrote:
> : Does anyone know if it's possible to create an associative array of
> : associative arrays?  If so, could you give me an example?  I've tried, but it
> : doesn't seem to be working.  Please reply by e-mail.  Thanks,
> 
>         RTFantasticM: perlref perllol perldsc

Well, I think you know it know by the replies, I just want to add that
you might want to read this article:

http://www.plover.com/~mjd/FAQs/references.html

on the subject. It is really good.

(Sorry Zenith, I did not have the original posting, so I replied this
mail)


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

Date: Thu, 30 Jul 1998 11:18:56 -0500
From: Indra Rosadi <rosadi@students.uiuc.edu>
Subject: binary uploading..
Message-Id: <Pine.SOL.3.96.980730111431.17162A-100000@ux10.cso.uiuc.edu>

Hi,
I have a problem with binary uploading..
I tried to do the following code as part of my uploading code:



 ....

open(OUTFILE,">>$fileLocation");

# $filename is a variable that contains file handle from file
# referenced in a filefield
while ($bytesread = read($filename,$buffer,1024){
	print  OUTFILE $buffer;
}
close $filename; 
 ....

It seems like the copied file becomes a little bit bigger than the
original file..

Anybody know what's going on? Any suggestion, comments will be
appreciated..

thanks

indra

--------------------------------------------------------------------------
"The position from which you view your reality will change your perception
of its nature"
	- Neon Genesis Evangelion 



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

Date: 29 Jul 1998 01:16:43 -0500
From: tye@fumnix.metronet.com (Tye McQueen)
Subject: Re: Calling a dll from Perl
Message-Id: <6pmeob$ph3@fumnix.metronet.com>

John Call <johnc@interactive.ibm.com> writes:
) I am writing some code for a NT project and need to call a dll. I have
) Learnng Perl on Win32 Systems and did not see a reference to this.
) 
) From what I have seen I need the Win32::API module. Is this correct. I
) looked on CPAN and could not find it and then saw a note on DejaNews
) that said that Win32::API was not on CPAN. Who knows?

Personally I'd write an XS module which means you need
Perl5.004 or later and a C compiler.  See perlxstut.pod.
For advanced stuff, see also perlxs.pod and perlguts.pod,
For an example, see my Win32API::Registry from CPAN.

A recent location of Win32::API can be found easily via
http://www.dejanews.com/ by searching for Win32::API within
the comp.lang.perl* newsgroups.
-- 
Tye McQueen    Nothing is obvious unless you are overlooking something
         http://www.metronet.com/~tye/ (scripts, links, nothing fancy)


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 3295
**************************************

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