[8437] in Perl-Users-Digest
Perl-Users Digest, Issue: 2054 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 9 07:14:10 1998
Date: Mon, 9 Mar 98 04:00:30 -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, 9 Mar 1998 Volume: 8 Number: 2054
Today's topics:
A simple question about command line variables... <smacmillan@iname.com>
Re: A simple question about command line variables... (A. Deckers)
Re: A simple question about command line variables... <uri@sysarch.com>
ANNOUNCE: DOCModify 1.4 to modify fields in every file <pivari@geocities.com>
ANNOUNCE: IndexMaker 5.1: an index.html maker from PDF, <pivari@geocities.com>
Re: Cookie extraction via Perl (A. Deckers)
Re: eval <uri@sysarch.com>
Re: Graphical menus in Perl? (Lozano Mosterin, Jesus)
HELP! <Jason13th@hotmail.com>
Re: how to automate the many web link pulls to my disk sneaker@mediaone.net
Re: How to check string variable against a number of pe <jefpin@bergen.org>
How to use CPAN modules (P.M.Wong )
Re: How to use CPAN modules (Jim Michael)
Re: install question... <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Interactive Tutorials? (Rick Figley)
Multi-methods? <jll@skynet.be>
ODBC; HPux and Microsoft SQL Query???
Re: random numbers? <c..bojswbo@86.usenet.us.com>
Re: regexp bourhis@qcd.th.u-psud.fr
Re: Retriving last item in array. <dgoyette@NoMoreSPAMpcisys.net>
Re: Sarathy port of perl for Win32 thinks it's a dos pr (Jim Michael)
Support for multicast sockets? (Chris Schleicher)
Re: Update another frame from Perl script. (A. Deckers)
Re: Using perl to do what a spreadsheet does but with a (Jon Orwant)
Re: What is PERL? Learn JAVA instead? (Bart Lateur)
Re: What is PERL? Learn JAVA instead? <dformosa@st.nepean.uws.edu.au>
Re: Win32::AdminMisc::GetDriveSpace and Active Server P <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 09 Mar 1998 01:24:07 -0500
From: "Scott A. MacMillan" <smacmillan@iname.com>
Subject: A simple question about command line variables...
Message-Id: <35038B07.6DB7DA7A@iname.com>
Hi, I've checked through the documentation that I have about Perl5.0 but
can't seem to find what I need. (WINNT40)
In my Perl script, I want to check for variables that the user my put on
the command line.
Example:
C:\>script.bat DAVID 47
If my scripts requires that the user types the command (script.bat)
followed by his name (DAVID) and his age (47), how can I access these
variables in my script?
In C-shell, $0 represents the scripts, $1 represents the firts variable,
$2 represents the second variable, and so on. What, if any, is the Perl
equivalent?
Thanks!
--
Scott A. MacMillan " If I'm ever a flash in the pan,
Sheridan College I shall consider myself lucky to have at least
Computer Animation been in the pan "
smacmillan@iname.com paraphrased from David Carson
------------------------------
Date: 9 Mar 1998 06:38:16 GMT
From: alain.deckers@man.ac.uk (A. Deckers)
Subject: Re: A simple question about command line variables...
Message-Id: <slrn6g73in.h40.alain.deckers@nessie.mcc.ac.uk>
In <35038B07.6DB7DA7A@iname.com>,
Scott A. MacMillan <smacmillan@iname.com> wrote:
[...]
>In C-shell, $0 represents the scripts, $1 represents the firts variable,
>$2 represents the second variable, and so on. What, if any, is the Perl
>equivalent?
Doesn't @ARGV work in the win32 world?
#!/usr/bin/perl -w
print join "\n", @ARGV;
Alain
------------------------------
Date: 09 Mar 1998 02:28:03 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: A simple question about command line variables...
Message-Id: <x7iupouxvg.fsf@sysarch.com>
alain.deckers@man.ac.uk (A. Deckers) writes:
> In <35038B07.6DB7DA7A@iname.com>,
> Scott A. MacMillan <smacmillan@iname.com> wrote:
> [...]
> >In C-shell, $0 represents the scripts, $1 represents the firts variable,
> >$2 represents the second variable, and so on. What, if any, is the Perl
> >equivalent?
>
> Doesn't @ARGV work in the win32 world?
probably not, fork doesn't :-)
uri
--
Uri Guttman SYStems ARCHitecture and Software Engineering
uri@sysarch.com Have Perl, Will Hack
http://www.sysarch.com (781) 643-7504 x*2 FAX: (781) 643-2710
Try the Best Search Engine on the Net --------> http://www.northernlight.com
------------------------------
Date: Mon, 09 Mar 1998 10:32:31 +0000
From: Fabrizio Pivari <pivari@geocities.com>
Subject: ANNOUNCE: DOCModify 1.4 to modify fields in every file
Message-Id: <3503C53E.F8E6346E@geocities.com>
Hi,
I'm glad to announce the version 1.3 of DOCModify.
DOCModify is a very flexible and powerfull PERL script. It permits you
to modify in every format file the fields you specify in the
configuration file modify.cfg. It works
with PERL 5.x on UNIX and Wintel Systems.
This tool is a free ANFACE Software tool.
What's new in 1.4 version:
Add verbose option
This is the URL where you can find the tool
http://www.geocities.com/CapeCanaveral/Hangar/4794/
Enjoy it!
Send me your suggestions
--
Fabrizio Pivari
mailto:pivari@geocities.com
http://www.geocities.com/CapeCanaveral/Lab/3469/
Member of ANFACE Software
http://www.geocities.com/CapeCanaveral/Hangar/4794/
------------------------------
Date: Mon, 09 Mar 1998 10:01:38 +0000
From: Fabrizio Pivari <pivari@geocities.com>
Subject: ANNOUNCE: IndexMaker 5.1: an index.html maker from PDF,HTML,VRML and other files
Message-Id: <3503BE01.8B694F9@geocities.com>
Hi,
I'm glad to announce the version 5.1 of IndexMaker a perl script to make
an index.html file from PDF, HTML, VRML and other files.
At the moment, it uses the /Author field, the first /Title field and in
the /Subject field
every matched PDF files, the <TITLE> </TITLE> field and the META
Description and Author fields
in every matched HTML files the Info node field in every matched VRML
1.0 files
the WorldInfo node field info and title in every matched VRML 2.0 files
and the name of the file in the others.
What's new with version 5.1
Without parameters, the help is print
Added PDFandSPIDER document
This is the URL where you can find the tool
http://www.geocities.com/CapeCanaveral/Lab/3469
--
Fabrizio Pivari
mailto:pivari@geocities.com
http://www.geocities.com/CapeCanaveral/Lab/3469/
Member of ANFACE Software
http://www.geocities.com/CapeCanaveral/Hangar/4794/
------------------------------
Date: 9 Mar 1998 06:29:41 GMT
From: alain.deckers@man.ac.uk (A. Deckers)
Subject: Re: Cookie extraction via Perl
Message-Id: <slrn6g732l.h40.alain.deckers@nessie.mcc.ac.uk>
In <35034314.22E92CBF@sympatico.ca>,
Brent Mondoux <brent@sympatico.ca> wrote:
>I have two books on Perl and neither of them cover the extraction and
>reading of a cookie. Odd enough...
Not really. "Cookie" is not a concept that exists in the Perl language.
>anyhow I was wondering if anyone
>could be so kind to send me some code that can extract a cookie that I
>wrote to the client using javascript? The cookie is called "username"
>by the way.
You need to read up on the CGI.pm module. You'll find it at
<URL:http://www.perl.com/CPAN/modules/by-module/CGI/>.
Alain
--
Perl information: <URL:http://www.perl.com/perl/>
Perl FAQ: <URL:http://www.perl.com/perl/faq/>
Perl archive: <URL:http://www.perl.com/CPAN/>
>>>>>>>> comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<
------------------------------
Date: 08 Mar 1998 23:12:05 -0500
From: Uri Guttman <uri@sysarch.com>
To: "Christopher Lambrou" <hold@cglis.com>
Subject: Re: eval
Message-Id: <x7ogzgv6y2.fsf@sysarch.com>
"Christopher Lambrou" <hold@cglis.com> writes:
> This is the code in question:
>
> eval {
> &foo;
> };
> print $@ if $@;
>
> sub foo {
> # blah, blah, blah
> return;
> }
>
> Question is: Will eval catch a runtime error inside sub foo?
yes
> Or should I include sub foo { } inside the eval block?
not needed if sub foo stays the same.
>
> Also, how do I trigger a run time error? In VB
> we just say "Err XXX" and that's it. Will 'die' do the
> same thing in Perl, assuming I'm insite an eval?
die, you sucker die!! :-)
use die to cause a fatal error whcih is trapped by eval.
read perlfunc eval for the details.
uri
--
Uri Guttman SYStems ARCHitecture and Software Engineering
uri@sysarch.com Have Perl, Will Hack
http://www.sysarch.com (781) 643-7504 x*2 FAX: (781) 643-2710
Try the Best Search Engine on the Net --------> http://www.northernlight.com
------------------------------
Date: 9 Mar 98 10:31:10 +0100
From: lozano@opalo.etsiig.uniovi.es (Lozano Mosterin, Jesus)
Subject: Re: Graphical menus in Perl?
Message-Id: <L+22oOyVEM5X@opalo.etsiig.uniovi.es>
In article <6dqjqh$pre@smash.gatech.edu>, kirk@kaybee.org writes:
> Is there a better way (without using any extra modules) to display
> a nice, graphical menu besides forking the 'dialog' program??
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Kirk Bauer -- Georgia Tech -- kirk@kaybee.org <== Finger for PGP
> http://www.kaybee.org/~kirk ResNet RTA Computer Engineering
> GT Sport Parachuting Club! http://cyberbuzz.gatech.edu/skydive
>
--
YES. I posted just this days ago and the post goes to null.
Here is again:
#!/usr/bin/perl
# FREE salvajada de J.Lozano using dialog-0.6z -a piece of stderr sh util
# origin returned val were: 1 on NO or Cancel, -1 on ESC, other otherwise
$base="dialog --backtitle \"t\.0\.1\" --";
($textodef, $altodef, $anchodef,$restodef) = ("",12,60,"");
$|=1;
&dodo ("clear");
$t = "Fundamental data";
$d= "Type in as you like:";
$dat = &dodo ("inputbox \"$d\" 10 50");
print "\r I get this ->$dat \n\a";
sleep 1;
$t="Other data\.\.\.";
$dat = &dodo ("textbox dialog\.pl 30 70");
$t= "This is the end\.\.\.";
$d= "I hope this helps you.\n Improve it, repost, and help me.\n\n Email me at \
lozano\@etsiig.uniovi.es \n\n finger avaible on lozano\@opalo.etsiig.uniovi.es";
$dat = &dodo ("msgbox \"$d\" 20 60");
$t= "last\, but not least\.\.\.";
$d= "\nDid you like it\?";
$dat = &dodo ("yesno \"$d\" 7 40");
if ($dat == -666) { $bla="NOOOP"; }
elsif ($dat == -69) { $bla="FIFTH_ENMENDMENT"; } #Why this don't work?
else { $bla = "YUUUUP"; }
$t= "Don't worry. Who cares much about\?";
$d= "Try another free method from this list";
$a= "ncurses with gnu C";
$b= "Curses-1.0.2 in perl";
$c= "maybe libreadline-*.gz module\?";
$dat = &dodo ("menu \"$d\" 14 55 4 1 \"$a\" 2 \"$b\" 3 \"$c\" ");
$t="-"; #ugh
$d="OK\, you typed $bla. to like/dislike question\n and prefered menu option was $dat \n \
and that's all what I wanted yesterday to know\!\n Plea, send me improvements\n\a Goodbye\!";
$dat = &dodo ("infobox \"$d\" 8 60");
sub dodo() {
my ($comand, $text, $alto, $ancho, $rest) = @_;
my ($res, $result)=0;
if (defined($t)){ $title="title \"$t\" --"; }
if (defined($text)){ $text=$textodef; }
if (defined($alto)){ $alto=$altodef; }
if (defined($ancho)){ $ancho=$anchodef; }
if (defined($rest)){ $rest=$restodef; }
$orden = $base.$title.$comand." ".$text." ".$alto.$ancho.$rest;
open(STDERR, ">/tmp/dialogout") || die "No puedo grabar /tmp/dialogout";
$res = system ($orden);
$res = $res/256; #any question? |-)
close STDERR; #personalized rulez -> infrecuent values
if ( $res == 1){
return -666; # NO or explicit CANCEL
}elsif ($res == -1){
return -69; # ESCape
}else{
open(IN, "/tmp/dialogout") || die "No puedo leer /tmp/dialogout (!)";
$result = <IN>; #chomp() not needed
close IN;
return $result;
}
}
---
perl -e 'print reverse(split("",":dionarap gnieb no desaelp era uoy fI")),"\n"'
e=44633196506372806702679568930241016072420372740654104856128065320983176095379
n=63928545982336976981162763955517745038001197960559116381014924921278270406501
perl -e 'print pack "B77", #longer key on finger lozano@opalo.etsiig.uniovi.es
"00111001001110000010110100110101001100010011100000110010001100010011000000111"'
------------------------------
Date: Sun, 08 Mar 1998 19:19:16 -0800
From: "[HJ]-Judak" <Jason13th@hotmail.com>
Subject: HELP!
Message-Id: <35035FB3.33DA@hotmail.com>
hi I just started to learn about Perl and CGI. I have perl interpreter
and a program called Sambar server, I can make perl program but I can't
get it to work on my brower(netscap), how do I get my *.pl program to
work on my brower???
Please help!! email me to jason13th@hotmail.com
Thanks a LOT.
a desperate student....
------------------------------
Date: Sun, 08 Mar 1998 22:30:08 -0600
From: sneaker@mediaone.net
Subject: Re: how to automate the many web link pulls to my disk
Message-Id: <6dvr6m$jia$1@nnrp1.dejanews.com>
In article <6dvbsn$vut$1@nnrp1.dejanews.com>,
thierry.metoudi@hol.fr wrote:
>
> Hi, I've just discovered Perl and I'd like to solve this problem:
>
> I want to automate the pulling of links from the web to my hard drive, for
> instance the many web pages ("my Yahoo", "news.com", a cgi returning a
chart
> or a map.
>
Lookup 'webmirror' - It will point you in the right direction...
>
> (I'm working on win 95 and have a DOS version of Perl)
Upgrade :-) NT Wks 4.0 is nice.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Sun, 8 Mar 1998 23:26:31 -0500
From: "I have a life, and I can prove it!" <jefpin@bergen.org>
To: Terry Carroll <carroll@tjc.com>
Subject: Re: How to check string variable against a number of permissible values, w/o compound IF?
Message-Id: <Pine.SGI.3.95.980308232457.15665B-100000@vangogh.bergen.org>
> if (($color ne 'Red') and
> ($color ne 'Green') and
> ($color ne 'Blue')) {
> print "Error: non-RGB color given\n";
> }
you could do:
unless (grep { $color eq $_ } 'Red','Green','Blue'){
print ....
}
or:
unless ($color =~ /^(green|red|blue)$/i){
print ....
}
--
| Some people say that I must be a horrible person, but that's not
| true. I have the heart of a young boy -- in a jar on my desk.
| - Stephen King
Jeff Pinyan | http://users.bergen.org/~jefpin | jefpin@bergen.org
techmaster@bergen.org | techmaster@mindless.com
qw[jeff] on #perl,#javascript,#cgi on IRC
&jp('"($``','','$)EDF8```','$*52J4```','$+E1G4```','#J``@','#2__`');sub
jp{for$w(@_){$c=unpack('B48',unpack('u',$w));$c=~tr/10/# /;print "$c\n"}}
------------------------------
Date: 9 Mar 1998 03:44:03 GMT
From: s11976@net1.hkbu.edu.hk (P.M.Wong )
Subject: How to use CPAN modules
Message-Id: <6dvoi3$cks$1@power42t.hkbu.edu.hk>
Sorry for asking such trivial question but i just can't find
any doc telling me what to do once i downloaded those CPAN modules
For example, i just downloaded the CGI_Lite and after extracting the
tar file, i found files like CGI_Lite.pm and Makefile.PL there.
Do i have to make it (that's using Makefile.PL) before i can use
it
OR simply copy the CGI_Lite.pm to the appropriate directory
(in my case it is /usr/local/lib/perl5/aix/5.00401 )
If i need to make it, how do i go about doing it
(I don't see any !#/usr/local/bin/perl line in the file Makefile.PL)
--
__
/ \_/ ) __ Pui Ming WONG (E-mail: pm@hkbu.edu.hk)
/ ( ------------- } System Support Programmer,
( =l=ll===============__} Computing & Telecomm. Services Centre
\ _ ( Hong Kong Baptist University
\_/ \__) 224 Waterloo Road, Hong Kong
------------------------------
Date: Mon, 9 Mar 1998 11:26:51 GMT
From: genepool@netcom.com (Jim Michael)
Subject: Re: How to use CPAN modules
Message-Id: <genepoolEpJuGr.KrK@netcom.com>
P.M.Wong (s11976@net1.hkbu.edu.hk) wrote:
: Sorry for asking such trivial question but i just can't find
: any doc telling me what to do once i downloaded those CPAN modules
: For example, i just downloaded the CGI_Lite and after extracting the
: tar file, i found files like CGI_Lite.pm and Makefile.PL there.
: Do i have to make it (that's using Makefile.PL) before i can use
Every module I have pulled off of CPAN had a readme with the instructions:
perl Makefile.PL
make
make test
make install
HTH.
------------------------------
Date: Sun, 8 Mar 1998 19:07:44 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: install question...
Message-Id: <6dvma3$qrt@bgtnsc02.worldnet.att.net>
Hmmmm. I tried opening CMD32 on my Win95 system and the same thing happened.
So, I tried a couple of tests:
run \PERL\BIN\CMD32 from the Start / Run box -- same thing
run \PERL\BIN\CMD32 perl -v from the Start / Run box -- I see the Perl info
screen, but then the box closes. Aha, I think!
So, I open up a DOS box and type the following lines:
C:\PERL5\BIN> CMD32 "perl"
for ($x=1; $x<=10000; $x++) {
print "$x\n";
}
^Z
and the program jumps to life. So it looks like on a Win95 system you can
open up CMD32 as a subprocess and run a Perl script from it. I did, however,
have trouble running the same program from the command line as a one-liner.
(The program said something like 'File not found -- ""'.) Go figure.
I've also had pretty good luck just running Perl scripts from the 95 command
prompt (and from 4DOS). I don't know if there's a difference between the two
environments. Hope this helps!
--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl
Dave and Sharon Mayer wrote in message ...
>I'm trying to install Perl for win 32 on my Win 95 computer. I've gone
>through the extract of build 315, and try executing the "cmd32.exe"
>executable, and then I have a problem. the executable appears to open, and
>then it quickly quits. does anyone have any suggestions for me?? I'd
>appreciate it....
>
------------------------------
Date: Sat, 7 Mar 1998 12:55:07 -0500
From: rickf@icanect.net (Rick Figley)
Subject: Interactive Tutorials?
Message-Id: <MPG.f6b53fa402826e898968c@news.icanect.net>
Can anyone direct me to where I might find Interactive Tutorials? By
interactive I mean tutorials that have me enter a given script- line by
line to tell me where problems exist as they are entered.
------------------------------
Date: Mon, 09 Mar 1998 11:57:23 +0100
From: Jean-Louis Leroy <jll@skynet.be>
Subject: Multi-methods?
Message-Id: <VA.00000073.0edc4727@jll_p133.INFOCAHB>
Like C++, Perl doesn't directly support multi-methods. Unlike C++, Perl
gives access to the machinery underlying the language, to the point
where you get the say on object layout (hash, array,
ObjectTemplate...). Hence it doesn't seem a priori impossible to hack
an implementation of MM.
Has research been done on this?
Jean-Louis Leroy
http://ourworld.compuserve.com/homepages/jl_leroy
------------------------------
Date: 9 Mar 1998 07:39:44 GMT
From: Query???
Subject: ODBC; HPux and Microsoft SQL
Message-Id: <6e06c0$sgc@triton.np.ac.sg>
Hi,
I have a Microsoft SQL server running on my NT. I would like to access
the server from my HPux(OS 9.05). Whet are the things that I must load and
on which side(NT/HPux) in order to make it work?
So far, I had loaded on my Hpux workstation:-
- Perl 5.004
- DBI 0.9
- ODBC 0.16 but has the followinf errors when I tried to run "perl
Makefile.PL" ERROR MESSAGE:=
========================================================================
Can't locate loadable object for module DBI in @INC (@INC contains:
/disk1/perl5/lib/PA-RISC1.1/5.00404 /disk1/perl5/lib
/disk1/perl5/lib/site_perl/PA-RISC1.1 /disk1/perl5/lib/site_perl .) at
./Makefile.PL line 12
BEGIN failed--compilation aborted at ./Makefile.PL line 12.
=-=====================================================================
Any pointers would be much appreciated.
Thanks.
------------------------------
Date: 9 Mar 1998 09:40:46 GMT
From: Anirvan Chatterjee <c..bojswbo@86.usenet.us.com>
Subject: Re: random numbers?
Message-Id: <6e0deu$5m3$1@samba.rahul.net>
mwsasser!nospam!@timetrend.com wrote:
> I'm trying to generate real random numbers but all I generally
> get are numbers from 8 to 14 when I try adding 3 random numbers from 1
> to 6. Should not 9 be the average number here? I'm trying
> int(rand(6)+1) what am I missing?
Iterations. 9 may be the average, but there's nothing to say 9 will be
the sum every time. Running the following snippet gave me 8.998 as a
result.
$total = 0;
$iterations = 10000;
for (1..$iterations) {
$total += rand(6) + rand(6) + rand(6);
}
print $total / $iterations, "\n";
_____________________________________________________________________
Anirvan Chatterjee . anirvan @ chatterjee.net . PGP 2048/0xE2D13BA9
Fast & free new/used multi-bookstore searching @ http://www.mxbf.com/
------------------------------
Date: Mon, 09 Mar 1998 04:30:43 -0600
From: bourhis@qcd.th.u-psud.fr
Subject: Re: regexp
Message-Id: <6e0gam$864$1@nnrp1.dejanews.com>
In article <3500CBD3.8EF643D@coos.dartmouth.edu>,
rjk@coos.dartmouth.edu wrote:
>
> [posted and mailed]
>
> bourhis@qcd.th.u-psud.fr wrote:
> >
> > I want to remove the sequence '\n', five spaces and one character which is
not
> > whitespace in a string. I tried the regexp /\n {5}\S/ but it does not
work.
> > Strangely (for me), the regexp / {5}\S/ and /\n {5}/ works.
>
> Are you sure the string only has 5 spaces between the \n and the
> non-whitespace character? It sounds to me like it has more than that.
Yes, you are right, but there should be only 5 spaces. First, here is the code
#!/usr/local/bin/perl
open(IN, "example.f");
@line = <IN>;
$line = "@line";
$line =~ s/\n {5}\S//g;
print $line;
and here is the file "example.f" in which I want to remove the sequence '\n',
five spaces and '_' (the last one could be another non white character so I
use \S in the regexp).
call the_big_routine(1.,2.,3.)
end
SUBROUTINE the_big_routine ( param1 , param2 param23
_ param21, param3 )
print*,param2param23param21
end
real * 8 function a_function (param1, param2)
end
character * ( * ) FUNCTION an_another_function (param1, param2)
end
real FUNCTION func (param1, param2)
end
double precision function func2 (param1, param2)
end
and it does not work. With 's/ {6}\S//g', it works. But it seems to me that
there is 5 spaces before the beginning of the fourth line and '_' ??!!
Luc
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 9 Mar 1998 03:38:51 GMT
From: "Don" <dgoyette@NoMoreSPAMpcisys.net>
Subject: Re: Retriving last item in array.
Message-Id: <01bd4b0c$9cfda040$c836e6d0@586win95>
Use -1 as the subscript, I believe. I'm a newbie, so I could be wrong.
-Don
---------------------------------------------------------------------
Mike <mhanson@arrowweb.com> wrote in article <350204C5.CDA@arrowweb.com>...
> How would you retrieve the last item in an array?
>
------------------------------
Date: Mon, 9 Mar 1998 03:20:53 GMT
From: genepool@netcom.com (Jim Michael)
Subject: Re: Sarathy port of perl for Win32 thinks it's a dos program
Message-Id: <genepoolEpJ7yt.8Ku@netcom.com>
pramsey@iname.com wrote:
: Sarathy port thinks it's a dos program. More accurately,
Run install.bat from the dos prompt. The installation program is
interactive, so you have to answer a couple of questions first.
Cheers,
Jim
------------------------------
Date: 8 Mar 1998 19:47:41 -0800
From: chrissch@cs.uoregon.edu (Chris Schleicher)
Subject: Support for multicast sockets?
Message-Id: <6dvoot$epk@psychotix.cs.uoregon.edu>
Keywords: perl multicast
After finding nothing but simulated multicast in the manpages
(perlipc), no mention of multicast in the FAQ, and no definitions for
things such as IPPROTO_IP or IP_MULTICAST_TTL in Socket.pm, I've
become fairly convinced that Perl doesn't support multicast.
Before I retreat to (dare I say it) C, could someone please confirm
that Perl does not support IP multicast? I've seen (via AltaVista)
this question asked twice in the past two months, both times without a
public answer. Could someone please post a response along with /
instead of an email CC so that the next person who actually tries to
get an answer to this question without increasing the volume of this
group can do so? :-)
Thanks,
--Chris
--
Chris Schleicher Office: 541/346-3998
Univ of Oregon CIS GTF email: chrissch@cs.uoregon.edu
URL: http://www.cs.uoregon.edu/~chrissch/
------------------------------
Date: 9 Mar 1998 06:31:33 GMT
From: alain.deckers@man.ac.uk (A. Deckers)
Subject: Re: Update another frame from Perl script.
Message-Id: <slrn6g7364.h40.alain.deckers@nessie.mcc.ac.uk>
In <6cs9uc$s8v@camel20.mindspring.com>,
Rick Ryan <rickryan@datrixnet.com> wrote:
>I'm building a messaging system with 2 frames. Frame 1 has a list of message
>headers. When the user clicks a message header I want to run a system
>program (with back ticks), then return the results (message text) to frame
>2. Oh yea, this is under (shudder) NT. Any suggestions?
Yes. Please read the relevant FAQs posted to
comp.infosystems.authoring.cgi.
Alain
--
Perl information: <URL:http://www.perl.com/perl/>
Perl FAQ: <URL:http://www.perl.com/perl/faq/>
Perl archive: <URL:http://www.perl.com/CPAN/>
>>>>>>>> comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<
------------------------------
Date: 08 Mar 1998 19:28:16 GMT
From: orwant@cyrano.media.mit.edu (Jon Orwant)
To: Tony Gonzalez <oak@crl.OmitThis.com>
Subject: Re: Using perl to do what a spreadsheet does but with a plain text file as a source?
Message-Id: <ORWANT.98Mar8142816@cyrano.media.mit.edu>
Tony Gonzalez <oak@crl.OmitThis.com> writes:
I'd like to use perl to do what a spreadsheet does but with a plain
text file as a source, for example, if I have a text file like this:
Mon. Tues. Total
------------------------
Joe Schmoe 5.3 1.2 TOTAL?
John Doe 2.5 4.6 TOTAL?
William Henry 1.3 3.2 TOTAL?
Is there any way I can generate a report like the above with the
totals computed?
Here's a simple solution that might be good enough for your purposes.
Learn more about regular expressions (see the perlre documentation) if
you want to make this more robust.
#!/usr/bin/perl
while (<>) {
@hours = /(\d+\.?\d+)/g;
if (@hours) {
$total = 0;
foreach (@hours) { $total += $_ }
s/TOTAL\?/$total/;
}
print;
}
When fed your text, it outputs:
Mon. Tues. Total
------------------------
Joe Schmoe 5.3 1.2 6.5
John Doe 2.5 4.6 7.1
William Henry 1.3 3.2 4.5
-Jon
------------------------------------
Jon Orwant http://tpj.com
Editor & Publisher, The Perl Journal
--
------------------------------
Date: Mon, 09 Mar 1998 09:00:44 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: What is PERL? Learn JAVA instead?
Message-Id: <3507af66.4206870@news.tornado.be>
Evan Kirshenbaum <evan@garrett.hpl.hp.com> wrote:
>No, there appears to be a mark and sweep at the end of the interpreter
>(as is described in the documentation).
I repeat: there is NO reason to go through a mark stage, as there can
not be anything left to keep! What would you keep it for?
So, in short: simply everything is destroyed.
HTH,
Bart.
------------------------------
Date: 9 Mar 1998 11:01:47 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: What is PERL? Learn JAVA instead?
Message-Id: <889441307.554792@cabal>
In <3507af66.4206870@news.tornado.be> bart.mediamind@tornado.be (Bart Lateur) writes:
>Evan Kirshenbaum <evan@garrett.hpl.hp.com> wrote:
>>No, there appears to be a mark and sweep at the end of the interpreter
>>(as is described in the documentation).
>I repeat: there is NO reason to go through a mark stage, as there can
>not be anything left to keep! What would you keep it for?
Would not some DESTROY subs need to access the infomation contained in the
unsweeped code?
--
Please excuse my spelling as I suffer from agraphia see the url in my header.
Never trust a country with more peaple then sheep.
Support NoCeM http://www.cm.org/
I'm sorry but I just don't consider 'because its yucky' a convincing argument
------------------------------
Date: Sun, 8 Mar 1998 21:42:15 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: Win32::AdminMisc::GetDriveSpace and Active Server Pages
Message-Id: <6dvvbp$5qf@bgtnsc02.worldnet.att.net>
Most likely it's something simple. I haven't checked this (my NT system is
at work :D), but I would guess that your Perlscript routine is unable to
access \\(server)\c$ properly. It's a hidden, administrative share and not
necessarily meant to be seen or accessed by everybody.
--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl
Jeff Cross wrote in message <6dtc24$a2c$1@ns15.wwisp.com>...
>When checking disk space on a drive in a remote NT server, I can use the
>following script with the AdminMisc module -
>
>use Win32::AdminMisc;
>$Server=MYSERVER;
>$UNCPath = "\\\\".$Server."\\"."C"."\$"."\\";
>($Total, $Free) = Win32::AdminMisc::GetDriveSpace($UNCPath);
>print "$Total\n";
>print "$Free\n";
>
>The Total disk space and Free disk space of the remote server displays
>correctly.
>
>When using the following PerlScript in an Active Server Page, the Total and
>Free space equals zero?
>
><%@LANGUAGE = PerlScript %>
><HTML>
><HEAD>
><Title>Get Drive Space</Title>
></HEAD>
><BODY>
><H1>Get Drive Space</H1>
>
><%
>use Win32::AdminMisc;
>$Server = MYSERVER;
>%>
>
><H2>Server <%= $Server %></H2>
>
><%
>$UNCPath = "\\\\".$Server."\\"."C"."\$"."\\";
>%>
>
><%
>($Total, $Free) = Win32::AdminMisc::GetDriveSpace($UNCPath);
>%>
>
><h2>Total = <%= $Total %></h2>
><h2>Free = <%= $Free %></h2>
>
></BODY>
></HTML>
>
>Why isn't the correct drive information being returned? Anyone have
>experience with this? I've searched the web and cannot find any help with
>this as it appears that most developers use VBScript instead of PerlScript
>with ASP. The build of Perl and PerlScript is 315. IIS is version 4.0.
>
>Thanks,
>
>Jeff
>
>
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
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 2054
**************************************