[10710] in Perl-Users-Digest
Perl-Users Digest, Issue: 4309 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 27 17:07:22 1998
Date: Fri, 27 Nov 98 14:00:20 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 27 Nov 1998 Volume: 8 Number: 4309
Today's topics:
Re: debugging forks (Ilya Zakharevich)
help-new <rainbowend@earthlink.net>
How could I "EXPORT" Variables from one script to anoth <guillaume@sandtechnology.com>
list processes vicengle@ix.netcom.com
locking files in Perl <andre@airmail.net>
locking files <marty@catnmoose.com>
newbie NEEDS HELP (J. J. Goodrich)
Newbie question: Executing scripts under Win95 jlhughes@pobox.com
Re: Newbie: Need to split comma-delimited data into sca (Simon Whitaker)
Re: Password Protected Sites ? <webmaster@dvd-dream.com>
Problem with Sybase::CTlib after upgrade <gst@avenir.no>
PROPOSAL: XML based Make for C++, Perl, Python, Java <Pluto@nospam.com>
quote & print confusion <marty@catnmoose.com>
Re: quote & print confusion <andy@focus-consulting.co.uk>
statement as "#include" in C <jinsy@iname.com>
Re: statement as "#include" in C (Matthew Bafford)
Re: sysread / need help w/ single byte I/O, urgent! pl (Ralph Forsythe)
Re: Trouble using format (newbie) <andy@focus-consulting.co.uk>
variable interpolation inside a hash <bsat@iprolink.ch>
Re: variable interpolation inside a hash (Matthew Bafford)
Re: variable interpolation inside a hash (Larry Rosler)
Re: variable interpolation inside a hash <r28629@email.sps.mot.com>
Re: Win32 and Perl modules (was Re: HELP !can't use GD. ernie_oporto@mentorg.com
Re: Win32 and Perl modules (was Re: HELP !can't use GD. dturley@pobox.com
Win32::API programming <carvdawg@patriot.net>
Re: Y2K and Programmer Denial <upsetter@ziplink.net>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 27 Nov 1998 19:38:34 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: debugging forks
Message-Id: <73mv3q$2j6$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to TS
<fx77@dial.pipex.com>],
who wrote in article <73m2dq$5da$1@plug.news.pipex.net>:
> If I strip the child code out of the program it works fine, but in this
> construction it fails under certain circumstances. When I try to debug this
> code the debugger seems to stay always in the parent process. Can anyone
> tell me how I can get the debugger to debug the child code?
Apparently you have a very old Perl. Upgrade.
Ilya
------------------------------
Date: Fri, 27 Nov 1998 15:56:02 -0800
From: Gary & Dianne Black <rainbowend@earthlink.net>
Subject: help-new
Message-Id: <365F3C12.4976D084@earthlink.net>
This is a multi-part message in MIME format.
--------------BD26C25B374C95CC5B8BA91A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I need to learn cgi and perl for a project. What is the best way? I
know html and need more especially how to add a shopping cart to a
website. Can anyone advise me on the best way to go about this.
Thanks, Dianne Black
--
Sincerely
Gary & Dianne Black
Rainbow's End LaManchas occasionally a Recorded Grade
http://home.earthlink.net/~rainbowend/
20 year 4-H advisor to Pet-Pourri 4-H Club
--------------BD26C25B374C95CC5B8BA91A
Content-Type: text/x-vcard; charset=us-ascii;
name="rainbowend.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Gary & Dianne Black
Content-Disposition: attachment;
filename="rainbowend.vcf"
begin:vcard
n:;Dianne Black
x-mozilla-html:TRUE
version:2.1
email;internet:rainbowend@earthlink.net
x-mozilla-cpt:;0
fn:Dianne Black
end:vcard
--------------BD26C25B374C95CC5B8BA91A--
------------------------------
Date: 27 Nov 1998 11:56:59 PST
From: Guillaume Dupuis <guillaume@sandtechnology.com>
Subject: How could I "EXPORT" Variables from one script to another?
Message-Id: <365FAD04.C1C6F855@sandtechnology.com>
This is my situation:
I have to re-write +-800 korn shell scripts into perl (I really do...),
for the scripts to be compatible under multiple platforms (which are all
supported under PERL...). I have been scripting perl for the past 2
years (that would qualify me as a intermediate...).
This is my problem:
We have one main script that calls 'child' scripts (All PERL
scripts...), that themselves call 'child' scripts. Under Korn shell,
this is not a problem, when you declare variables x,y,z in the
'parent'-most script, you can call those variables anywhere in the two
other 'child' scripts. My problem being that I don't know how to execute
that under perl. I have tried unsuccessfully to execute those 'child'
scripts, by calling them with:
...
$scr_1 = system("perl script1.pl");
...
And as you can figure it out, I've failed.
What I would like:
Define the majority of my variables in the "main" module (script), and
use those variables in all the other 'child' processes.
Thanks in advance for your help!!
--
Guillaume Dupuis,
Nucleus QA
mailto:guillaume@sandtechnology.com
http://www.sandtechnology.com
------------------------------
Date: Fri, 27 Nov 1998 20:25:58 GMT
From: vicengle@ix.netcom.com
Subject: list processes
Message-Id: <73n1s9$kje$1@nnrp1.dejanews.com>
I have written a perl script on an NT system and I need to find out all the
processes that are running on the NT machine when I start the script. Is there
a way to list processes on an NT system. I'm looking for the equivalent of
ps -ef
in Unix.
Please email vicengle@netscape.net
Thanks,
vic
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 27 Nov 1998 13:44:29 -0600
From: "Andre Kopostynski" <andre@airmail.net>
Subject: locking files in Perl
Message-Id: <F3728B89C304ED74.1B7E6C98769C20D6.19528F2F710DE48E@library-proxy.airnews.net>
I'm trying to lock my counter file in anticipating multiple users submitting
their results simultaneously on my online questionnaire form. Here's what I
have. it's working fine, but how do I lock the file until the submission is
completed and how do I unlock for next submission?
Your expertise is greatly appreciated.
# Beginning of writefile function
sub writetofile {
# Creating a variable the value of which is the name of the counter file
$counter_file = "counter.file";
# Opening the counter file and reading the next number from this file
open (FILE, "<" . $counter_file);
$next_numb = <FILE>;
close (FILE);
# Opening the counter file again and rewriting the next number to this file
$next_numb++;
open (FILE, ">" . "counter.file");
print FILE $next_numb;
close (FILE);
------------------------------
Date: Fri, 27 Nov 1998 15:46:57 -0500
From: Marty Landman <marty@catnmoose.com>
To: andre@airmail.net
Subject: locking files
Message-Id: <365F0FC1.72F4609C@catnmoose.com>
do it like this:
# Beginning of writefile function
sub writetofile {
# Creating a variable the value of which is the name of the counter file
$counter_file = "counter.file";
# Opening the counter file and reading the next number from this file
open (FILE, "<" . $counter_file);
flock(FILE, 2);
$next_numb = <FILE>;
flock(FILE, 8);
close (FILE);
# Opening the counter file again and rewriting the next number to this
file
$next_numb++;
open (FILE, ">" . "counter.file");
flock(FILE, 2);
print FILE $next_numb;
flock(FILE, 8);
close (FILE);
"Andre Kopostynski" wrote:
I'm trying to lock my counter file in anticipating multiple users
submitting
their results simultaneously on my online questionnaire form. Here's
what I
have. it's working fine, but how do I lock the file until the
submission is
completed and how do I unlock for next submission?
Your expertise is greatly appreciated.
--
_____ Marty Landman _______ http://www.catnmoose.com/ ______
Living Glass http://www.catnmoose.com/livinglass
Mountain Man http://www.catnmoose.com/mountainman
__________Cat 'n Moose Web Site Design & Development_________
------------------------------
Date: Fri, 27 Nov 1998 16:16:41 -0500 (EST)
From: JJ353@webtv.net (J. J. Goodrich)
Subject: newbie NEEDS HELP
Message-Id: <14355-365F16B9-9@newsd-199.iap.bryant.webtv.net>
Hello allim trying to make this script work for my homepage someone gave
it to me and ive attempted to edit it some at the bottom are some of my
questions heres the script
#!/usr/local/bin/perl/
$HOME =3D "http://corp-alliance.hypermart.net"; $CGI =3D $HOME .
"spy123.cgi";
if ($ARGV[0] eq '-local') {
$in{game} =3D <STDIN>;
chop $in{game};
while (<STDIN>) {
=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 $in{text} .=3D $_;
=A0=A0=A0=A0}
} else {
require 'cgi-lib.pl';
print &PrintHeader;
&ReadParse;
};
$date =3D `date`;
chop $date;
print "<title> CF Spy Reports</title>";
print "<body bgcolor=3D#000000 text=3D#00ff00 link=3D#00ffff vlink=3D#aaaa=
00>";
#print "<li> Back to <a
href=3D"http://corp-alliance.hypermart.net/members/>Member Menu</a><br>";
print "<li> To <a href=3D1A/spy/>1A Spy Reports</a><br><br>"; if
($in{submit} eq "Clear Form") {
=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 print "Form Cleared<br>";
=A0 =A0 =A0 undef $in{text};
=A0 =A0 =A0 &print_form;
=A0 =A0 =A0 exit;
}
&error("Missing game (1A, etc)") unless defined $in{game}; &error("Badly
formatted game id ($in{game})")
=A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 =A0 unless ($in{game} =3D~
/^[1-2][A-Z]$/);
&error("") unless defined $in{text};
#&error("Badly formatted id ($in{id})") if ($in{id} !~ /^\d+$/);
#&error("Where is that spy report?") unless $in{text};
$SPYDIR =3D "$in{game}/spy/";
$TARGETDIR =3D "/var/home/denis/webpages/earth/" . $SPYDIR; $LOG =3D
$TARGETDIR . "spy.log";
$INDEX =3D $TARGETDIR . "index.htm";
# was it correct?
undef $name,$number;
while ($in{text} =3D~ m/(.+)/g)
{
=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 if ($foundhead) {
=A0 =A0 =A0 =A0 =A0 =A0 =A0 $foundhead =3D 0;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 ($name,$number) =3D $1 =3D~ m,<FONT.+>(.+)
\(\#(\d+)\)</FONT>,; }
=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 $foundhead=3D1 if ($1 =3D~ /<TH>Countr=
y
Name/);
}
if (!defined $name) { # try AOL report
while ($in{text} =3D~ m/(.+)/g)
=A0=A0=A0=A0{
=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 if ($foundhead) {
=A0 =A0 =A0 =A0 =A0 =A0 =A0 $foundhead =3D 0;
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 =A0 =A0 =A0
=A0 ($name,$number) =3D "$namestart$1" =3D~ m,(.+) \(\#(\d+)\),;
}
=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 if ($1 =3D~ /Country Name (.+)/) {
=A0 =A0 =A0 =A0 =A0 $foundhead=3D1;
=A0 =A0 =A0 =A0 =A0 $namestart =3D $1;
=A0=A0=A0=A0=A0=A0=A0=A0}
=A0=A0}
}
&error("Improper report - Couldn't find country name and number. Make
sure it is the HTML code for the spy report.")
=A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 =A0 unless defined $name;
$in{id} =3D $number;
# index
open(INDEX,"<$INDEX") || do {
=A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 =A0 open(INDEX,">$INDEX") ||
&error("Could not create index file");
print INDEX <<index;
<title> CF Spy Reports</title><body bgcolor=3D#000000 text=3D#00ff00
link=3D#00ffff vlink=3D#aaaa00><li> Back to <a
href=3Dhttp://corp-alliance.hypermart.net/members>Member Menu</a><br><br>
<table border=3D1>
<tr><td>Updated</td><td>Number</td><td>Country</td></tr> </table>
</body>
</html>
index
=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 close INDEX;
=A0 =A0 =A0 chmod 0660,"$INDEX";
=A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 =A0 open(INDEX,"<$INDEX") ||
&error("Could not read index file"); };
while (<INDEX>) {
=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 if (/<td>#(\d+)/) {
=A0 =A0 =A0 =A0 =A0 =A0 =A0 if ($1 eq $number) {
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0
=A0 } else { $index .=3D $_ }
=A0 =A0 =A0 } elsif (m,</table>,) {
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0
=A0 $index .=3D "<tr><td>$date</td><td>#$number</td><td><a
href=3D$HOME$SPYDIR$number.htm>$name</a></td></tr>\n$_"; =A0 =A0 } else {
$index .=3D $_; }
}
close INDEX;
open (INDEX,">$INDEX") || &error("Could not write new index file");
print INDEX $index;
close INDEX;
# posting, get name
open(SPY,">$TARGETDIR$in{id}.htm") || &error("Could not write spy
report"); print SPY "<body bgcolor=3D#000000 text=3D#ffffff link=3D#ffeecc=
vlink=3D#ffddbb><font link=3D#00ff00 vlink=3D#00ff00 size=3D+1><a
href=3D\"$HOME$SPYDIR\">To Spy Report List</a></font><br>"; print SPY
$in{text}; close SPY; chmod 0660,"$TARGETDIR$in{id}.htm"; print "Spy
report posted for $name (#$in{id}): <a href=3D$HOME$SPYDIR$in{id}.htm>
Test it</a><br>"; &log("$date $in{id} IP:$ENV{REMOTE_ADDR}
HOST:$ENV{REMOTE_HOST}\n"); undef $in{id};
undef $in{text};
&print_form;
sub log {
local($msg) =3D @_;
open(LOG,">>$LOG");
print LOG $msg;
close LOG;
chmod 0660,"$LOG";
}
sub print_form {
=A0 =A0 =A0 print <<FORM;
<form action=3D"$CGI" method=3DPOST value=3D"$in{id}"> GAME <input type=3D=
text
name=3Dgame size=3D2 value=3D"$in{game}"><!br> <!input type=3Dtext name=3D=
id
size=3D4> <input type=3Dsubmit value=3D"Submit Spy Report"><br> SPY REPORT=
<b>(Copy and Paste the HTML source)</b> <br> <textarea name=3Dtext cols=3D=
80
rows=3D20>
$in{text}
</textarea><br>
<input type=3Dsubmit name=3Dsubmit value=3D"Clear Form"> </form>
</body>
</html>
FORM
}
sub error {
=A0 =A0 =A0 print "ERROR: " . $_[0] if $_[0] ne "";
=A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 =A0 &log("$date $in{id}
IP:$ENV{REMOTE_ADDR} HOST:$ENV{REMOTE_HOST} ERROR: " . $_[0] . "\n");
$in{game} =3D '1A' unless ($in{game} =3D~ /^[1-2][A-Z]$/); &print_form;
exit;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=A0=A0}
} else {
require 'cgi-lib.pl';
print &PrintHeader;
&ReadParse;
};
$date =3D `date`;
chop $date;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To <a href=3D1A/spy/>1A Spy
Reports</a><br><br>";
if ($in{submit} eq "Clear Form") {
=A0 =A0 =A0 print "Form Cleared<br>";
=A0 =A0 =A0 undef $in{text};
=A0 =A0 =A0 &print_form;
=A0 =A0 =A0 exit;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$SPYDIR =3D "$in{game}/spy/";
$TARGETDIR =3D "/var/home/denis/webpages/earth/" . $SPYDIR; $LOG =3D
$TARGETDIR . "spy.log";
$INDEX =3D $TARGETDIR . "index.htm";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<a href=3D\"$HOME$SPYDIR\">To Spy Report List</a></font><br> @@Does the
Home SpyDir Make it self What is the addy of this do i need to create a
directorty for this if so what do i calll it@@@@
"; print SPY $in{text}; close SPY; chmod 0660,"$TARGETDIR$in{id}.htm";
@@What is the TARGETDIR@@
print "Spy report posted for $name (#$in{id}): <a
href=3D$HOME$SPYDIR$in{id}.htm> Test it</a><br>";
@@@Please Explain the HOME$SPYDIR$@@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
open(LOG,">>$LOG");
@@Do i make fiile log@@
@@@@@@@@@@@@@@@@@@@Other Questions:
1.) What files do i need to create to make this script work
2.) What directories do i need to amke
3.) Do i need a cgi-lib if so what is a cgi-lib
4.) What is the log file or whatever
5.) What is a cgi-lib file and how do i make one there are many urls on
this script like at the very top spy123.cgi for that file i just need to
upload this in ascii mode and name it spy123.cgi insteadof the txt i
have it now what about the file directories like spydir
and all that do i need to create them or does the script
6.) what is the chmod number allt hese files have to be in
7.) is there anything else i ahve to do on hypermart to make this script
work if your eon hypermart and run cgi please email me i ahve lots of
questions
JJ353@webtv.net
I dont post here much so please amil any results or reply tot his post
to me at the above address
------------------------------
Date: Fri, 27 Nov 1998 18:36:04 GMT
From: jlhughes@pobox.com
Subject: Newbie question: Executing scripts under Win95
Message-Id: <73mrej$fa7$1@nnrp1.dejanews.com>
I'm learning Perl for use with CGI. I've installed Perl on my Win95 machine
so I can work locally on the lessons.
When I execute a script by double-clicking on the file in explorer or in the
run command, the perl DOS window opens, the script executes, the output
displays and then immediately the perl window closes before I can read the
results.
Is there a PAUSE command I can add to the end of scripts to force the window
to stay open? Or is there a better way to run these scripts so that I can see
the output?
John Hughes
--
http://come.to/digital_art_desktops
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 27 Nov 1998 21:11:50 GMT
From: spam@netcetera.org (Simon Whitaker)
Subject: Re: Newbie: Need to split comma-delimited data into scalars or an array.
Message-Id: <36601568.7023674@news.u-net.com>
On Fri, 27 Nov 1998 16:53:12 GMT, tcpeter@iname.com wrote:
> Can anyone point me in
> the right direction, (and hopefully something more explicit or easier for a
> newbie than the Perl docs)?
Hi Tim,
Speaking as a newbie myself I can hopefully answer both queries in one, in
reverse order. The following is extracted from the excellent "Learning Perl"
written by Randal L. Schwartz and Tom Christiansen and published by
O'Reilly, which I heartily recommend:
$line = "merlyn::118:10:Randal:/home/merlyn:/usr/bin/perl";
@fields = split(/:/,$line); # split $line, using : as delimiter
# now @fields is ("merlyn","","118","10","Randal",
# "/home/merlyn","usr/bin/perl")
In your case you'd want to set the comma to be the delimiter, i.e.:
@fields = split(/,/);
I've just cobbled together a little sample app and data file and it works a
treat, although I await corrections, criticisms etc with bated breath. :)
We newbies should stick together. Go forth and code, brother!
All the best,
Simon
--
My friends went to alt.california, and all they brought
me was this lousy sig.
[Please change spam to simon when replying by mail.]
------------------------------
Date: Fri, 27 Nov 1998 19:27:26 +0100
From: Webmestre DVD DREAM <webmaster@dvd-dream.com>
Subject: Re: Password Protected Sites ?
Message-Id: <365EEF0E.FB68A49E@dvd-dream.com>
Philip Class wrote:
> What are possible solutions for password protected sites ?
Apache web server is doing this quite well without any Perl script. Try this in
your httpd.conf (Apache 1.3.3 compliant)
<directory /home/your.site/any.dir>
AuthType Basic
AuthName "Restricted Area"
AuthUserFile /home/restricted.authfile
<Limit GET POST>
require valid-user
</Limit>
</directory>
Combine this with htpasswd to create your restricted.authfile. Works great.
Hope this helps!
DVD DREAM
http://www.dvd-dream.com
------------------------------
Date: 27 Nov 1998 18:16:36 GMT
From: "Glenn Stxlen" <gst@avenir.no>
Subject: Problem with Sybase::CTlib after upgrade
Message-Id: <01be1a32$52408680$3f026a96@compaq-003.avenir.no>
Hi!
We have upgraded to Perl 5.004 04 (binary distribution, source from
ftp://ftp.cise.ufl.edu/pub/perl/CPAN/src/5.0) from 5.002 on
Solaris 2.5.1.
I had no problems installing the new version, but when trying to
run a perl-program (that used to work with perl 5.002), I got the
following error message:
>>Can't load
/opt/lib/perl5/site_perl/sun4-solaris/auto/Sybase/CTlib/CTlib.so' fo
>>r module Sybase::CTlib: ld.so.1: /usr/bin/perl: fatal: relocation error:
file /o
>>pt/lib/perl5/site_perl/sun4-solaris/auto/Sybase/CTlib/CTlib.so: symbol
sv_undef:
>>referenced symbol not found at
/usr/local/lib/perl5/sun4-solaris/5.00404/DynaLo
>>ader.pm line 166.
>>at parse.pl line 20
>>BEGIN failed--compilation aborted at parse.pl line 20.
>>ultra%
line 20 in parse.pl is:
>>use Sybase::CTlib();
We have sybperl 2.05 installed fom before.
Does anybody know what the problem is ?
Is there a way to go back (uninstall !!) ?
TIA
Glenn Stxlen (gst@avenir.no)
------------------------------
Date: Fri, 27 Nov 1998 11:45:34 -0800
From: Pluto <Pluto@nospam.com>
Subject: PROPOSAL: XML based Make for C++, Perl, Python, Java
Message-Id: <365F015D.4B86DE60@nospam.com>
Perl, Python,etc are scripting languages that I use and that make me
very productive relative to the systems level languages like Java and
C++ (that I also use). There is a lot of innovation in both scripting
and system languages. But Make stays the same - and cryptic as ever.
So, I was hoping to challenge the more knowledgeable people on these
newsgroups (Perl, Python, Java, C++) to cooperate and bring Make into
the 90s. I was hoping to use an XML grammar to describe the Makefile.
The goals for this project:
1) Increase productivity by atleast 200%, while reducing typical
makefile lines of code by 50%.
2) Use a well defined XML standard.
3) Very human-readable.
4) X-Platform (Must run on Linux, NT, Solaris, AIX, HP-UX, others)
5) X-Language (Must work for C++, Perl, Python, Java, others)
Perl's MakeMaker is a wonderful tool. And Perl is very popular (I like
Python too!). So, I was hoping to get the Perl community to lead us to
the promised land by redoing MakeMaker using the above requirements.
And I also hope that Python, Java and C++ will aggresively build on
this. For details on Perl's MakeMaker:
http://www.perl.com/CPAN/doc/manual/html/lib/ExtUtils/MakeMaker.html
====================================
luckily, while doing a dejanews search, I came across a very interesting
discussion on "perl.porters-gw". See the post below by mike808@mo.net:
<module name="My::Module" version="0.01">
<prereqs>
<prereq>Some::Package 1.23</prereq>
<prereq>Other::Module 4.56</prereq>
</prereqs>
<files base="/the">
<file><path full>/the/first/module/</dir>file</file>
<file><path relative="base">/second/module/</dir>file</file>
<file><path relative="current">module/</dir>file</file>
</files>
<other>any other data</other>
</module>
Some ideas/projects immediately spring to mind:
a MakeMaker package definition DTD?
a converter from current MakeMaker format to the DTD XML format?
a MakeMaker modification to understand the new DTD?
an autodetect in MakeMaker to determine the makefile.PL format and
parse appropriately.
Create Data::Dumper::XML?
====================================
Are the Perl MakeMaker team ready to lead?
------------------------------
Date: Fri, 27 Nov 1998 13:58:20 -0500
From: Marty Landman <marty@catnmoose.com>
Subject: quote & print confusion
Message-Id: <365EF64C.79307265@catnmoose.com>
I'm trying to save a line of code if possible by saying
print "<td>substr($rhs,$i,1)</td> \n";
rather than
$myguy = substr($rhs,$i,1);
print "<td>$myguy</td> \n";
Is this doable? What am I missing? It is obvious (to those reading
this with a knowing grin) that what my browser is rendering from my one
liner above is
<td>substr(eqzrluz,0,1)</td> rather than the desired <td>e</td>
tia
--
_____ Marty Landman _______ http://www.catnmoose.com/ ______
Living Glass http://www.catnmoose.com/livinglass
Mountain Man http://www.catnmoose.com/mountainman
__________Cat 'n Moose Web Site Design & Development_________
------------------------------
Date: Fri, 27 Nov 1998 19:33:57 +0000
From: Andy Mendelsohn <andy@focus-consulting.co.uk>
Subject: Re: quote & print confusion
Message-Id: <365EFEA5.C168F994@focus-consulting.co.uk>
Marty Landman wrote:
>
> I'm trying to save a line of code if possible by saying
>
> print "<td>substr($rhs,$i,1)</td> \n";
>
> rather than
>
> $myguy = substr($rhs,$i,1);
> print "<td>$myguy</td> \n";
>
> Is this doable? What am I missing? It is obvious (to those reading
> this with a knowing grin) that what my browser is rendering from my one
> liner above is
>
> <td>substr(eqzrluz,0,1)</td> rather than the desired <td>e</td>
>
> tia
> --
> _____ Marty Landman _______ http://www.catnmoose.com/ ______
>
> Living Glass http://www.catnmoose.com/livinglass
> Mountain Man http://www.catnmoose.com/mountainman
>
> __________Cat 'n Moose Web Site Design & Development_________
You're just missing a couple of commas.
print "<td>",substr($rhs,$i,1),"</td>\n";
------------------------------
Date: Sat, 28 Nov 1998 02:28:07 +0800
From: Jin Shunyao <jinsy@iname.com>
Subject: statement as "#include" in C
Message-Id: <365EEF35.DB6C127B@iname.com>
Hi,
Have there a statement that can include a file from another file in
perl language? Just like #include "file" in C.
regards
Jin
------------------------------
Date: Fri, 27 Nov 1998 13:45:42 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: statement as "#include" in C
Message-Id: <MPG.10c8bd62a87b1262989742@news.scescape.net>
[Followups set]
In article <365EEF35.DB6C127B@iname.com>, jinsy@iname.com says...
=> Hi,
=>
=> Have there a statement that can include a file from another file in
=> perl language? Just like #include "file" in C.
The closest would be 'do'.
=> regards
HTH!
=> Jin
--Matthew
--
# clp is no longer a valid newsgroup. For a much better chance of
# getting your question or comments noticed, please move your
# discussions to either comp.lang.perl.moderated, or comp.lang.perl.misc.
------------------------------
Date: 27 Nov 1998 20:36:26 GMT
From: ralph@centerone.com (Ralph Forsythe)
Subject: Re: sysread / need help w/ single byte I/O, urgent! please!
Message-Id: <73n2ga$bj4$1@news-2.csn.net>
Ok, here is the latest effort, which doesn't work either but will show the
general direction I've been headed:
(note, $fh1 is fileno()'d to filehandle PORT1, which is read/write on
/dev/cuaa1)
sub ADCAction {
vec ($rin, $fh1, 1) = 1;
select($rout=$rin, $wout=$win, $eout=$ein, 1);
if ($adc_action='CKADC') { # <- adc_action variable set by main loop
print PORT1 "!0RA",chr(3);
if (vec($rout, $fh1, 1)) {
for ($icnt = 1; $icnt < 3; $icnt++) {
sysread (PORT1, $input, 1);
$MSB = ord($input)*256;
sysread (PORT1, $input2, 1);
$LSB = ord($input2);
print "MSBx256 $MSB and LSB $LSB\n";
$ch = $MSB+$LSB;
$chnum = 4 - $icnt;
print "Read number $icnt: $ch\n";
}
}
}
sleep 1;
}
It reads one time then hangs, giving me a value that ain't even close to what
it should be. According to the book, the total value should equal a max of
4095. See prior basic code for what they wrote. Note that I also tried the
getc() function with no better results.
Thanks,
Ralph
In article <1dj0vit.16sjqjwldijngN@bos-ip-1-61.ziplink.net>, >Rewriting this in
Perl is exactly what Ralph wants to do. But what he
>came up with didn't work. Hopefully he'll post the Perl code he wrote,
>and we can find the problem. :-)
------------------------------
Date: Fri, 27 Nov 1998 19:11:00 +0000
From: Andy Mendelsohn <andy@focus-consulting.co.uk>
Subject: Re: Trouble using format (newbie)
Message-Id: <365EF943.A2922031@focus-consulting.co.uk>
Paul Deshaies wrote:
>
> This is what I'm trying to do:
>
> open (ORDER, ">>orders.info") || die"Could not open orders.info file";
> write;
> close ORDER;
>
> format ORDER_TOP =
> _____________________________________________________________________________
> .
> format ORDER =
> @<<<<<<<<<<< @||||||||||||||||||||||| @>>>> @>>>>>>>>
> @>>>>>>>>>>
> $uid, $orderedDocument, $quantite,$date, $time
> .
>
> and this is the error I get:
>
> Format not terminated in file upDateOrder.pl at line 359, next char ^?
> Execution of upDateOrder.pl aborted due to compilation errors.
>
> What am I missing.
>
> pd
Some of what you're missing is :
1) your write statement is not looking to write to ORDER but to STDOUT
2) The error you should get is something like :
Undefined format : "main::STDOUT" at line xxx
3) I'm assuming the the @>>>>>> on the second line following format
ORDER is in fact there only as a result of mail formating and that it
should be one continuous line, otherwise that would give you an error as
well. If I'm wrong then you need to do this :
@<<<<<<<<<<< @||||||||||||||||||||||| @>>>> @>>>>>>>>
$uid, $orderedDocument, $quantite,$date
@>>>>>>>>>>
$time
This works :
open (ORDER, ">>orders.info") or die "Could not open orders.info
file\n";
write ORDER;
close ORDER;
format ORDER_TOP =
_____________________________________________________________________________
.
format ORDER =
@<<<<<<<<<<< @||||||||||||||||||||||| @>>>> @>>>>>>>>
@>>>>>>>>>>
$uid, $orderedDocument, $quantite, $date, $time
.
But I don't think this accounts for : Format not terminated in file
upDateOrder.pl at line 359, next char ^?
Andy
------------------------------
Date: Fri, 27 Nov 1998 21:06:38 +0100
From: Maan Bsat <bsat@iprolink.ch>
Subject: variable interpolation inside a hash
Message-Id: <365F064E.79331032@iprolink.ch>
Hi,
I need to access data that is in a hash, and the keys are numbered. So
I'm trying to do something like $myvar{"name_$i"} so that when $i = 1,
it would give me the value $myvar{'name_1'}. How can I do it, since it
doesn't really like it...
Maan
bsat@iprolink.ch
PS: An answer by e-mail would be greatly apreciated. Thanks.
------------------------------
Date: Fri, 27 Nov 1998 15:14:23 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: variable interpolation inside a hash
Message-Id: <MPG.10c8d22bfc0e8ce4989743@news.scescape.net>
[This followup was posted to comp.lang.perl.misc and a copy was sent to
the cited author.]
In article <365F064E.79331032@iprolink.ch>, bsat@iprolink.ch says...
=> Hi,
=>
=> I need to access data that is in a hash, and the keys are numbered. So
=> I'm trying to do something like $myvar{"name_$i"} so that when $i = 1,
=> it would give me the value $myvar{'name_1'}. How can I do it, since it
=> doesn't really like it...
$myvar{'name_' . $i}
HTH!
=> Maan
--Matthew
------------------------------
Date: Fri, 27 Nov 1998 12:53:21 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: variable interpolation inside a hash
Message-Id: <MPG.10c8b119427147c898992a@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <MPG.10c8d22bfc0e8ce4989743@news.scescape.net> on Fri, 27 Nov
1998 15:14:23 -0500, Matthew Bafford <dragons@scescape.net> says...
> In article <365F064E.79331032@iprolink.ch>, bsat@iprolink.ch says...
> => I need to access data that is in a hash, and the keys are numbered. So
> => I'm trying to do something like $myvar{"name_$i"} so that when $i = 1,
> => it would give me the value $myvar{'name_1'}. How can I do it, since it
> => doesn't really like it...
>
> $myvar{'name_' . $i}
But this is *identical* to the construction that wasn't "really like"d
(whatever that means). Why should this be liked any better?
Both ways of expressing it seem perfectly sound to me. The only thing
that might go wrong is sorting on keys when $i > 9, but that wasn't
mentioned. One way around that would be
$myvar{sprintf 'name_%.4d', $i};
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 27 Nov 1998 15:13:16 -0500
From: Tk Soh <r28629@email.sps.mot.com>
To: Maan Bsat <bsat@iprolink.ch>
Subject: Re: variable interpolation inside a hash
Message-Id: <365F07C1.A120F1C6@email.sps.mot.com>
[posted to c.l.p.m and copy emailed]
Maan Bsat wrote:
>
> Hi,
>
> I need to access data that is in a hash, and the keys are numbered. So
> I'm trying to do something like $myvar{"name_$i"} so that when $i = 1,
> it would give me the value $myvar{'name_1'}. How can I do it, since it
> doesn't really like it...
>
> Maan
> bsat@iprolink.ch
>
> PS: An answer by e-mail would be greatly apreciated. Thanks.
Worked for me! Perhaps you should post part of you code (and data if
necessary), so someone could help.
#####################################
DB<18> X n
$n = 1
DB<19> X h
%h = (
'a1' => 23
'b_1' => 55
)
DB<20> p $h{"b_$n"}
55
#####################################
-TK
------------------------------
Date: Fri, 27 Nov 1998 19:14:02 GMT
From: ernie_oporto@mentorg.com
Subject: Re: Win32 and Perl modules (was Re: HELP !can't use GD.pm ....)
Message-Id: <73mtle$h5b$1@nnrp1.dejanews.com>
What didn't seem to make it into my post was that I cannot get modules from
off the net and installed into my O'Reilly Perl Resource Kit distribution
without them already having some sort of PPM file already in there with them.
How do I create that PPM file for a module distribution that only consists
of a directory of *.pm files?
-Ernie
In article <73i1l0$lte$1@nnrp1.dejanews.com>,
ernie_oporto@mentorg.com wrote:
> In article <73gvfg$m5m$1@nnrp1.dejanews.com>,
> dturley@pobox.com wrote:
> > In article <365BB5DA.A02BCC19@rokura.roknet.ro>,
> > adi sorescu <guide@rokura.roknet.ro> wrote:
> >
> > > to bulid myself the binaries ) .I'm using ActiveState's perl bulid 507.
> >
> > > where can I find a gcc port to WIn32 to compile and install modules from
> > > CPAN ?
> >
> > You can find GD for win32 perl already compiled at the same place you found
> > Perl. Use PPM to install modules that need compiling. For other modules, I
use
> > dmake to install them like you would under "real" Perl.
--
http://www.geocities.com/SiliconValley/Park/9276
_____/ ____ / /Ernie "Shokk" Oporto-SysAdmin
_____ ____ / \ __ / __ / Mentor Graphics Corporation
\______/ __ __ \______/ __ \___ __ \___ Ernie_Oporto@MentorG.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 27 Nov 1998 19:22:59 GMT
From: dturley@pobox.com
Subject: Re: Win32 and Perl modules (was Re: HELP !can't use GD.pm ....)
Message-Id: <73mu65$hks$1@nnrp1.dejanews.com>
In article <365D75E1.3C6D7BC3@dcg.sncf.fr>,
docgen@multimania.com wrote:
> ok but what can we do if we can't pass through the enterprise proxy server?
>
> I've the same problem to get the GD library!
One solution: Search dejanews, this question get asked and answered several
times a month.
Another Solution: Go to ActiveState's site. --> support, search the mailing
list, this question gets asked and answered once a week it seems.
Yet Another Solution: Send me 50 bucks and I'll do the easy stuff for you.
:-)
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 27 Nov 1998 15:14:33 +0000
From: Marquis de Carvdawg <carvdawg@patriot.net>
Subject: Win32::API programming
Message-Id: <365EC1D9.3C51D074@patriot.net>
Can someone point me to a resource that shows me what
APIs are available to me using Win32::API? I have the PRK,
but I want to know more...
Carv
------------------------------
Date: Fri, 27 Nov 1998 20:39:49 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Y2K and Programmer Denial
Message-Id: <p6E72.1$J4.204@news.shore.net>
David Formosa <dformosa@zeta.org.au> wrote:
: ]If I hadn't received several emails confirming that the "booby-trap
: ]code" is, in fact, very prevalent,
: Isn't this a "lurkers support me in email" type of stament.
: Inpossable to confurm because the infomation isn't public?
People probably don't post here because they don't want a new asshole torn
for them by folks who can't abide any deviation from the party line.
Y2k bugs can and do exist in perl scripts. The fact that the behavior of
locatime is (now) well-documented does not change that fact. Nonetheless,
I've been told by regulars on this newsgroup that checking perl scripts
for y2k bugs that involve localtime is no more worthwhile than checking
for bugs involving "print" or "abs". That sounds like denial to me.
--Art
--
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
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 4309
**************************************