[10261] in Perl-Users-Digest
Perl-Users Digest, Issue: 3854 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 30 00:09:15 1998
Date: Tue, 29 Sep 98 21:00:18 -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 Tue, 29 Sep 1998 Volume: 8 Number: 3854
Today's topics:
About CPAN <gzhel@space.ru>
Re: Automatically uploading files with perl <sneaker@sneex.fccj.org>
Re: BANIP <sneaker@sneex.fccj.org>
Re: Can't find YIELD in threaded perl on Solaris. <jhein@timing.com>
Re: CGI.pm - forms within tables - How to? <jdw@dev.tivoli.com>
Re: date::manip and GMT/localtime <hevsys@enteract.com>
Re: Email parser (Wotan)
Re: Find NbOfCpu (Martien Verbruggen)
lightweight date checker NOT DATE::MANIP mizpoon@my-dejanews.com
Linux - Perl code for email to fax gataway - Interested <ccadic@cadic.com>
Re: mod_perl file closing problem (David Formosa)
Multithreaded server and client processes that sort-of (Jeeves)
Re: need a regular expressions expert.... <jdporter@min.net>
Re: need a regular expressions expert.... (Abigail)
Need IP Address Sort Subroutine <willliams@clark.net>
Re: Need IP Address Sort Subroutine <jdporter@min.net>
Re: new term for illogical (David Formosa)
Re: new term for illogical (Craig Berry)
Re: new term for illogical (Abigail)
Passing Perl Var To JavaScript - How? (Ralph Freshour)
Re: restricting script execution? <sneaker@sneex.fccj.org>
Simple database recommendation needed <cdavies@harris.com>
Some kind of 'real' user interface? <david@nospam.port80.com>
system function question <julio13@ibm.net>
Re: system function question (Martien Verbruggen)
Re: Unix & Perl Newbie Questions <sneaker@sneex.fccj.org>
Re: Unix & Perl Newbie Questions (Craig Berry)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 28 Sep 1998 18:16:54 +0300
From: "news.space.ru" <gzhel@space.ru>
Subject: About CPAN
Message-Id: <6uo5lt$4ko$1@zware.space.ru>
How download all CPAN or only latest versions of Perl-modules?
Thank You. Yurin Andrey from Russia
------------------------------
Date: Tue, 29 Sep 1998 21:18:39 -0400
From: Bill 'Sneex' Jones <sneaker@sneex.fccj.org>
Subject: Re: Automatically uploading files with perl
Message-Id: <361186EF.120BAE70@sneex.fccj.org>
Dennis M. Parrott wrote:
>
> mcalbers@my-dejanews.com wrote:
> >
> > Hello,
> >
> > Does anyone know how to automatically changing the content of a web page using
> > perl.
> > I need to add an url every week.
> >
> >
>
> yes, I do. for the appropriate fee, I could be enticed to tell you!
> --
Oh No! Me, Me!! Let me tell ya how!
Pretty please!
-Sneex- :]
__________________________________________________________________
Bill Jones FCCJ Webmaster | http://www.fccj.org/cgi/mail?webmaster
__________________________________________________________________
We are the CLPM... Lower your standards and surrender your code...
We will add your biological and technological distinctiveness to
our own... Your thoughts will adapt to service us...
...Resistance is futile...
------------------------------
Date: Tue, 29 Sep 1998 21:30:01 -0400
From: Bill 'Sneex' Jones <sneaker@sneex.fccj.org>
Subject: Re: BANIP
Message-Id: <36118999.BED79CE7@sneex.fccj.org>
Moishe Wasserman wrote:
>
> Is there a way to ban someone from an HTML page. I know how to do it in
> perl, but then I dont know how to call it to the HTML page.
>
> Please MAIL me the reply moishew@globalserve.net
Not a perl question but a -
firewall, or
router, or
tcp-wrappers, or
.htaccess, etc
issue. Look at various WWW configuration files, etc...
PS - By the time the IP address has seen your Perl script,
it's prolly already to late...
HTH,
-Sneex- :]
__________________________________________________________________
Bill Jones | FCCJ Webmaster | http://webmaster.fccj.org/Webmaster
__________________________________________________________________
We are the CLPM... Lower your standards and surrender your code...
We will add your biological and technological distinctiveness to
our own... Your thoughts will adapt to service us...
...Resistance is futile...
------------------------------
Date: Tue, 29 Sep 1998 18:35:08 -0600
From: "John E. Hein" <jhein@timing.com>
To: Lavoie Philippe <lavoie@zeus.genie.uottawa.ca>
Subject: Re: Can't find YIELD in threaded perl on Solaris.
Message-Id: <36117CBC.6295A49D@timing.com>
I ran into this as well... (Sol 2.6 x86). I would guess that we
could use '#define YIELD thr_yield' in thread.h, but
I'm not sure about that, nor about the best way to test it
(since I don't have any code yet to test it with).
If anyone finds out, let us know.
thr_yield is in the Sol 2.6 libc, btw.
Lavoie Philippe wrote:
> Hi,
>
> line 465 of Thread.xs fails because it can't find YIELD.
>
> For now I'm recompiling without the threading option, but I'd
> appreciate a patch.
>
> PS Solaris 2.5.1 on Ultra1 and Solaris2.6 on Pentium gives this error
------------------------------
Date: 29 Sep 1998 15:35:40 -0500
From: Jim Woodgate <jdw@dev.tivoli.com>
Subject: Re: CGI.pm - forms within tables - How to?
Message-Id: <obyar2zmg3.fsf@alder.dev.tivoli.com>
Steve_D_Jones@hp.com (Steven D Jones) writes:
> What I'm looking for is specific syntax examples. I've used CGI.pm to create
> both tables and forms, but not both together. I can't figure out the syntax
> to put the different radio buttons from a common radio group into different
> cells of a table.
how about:
print table({-border => 1},
TR( td( [radio_group( {'name' => 'test',
'values' => ['test1',
'test2',
'test3']})],
)));
--
Jim Woodgate
Tivoli Systems
E-Mail: jdw@dev.tivoli.com
------------------------------
Date: Tue, 29 Sep 1998 20:07:22 -0500
From: Jeff McClain <hevsys@enteract.com>
To: Russ Allbery <rra@stanford.edu>
Subject: Re: date::manip and GMT/localtime
Message-Id: <36118449.D94E9D2@enteract.com>
Russ,
Steve posted this for me. I have one Linux system FTPing a file up to
another Linux system. In this file is a value of GMT. I need to reflect the
hours different then localtime.
Example:
14:00 GMT time
8:00 converted time
real local time 15:00
difference I need 7 hours
Your perl script did not do what I needed in fact it gave me
1/1/70 00:00 as the GMT time and 6 hours earlier for the
local time. I tried several attempt at syntax but am getting
not getting anywhere. Any help would be appreciated
Jeff McClain
Russ Allbery wrote:
> Steve <syarbrou@ais.net> writes:
>
> > Has anyone used Date::Manip to convert GMT to localtime? If so, how do
> > you go about doing that?
>
> I would usually use Date::Parse to do this, as it's considerably
> lighter-weight.
>
> use Date::Parse;
> $time = str2time ($date, 'GMT');
> $localtime = localtime $time;
>
> --
> #!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
> $^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
> 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
> rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Wed, 30 Sep 1998 02:48:58 GMT
From: wotan@databasix.co (Wotan)
Subject: Re: Email parser
Message-Id: <36309b6c.1125066850@nntpd.databasix.com>
For some reason on Tue, 29 Sep 1998 09:04:07 -0700,
Andrew Perrin <aperrin@mcmahon.qal.berkeley.edu> babbled:
>[Reply posted and sent via e-mail]
>
>1.) In the spirit of avoiding wheel-reinvention, check out procmail, a
>free (I think) utility that does much of what you want without writing
>perl scripts. If it's not already on your system you can install it
>locally and pipe your mail through it.
>
>2.) Alternatively, the Mail::Internet and Mail::Header packages
>available at CPAN will help you a lot.
And, someone actually wrote a perl version of filter. More of an
upgrade as its abilities are far greater. Ask on comp.mail.misc,
since I no longer remember what it was called. I prefered Procmail
myself. :-D
--
The best book on programming for the layman is
"Alice in Wonderland"; but that's because it's
the best book on anything for the layman.
------------------------------
Date: Tue, 29 Sep 1998 23:39:08 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Find NbOfCpu
Message-Id: <wceQ1.21$tK.146588@nsw.nnrp.telstra.net>
In article <3610FBB2.99A4AF3B@fairchildsemi.com>,
Christopher Marquis <Christopher.Marquis@fairchildsemi.com> writes:
> Does anyone know of a module, function or some spawned shell trick to
> find the number of cpu's running on a Solaris or HP/UX box?
You could see if you can get that information from prtconf or sysdef,
although I don't think it's in there. Parsing the output of dmesg
looking for cpu# (where # is a number) might tell you more.
You could write some XS stuff to access the sysconf(3C) library
function. If you pass that a name of _SC_NPROCESSORS_CONF or
_SC_NPROCESSORS_ONLN you should get back the number of processors
configured and online. You could of course also write a little C
program that returns these things on stdout.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au |
Commercial Dynamics Pty. Ltd. | What's another word for Thesaurus?
NSW, Australia |
------------------------------
Date: Tue, 29 Sep 1998 23:43:14 GMT
From: mizpoon@my-dejanews.com
Subject: lightweight date checker NOT DATE::MANIP
Message-Id: <6urrai$g6g$1@nnrp1.dejanews.com>
hi there. I'm looking for a very quick function to confirm whether a date is a
valid one. basically I want to check if '2/31/1998' is a valid date or not.
currently I'm using Date::Manip to do this, but this module is HUGE and takes
a considerable amount of time to return.
does anyone else know a cheap alternative to this?
please reply to pouneh@wired.com as I don't read this newsgroup that often...
thanks,
pouneh
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Wed, 30 Sep 1998 02:42:37 +0200
From: "cadic" <ccadic@cadic.com>
Subject: Linux - Perl code for email to fax gataway - Interested ?
Message-Id: <6urut8$8c$1@platane.wanadoo.fr>
I've programed an email to fax gateway.
It autoconnects to any ISP, gets the email , screens it to search for fax
emails then send faxes.
It runs on redhat version of linux with qmail, procmail, fetchmail and one
POP3 account. you may keep your mail.
Please mail if interested .
I would like to beta testers and suggestions for future devs.
YOUrs
------------------------------
Date: 30 Sep 1998 09:25:04 +1000
From: dformosa@zeta.org.au (David Formosa)
Subject: Re: mod_perl file closing problem
Message-Id: <6urq8g$heo$1@godzilla.zeta.org.au>
In <m3af3joy6u.fsf@joshua.panix.com> Jonathan Feinberg <jdf@pobox.com> writes:
>ryan@mail.ramresearch.com (Ryan McGuigan) writes:
>> How can I close all open files that are still open, if I don't know
>> what files are open?
>You can't[*]. Therefore you must *know what files are open*.
exit;
Would solve this problem, I think that this (untested) code would
do it as well.
for (keys %::) {
close $::{$_};
}
Althoug it most likely has negative side effects.
--
Please excuse my spelling as I suffer from agraphia. See the URL in my
header to find out more.
------------------------------
Date: 30 Sep 1998 01:14:48 GMT
From: darlenem@flash.net (Jeeves)
Subject: Multithreaded server and client processes that sort-of interact...
Message-Id: <6us0m8$s40$1@excalibur.flash.net>
I am somewhat new to Unix sockets and I/O redirection procedures, and I'm
having some trouble building a multithreaded server script that will process
input from a multitude of clients and send output to the proper clients. The
example of a multithreaded server given in the perlipc manpage was an excellent
starting point, but I'm not sure how to modify it to do what I need it to do.
On receipt of a new connection, the server needs to:
1) Initialize an instance of a class
2) Store the instance in several hashes and some arrays
3) Make the STDIN and STDOUT on the process originating the connection
correspond to filehandles (?) in the instance.
In step 1, the server constructs a class instance and chats with the client a
bit to determine how to initialize it; this step is somewhat like a login
process. If the user exists (this is determined by looking in a hash generated
from some files), the instance's variables are set to particular values stored
in more files. If the user does not exist, some server-spawned process talks to
the client some more and determines the necessary values.
In step 2, the newly-created instance gets stored in a bunch of places (I'm
using references here, of course). However, the hard bit is somewhere between
steps 2 and 3, where whatever filehandles on the client connection
corresponding to STDIN and STDOUT need to be kept in variables of the new
instance, so that they can be recalled later. The idea here is that as input is
received from the client, it is processed by the server (or more accurately,
by some processes spawned by the server), which can then print output to the
client's stdout. I'm pretty sure there can only be one stdout/stdin per
process, and I do not believe processes may be directly stored as variables
(probably wouldn't want to anyways).
To descend further into the grotesque details of all this (grotesque because it
gets complicated, and grotesque because I'm sure my methodology is all wrong),
what actually happens is that each client process (meaning the subprocesses
forked by the multithreaded server from the perlipc manpage) runs a loop which
reads lines from STDIN (_hopefully_, this is the keyboard on the remote user's
machine), splits up the line into tokens, and calls one of a limited number of
subroutines. As these subroutines are called, they probably need to be passed a
reference to the Client instance, so that they can print to its filehandles.
They may be called the next second by a totally different client process, which
will naturally have different filehandles to be printed to.
Help and/or advice would be appreciated. I'm familiar with the mechanics of
Perl, but not with the general intricacies/wizardry of Unix sockets and
I/O stuff, and not very adept at IPC yet either.
- Dominic Espinosa
(darlenem@flash.net)
P.S. I've danced around the purpose and function of the application I'm
writing, but just for the hell of it, can anyone guess what it is I'm up to? =)
--
---------------------------------------------------------------------
J | Copyright (c) 1997 Jeeves Industries Limited.
J | All rights reserved. Void where prohibited.
J | Some restrictions may apply. Limit 1 per customer.
J J | Offer not valid in conjunction with any other offer.
JJJ | Some sold separately. Not intended for children under 3.
---------------------------------------------------------------------
>From .cshrc:
alias rm 'rm -rf \!*'
alias hose kill -9 '`ps -augxww | grep \!* | awk \'{print $2}\'`'
alias kill 'kill -9 \!* ; kill -9 \!* ; kill -9 \!*'
alias renice 'echo Renice\? You must mean kill -9.; kill -9 \!*'
=====================================================================
------------------------------
Date: Tue, 29 Sep 1998 19:43:48 -0400
From: John Porter <jdporter@min.net>
Subject: Re: need a regular expressions expert....
Message-Id: <361170B4.77011E1F@min.net>
Uri Guttman wrote:
> >>>>> "MB" == Matthew Bafford <dragons@scescape.net> writes:
> MB> if ( /^[^B][^A][^D]$/ )
>
> boy, two exactly same incorrect answers to a single post. see my
> followup to matt knecht. you do have the $ anchor but the rest is very
> wrong. negating each char is not negating the string.
> it is very 'reese' (see my post about a new perl term) to do this.
I'm sorry, but that is an incorrect usage of the term.
You should not equate honest, innocent, newbie, clue deficiency
with wanton disregard for rationality.
--
John "Many Jars" Porter
------------------------------
Date: 30 Sep 1998 00:44:10 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: need a regular expressions expert....
Message-Id: <6urusq$7eb$2@client3.news.psi.net>
Matt Knecht (hex@voicenet.com) wrote on MDCCCLV September MCMXCIII in
<URL:news:QncQ1.1068$7Q6.7122073@news2.voicenet.com>:
++
++ This doesn't make much sense to me, but if you don't want to use
++ neagtion, just specify a different regex.
++
++ /^[^B][^A][^D]/
++
++ Comes to mind as one way to do it.
But that disallows "HAPPY" as well.
Abigail
--
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT
------------------------------
Date: Tue, 29 Sep 1998 19:24:39 -0400
From: "Joe Williams" <willliams@clark.net>
Subject: Need IP Address Sort Subroutine
Message-Id: <6urq6t$pe2$1@callisto.clark.net>
Does anyone have, or can anyone me toward a routine that will sort IP
addresses? Many thanks.
------------------------------
Date: Tue, 29 Sep 1998 19:49:37 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Need IP Address Sort Subroutine
Message-Id: <36117211.862D3281@min.net>
Joe Williams wrote:
>
> Does anyone have, or can anyone me toward a routine that will sort IP
> addresses? Many thanks.
I assume you want to sort them numerically.
You will therefore want to be able to convert dotted-quad
notation to an integer. The following sub does it:
sub dotted_to_int {
return undef if $_[0] =~ /[^0-9.]/;
my @a = split /\./, $_[0];
my $n = pop @a;
return undef unless $n < (256 ** ( 4 - @a ));
for ( 0..$#a ) {
return undef unless $a[$_] < 256;
$n += ( $a[$_] << (8*(3-$_)) );
}
$n;
}
(It actually accepts all valid dotted-number notations,
not just dotted-quad.)
Then you can use a Schwartzian Transform to do the sort:
@ips_sorted =
map { $_->[0] }
sort { $a->[1] <=> $b->[1] }
map { $_, dotted_to_int( $_ ) }
@ips;
Hope this helps.
--
John "Many Jars" Porter
------------------------------
Date: 30 Sep 1998 09:35:57 +1000
From: dformosa@zeta.org.au (David Formosa)
Subject: Re: new term for illogical
Message-Id: <6urqst$if8$1@godzilla.zeta.org.au>
In <36115D3E.5A0F487E@bbnplanet.com> Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> writes:
>Abigail wrote:
>> Can we then define "to uri" as "to forget how the shift key works"?
>Hmm...'to abigail'...what could that possibly be?
To Abigail is the practice of useing a map in a void context.
--
Please excuse my spelling as I suffer from agraphia. See the URL in my
header to find out more.
------------------------------
Date: 30 Sep 1998 00:26:46 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: new term for illogical
Message-Id: <6urts6$n5g$1@marina.cinenet.net>
Abigail (abigail@fnx.com) wrote:
: Uri Guttman (uri@camel.fastserv.com) wrote on MDCCCLV September MCMXCIII
: in <URL:news:saraf3ivd0s.fsf@camel.fastserv.com>:
: ++ i just was writing to elaine (happy fun girl) about something and i
: ++ invented a new term. we might want to use in perl discussions.
: ++
: ++ i was saying how if i drink alcohol i get 'reese' as i lose my ability
: ++ to think logically.
:
:
: Can we then define "to uri" as "to forget how the shift key works"?
RTFM. Everybody knows that URI's are case insensitive. :)
[and yes, I know that isn't *always* true, but I hope you obsessive people
will let that nit slide...]
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: 30 Sep 1998 00:32:49 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: new term for illogical
Message-Id: <6uru7h$7eb$1@client3.news.psi.net>
Uri Guttman (uri@camel.fastserv.com) wrote on MDCCCLV September MCMXCIII
in <URL:news:saryar2tvgb.fsf@camel.fastserv.com>:
++
++ dear abby,
*plonk*
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
------------------------------
Date: Wed, 30 Sep 1998 03:13:09 GMT
From: ralph@primemail.com (Ralph Freshour)
Subject: Passing Perl Var To JavaScript - How?
Message-Id: <3611a18c.7462898@news.mindspring.com>
I have a perl/cgi form with some JavaScript in it - I'm trying to pass
a perl variable to a javascript function and cannot quite figure out
how to do this. My perl code reads a variable ($usingName) out of a
file on the server side and I need to pass this value to my JS for
some checking.
What I have thus far:
(snippet of code in my javascript)
function addToList(inform)
if (inform.usingName == "no")
{
alert("\\nYou must use a first name\\n");
continue;
}
<INPUT TYPE="HIDDEN" NAME="usingName" VALUE="$usingName">
Am I passing it correctly by using a Hidden Field?
Or do I need to be passing the usingName arg to the function
addToList?
My cgi, perl and html manuals do not cover this aspect, as least I did
not find anything in them that gave me any guidence on how to do this
- my Netscape web site JS Manual does not mention this either.
Any help appreciated...
Ralph
------------------------------
Date: Tue, 29 Sep 1998 21:42:26 -0400
From: Bill 'Sneex' Jones <sneaker@sneex.fccj.org>
Subject: Re: restricting script execution?
Message-Id: <36118C82.E85009F2@sneex.fccj.org>
Kiril wrote:
>
> what I am driving at is (I suppose) is a 'security' shell between an
> eval'd script
> and the functions it calls.
>
You're killin' me! :]
What you want is a fully functional Unix system with
appropriate security set on all the 'bad' stuff.
(Then all you need to do is Telnet in. Hmmm, what a concept!)
Just teasing... :]
Yes, this has been discussed and written up before -
look at various DejaNews perl-group postings...
HTH,
-Sneex- :]
__________________________________________________________________
Bill Jones | FCCJ Webmaster | http://webmaster.fccj.org/Webmaster
__________________________________________________________________
We are the CLPM... Lower your standards and surrender your code...
We will add your biological and technological distinctiveness to
our own... Your thoughts will adapt to service us...
...Resistance is futile...
------------------------------
Date: Tue, 29 Sep 1998 18:32:56 -0400
From: Charlie Davies <cdavies@harris.com>
Subject: Simple database recommendation needed
Message-Id: <36116018.38991FDC@harris.com>
I am working on an UNIX based application where I need a simple
database. I was looking for a recommendation from this group.
The database will be fairly small 20K-40K records. Each record would
have 3 text fields, each containing 50-60 characters. During a normal
session, I will have to open the DB, find a given record, update its
content, and close the DB.
I don't have access to commercial databases for this application.
Any recommendations would be greatly appreciated.
--
\_\_ \_\_\_ \_\_\_ Charlie Davies Harris ASD
\_ \_ \_ \_ \_ P.O. Box 94000
\_ \_\_ \_ \_ Voice: 407-727-6235 MS 102-4832
\_ \_ \_ \_ \_ Pager: 407-690-8518 Melbourne, Fl 32902
\_\_ \_\_\_ \_\_\_ FAX: 407-729-3212 Location: 102-3422
mailto:cdavies@harris.com
------------------------------
Date: 29 Sep 98 11:30:20 GMT
From: "David" <david@nospam.port80.com>
Subject: Some kind of 'real' user interface?
Message-Id: <01bdeb9d$09f90730$e5c499c3@fozzie>
hi there,
I'm trying to work out how I can add some kind of 'graphical
interface' to my Perl programs running under NT. I don't mind
using a DOS window interface (with limited menus, and graphics)
but a Windows interface would be even better.
Does anyone have any advice as to what modules to use for
this kind of thing?
thanks for any help
david
------------------------------
Date: Tue, 29 Sep 1998 21:48:41 -0400
From: "John Burnett" <julio13@ibm.net>
Subject: system function question
Message-Id: <36118ddf.0@news1.ibm.net>
This may be a rookie question but if anyone can help, please do so:
If I code a while loop, that reads data from a file like this;
$line = <LSVG_file>;
while ($line ne "") {
system("lsvg $line > dummy.out");
print ($line);
$line = <LSVG_file>;
}
the contents of the file do not get written to dummy.out, but rather
the program lsvg works on the contents of $line, so the read occurs
properly, but the output gets written to stdout, and dummy.out remains
empty. If I insert a line of code into the above to assign a value to $line
then everything works ok. So,
the catcher seems to be that the data in the scalar $file comes from reading
a file, line by line, rather than being assigned in the code.
Thanks for any thoughts.
John Burnett julio13@ibm.net
------------------------------
Date: Wed, 30 Sep 1998 02:45:48 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: system function question
Message-Id: <wXgQ1.52$tK.266217@nsw.nnrp.telstra.net>
In article <36118ddf.0@news1.ibm.net>,
"John Burnett" <julio13@ibm.net> writes:
> This may be a rookie question but if anyone can help, please do so:
> If I code a while loop, that reads data from a file like this;
I suppose you did open the file, and checked to see that it succeeded?
> $line = <LSVG_file>;
This only reads the first line from the file, and puts its contents in
$line.
> while ($line ne "") {
Depending on what the first line in the file is, this either gets
executed once, or never (if you happen to have nothing in the file at
all.
> system("lsvg $line > dummy.out");
$line still contains a newline, most likely. You should get rid of it.
You do realise that if this loop gets executed more than one, that
dummy.out will be overwritten, right?
You never check to see if the system() returned an error.
> print ($line);
> $line = <LSVG_file>;
Ah... here you read the next line. This is very unperlish. I'll show
you a more common way:
while(defined($line = <LSVG_file>))
{
chomp;
last if $line eq "";
my $rc = system("lsvg $line > dummy.out");
# check the return code, blablabla
}
> the contents of the file do not get written to dummy.out, but rather
> the program lsvg works on the contents of $line, so the read occurs
> properly, but the output gets written to stdout, and dummy.out
> remains empty. If I insert a line of code into the above to assign
That is because you have a newline in your $line.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au |
Commercial Dynamics Pty. Ltd. | Can't say that it is, 'cause it ain't.
NSW, Australia |
------------------------------
Date: Tue, 29 Sep 1998 21:47:52 -0400
From: Bill 'Sneex' Jones <sneaker@sneex.fccj.org>
Subject: Re: Unix & Perl Newbie Questions
Message-Id: <36118DC8.B5CDF50B@sneex.fccj.org>
Tk Soh wrote:
>
> Craig Berry wrote:
> > Typically, you'd use a Windows programming-oriented text editor (e.g.,
> > Emacs, PFE, BBEdit) to write the code, then run it in a DOS box from the
> > command line.
>
> I know this has nothing to do with Perl, but BBEdit on Win32!? Where can
> I find a copy? A web search only showed BBEdit on Mac.
Pretty sure Craig meant the Windows-environment figuratively!
(I too would want BBEdit on Winders!)
-Sneex- :]
__________________________________________________________________
Bill Jones | FCCJ Webmaster | http://webmaster.fccj.org/Webmaster
__________________________________________________________________
We are the CLPM... Lower your standards and surrender your code...
We will add your biological and technological distinctiveness to
our own... Your thoughts will adapt to service us...
...Resistance is futile...
------------------------------
Date: 30 Sep 1998 03:46:47 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Unix & Perl Newbie Questions
Message-Id: <6us9j7$4sh$2@marina.cinenet.net>
Tk Soh (r28629@email.sps.mot.com) wrote:
: Craig Berry wrote:
: > Typically, you'd use a Windows programming-oriented text editor (e.g.,
: > Emacs, PFE, BBEdit) to write the code, then run it in a DOS box from the
: > command line.
:
: I know this has nothing to do with Perl, but BBEdit on Win32!? Where can
: I find a copy? A web search only showed BBEdit on Mac.
Sorry, slip of the brain. My mental DB query went something like "Select
editors where OS != Unix". :)
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
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 3854
**************************************