[10300] in Perl-Users-Digest
Perl-Users Digest, Issue: 3892 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 5 13:57:38 1998
Date: Mon, 5 Oct 98 09:00:26 -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 Mon, 5 Oct 1998 Volume: 8 Number: 3892
Today's topics:
Re: $i = int($1) if ($st = /([0-9]+)/ ==> the int($1) i (Mike Wescott)
Accessing Access97 using ADO DB... <haller@broadnet.ascom.ch>
ActiveState Perl evaluation...questions <smithr@lexma.meitech.com>
Re: Are there conditional comments? <jdf@pobox.com>
Re: Best Editor for Perl (under WinNT4) - Syntax Colori (Jari Aalto+mail.perl)
Controlling 3270 from Perl <koji.kiyokawa@which.net>
Re: Editing a file "in-place" <jdw@dev.tivoli.com>
Re: HELP !!! <dparrott@ford.com>
Re: Inconsistency in -w for substr outside of string <hansmu@xs4all.nl>
Re: need a regular expressions expert... <selected.only@bigfoot.com>
Re: Need IP Address Sort Subroutine <jdporter@min.net>
Newbie ? on ftp and perl (Dorene Clark)
Re: Newbie question about variable scope huntersean@hotmail.com
Re: Passing Variables: $_ vs. @_ <rabell@ti.com>
Re: Passing Variables: $_ vs. @_ <erhmiru@erh.ericsson.se>
Re: per <jdporter@min.net>
Re: per <jdporter@min.net>
Re: perl as shell. <jdporter@min.net>
Re: Perl as solution? <sneaker@sneex.fccj.org>
Re: Perl as solution? <eashton@bbnplanet.com>
Re: perl2c script/module available? <nguyend7@msu.edu>
Re: Please Help <jdporter@min.net>
Re: POLL: Perl features springing into your face (Bart Lateur)
Re: POLL: Perl features springing into your face <eashton@bbnplanet.com>
Re: Problem with Getopt::Std <jdporter@min.net>
Re: Problems Using a Compare Subroutine with Sort droby@copyright.com
Re: Problems with syswrite (I guess!!!) <jdf@pobox.com>
Re: read subdirectories aumman@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 05 Oct 1998 11:12:24 -0400
From: wescott@cygnus.ColumbiaSC.NCR.COM (Mike Wescott)
To: Rich@chilidogNOSPAM.com (Richard Gibson)
Subject: Re: $i = int($1) if ($st = /([0-9]+)/ ==> the int($1) is ignored, why?
Message-Id: <x4pvc7oxew.fsf@cygnus.ColumbiaSC.NCR.COM>
[ cc sent by email ]
In article <361605bc.664936247@news.rmii.com> Richard Gibson writes:
> I am reading a file with numbers embedded 'somewhere' in a certain
> position of each line:
> simplified sample (in the real data there are more columns):
> some text for the first bit number anywhere in here
> This is sample text 12345
> this is more text 12345
> and more 12345
> My code looks like this:
> while (<>){
> /^(.{33})(.{15})/
> $st1= $1;
> $st2= $2;
> $i = $1 if ($st2 =~ /([0-9]+)/); #this works
> $i = int($1) if ($st2 =~ /([0-9]+)/); #this does the same thing
> }
> So: why doesn't the int($1) seem to have an effect?
Given your example, $1 will be a string of digits without decimal point
or exponent. Therefore the only effect that int($1) might have is to
remove leading zeros.
What kind of effect were you looking for?
--
-Mike Wescott
mike.wescott@ColumbiaSC.NCR.COM
------------------------------
Date: Mon, 05 Oct 1998 16:25:03 +0200
From: haller <haller@broadnet.ascom.ch>
Subject: Accessing Access97 using ADO DB...
Message-Id: <3618D6BF.4E79DC6E@broadnet.ascom.ch>
Hi all
Note: I'm a newbie...
I've got some trouble using ADO from Perl32...
I'm accessing a Access97 DataSource....
1. How or where can I find descriptions of the available methods of a
recordset-object?
I know $rs->EOF, MoveNext, Close methods and the Fields->Value
property...
Could you please give me a little overview what methods/properties can
be used?
2. I made a query and would like to see, if it found something.
So, I tried '$rs->RecordCount' but this returns always -1, but there
should be 4 records found.. If I use '$rs->MoveNext' and
'$rs->Fields->Value;' the right values are displayed.
what could I've done wrong.. or am I calling a wrong function?
how can I find out, if a recordset is empty?
I really need some help on this... It seems, that not very much
documentation is available on this topic... or am I completly wrong?
thanks for all help.
regards
Stefan
--
"Those are my principles! And if you don't like them... well, I have
others..."
-- Groucho Marx
------------------------------
Date: Mon, 05 Oct 1998 15:10:02 GMT
From: "Ray Smith" <smithr@lexma.meitech.com>
Subject: ActiveState Perl evaluation...questions
Message-Id: <ej5S1.16$8Z5.50862@client.news.psi.net>
I've been trying to use ActiveState's Perl (build 502). A few problems have
stopped me cold. I'm hoping this forum might propose some answers.
1. In attempting to run Perl code which correctly works under Gurusamy
Sarathy's binary distribution Perl, the following occurs:
Note the example code uses Tk and I have installed Tk.
S:/R11/SDFREV/TESTDEV[4204] sdflog -bt01.sfl -e
...
Goto undefined subroutine &Tk::Entry::insert at
d:\ap502\site\5.00502\lib/Tk/Widget.pm line 318.
I can't see where the problem lies.
...Looking at the source code, I see nothing which references "insert":
S:/R11/SDFREV/TESTDEV[4205] head -320
d:/ap502/site/5.00502/lib/tk/widget.pm|tail
require "Tk/$method.pm";
}
}
}
}
$@ = $save;
$DB::sub = $what; # Tell debugger what is going on...
goto &$what;
}
I may be dense, but I don't quite see where member references such as ...
d:/ap502/site/5.00502/lib/Tk/Entry.pm: $w->insert("insert",$s);
d:/ap502/site/5.00502/lib/Tk/Entry.pm: $w->insert('insert',$new);
2. Debugging... When I try to use the debugger (via -d switch) to debug the
above problem.
a. I get a deluge of "Use of uninitialized value at d:\pasdebug\PerlDB.pl
line 644." messages
b. then I get a message saying "No License Key was found"
c. When I continue the debugger exits upon the "Goto undefined subroutine"
error.
Is there a way to set breakpoints in a named module's member function?
Single stepping from the main would take just too long.
Does the debugger work properly for evaluation without a license key?
Thanks for your attention and help.
------------------------------
Date: 03 Oct 1998 19:06:23 +0200
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Are there conditional comments?
Message-Id: <m3ww6ho9rk.fsf@joshua.panix.com>
Robert Krajcarski <robertk@techne.ca> writes:
> I know that there is the -P command line option that will put the
> perl script throught a C preprocessor, but that doesn't seem to be a
> wonderful solution (since all files will have to be run through the
> perl on the command line, rather then making files executable,
Not at all.
#!/usr/bin/perl -wP
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 05 Oct 1998 17:24:40 +0300
From: jari.aalto@poboxes.com (Jari Aalto+mail.perl)
Subject: Re: Best Editor for Perl (under WinNT4) - Syntax Coloring ?
Message-Id: <ptrogrrulw7.fsf@olkikukka.i-have-a-misconfigured-system-so-shoot-me>
alec@venus.co.uk (Alec Stewart) writes:
>
> Yeah but which is best ?!
Emacs. But it requires lot of learning to get 5x boost out of it.
All Emacs users know what it can do to your soul :-)
Programming is never the save once you have got a hang on Emacs,
you never want to give it up.
jari
Where to find Emacs
XEmacs/Emacs, is available to various platforms:
o Unix:
..If you don't have one, bust your sysadm...
http://www.gnu.org/software/emacs/emacs.html
http://www.xemacs.org/
Emacs resources listed: ftp://cs.uta.fi/pub/ssjaaa/elisp.html
o W95/NT:
http://www.cs.washington.edu/homes/voelker/ntemacs.html
Emacs Perl Modules
Cperl -- Perl programming mode
.ftp://ftp.math.ohio-state.edu/pub/users/ilya/perl
.<olson@mcs.anl.gov> Bob Olson (started 1991)
.<ilya@math.ohio-state.edu> Ilya Zakharevich
Major mode for editing perl files. Forget the default
o Coloured pod pages with `font-lock'
o Separate `tiperl-pod-view-mode' for jumping topics and pages
forward and backward in *pod* buffer.
o TinyUrl is used to jump to URLs (other pod pages, man pages etc)
mentioned in POD pages. (It's a general URL minor mode)
TinyIgrep -- Perl Code browsing and easy grepping
[TinyIgrep is included in the tgz mentioned above]
To grep from all installed Perl modules, define database to
TinyIgrep. There is example in the tgz (ema-tigr.ini) that shows
how to set up datatbases for Perl5, Perl4 whatever you have
installed
TinyIgrep calls Igrep.el to run the find for you, You can adjust
recursive grep options, ignored case, add user grep options.
You can get `igrep.el' module from <kevinr@ihs.com>. Ask for copy.
TinyCompile -- Browsing grep results in Emacs *compile* buffer
TinyCompile is minor mode for *compile* buffer from where
you can collapse unwanted lines, shorten the file URLs
/asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file1:NNN: MATCHED TEXT
/asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file2:NNN: MATCHED TEXT
-->
cd /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/
file1:NNN: MATCHED TEXT
file1:NNN: MATCHED TEXT
------------------------------
Date: Mon, 5 Oct 1998 11:22:48 +0100
From: "koji kiyokawa" <koji.kiyokawa@which.net>
Subject: Controlling 3270 from Perl
Message-Id: <6va5m5$1u9s$1@news.uk.ibm.com>
Hello,
Is there a way to control 3270 sessions from Perl? Visual Basic
seems to come with the capability to execute EHHLAPI. I quite
frankly do not like Visual Basic and prefer to stick to Perl.
Any help will be appreciated.
Thanks
------------------------------
Date: 04 Oct 1998 22:09:29 -0500
From: Jim Woodgate <jdw@dev.tivoli.com>
Subject: Re: Editing a file "in-place"
Message-Id: <ob90ivaemu.fsf@alder.dev.tivoli.com>
tingdale@flash.net (Tom Tingdale) writes:
> I have seen an example here before on how to edit a file in place, but
> when I try it nothing happens - the file is not changed. Here is the
> code:
> -----------------------------------
> #!/usr/local/bin/perl -wi
> use strict;
>
> open (FILE, "+< filename.txt") || die "Cannot open filename.txt:$!\n";
> while (<FILE>) {
> s/text/newtext/;
> }
> ---------------------------------
> It doesn't make any difference how I open the file, the file is not
> changed. What I'm I doing wrong?
I'm not sure about opening the file, but try the following both work:
perl -i.bak -pe "s/text/newtext/" filename.txt
or call
$ your_script.pl filename.txt
where your_script.pl is the following:
#!/src/woody/bin/perl -wi.bak
while (<>) {
s/text/newtext/;
print;
}
maybe a combination of the 3 will help... :)
--
Jim Woodgate
Tivoli Systems
E-Mail: jdw@dev.tivoli.com
------------------------------
Date: Mon, 05 Oct 1998 11:03:05 -0400
From: "Dennis M. Parrott" <dparrott@ford.com>
To: Charles Li <qli3@jetson.uh.edu>
Subject: Re: HELP !!!
Message-Id: <3618DFA9.67A4@ford.com>
Charles Li wrote:
>
> I'm doing PERL CGI programming. I am not able to use CGI.pm (for some
> reason), how do I pass on the HTML form inputs to the variables in my PERL
> CGI script?
>
I'd suggest a trip to the library or local technical bookstore.
The solution to your homework can be found in the following Good Book:
_CGI Programming on the World Wide Web_ by Shishir Gundavaram, it is
an O'Reilly book.
Check it out.
> --
> Charles Li
--
-----------------------------------------------------------------------
Dennis M. Parrott | Unix: dparrott@ford.com
PCSE Webmaster | PROFS: DPARROTT
Ford Motor Company | VAX: EEE1::PARROTT
Dearborn, Michigan USA | public Internet: dparrott@ford.com
-----------------------------------------------------------------------
Voice: 313-322-4933 Fax: 313-248-1234 Pager: 313-851-2958
------------------------------
Date: 2 Oct 1998 20:53:16 GMT
From: Hans Mulder <hansmu@xs4all.nl>
Subject: Re: Inconsistency in -w for substr outside of string
Message-Id: <6v3efs$10h@news.euro.net>
lr@hpl.hp.com (Larry Rosler) wrote:
>perl -we '$x = "x"; print substr $x, 2'
>
>produces two warnings:
>
>substr outside of string at -e line 1.
>Use of uninitialized value at -e line 1.
>
>But the following produces no warnings:
>
>perl -we '$x = "x"; print substr $x, 1'
>
>Is this a bug?
No, it isn't: if $x eq "x", then substr $x, 1 is $x minus
it's first character; i.e. "". This is a defined empty string.
The difference is probably easier to see if you try to assign
to the substring:
perl -lwe '$x = "x"; substr($x,1) = "y"; print $x;'
prints "xy"; whereas
perl -lwe '$x = "x"; substr($x,2) = "y"; print $x;'
prints "Modification of a read-only value attempted";
the read-only value you're modifying is the constant undef.
-- HansM
------------------------------
Date: Mon, 05 Oct 1998 14:56:30 +0200
From: Roland Giersig <selected.only@bigfoot.com>
To: Patrick Timmins <ptimmins@netserv.unmc.edu>
Subject: Re: need a regular expressions expert...
Message-Id: <3618C1FE.C5618721@bigfoot.com>
Patrick Timmins wrote:
...
> What's wrong with the
>
> print unless /^BAD/;
>
> that was recommended by several, which says :
> " print it unless it starts with 'BAD' "
Again, he is not using perl for regular expression matching, he
is just using it to figure out the correct RE!
> Why not print on the 'else' side of an if?
Probably because his RE matching framework does not have it.
--
If you want to reply to me personally, please mention the word `geek' in
the subject line or your message will not reach me (spam filter active).
GS/CS/IT e*+++ d-(+) s++:++ C++$ USL*$++>+++ DI++(+++)>++++ w--->? P+++$
L>++ E+$>++ N+(++) W+$(-)>+++ PGP++>+++ G+ t++* 5? X+ D++(---) Y+ PS+ PE
b>++++ tv(++) r+++ h----(*) y++++-- a>?
------------------------------
Date: Mon, 05 Oct 1998 09:04:15 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Need IP Address Sort Subroutine
Message-Id: <3618C3CF.B3176145@min.net>
Joe Williams wrote:
>
> This is in answer to my original post. First, many thanks for all the
> comments. I will be traveling over the next couple of days, but look forward
> to checking them out. Meantime, I'm posting a solution that is certainly not
> the most elegant or efficient, but it does work, and is fairly transparent.
> I used John Porter's solution to the IP string conversion with some changes
> as noted.
Joe, thanks for the nod, but I must formally disclaim the
appropriateness of that routine. It is a dog, besides which the
functionality it attempts to implement is already handled faster and
more correctly by Socket::inet_aton.
> ("\n0179 Tue 01Sep98 06:17:55 - Address of Site: 129.1.144.88#0179 Tue
> foreach $list_item (@list)
> {
> $x = index($list_item, "#");
> $w = (index ($list_item, "ite:") + 5);
> $ip_dotted_quad = substr( $list_item, $w, ($x - $w) );
> $ip_int = dotted_to_int($ip_dotted_quad);
> # Must hash with $list_item as key, because $ip_int's are not unique
> $hashed_by_ip{$list_item} = $ip_int;
> }
You should learn to use regular expressions.
For your two index()s, one substr(), and two temporary variables,
you could have:
( $ip_dotted_quad ) = ( $list_item =~ /ite:(.*)#/ );
One other note: please edit down the quoted message as much
as you can. The net will appreciate it.
--
John "Many Jars" Porter
baby mother hospital scissors creature judgment butcher engineer
------------------------------
Date: Mon, 05 Oct 1998 09:23:56 -0400
From: soswww@ibm.net (Dorene Clark)
Subject: Newbie ? on ftp and perl
Message-Id: <shMG2sd+aJ/F090yn@ibm.net>
I was wondering if someone could help me with the following problem.
I'm using a Perl script on my web site. The user fills out a form, then
it brings up a "thank you" html page where they can download some software.
I changed the link on the "thank you" page so they can ftp the software. But
now it doesn't even bring up the thank you page. What am I missing? Does
Perl not work with ftp or do I need something else in the script? Any
help would be greatly appreciated.
Dorene
soswww@ibm.net
------------------------------
Date: Mon, 05 Oct 1998 15:05:30 GMT
From: huntersean@hotmail.com
Subject: Re: Newbie question about variable scope
Message-Id: <6van7q$nsi$1@nnrp1.dejanews.com>
It looks like you may be running perl 4. Try "perl -v" & see what the answer
is. Some sites have both. Try "which perl5" (assuming you're running on
unix)
Sean Hunter
In article <MWNR1.9510$N43.29034654@news.rdc1.tn.home.com>,
"Perless Dudek" <perless@yellowkite.com> wrote:
> Hello,
>
> I am still trying to make this work. I think my problem has to do with
> somthing about local/global variables and my PERL environment, but I dont
> know what to do about it. Can anyone help????
>
> Thanks,
> Syd
>
> ****Code*****
>
> #!/usr/bin/perl -w
> use Getopt::Std;
>
> getopt('de');
> print "Debug trace swith on\n" if $opt_d;
> print "Extra debug trace swith on\n" if $opt_e;
> print "no more switches\n";
>
> *** Result ****
>
> % perl -w optdemo.pl
>
> "use" may clash with future reserved word at optdemo.pl line 2.
> syntax error in file optdemo.pl at line 2, next 2 tokens "use Getopt"
> "getopt" may clash with future reserved word at optdemo.pl line 4.
>
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 05 Oct 1998 09:09:28 -0500
From: Robert Bell <rabell@ti.com>
Subject: Re: Passing Variables: $_ vs. @_
Message-Id: <3618D318.BA282368@ti.com>
Ronald Gvggel wrote:
> There is just one difference:
> The three line code depends on $[
>
> $[ = 1;
> @arr = (1,2,3,4,5,6,7);
> &sub(@arr);
>
> sub sub {
> print $_[0];
> print $_[1];
> print $_[2];
> }
>
> this results in:
> 112
> (I don't know why)
>
> This is perl, version 5.004_04 built for PA-RISC1.1
>
> HTH
> Ronald
I don't seem to see the same results using your example code and version
5.001 .
I get
123
as expected.
rabell ...
------------------------------
Date: 05 Oct 1998 16:31:12 +0200
From: Michal Rutka <erhmiru@erh.ericsson.se>
Subject: Re: Passing Variables: $_ vs. @_
Message-Id: <la1zon5bdb.fsf@erh.ericsson.se>
Robert Bell <rabell@ti.com> writes:
> Ronald G=F6ggel wrote:
> > There is just one difference:
> > The three line code depends on $[
> >
> > $[ =3D 1;
> > @arr =3D (1,2,3,4,5,6,7);
> > &sub(@arr);
> >
> > sub sub {
> > print $_[0];
> > print $_[1];
> > print $_[2];
> > }
> >
> > this results in:
> > 112
> > (I don't know why)
Well, what do you expect? If the first index of arrey is set to be 1, then
index 0 is invalid. The correct output is therefore:
.12
where . stands for any number.
If you change $[ =3D 2; then the correct output should be:
..1
On my system actually 171.
[...]
> I don't seem to see the same results using your example code and version
> 5.001 .
>
> I get
>
> 123
How bizzare! This result is not correct!
>
> as expected.
Not by me.
>
> rabell ...
Michal
------------------------------
Date: Mon, 05 Oct 1998 09:23:42 -0400
From: John Porter <jdporter@min.net>
Subject: Re: per
Message-Id: <3618C85E.22CDD099@min.net>
Ian Lowe wrote:
>
> The /code filesystem is not in my vfstab. I have never used such a
> filesystem name. Also, the code works fine if I use my previous perl
> binary location (which is on another system), so I know it isn't a
> problem with the code.
Have you looked to see if there is a /code filesystem on this other
system where the scripts work? (Didn't I already suggest that?)
--
John "Many Jars" Porter
baby mother hospital scissors creature judgment butcher engineer
------------------------------
Date: Mon, 05 Oct 1998 09:23:48 -0400
From: John Porter <jdporter@min.net>
Subject: Re: per
Message-Id: <3618C863.31D75D2F@min.net>
Ian Lowe wrote:
>
> $df = `df -k`
> print "$df\n";
>
> Even this reproduces the original error message. So, coding aside, I
> still have the original problem.
Did you do what Elaine suggested, and type df -k at your shell
prompt? And what's your uname -a?
--
John "Many Jars" Porter
baby mother hospital scissors creature judgment butcher engineer
------------------------------
Date: Mon, 05 Oct 1998 10:46:33 -0400
From: John Porter <jdporter@min.net>
Subject: Re: perl as shell.
Message-Id: <3618DBC9.685D317B@min.net>
Campbell wrote:
>
> I have heard scary little whisperings about people using perl instead of
> bash as their shell.
>
> The mind boggles.
Oh, hardly.
> Does anyone here know how this could be accomplished under Linux?
Deja News.
--
John "Many Jars" Porter
baby mother hospital scissors creature judgment butcher engineer
------------------------------
Date: Mon, 05 Oct 1998 09:21:31 -0400
From: Bill 'Sneex' Jones <sneaker@sneex.fccj.org>
Subject: Re: Perl as solution?
Message-Id: <3618C7DB.3E30536F@sneex.fccj.org>
Jim Brewer wrote:
>
> Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> writes:
>
> >
> > Actually, it would seem not. Inconsiderate perhaps, but not always
> > annoying. They are seemingly willing to work with me and my neighbors.
> > I'm glad really. The cop last night was completely into the pilot..:)
> > *giggle* So was the neighbor even if his wife was ready to shoot
> > me...toy factor is everything :) I love engineers.
>
> Elaine, please stop!!! You'll destroy us all!!! Only a TRULY perverted
> person would insist on being this bloody happy. Sicko!!!
> --
> Jim Brewer
> e-mailed courtesy copies are unappreciated, please refrain.
You're not supposed to make "Happy Fun Ball" mad,
according to Saturday Night Live, there's no telling
what "Happy Fun Ball" will do!
__________________________________________________________________
Bill Jones FCCJ Webmaster http://www.fccj.org/cgi/mail?webmaster
------------------------------
Date: Mon, 05 Oct 1998 15:43:21 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Perl as solution?
Message-Id: <3618E6A1.EACD2A92@bbnplanet.com>
Jim Brewer wrote:
> Elaine, please stop!!! You'll destroy us all!!! Only a TRULY perverted
> person would insist on being this bloody happy. Sicko!!!
Heh, well, how about if I go get my luger and shoot myself? That would
fix a lot of things. See, now you've gone and done it. Be safe in your
despair as am I.
/me fumbles around her desk looking for that unfinished Hemlock Society
application.
e.
As I was lying there with my eyes closed, just after I'd
imagined what it might be like if in fact I never got up
again, I thought of you. I opened my eyes then and got
right up and went back to being happy again.
I'm grateful to you, you see. I wanted to tell you. -R. Carver-
------------------------------
Date: 5 Oct 1998 13:43:49 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: perl2c script/module available?
Message-Id: <6vaiel$h3d$1@msunews.cl.msu.edu>
Richard Christensen <ra5815@email.sps.mot.com> wrote:
: For very specific reasons I need to code several of my perl scripts to C and
: make small executables from them.
There is a perl compile available. It's part of the standard release
since 5.005. It converts the code to C, then compiles it with the
system's cc. One problem. There is genereally no speed advantage,
and the code will be tremendously larger.
I compiled the "Hello World" program and it was over 800k. While the
C executable was just under 6k. Your program may or may not even work
after compiling.
--
Dan Nguyen | There is only one happiness in
nguyend7@msu.edu | life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 | -George Sand
------------------------------
Date: Mon, 05 Oct 1998 11:03:07 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Please Help
Message-Id: <3618DFAB.5AAAF22A@min.net>
Steven wrote:
>
> After installation, the .pl still cannot be execute at my browser.
>
> How do l register the .pl into the register to NT server, such that
> the web server would "recognise" .pl.
Did you read the "Perl for Win32 FAQ"?
http://www.perl.com/CPAN-local/doc/FAQs/win32/Perl_for_Win32_FAQ.html
--
John "Many Jars" Porter
baby mother hospital scissors creature judgment butcher engineer
------------------------------
Date: Mon, 05 Oct 1998 08:41:46 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: POLL: Perl features springing into your face
Message-Id: <361a81ba.1582993@news.ping.be>
Kai Henningsen wrote:
>"Real" nested subs are very useful once you do large programs. To put it
>in Perl terms, you have access to the my variables of the parent sub,
>which means that many less parameters;
I see... I use 'local' for this kind of application.
> also, the sub is itself a sort of
>my variable in the parent sub, and thus its name cannot collide with any
>odd sub elsewhere.
And for that, I use 'package'. You put each largish group of cooperating
code, into a different package. That way the won't thread on each others
variables, or subs.
What you propose is actually not that new. It's just a different angle.
Bart.
------------------------------
Date: Mon, 05 Oct 1998 15:39:09 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: POLL: Perl features springing into your face
Message-Id: <3618E5A5.22DD42F0@bbnplanet.com>
Jim Brewer wrote:
> Well, God help us each and every one. The 'Happy Fun Ball' is in
> town. Daily from 8 to 5. Weekends too!!!
Hrm. If anyone in my office saw the whites of my eyes at 8am they would
have a stroke. I'm go off-line only for beer and sleep. No deity can
help that except maybe to make mo' betta mo' beer.
e.
As I was lying there with my eyes closed, just after I'd
imagined what it might be like if in fact I never got up
again, I thought of you. I opened my eyes then and got
right up and went back to being happy again.
I'm grateful to you, you see. I wanted to tell you. -R. Carver-
------------------------------
Date: Mon, 05 Oct 1998 10:23:05 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Problem with Getopt::Std
Message-Id: <3618D649.C4995690@min.net>
Perless Dudek wrote:
>
> syntax error in file optdemo.pl at line 2, next 2 tokens "use 'Getopt::Std'"
> Execution of optdemo.pl aborted due to compilation errors.
What version of perl are you using? (perl -v)
--
John "Many Jars" Porter
baby mother hospital scissors creature judgment butcher engineer
------------------------------
Date: Mon, 05 Oct 1998 15:16:22 GMT
From: droby@copyright.com
Subject: Re: Problems Using a Compare Subroutine with Sort
Message-Id: <6vans7$p02$1@nnrp1.dejanews.com>
In article <la7lyf5moa.fsf@erh.ericsson.se>,
Michal Rutka <erhmiru@erh.ericsson.se> wrote:
> John Porter <jdporter@min.net> writes:
> [...]
> > > Do you dont understand that it overflows? Thats mean it
> > > gives different result on your Spark than on mine. Does this not worry
> > > you? At least it worries me.
> >
> > Are you sure it overflows?
>
> Yes.
>
> > I have a hard time believing that your
> > machine, which is alsa a sparc, behaves so differently.
>
> It is up to you.
>
Perhaps someone should file a bug report. On a Sparc4 running Solaris2.6 and
Perl 5.004_04, an Alpha running Digital Unix 4.0D and Perl 5.004_04 and a
Pentium running RedHat Linux 5.0 (kernel version 2.0.32) and Perl 5.004_01,
I see exactly the same behavior as John reports.
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 05 Oct 1998 15:27:54 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: jonas4524@my-dejanews.com
Subject: Re: Problems with syswrite (I guess!!!)
Message-Id: <m37lyfw339.fsf@joshua.panix.com>
jonas4524@my-dejanews.com writes:
> I have a little problem when sending data with a modem - modem connection. I
> use the syswrite function but can't get it to work. Don't know if that which
> I'm sending is transmitted or if it is transmitted correctly.
See the documentation for syswrite() which tells you how to check the
success of the call, and which gives you an important caveat about its
use. Also see perlfaq8, "How do I read and write the serial port?"
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Mon, 05 Oct 1998 14:57:04 GMT
From: aumman@my-dejanews.com
Subject: Re: read subdirectories
Message-Id: <6vamo1$ncm$1@nnrp1.dejanews.com>
In article <01bdefa7$ac6ddd20$231e67d1@richard>,
"Richard Ahier" <richarda@profil-cdi.qc.ca> wrote:
> Hi,
>
> I try since a week to make a recursive script who read a directory and all
> his subdirectories.
> I just need directories not files.
> Does somebody have a script to suggest.
>
> Thanks in advance.
>
try this:
sub dir_read {
my ($dir) = shift;
return if ! -d $dir;
print $dir, "\n";
opendir(DIR, $dir);
foreach ( readdir(DIR) ) {
next if /^\./;
&dir_read($dir . '/' . $_);
}
closedir(DIR);
}
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
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 3892
**************************************