[10776] in Perl-Users-Digest
Perl-Users Digest, Issue: 4377 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 8 01:07:26 1998
Date: Mon, 7 Dec 98 22: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 Mon, 7 Dec 1998 Volume: 8 Number: 4377
Today's topics:
Check file exist in the client directory <isetso@ust.hk>
Re: Code Bash: File Include <ajohnson@gatewest.net>
Re: Conditional statements in control structures <aqumsieh@matrox.com>
Re: Connection to Microsoft SQL Server (Stephen Spence)
Re: function for copying files <aqumsieh@matrox.com>
Re: Generating a Reference Number imchat@ionet.net
Re: Generating a Reference Number (Ronald J Kimball)
Re: Help clearing hash index from memory <aqumsieh@matrox.com>
Re: Help: How to send email with attached multimedia fi imchat@ionet.net
Hey look! Im an expert too <smart@lleck.com>
Re: Hey look! Im an expert too <uri@sysarch.com>
Re: Hey look! Im an expert too imchat@ionet.net
Re: Need Help on code! (Tad McClellan)
Re: Not a subroutine reference (Ronald J Kimball)
PERL date/time expiration question cgi@higherlove.com
Re: PERL date/time expiration question (Martien Verbruggen)
Re: Petition: Contrast: South Australian gov't has 20 y (Matthew Hannigan)
PID ($$) of system() call? otis@my-dejanews.com
Re: Question: Perl IRC Bot (Ronald J Kimball)
Recursion or sort problem <bp@bp.com>
Solaris 2.6 x86 miniperl compile error (Darren Littlejohn)
Re: Solaris 2.6 x86 miniperl compile error (Martien Verbruggen)
Re: system() problems on Win32 && infozip <bryan@eai.com>
Re: Tool to reverse engineer perl code <newspost@morlock.net>
Re: Training wheels for Perl <waltman@netaxs.com>
Re: usage of $_ within nested loops <gellyfish@btinternet.com>
Re: Which modules to use (Tad McClellan)
Re: Why i can't "localize through a reference" in perl (Andrew Allen)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 08 Dec 1998 10:26:29 +0800
From: Eddie Tso <isetso@ust.hk>
Subject: Check file exist in the client directory
Message-Id: <366C8E55.C7C9EAD0@ust.hk>
Hi all,
I am not very good at Perl Programming and now I need to do a form
with the file upload function. I got the Perl code for the file upload
but how can I do a checking on the file actually exist in the directory
of the client side.
Thanks in advance,
Eddie
------------------------------
Date: Mon, 07 Dec 1998 20:44:52 -0600
From: Andrew Johnson <ajohnson@gatewest.net>
Subject: Re: Code Bash: File Include
Message-Id: <366C92A4.49BA444C@gatewest.net>
Randal Schwartz wrote:
> Sam> sub ifile {
> Sam> foreach $file (@_) {
> Sam> unless(open IFILE, $file) { print("Can't open $file: $!\n"); return;
> Sam> }
> Sam> while($line = <IFILE>) { print $line; }
> Sam> close IFILE;
> Sam> }
> Sam> }
>
> I usually don't do that as a subroutine. I just do this:
>
> { local @ARGV = @yourlist; print while <>; }
>
of course, that won't work well inside of an already running
while(<>) loop that is looking for include directives of
some sort while printing the current file, whereas a routine
that manages its own open()/print()/close() can insert
include files fine (also, $|++ might be a good idea in
any case).
regards
andrew
------------------------------
Date: Mon, 7 Dec 1998 18:58:15 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Conditional statements in control structures
Message-Id: <x3ypv9vjyqg.fsf@tigre.matrox.com>
Jeff Beard <jeffbremovethis@mcguckin.com> writes:
>
> Hello,
>
> I've got an array that I want to loop through and when I am at the first
> value (regardless of the value) I want to do one thing but for the rest
> do something different. What I have is:
>
> my @array = qw(apples oranges pears);
>
> my $i = @array1[0];
This has two problems.
1) @array1 does NOT exist! but I suspect this is a typo and should be
@array.
2) @array[0] is wrong syntax. Change it to
my $i = $array[0];
> foreach (@array) {
> if ($_ = $i) {
"=" is for assignment. Your are assigning $i to every member of the
array. Definitely NOT what you want. "==" is for number comparison, so
that is NOT was you want either. You want "eq"
if ($_ eq $i) {
> print "$_\n";
> } else {
> print "$_\n";
> }
>
> This, of course, doesn't work. I've also tried something similar with a
> while loop. Could you help please?
Of course? why ofcourse? this gives me the impression that you know
what's wrong with your code. So why not solve it??
Read some more docs on Perl before you attempt to write any more code
please.
Hope this helps,
Ala
------------------------------
Date: 8 Dec 1998 15:08:12 +1000
From: sspence@mincom.com (Stephen Spence)
Subject: Re: Connection to Microsoft SQL Server
Message-Id: <74ic7s$gml$1@pithy.mincom.oz.au>
Try
http://www.algonet.se/~sommar/mssql.
Cheers,
Stephen
David Cantrell (NukeEmUp@ThePentagon.com) wrote:
: On Tue, 01 Dec 1998 17:39:22 +0100, Hendrik Woerdehoff
: <hendrik.woerdehoff@sdm.de> enlightened us thusly:
: >Jens Hilgers wrote:
: >
: >> is there a perl module to connect to a MS SQL Server ?
: >
: >Yes! DBI and DBD::Sybase :-)
: I know MS-SQL is really a tarted up old version of Sybase, but would
: DBD::Sybase _really_ work?
: [Copying newsgroup posts to me by mail is considered rude]
: --
: David Cantrell, part-time Unix/perl/SQL/java techie
: full-time chef/musician/homebrewer
: http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: Mon, 7 Dec 1998 13:31:23 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
To: "Michael Tacelosky" <tac@smokescreen.org>
Subject: Re: function for copying files
Message-Id: <x3yww43kdv7.fsf@tigre.matrox.com>
[posted & mailed]
"Michael Tacelosky" <tac@smokescreen.org> writes:
>
> I've read the chapter on File and Directory manipulation, and can't seem to
> find the simple command to copy a file from one directory to another, or
> from one name to another.
>
> The rename() function is close, but I don't want to delete the original.
>
> This seems so simple -- can anyone point me in the right direction?
Use the File::Copy module from CPAN.
Hope this helps,
Ala
------------------------------
Date: Tue, 08 Dec 1998 04:29:50 GMT
From: imchat@ionet.net
Subject: Re: Generating a Reference Number
Message-Id: <366ca902.351528581@news.ionet.net>
Sure. The easiest way is to use a counter sub to assign the
number. This is Selena Sols work BTW. It is very well documented. You
just put the $item_number scalar wherever you need the number.
$counter_file = "./data";
&counter
sub counter
{
# Open up the counter file. If the counter file cannot be opened,
# however, access the &open_error routine
open (COUNTER_FILE, "$counter_file") ||
&open_error($counter_file);
# Check to see what number the counter is currently on and assign that
# value to $_
while (<COUNTER_FILE>)
{
$item_number = "$_";
}
close (COUNTER_FILE);
# Add one to that number, change the counter file to the new number,
# return the number to the mian script, and close the counterfile.
$item_number += 1;
open (COUNTER_FILE, ">$counter_file") ||
&open_error($counter_file);
print COUNTER_FILE "$item_number\n";
close (COUNTER_FILE);
return $item_number;
}
sub open_error
{
# Let the client know that the script was unable to open the requested
file
# and then die so that the routine does not continue
print "I am really sorry, but for some reason I was unable to open
<P>$counter_file<P> Would you please make sure that the filename
is
correctly defined in the script, it actually exists, and has the
right permissions relative to the web browser. Thanks!";
die;
}
On Mon, 07 Dec 1998 11:59:28 -0800, mikej <mikej@1185design.com>
wrote:
>Hi All,
>
>I have a form that calls a Perl script and I want it to generate a
>"reference number" as an ID for people to use later on if they want to
>change something on their entry. An example would be something you would
>see on sites where you buy a product and the thank you page gives you a
>transaction reference number. Anyone know a quick and easy way in Perl
>to generate a unique number based on each form submission? Thanks!
>
>-Mike
>
>mikej@1185design.com
>
------------------------------
Date: Tue, 8 Dec 1998 00:09:02 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Generating a Reference Number
Message-Id: <1djox98.9rm2f71dbhq33N@bay1-188.quincy.ziplink.net>
mikej <mikej@1185design.com> wrote:
> Anyone know a quick and easy way in Perl
> to generate a unique number based on each form submission?
Use a counter.
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Mon, 7 Dec 1998 18:35:11 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Help clearing hash index from memory
Message-Id: <x3ysoerjzsw.fsf@tigre.matrox.com>
Pete Cion <pcion@cybersource.com> writes:
>
> Hello -
>
> I am working with a rather large associative array (about 100,000
> name/value pairs) that I need to keep in memory. The problem isn't the
> array itself, but that once the array is undef'd, the memory is not
> released. I assume that this memory is for the index to the associative
> array rather than for the array itself.
>
> Any thoughts as to how to clear the index out of memory once the array
> itself has been undef'd?
Once the hash has been undef'ed, its memory will be recycled and will
be reused by your program. I don't think it's possible to release that
memory to the system as long as your program is running.
Hope this helps,
Ala
------------------------------
Date: Tue, 08 Dec 1998 04:47:23 GMT
From: imchat@ionet.net
Subject: Re: Help: How to send email with attached multimedia files uploaded from a form?
Message-Id: <366caf26.353101002@news.ionet.net>
Get MIME::Lite. Just do a search and you'll find it. I can't remember
the exact page its on.
On Mon, 07 Dec 1998 10:34:16 -0600, wwv1@inclab09.cs.depaul.edu wrote:
>Hello,
> I'm a new user of perl. Is there anybody can tell me how to send
>email with attached files uploaded from a form? I'm using HP Unix
>platform and Apache server.
>
> Any help will be greatly appreciated. Thank you.
>
>Jane
>
------------------------------
Date: Mon, 7 Dec 1998 21:28:50 -0500
From: "S. Mart Alleck" <smart@lleck.com>
Subject: Hey look! Im an expert too
Message-Id: <74i2s3$n86$1@fir.prod.itd.earthlink.net>
First, read the frickin' manuals you frickin bonehead.
Second, don't ever post here if you expect a fickin' answer
Hope this helps
(Its easy being an expert)
------------------------------
Date: 07 Dec 1998 22:11:29 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Hey look! Im an expert too
Message-Id: <x7zp8zuy3i.fsf@sysarch.com>
>>>>> "SMA" == S Mart Alleck <smart@lleck.com> writes:
SMA> First, read the frickin' manuals you frickin bonehead.
SMA> Second, don't ever post here if you expect a fickin' answer
SMA> Hope this helps
SMA> (Its easy being an expert)
it helps to actually have a brain, which you seem to be missing.
and what is fricking/ficking? does it have anything to do with rtfm?
BTW aleck has 1 l. so you are a lousy speller too.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Tue, 08 Dec 1998 04:05:09 GMT
From: imchat@ionet.net
Subject: Re: Hey look! Im an expert too
Message-Id: <366ca481.350375553@news.ionet.net>
It actually does help to read. I spend a lot of time in this
news group but post very seldom because most of my questions are
already answered in another post. This news group is a very valuable
resource and those peolpe that answer questions here should be
applauded for putting up with rank amatuers such as myself. Not all of
my questions have been answered, but I have found answers to all of my
questions because I can read! Imagine that !!
On Mon, 7 Dec 1998 21:28:50 -0500, "S. Mart Alleck" <smart@lleck.com>
wrote:
>
>First, read the frickin' manuals you frickin bonehead.
>Second, don't ever post here if you expect a fickin' answer
>
>Hope this helps
>
>(Its easy being an expert)
>
>
>
------------------------------
Date: Mon, 7 Dec 1998 19:10:39 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Need Help on code!
Message-Id: <fauh47.e4o.ln@metronet.com>
Matt Schuette (schuette@umr.edu) wrote:
: If you do
: /^Customer: /
: Then the variable $' (or $POSTMATCH) holds everything after the match,
And your script will be slooooow.
/^Customer: (.*)/; # $1 holds rest and doesn't slow down every
# single pattern match throughout your
# entire script like using $', $`, and $& does...
or
s/^Customer: //; # $_ host the rest
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 8 Dec 1998 00:09:05 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Not a subroutine reference
Message-Id: <1djoxkd.10yi2ot9im4pkN@bay1-188.quincy.ziplink.net>
Aaron Young <ayoung@sigg.com> wrote:
> What I have seen is that this is me trying to use a reference to a
> non-function as a function.
>
> the only thing is, I can't seem to find where I'm making the mistake.
>
> What types of things should i be looking for? Is there a known
> suspicious construct?
Look for code that attempts to dereference a value as a subroutine.
For example:
$sub = sub { print "$_[0]\n"; };
$arr = ["foo"];
&$sub('bar'); # good
&$arr('bar'); # bad!
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Tue, 08 Dec 1998 03:34:43 GMT
From: cgi@higherlove.com
Subject: PERL date/time expiration question
Message-Id: <366c9e45.96870365@news.phnx.uswest.net>
I'm getting stumped on how to use dates and time in PERL for cgi.
I want to be able to write a line to a text file with the current time
when the program is activated (say, like in a logging script). Then
each time the program is run, it compares the current time against the
times listed in the text file -- if the difference is greater than 5
minutes (ie: over 5 minutes have passed since the line was written
into the file), the expired lines are deleted.
I've seen some chat programs that use similar routines, but I can't
figure out the date/time routines to get a worthwhile understanding.
Any help on how to put together a small script like this would be
greatly appreciated!
Lisa
------------------------------
Date: Tue, 08 Dec 1998 04:59:44 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: PERL date/time expiration question
Message-Id: <4n2b2.155$884.153@nsw.nnrp.telstra.net>
In article <366c9e45.96870365@news.phnx.uswest.net>,
cgi@higherlove.com writes:
> I'm getting stumped on how to use dates and time in PERL for cgi.
There is no such thing as PERL for cgi. CGI is an interface
specification, which can be implemented in (almost) any language. Perl
is a programming/scripting language. perl is the interpreter/compiler
that works with Perl. I don't know what PERL is.
So, you are trying to use dates and times in a CGI script that you are
writing in Perl, right?
> I want to be able to write a line to a text file with the current time
> when the program is activated (say, like in a logging script). Then
> each time the program is run, it compares the current time against the
> times listed in the text file -- if the difference is greater than 5
> minutes (ie: over 5 minutes have passed since the line was written
> into the file), the expired lines are deleted.
# perldoc -f time
=item time
Returns the number of non-leap seconds since whatever time the system
considers to be the epoch (that's 00:00:00, January 1, 1904 for MacOS,
and 00:00:00 UTC, January 1, 1970 for most other systems).
Suitable for feeding to C<gmtime()> and C<localtime()>.
So, if you use the output of time, all you need to do is look for a
difference that is greater than 300 (60 * 5).
Since this is a CGI program, you will need to deal with file locking,
because more than one instance of your program may be trying to write
to the same file.
have a look at http://www.stonehenge.com/merlyn/WebTechniques/ for
some tips and techniques.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd. | clothes.
NSW, Australia |
------------------------------
Date: 8 Dec 1998 02:46:40 GMT
From: mlh@zipper.zip.com.au (Matthew Hannigan)
Subject: Re: Petition: Contrast: South Australian gov't has 20 yr Microsoft-Only Contract!
Message-Id: <74i3ug$63$1@the-fly.zip.com.au>
In article <01be1ff2$c98dc250$0a00000a@KangalCreek>,
ARA <ara@neWave.net.au> wrote:
>
>I read with interest your call for petition signers...
>
>By contrast, can you imagine the up-hill battle you'd
>have in South Australia, where (perhaps to get EDS to
>relocate to Adelaide) the State gov't has reportedly
>signed a contract which makes it ILLEGAL for them to
>use anything but Microsoft software products?
>
>For details, find an archive of our local LUNIX SA
>mailing list (Nov/Dec 98) and read what "insiders"
>have had to say about the deal.
URL please!
--
-Matt
------------------------------
Date: Tue, 08 Dec 1998 04:15:00 GMT
From: otis@my-dejanews.com
Subject: PID ($$) of system() call?
Message-Id: <74i942$u1u$1@nnrp1.dejanews.com>
Hello,
Is there a way to get the PID of the process started by a system() call from a
perl script?
I have a situation where I use a perl script as a 'wrapper' that calls
something via system() and I need to be able to send signals (SIG*) such as
-2 -9 -15, etc. to the process started by system(). Currently, if I kill the
perl script, for example, the thing invoked by signal() keeps running. I
know how to catch signals in a perl script, but I need to know how to
'forward' or 'apply' them to the process invoked by system() after I catch
them :)
Thanks!
Otis
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 8 Dec 1998 00:09:09 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Question: Perl IRC Bot
Message-Id: <1djoxy6.1ql31arfocqgtN@bay1-188.quincy.ziplink.net>
Ralph <rweaver@raex.com> wrote:
> Does anyone know of a decent bot written in perl or how hard it would be
> to extend an existing bots C/C++ code to use perl as an extensible part of
> the bot? (so you can write scripts inside the bot). Thanks for info in
> advance.
purl, the #perl infobot, is written in Perl. (Of course!)
The creator of purl had an article in The Perl Journal, Iss #10, Summer
1998, titled "Infobots and Purl". He mentioned these two links, among
others:
http://www.cs.cmu.edu/~lenzo/infobot.html
http://www.infobot.org/
Hope that helps!
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 8 Dec 1998 01:49:57 GMT
From: <bp@bp.com>
Subject: Recursion or sort problem
Message-Id: <01be224d$0aa711e0$294463a1@amancw006409>
I got this problem that I've solved in C but would like to find out how to
do it in perl.
Any assistance would be appreciated.
I have 2 files, the first contains 5 columns
line_name
fluid4 contact
fluid3 contact
fluid2 contact
fluid1 contact
comment
the second file contains
line_name
fluid contact begin
fluid contact end
comment
The first goal is to create intervals based on the first file, so for
instance the fluid 1 interval is from 0 to fluid1 contact,
fluid2 is from fluid1 contact + 1 to fluid2 contact
fluid3 is from fluid2 contact + 1 to fluid3 contact
fluid4 is from fluid3 contact + 1 to fluid4 contact
fluid5 is from fluid4 contact +1 to an arbitrary maximum of 15000
The second goal is to insert the intervals from the second file into the
origional set, adjusting the interval lengths to prevent overlap. The
general assumption is that fluid2 fills in the blanks.
For example, for a particular line, the following origional set exists
fluid1 0 9899
fluid2 9900 11000
fluid3 11001 12656
fluid4 12657 13726
fluid5 13726 15000
and the following new intervals are for the same line in the second file
fluid1 0 9995
fluid1 10007 10438
fluid1 10536 10823
fluid1 10986 11008
The resulting interval set should look like
fluid1 0 9995
fluid2 9996 10006
fluid1 10007 10438
fluid2 10439 10535
fluid1 10536 10823
fluid2 10824 10985
fluid1 10986 11008
fluid3 11008 12656
fluid4 12657 13726
fluid5 13726 15000
The easy conditions my prototype handles fine, but where fluid1 overlaps
into succissive bottom layers, the whole thing breaks down. I am looking
for a way to recurse the origional interval array, but I can't quite get
it. I'd appreciate any suggestions you could provide to help me solve this
problem.
Thanks
TRP
------------------------------
Date: Tue, 08 Dec 1998 02:13:37 GMT
From: darrenl@cats.ucsc.edu (Darren Littlejohn)
Subject: Solaris 2.6 x86 miniperl compile error
Message-Id: <366c8b24.836062@news.ucsc.edu>
Would you happen to know anything about this:
rm -f libperl.a
ar rcu libperl.a perl.o gv.o toke.o perly.o op.o regcomp.o dump.o
util.o mg.o byterun.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o
pp_ctl.o pp_sys.o doop.o doio.o regexec.o taint.o deb.o universal.o
globals.o perlio.o
gcc -o miniperl miniperlmain.o libperl.a
Undefined first referenced
symbol in file
log libperl.a(pp.o)
pow libperl.a(pp.o)
sqrt libperl.a(pp.o)
floor libperl.a(pp.o)
atan2 libperl.a(pp.o)
exp libperl.a(pp.o)
sin libperl.a(pp.o)
cos libperl.a(pp.o)
ld: fatal: Symbol referencing errors. No output written to miniperl
*** Error code 1
make: Fatal error: Command failed for target `miniperl'
I'm on Solaris 2.6 for Intel x86.
Darren Littlejohn
darrenl@cats.ucsc.edu
------------------------------
Date: Tue, 08 Dec 1998 04:53:07 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Solaris 2.6 x86 miniperl compile error
Message-Id: <Tg2b2.154$884.153@nsw.nnrp.telstra.net>
In article <366c8b24.836062@news.ucsc.edu>,
darrenl@cats.ucsc.edu (Darren Littlejohn) writes:
> gcc -o miniperl miniperlmain.o libperl.a
> Undefined first referenced
> symbol in file
> log libperl.a(pp.o)
You seem to not be linking in your math library. You'll need to tell
gcc to link it in, with -lm.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au |
Commercial Dynamics Pty. Ltd. | 'I hate gramaticle errors!' 'Me to!'
NSW, Australia |
------------------------------
Date: Mon, 07 Dec 1998 13:14:12 -0600
From: Bryan Hart <bryan@eai.com>
Subject: Re: system() problems on Win32 && infozip
Message-Id: <366C2904.167E@eai.com>
This is posted in another post (this one was held up so long because I
cross-posted to comp.lang.perl.moderated that I resubmitted).
The problem appears to come down to a problem with quoted arguments and
the multi-arg form of system() under Win32.
In short, you need to quote any argument that has "special" characters
(I was using infozip via a full path that contained a space) before
sending it to system() under Win32. Apparently the arguments are parsed
in a different way under Win32 that causes problems when both the
executeable name and at least one of it's arguments are quoted.
This is logged as a bug in Perl - I'm currently using the 8.3 version of
the executeable path as a workaround.
Bryan
Paul Roub wrote:
>
> Bryan Hart <bryan@eai.com> writes:
>
> > I'm just wondering if anyone here has any expience running infozip via a
> > system() under Win32 (5.00502) perl.
> >
> > I've tried every combination of full paths, relative paths, using/not
> > using drive letters, forward slashes, back slashes, etc I can think of.
> >
> > In each case, running the command via a command prompt works, running
> > from system() exits with code 65280 (Invalid Argument).
> >
>
> Also running 5.00502 here, under WinNT 4.0. The following:
>
> use strict;
>
> my @sysargs = ("zip.exe");
>
> push @sysargs, @ARGV;
>
> my $result = system( @sysargs );
>
> print "result: $result\n";
>
> running as:
>
> perl -w pz.pl *.txt
>
> gives:
>
> adding: 3.txt (stored 0%)
> adding: 1.txt (stored 0%)
> adding: 2.txt (stored 0%)
> result: 0
>
> so no problem here. Could you give an example of the code you're using?
>
> -paul
--
------------------------------------------------------------
| Bryan Hart | Phone: (515) 296-5979 |
| Network Products Engineer | Fax: (515) 296-7025 |
| Engineering Animation Inc. | Email: bryan@eai.com |
| | WWW: http://www.eai.com/
|
------------------------------------------------------------
------------------------------
Date: Mon, 7 Dec 1998 21:14:02 -0500
From: "Steven Morlock" <newspost@morlock.net>
Subject: Re: Tool to reverse engineer perl code
Message-Id: <RY%a2.231$l24.1049956@lwnws01.ne.mediaone.net>
SPAM!
--
Foliage Software Systems
aka The Nerd Farm
http://www.foliage.com
Michael Gold wrote in message <74edlt$u7p$1@camel21.mindspring.com>...
>
>drkeith@bway.net wrote in message <749b1s$km9$1@nnrp1.dejanews.com>...
>>I was just searching for the same thing -- a tool for analyzing perl
>>application -- required files, sub-routines & data members, inputs,
>outputs,
>>etc & generating HTML documentation a la javadoc. Anything exist already?
>>I've seen debuggers, but I'm wanting to document working apps.
>>
>>Thanks,
>>
>>David Keith
>>
>>In article <744g8p$7e7$1@bcarh8ab.ca.nortel.com>,
>> "Steve Walsh" <swalsh@americasm01.nt.com> wrote:
>>> Has anyone on this list come across a reverse engineering tool that will
>>> take perl code as input and generate data diagrams, process diagrams
>>> (flowcharts), etc. I know that there are lots of software tools available
>>> that do this for Java, C++, etc but I would like to find one that I can
>use
>>> with perl or is customizable to allow me to add perl in as a supported
>>> language. If you know of such a tool please email with details. Thank
>you.
>>>
>>> Steve Walsh
>>> swalsh@americasm01.nt.com
>>>
>>>
>>
>
>It should be possible to use WithClass 98 to do this. WithClass is a UML
>design
>tool with a VBA scripting language built in that has support for reverse
>engineering
>in any language and also the ability to automate the drawing of diagrams.
>If you
>send us a sample of the type of code you want reversed we would be excited
>to
>try to write an automation script that would allow the drawing of a diagram
>from
>Perl. (object, state, activity). We will then post the script here. If
>you'd like to try
>it yourself you can download a trial version of the product at
>http://www.microgold.com
>Look for the vba version.
>
>-Mike Gold
>MicroGOLD Software
>Developer
>
>
>>-----------== Posted via Deja News, The Discussion Network ==----------
>>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
>
------------------------------
Date: 07 Dec 1998 23:12:26 -0500
From: Walt Mankowski <waltman@netaxs.com>
Subject: Re: Training wheels for Perl
Message-Id: <m3u2z7b7bp.fsf@netaxs.com>
ziggy@panix.com (Adam Turoff) writes:
> Jonathan Stowe <gellyfish@btinternet.com> wrote:
> >On 25 Nov 1998 22:48:27 GMT Zenin <zenin@bawdycaste.org> wrote:
> >> Tom Phoenix <rootbeer@teleport.com> wrote:
> >> >snip<
> >> : My cat can write better Perl just by walking across the keyboard!
> >>
> >> And it would be more readable then most Perl code. :-) :-)
> >
> >In the spirit of enquiry I thought I would put this assertion to the test.
> >Not having a cat I simulated the feline footsteps by rolling a grapefruit
> >around on the keyboard producing the following:
>
> I think you'd get better results rolling a few thousand pe[a]rls across
> your keyboard instead. Try that, or use a perl keyboard. You'll need to
> simulate two cats - one for the alphanums, and one to play with the
> $, % and @ footpedals. :-)
Lacking a cat I tried rolling my Microsoft Mouse across my keyboard.
But I keep getting MFC code instead of Perl. What am I doing wrong?
------------------------------
Date: 8 Dec 1998 01:37:42 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: usage of $_ within nested loops
Message-Id: <74hvt6$to$1@gellyfish.btinternet.com>
On 7 Dec 1998 22:18:58 GMT Greg Bacon <gbacon@itsc.uah.edu> wrote:
> In article <366c3cdb.9105136@news.skynet.be>,
> bart.lateur@skynet.be (Bart Lateur) writes:
> : Always treat $_ as a temporary variable. You should never depend on it
> : retaining it's value after a long piece of code. Sure, it might work
> : NOW, but if the code ever gets updated, maybe by somebody else, that
> : might break.
>
> If I worked in a place where people rudely trashed others' variables
> unannounced, I'd find somewhere else to work. If a subroutine is
> going to temporarily modify $_ or any other global variable, it should
> politely C<local $_;>.
>
I agree with Bart - you treat $_ as a register - if its value needs to
be preserved during some procedure that will alter its value then you
save it and restore it as you see fit. I could get very carried away
and treat it the same way as I would if it were an assmbler thing -
but you have this one register and you use it to its best advantage.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Mon, 7 Dec 1998 20:04:39 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Which modules to use
Message-Id: <nf1i47.8co.ln@metronet.com>
John Hankey (monkey@chisp.net) wrote:
: For "reading in" a HTML page I mean from a URL, similar to as in Java.
use LWP::Simple;
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 8 Dec 1998 01:10:22 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Why i can't "localize through a reference" in perl version 5.005_02
Message-Id: <74hu9u$k3d@fcnews.fc.hp.com>
FENG XIAN, ALEX (feng_xian@mitel.com) wrote:
: hi, all,
: i have a piece of perl script that ran fine under 5.004 version but
: after i moved to perl 5.005_02, i got an error message when the perl
: compile the code,
: Can't localize through a reference at perlscript.pl line 271.
: the code is like this,
: foreach $i (...) {
: $min_group_name = "min_group$i";
: 271=> local @{$min_group_name} = ();
: ...
: }
It's probably just more fortification against evil symbolic
references. Are you sure that an array-of-arrays (or just a "my"
variable, since you're localizing it anyway) wouldn't work just as
well? Why do you need unique variables names if you throw away the
value each iteration?
Besides that, here's a gross hack workaround:
@b=(7);
$a="b";
do
{
local *c=$a; # makes @c and @b the same array
local @c; # localizes @c (and thus also @b)
@b=(8);
print "@b @c\n";
@c=(9);
print "@b @c\n";
};
print "@b\n";
yields:
8 8
9 9
7
I was surprised that this even works at all when I tried it. It might
even work until 5.005_47 :)
: i am creating a local symbolic array. maybe perl doesn't suggest to use
: symblic variables, but sometime the symbolic variable is really flexible
: and very useful.
Only in perl4. In perl5, you can build any sort of data structure
using hard references, usually much easier than using symbolic
references.
Andrew Allen
------------------------------
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 4377
**************************************