[10750] in Perl-Users-Digest
Perl-Users Digest, Issue: 4349 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 3 07:07:20 1998
Date: Thu, 3 Dec 98 04:00:25 -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 Thu, 3 Dec 1998 Volume: 8 Number: 4349
Today's topics:
automated email,URGENT russellyoung@mailexcite.com
Re: Connection to Microsoft SQL Server (David Cantrell)
Re: Connection to Microsoft SQL Server <hendrik.woerdehoff@sdm.de>
Re: die() message available at END time? <aqumsieh@matrox.com>
Re: Does "XS_unpack_charPtrPtr" exist? <case@nimsoft.no>
Dynamic loading Modules <Dirk.Palme@Softing.com>
Re: Excel Spreadsheets, Perl, CGI and Linux (Victor B Wagner)
Re: Excel Spreadsheets, Perl, CGI and Linux <patrick.mulvany@no.spam.torrington.net>
Re: Excel Spreadsheets, Perl, CGI and Linux (Bart Lateur)
Re: Memory in Perl <aqumsieh@matrox.com>
Re: newbie question dave@mag-sol.com
Re: newbie question dave@mag-sol.com
panic: leave_scope inconsistancy (Peter Hamilton)
Re: panic: leave_scope inconsistancy (Tye McQueen)
Re: panic: leave_scope inconsistancy (Ilya Zakharevich)
Re: PC to Unix Problem dave@mag-sol.com
Re: pdf converter lamzak@hotmail.com
perlshop 3.1 vivekvp@hotmail.com
Re: Round with Perl <gdufour@cisco.com>
Selecting multiple Dropdown entries (Burt Lewis)
signals on Windows nt <fnunez@mail.cern.ch>
Re: System() <aqumsieh@matrox.com>
usage of $_ within nested loops <thomas_janke@bbn.hp.com>
Re: Using RCS in Perl scripts (Brendan O'Dea)
Re: When does CLOSE not FLUSH? (Bart Lateur)
Re: Why is "... @foo ..." occasionally a syntax error? <aqumsieh@matrox.com>
Re: Why is "... @foo ..." occasionally a syntax error? <aqumsieh@matrox.com>
Re: Win32::AdminMisc::UserGetMiscAttributes (Tye McQueen)
Re: XS / C++ and the 'simple' example CCsimple - HELP! (Tye McQueen)
Re: XS / C++ and the 'simple' example CCsimple - HELP! <perl_writer@hotmail.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 03 Dec 1998 09:38:37 GMT
From: russellyoung@mailexcite.com
Subject: automated email,URGENT
Message-Id: <36665ad9.2525461@news.ftech.net>
looking for a cgi script that will automate a html email to be sent
from the web site to the user email address that they must enter on
the site. i also need for this end button to link to a download page
on the same server.
------------------------------
Date: Wed, 02 Dec 1998 10:57:58 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: Connection to Microsoft SQL Server
Message-Id: <36651ce1.65941999@thunder>
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: Thu, 03 Dec 1998 10:31:27 +0100
From: Hendrik Woerdehoff <hendrik.woerdehoff@sdm.de>
Subject: Re: Connection to Microsoft SQL Server
Message-Id: <36665A6F.4C85@sdm.de>
David Cantrell 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?
If it wouldn't I wonder how our system got data from our Linux machine
into the NT database and back for the last three months ;-)
It works really well for MS SQLServer 6.5 and the Linux ctlib version
10. I also tried version 11 successfully but that was just a quick test.
The most important difference is that MS SQLServer listens to a
different socket than Sybase SQLServer.
A nice description by Brian Jepson is in
http://www.localnet.com.au/lg/issue18/sybase.html. For answers about how
to get DBI/DBD::Sybase working on Linux see
http://www.brodeur.com/~pjacob/dbdsybase/.
I have read some statements that suggested that MS SQLServer 7 doesn't
work with Sybase libraries any longer. But I have no knowledge whether
this is really the case and wich actions are not working (all or just
new features).
Yours
Hendrik
Pursuant to US Code, Title 47, Chapter 5, Subchapter II, Sec. 227,
any and all unsolicited commercial E-mail sent to this address
is subject to a download and archival fee in the amount of $500
US (per infraction). E-mailing denotes acceptance of these terms.
--
Hendrik W"ordehoff |s |d &|m | software design & management
| | | | GmbH & Co. KG :
woerdehoff@sdm.de | | | | Thomas-Dehler-Str. 27 >B)
Tel/Fax (089) 63812-337/515 81737 M"unchen :
------------------------------
Date: Wed, 2 Dec 1998 17:13:10 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: die() message available at END time?
Message-Id: <x3y90gqci41.fsf@tigre.matrox.com>
chess@watson.ibm.com writes:
>
> Can an END routine get access to the string that was passed to die()
> in any plausible way? For instance:
>
One way to do it is to cheat! Define a variable, let's say
$die_string, and assign to it whatever you wish before calling
die(). $die_string should be available in the END subroutine.
Hope this helps,
Ala
------------------------------
Date: Thu, 3 Dec 1998 11:23:44 +0100
From: "Carstein Seeberg" <case@nimsoft.no>
Subject: Re: Does "XS_unpack_charPtrPtr" exist?
Message-Id: <745ov0$t69$1@elle.eunet.no>
This is NOT a bogus message, this function is needed to access an array
(AV*) of
strings from your c-extension. You'll find this function in Dean
Roehrich's CookBookA found on CPAN, example 8, Av_CharPtrPtr.[ch].
dmulholl@cs.indiana.edu wrote in message
<742hip$r79$1@nnrp1.dejanews.com>...
>While running "make test" on an XS project compilation goes just fine and
then
>as the test.pl script is executed the error message appears:
>
>/usr/bin/perl: can't resolve symbol 'XS_unpack_charPtrPtr'
>
>In what library should this be in? Or is this a bogus message? I am
running
>Perl 5.005_02.
------------------------------
Date: Thu, 3 Dec 1998 10:24:16 +0100
From: "Dirk Palme" <Dirk.Palme@Softing.com>
Subject: Dynamic loading Modules
Message-Id: <745l3p$7os$1@softing.com>
Hi,
I want to run embedded perl on Win32. I can call sub's of my
perl script from my C-program.
Now I want to call C-functions from my perl script. I have built
a dynamic loadable Perlmodule for this functions. When I will
run the program, I get the error description:
"Can't load module XXX, dynamic loading not available in this perl."
How must I recompile my perl to support dynamic loading ???
Best regards
Dirk
------------------------------
Date: 3 Dec 1998 09:22:38 GMT
From: vitus@brass.fe.msk.ru (Victor B Wagner)
Subject: Re: Excel Spreadsheets, Perl, CGI and Linux
Message-Id: <745l8u$gam$3@zware.space.ru>
michalk@awpi.com wrote:
: I have a shared networked Excel spreadsheet that I would like to make
: available to the web via CGI and Perl on a Linux machine.
: I have found the ODBC drivers, but it looks like all that is only for Win
: platforms.
: Is there anything that will allow me to natively query the spreadsheet from
: Perl?
There is a perl library, named LAOLA, which allows to decrypt some
Microsoft formats. Check it out.
I don't remember URL but it is listed on my catdoc pages
http://www.ice.ru/~vitus/catdoc/
among "competing products"
--------------------------------------------------
Victor Wagner vitus@ice.ru
Programmer Office:7-(095)-964-0380
Institute for Commerce Home: 7-(095)-135-46-61
Engineering http://www.ice.ru/~vitus
------------------------------
Date: Thu, 03 Dec 1998 10:39:06 +0000
From: Patrick Mulvany <patrick.mulvany@no.spam.torrington.net>
Subject: Re: Excel Spreadsheets, Perl, CGI and Linux
Message-Id: <36666A4A.7CF6E17E@no.spam.torrington.net>
michalk@awpi.com wrote:
> I have a shared networked Excel spreadsheet that I would like to make
> available to the web via CGI and Perl on a Linux machine.
By "made availible" to the web I take it you do not mean downloadable but
rather making the data from the spreadsheet availible.
> I have found the ODBC drivers, but it looks like all that is only for Win
> platforms.
>From what I have seen of ODBC and Excel you really do not want to go down this
route... Trying to get Excel to query a database in Excel 97 creates an OLE
link to MS-Query that then does the query and pumps it back to Excel. (yes i
know this is going the other way but the fact it is messy in one direction is
usually an indication of problems going the other way too).
Had great fun trying to get Excel to run a SQL query internally when being
controlled via OLE from Perl. In the end I gave up and just pumped the data
into Excel from SQL Server via an ODBC Link to Perl and an OLE link to Excel.
(you might have guessed all this was on WinNT)
> Is there anything that will allow me to natively query the spreadsheet from
> Perl?
Not as far as I know... what information do you need to get out of the
spreadsheet?
You may find it easier to write a Excel Macro that intercepts the FileSave and
writes a second copy of the data in another format (say .SLK) that can easily
be interpreted by a perl script in Linux.
Paddy
------------------------------
Date: Thu, 03 Dec 1998 11:42:39 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Excel Spreadsheets, Perl, CGI and Linux
Message-Id: <366e7916.11622624@news.skynet.be>
michalk@awpi.com wrote:
>I have a shared networked Excel spreadsheet that I would like to make
>available to the web via CGI and Perl on a Linux machine.
>
>I have found the ODBC drivers, but it looks like all that is only for Win
>platforms.
>
>Is there anything that will allow me to natively query the spreadsheet from
>Perl?
I think only MS stuff can reliably read Excel.
Why don't you get the data out of Excel, and make it a text-only file?
Converting Excel to tabbed text is dead easy: simply, in Excel, select
the whole sheet, and copy. Paste into a text editor. Save. Voil`.
You can now read the textfile from Perl line by line, strip the LF
(plus, if you want it, the CR), split into fields using (split /\t/).
There you have all the data from all cells in one row.
p.s. I don't think even MS people "know" what the format is as used by
Excel. My guess is that they simply use C or C++ code (actually, using
OLE) to manipulate the data, and that they simply dump the data into the
file. That would explain why the files for different Excel versions are
never compatible. Unless if they do it on purpose.. (force the user to
upgrade, you know...)
HTH,
Bart.
------------------------------
Date: Wed, 2 Dec 1998 18:28:20 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
To: jmp35@cornell.edu
Subject: Re: Memory in Perl
Message-Id: <x3y67bucems.fsf@tigre.matrox.com>
[posted and mailed]
Jon Peck <jmp35@cornell.edu> writes:
>
> Hi- can any Perl gurus out there tell me a little about memory
> management in perl, since I can't seem to find out elsewhere? I know
> each runtime environment is a little different, but in general:
>
> - Does Perl delete/clean a variable when it sees it will no longer be
> needed in the rest of the script?
Yes .. Perl uses a reference count to each of its variables. This is a
number that indicates how many times the variable is accessed in your
script and is determined when your script is parsed before it is
actually executed. Each time you access the variable, the reference
count decrements. When it reaches zero, Perl recycles the memory.
> - If not, will my()'d variables be cleared when the subroutine/block
> exits, or still exist and just not be acessible? How about local()?
both will be recycled at the end of their scope.
> - Is there any forcable garbage-collection?
Since Perl does all the dirty work for you *willingly* .. you don't
have to force it to do anything! If you want to do something specific,
then maybe you could play around with objects and thier DESTROY
functions. Have a look at perlobj.
> - Is re-using temp variables a good solution? How about setting vars
> to null?
You can do whatever you wish. Perl will always recylce variables you
don't need anymore. Setting variables to null will keep the variable,
but it will have a null value. You should undef it.
undef $var, @var, %var;
> - Does reset() have anything to do with this?
NOPE! from the perldoc:
=item reset
Generally used in a C<continue> block at the end of a loop to clear
variables and reset ?? searches so that they work again.
> Any help would be greatly appreciated. Please reply to email:
> jmp35@cornell.edu
>
> Thanks!
> -Jon Peck
Hope this helps,
Ala
------------------------------
Date: Thu, 03 Dec 1998 10:52:18 GMT
From: dave@mag-sol.com
Subject: Re: newbie question
Message-Id: <745qh1$jrg$1@nnrp1.dejanews.com>
In article <743pfb$ru1$1@nnrp1.dejanews.com>,
dennishancy@eaton.com wrote:
> I have a CGI script that looks like this:
>
> open(STATS,">>../stats.txt");
>
> $mydate = `date`;
> print STATS "$mydate"." "."$ENV{HTTP_USER_AGENT} \n";
>
> close STATS;
>
> How come when I run this script, my output looks like this?
>
> Wed Dec 2 11:28:46 GMT 1998
> Mozilla/4.06 [en] (Win95; I)
>
> Shouldn't everything be on the same line?
$mydate contains the output of the Unix date command - which is the current
date followed by a newline.
Either 'chomp' $mydate or use localtime instead.
chomp($mydate = `date`);
or
$mydate = localtime;
hth,
Dave...
--
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 03 Dec 1998 10:50:38 GMT
From: dave@mag-sol.com
Subject: Re: newbie question
Message-Id: <745qdu$jr7$1@nnrp1.dejanews.com>
In article <743pfb$ru1$1@nnrp1.dejanews.com>,
dennishancy@eaton.com wrote:
> I have a CGI script that looks like this:
>
> open(STATS,">>../stats.txt");
>
> $mydate = `date`;
> print STATS "$mydate"." "."$ENV{HTTP_USER_AGENT} \n";
>
> close STATS;
>
> How come when I run this script, my output looks like this?
>
> Wed Dec 2 11:28:46 GMT 1998
> Mozilla/4.06 [en] (Win95; I)
>
> Shouldn't everything be on the same line?
$mydate contains the output of the Unix date command - which is the current
date followed by a newline.
Either 'chomp' $mydate or use localtime instead.
chomp($mydate = `date`);
or
$mydate = localtime;
hth,
Dave...
--
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 02 Dec 1998 18:31:22 GMT
From: peter@cityc.co.uk (Peter Hamilton)
Subject: panic: leave_scope inconsistancy
Message-Id: <36657b09.27759546@gateway1>
We're running some large Perl scripts on SCO Openserver 5.0.4 that run
thousands of times each day (recently upgraded Perl from v4 to
v5.004.04).
Occasionally, we get the following errors:
"panic: leave_scope inconsistancy at job_queue.p line 215.":
&read_em;
"Undefined subroutine &main::CUST_SERVICE called at job_queue.p line
157.":
&send_data("M","$CUST_SERVICE $myjobdetails{$CUST_SERVICE}\r");
"Not a CODE reference at job_queue.p line 229":
&audit("Fault Note : $myfaultnotes[$fnidx]\n");
Also, we get "Out of memory" errors 2 or 3 times a day, but not at the
same time as the above errors.
It's important to note that when the scripts run successfully they
execute the lines mentioned above many times without any error : we
know this because the lines above have to work for the scripts to have
the desired effect (and this they do, most of the time).
Has anyone seen this kind of error before? Are we hitting a resource
limit somewhere, or should we move to v5.005.02 ??
Many thanks in advance, Pete.
------------------------------
Date: 3 Dec 1998 02:20:12 -0600
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: panic: leave_scope inconsistancy
Message-Id: <745hjs$hhc@fohnix.metronet.com>
peter@cityc.co.uk (Peter Hamilton) writes:
)
) Occasionally, we get the following errors:
) "panic: leave_scope inconsistancy at job_queue.p line 215.":
) &read_em;
[...]
) Also, we get "Out of memory" errors 2 or 3 times a day, but not at the
) same time as the above errors.
My first guess is that the strange errors are caused by out of
memory conditions that are not being detected by Perl (perhaps
because they are happening when some library routine is allocating
memory, for example).
Find some more swap space and/or increase the virtual memory quota
for the processes that run the scripts to get rid of the "Out of
memory" problems and see if that solves the other problems as well.
Or find some other memory hog -- especially if the above steps
don't fix the problem. Or put some kind of throttle on how many
copies of these scripts are allowed to run at once.
At the same time, I'd also grab 5.005_02 and get it built and test
your scripts against it. Then switch the scripts to use it for a
day and see if the strange errors go away. Because my second
guess is a bug in Perl.
Trial pre-releases of 5.005_03 are also available now, though I'd
stick with 5.005_02 until _03 is officially released.
If none of this helps, my third guess would be buggy XS code,
but you don't mention that you are even using any.
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
Date: 3 Dec 1998 09:50:17 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: panic: leave_scope inconsistancy
Message-Id: <745msp$4ct$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Peter Hamilton
<peter@cityc.co.uk>],
who wrote in article <36657b09.27759546@gateway1>:
> Occasionally, we get the following errors:
> "panic: leave_scope inconsistancy at job_queue.p line 215.":
> &read_em;
>
> "Undefined subroutine &main::CUST_SERVICE called at job_queue.p line
> 157.":
> &send_data("M","$CUST_SERVICE $myjobdetails{$CUST_SERVICE}\r");
>
> "Not a CODE reference at job_queue.p line 229":
> &audit("Fault Note : $myfaultnotes[$fnidx]\n");
>
> Also, we get "Out of memory" errors 2 or 3 times a day, but not at the
> same time as the above errors.
Of the cuff: Do you process signals in these scripts? Then it may be
it. Signals-n-Perl is a dangerous mix. Though a part of the problem
would be gone with (I think) 5.004_something, where signals were made
many times "more secure" (but without removing the core reason).
Ilya
------------------------------
Date: Thu, 03 Dec 1998 11:11:24 GMT
From: dave@mag-sol.com
Subject: Re: PC to Unix Problem
Message-Id: <745rkr$kqc$1@nnrp1.dejanews.com>
In article <744ujd$t4u$1@nnrp1.dejanews.com>,
oleynikl@geocities.com wrote:
> I've been learning Perl 5.0 for 2 days now. I'm trying to use Perl to solve a
> problem. Whenever I create an ascii file in a PC environment and upload it to
> a UNIX account, what I get is newline characters appearing everywhere. (ie: I
> get ^M in vi and <cr> in nedit).
>
> I wrote this short Perl program hoping to rid the newline characters, but it
> doesn't seem to work.
>
> #!/usr/bin/perl -w
> $^I = '.old'; # backup file
> while(<>) {
> s/^\s/ /g; # replace newlines,etc. with a single space
> print; # write to file
> }
Probably best to transfer the files between DOS and Unix using FTP in ASCII
mode, it will then do the conversion for you. If you'r forced to use some
other method then you Unix may well have a dos2unix filter that you can use
like:
dos2unix < ugly_dos_file.text > nice_unix_file.txt
Only if all these easy methods fail should you take on the massive task of
writing dos2unix yourself. It may well look a little like this
#!/usr/bin/perl -w
use strict;
while (<STDIN>)
{
s/\r\n/\n;
print;
}
hth,
Dave...
--
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 03 Dec 1998 09:47:15 GMT
From: lamzak@hotmail.com
Subject: Re: pdf converter
Message-Id: <745mn3$gr3$1@nnrp1.dejanews.com>
In article <01be1d15$6acb9c40$d6c010ac@pc1447.surpat.fr.origin-it.com>,
"Lindholm Christian" <christian.lindholm@NOSPAM.fr.origin-it.com> wrote:
> Does anybody know how to convert pdf files to simple text ?
> Is it possible to find a perl script for this ?
On a very unknown site, far away, with the strange name http://www.perl.com ,
there is a nice search button with the unexplainable name 'Search Perl
Reference'. After filling out the magic letters 'PDF' the magic search oracle
said among others:
"PDF library provides classes and functions to read and manipulate PDF files
with perl. PDF stands for Portable Document Format and is a format proposed by
Adobe"
After clicking on the underlinded words, some strange guide introduced this on
the glass ball:
http://www.perl.com/CPAN-local/authors/Antonio_Rosella/
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 03 Dec 1998 11:34:09 GMT
From: vivekvp@hotmail.com
Subject: perlshop 3.1
Message-Id: <745svi$lnj$1@nnrp1.dejanews.com>
anyone have any luck installing perlshop 3.1???
i have tried but still get problems:
i downloaded and try to install perlshop on a unix server. i am running into
the folowing error:
Invalid Transmission #3 received from: 192.58.194.69
If your connection was interrupted, you must Enter the shop from the beginning
again.
i am not using ssl, and have cookies turned off. can you give me any idea why
this is happening?
thanks!!
please email me at personally if you have any info!
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 03 Dec 1998 12:01:01 +0100
From: Gilles Dufour <gdufour@cisco.com>
Subject: Re: Round with Perl
Message-Id: <36666F6D.A54BCA0E@cisco.com>
Sean Mintz wrote:
> Tuomas Angervuori wrote in message ...
> >I have a problem: for example when I divide 1 with 3, I get result
> >0.3333333333.... How can I tell Perl to count only for example two
> >desimals?
> >
> > -Tumppi
>
> Here do this:
>
> $answer = 1/3; #gets 0.3333....
> print "$answer\n"; #prints that
>
> while(length($answer) > 4) {chop($answer);} # chops it down to 0.33
> print $answer; #prints the new 0.33
>
> if you are trying to round, i did have the code but i do not remembr
> it was something like $answer = $answer * 0.5 / 2 or something i dunno well
> anways there you go
>
> Sean Mntz <stmintz@yahoo.com>
Use the sprintf command to convert numbers.
#!/usr/local/bin/perl
$tmp = 1/3;
$integer = sprintf "%i",$tmp; <=======================
print "Val = $tmp Round = $integer\n";
test.pl
Val = 0.333333333333333 Round = 0
------------------------------
Date: 3 Dec 1998 10:50:07 GMT
From: burt@ici.net (Burt Lewis)
Subject: Selecting multiple Dropdown entries
Message-Id: <745qcv$ij9$1@bashir.ici.net>
Hi,
Haven't found any examples that will take selected dropdown entries from a list
and move them over to a new "selected" list in a new box. The new list would
allow one to move them back to the original list.
This is a common Windows thing but haven't seen it done in Perl yet.
Appreciate any ideas.
Thanks!
Burt Lewis
burt@ici.net
------------------------------
Date: Thu, 3 Dec 1998 10:46:50 +0100
From: Fernando Nunez Benito <fnunez@mail.cern.ch>
Subject: signals on Windows nt
Message-Id: <Pine.A41.3.95a.981203104049.41898A-100000@rsplus15.cern.ch>
Hi all,
I finished implemented a monitoring program for different unix platforms
and when I tried to port it to Winndows NT, I realised "frok()" function
was not implemented (surprising) and signals didn't work.
I fixed the first problem, but I couldn't make signals work properly on
Windows NT. Even with a simple example like this one:
$SIG('INT')='my_handler';
kill INT=>$$; #I also tried kill('INT,$$);
sub my_handler {
print "caught\n";
}
Any idea?
Thanks a lot
_____________________________________
Fernando Nunez Benito
Special Projects
Physics Data Processing Group
IT DIvision
CERN Tel: +41227674528
1211 Geneve 23
Switzerland
_____________________________________
------------------------------
Date: Wed, 2 Dec 1998 17:20:21 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: System()
Message-Id: <x3y7lwachs2.fsf@tigre.matrox.com>
"lferon" <lferon@ifrance.com> writes:
>
> Hi, The System function does not work with CGI. Why????
Then what does it do? any errors at all? Elaborate plZ.
by the way, it is system() with a small s not capital S.
Ala
------------------------------
Date: Thu, 03 Dec 1998 11:18:14 +0100
From: Thomas Janke <thomas_janke@bbn.hp.com>
Subject: usage of $_ within nested loops
Message-Id: <36666565.4C2CFA71@bbn.hp.com>
--------------F383E47B48D95E36768FDB60
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
How will Perl handle the usage of "$_" within nested loops.
An example:
while(<FILEHANDLE>)
{
# Do something with $_
foreach $i (@another_list)
{
# Do something else with $_
}
}
Yours Sincerely
--
Thomas Janke
Hewlett Packard
Bvblingen
mailto:thomas_janke@bbn.hp.com
--------------F383E47B48D95E36768FDB60
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
How will Perl handle the usage of "$_" within nested loops.
<P>An example:
<P>while(<FILEHANDLE>)
<BR>{
<BR> # Do something with $_
<P> foreach $i (@another_list)
<BR> {
<P> # Do something else with
$_
<P> }
<BR>}
<P>
<P>Yours Sincerely
<PRE>--
Thomas Janke
Hewlett Packard
Böblingen
<A HREF="mailto:thomas_janke@bbn.hp.com">mailto:thomas_janke@bbn.hp.com</A></PRE>
</HTML>
--------------F383E47B48D95E36768FDB60--
------------------------------
Date: 3 Dec 1998 18:17:51 +1100
From: bod@compusol.com.au (Brendan O'Dea)
Subject: Re: Using RCS in Perl scripts
Message-Id: <745duv$i3f$1@duende.compusol.com.au>
In article <912600121.138742@thrush.omix.com>,
Zenin <zenin@bawdycaste.org> wrote:
>Russ Allbery <rra@stanford.edu> wrote:
> >snip<
>: ($VERSION = (qw$Revision: 1.2 $)[-1]) =~ s/\.(\d+)/sprintf '.%03d', $1/e;
>:
>: There should be a shorter way of doing that.
>
> There should also be a way to make MakeMaker respect multi-line
> version definitions, or better yet some way it could respect
> my version.pm module without needing to fully eval the entire
> module. I wrote version.pm to be able to do things like:
>
> use version q$Revision: 1.2 $, 'beta';
>
> And have it sanely make a $VERSION that VERSION() would like, string
> "beta" or whatever. But alas MakeMaker won't see any $VERSION, and
> more importantly neither will CPAN.pm... :-/
Hmmm. How about something like this:
[$Config{privlib}/ExtUtils/Version.pm]
package ExtUtils::Version;
sub RCS
{
my @r;
@r = $_[1] =~ /\d+/g or @r = (0, 0);
my $v = sprintf '%d.%03d', @r;
$v .= sprintf '_%02d', --$r[2] * 50 + $r[3];
$v;
}
sub SCCS
{
# whatever
}
1;
[Foo.pm]
package Foo;
use ExtUtils::Version;
$VERSION = ExtUtils::Version->RCS(q$Revision: 1.4.2.9 $);
[Makefile.PL]
require 5.005;
use ExtUtils::MakeMaker;
use ExtUtils::Version;
WriteMakefile(
'NAME' => 'Foo',
'VERSION_FROM' => 'Foo.pm',
);
Which works fine for MakeMaker, although CPAN.pm would have to be
patched to grok this method.
The `RCS' method given is just an example, which deals to a limited
extent with one level of branches by turning 1.4.2.9 (in this example)
into 1.004_59.
Note that this is indistinguishable from 1.004 to Perl's version checks
(which may be a good thing), and the suffix no longer sorts correctly
given M.m.B.b where either B > 2 or b > 50. Others may have better
solutions.
The big drawback with this approach is that ExtUtils::Version would have
to become part of the core for this to work.
Regards,
--
Brendan O'Dea bod@compusol.com.au
Compusol Pty. Limited (NSW, Australia) +61 2 9809 0133
------------------------------
Date: Thu, 03 Dec 1998 11:42:44 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: When does CLOSE not FLUSH?
Message-Id: <366c67e8.7223955@news.skynet.be>
Russ Allbery wrote:
>That means that if you have two
>simultaneous writers, it's still possible for their data to be intermixed
>although each will write to the end of the file when it does its write.
Aha!
That means that indeed we do need the lock.
Bart.
------------------------------
Date: Wed, 2 Dec 1998 18:54:42 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Why is "... @foo ..." occasionally a syntax error?
Message-Id: <x3y1zmicdeu.fsf@tigre.matrox.com>
John Chambers <jc@eddie.mit.edu> writes:
> Hmmm ... I wonder how one goes about declaring an array in perl.
> I don't seem to recall every running across the syntax of an array
> declaration. I've always created them at run-time by statements:
> @foo = ();
hmmm... if you had been using the correct pragmas, then you would've
been forced to declare all your variables.
Remeber these:
1) ALWAYS use the -w switch.
2) ALWAYS "use strict;"
when you declare a variable, you have to define it's nature and its
scope. The nature is defined by using either "$", "%", "@" before the
variable name. Its scope is defined by declaring the variables as a
my() or local() variables.
Corollary of Rule #2:
2a) (almost) ALWAYS use my() variables. They are faster and make the
most sense (most probably).
So, the way to declare an array is:
my @foo;
> Note that I get the error while perl is reading in the code (via
> a require command); it is a fatal *syntax* error, and the process
> evaporates without returning from the require. So the program hasn't
> assigned anything to @resource yet, because it hasn't gotten past
> the initial requires. Does this mean that there has to be some
require() includes the file at *run-time*. I am not sure what exactly
you are doing, but you could try using use() instead.
use yourModule qw/@resources/;
If @resources is defined in your program (not your module that you
require()) then the module will not have access to it. eval() would be
a good idea then.
> sort of use of @resource before the require? I've never done that
try declaring it:
my @resources;
before.
> with any arrays before, in quite a lot of years of programming in
> perl. I've almost always put the requires (or uses) at the very
> beginning, and it seems to (usually) work. If some sort of declaration
> is needed for @foo to work inside "", then the zillions of uses of
> this construct in my code should all bomb, and most of them work just
> fine. I do this inside verbose messages all over the place.
There is nothing wrong with "@resources" .. just declare it before.
> Just what is the rule here? (And what's a "declaration"? I thought
> that one of the great things about perl is that it didn't have or
> need them. ;-)
You don't have to allocate memory .. most of the times you also don't
need to declare. But you should start using Perl the Proper Way (tm).
Hope this helps.
Ala
------------------------------
Date: Wed, 2 Dec 1998 18:36:18 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Why is "... @foo ..." occasionally a syntax error?
Message-Id: <x3y3e6yce9i.fsf@tigre.matrox.com>
eln@cyberhighway.net (Erik) writes:
>
> In article <36645C96.430B1AA3@eddie.mit.edu>,
> John Chambers <jc@eddie.mit.edu> writes:
> > This was a fatal syntax error. Here's the offending line:
> >
> > $extra = "@resource" if ($typ eq 'lab');
>
> Interesting...the only way I'm able to reproduce this error is if @resource
You should also have a look at a line or two before the above
line. They might be the culprits.
> Perl will correctly interpolate "@array", unless it cannot find
> a variable anywhere called @array, in which case it assumes you mean the
> literal "@" character, followed by the literal string "array", and advises
> you that the "@" character needs to be escaped to print.
Hmmm.. Just a clarification here ..
% cat >> temp.pl
$a = "@a";
print "A is $a.\n";
__END__
% perl temp.pl
In string, @a now must be written as \@a at temp.pl line 1, near "@a"
Execution of temp.pl aborted due to compilation errors.
Maybe you didn't mean it, but your above statement gave me the
impression that Perl assumes that @ is literal and continues running
the program. It doesn't.
Ala
------------------------------
Date: 3 Dec 1998 02:25:11 -0600
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: Win32::AdminMisc::UserGetMiscAttributes
Message-Id: <745ht7$i9h@fohnix.metronet.com>
keydet89@yahoo.com writes:
)
) No matter what account I try to use it against, I keep
) getting:
)
) Wed Dec 31 19:00:00 1969
C<localtime(0)> in your timezone, perhaps?
) if ( Win32::AdminMisc::UserGetMiscAttributes('', "gshanton", \%Hash)){
!!!!
) print "Last logoff: " . localtime($Data{USER_LAST_LOGOFF}) . "\n";
!!!!
Look above the "!!!"s and you should hear yourself say "Doh!".
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
Date: 3 Dec 1998 02:06:20 -0600
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: XS / C++ and the 'simple' example CCsimple - HELP!
Message-Id: <745gps$dd6@fohnix.metronet.com>
Howard Price <priceh@ms.com> writes:
) Error: No INPUT definition for type 'color *' [...]
) Error: No OUTPUT definition for type 'color *' [...]
[...]
) Inside the typemap file I see:
)
) TYPEMAP
) color * O_OBJECT
)
) What is it expecting?
Inside its typemap file or Perl's typemap file:
INPUT
[...]
O_OBJECT
<C code to convert Perl item to things like (color *)>
[...]
OUTPUT
<C code to convert things like (color *) to Perl item>
[...]
O_OBJECT [...]
I don't see O_OBJECT in the standard typemap of the latest real
release of Perl, so it must be missing from CCsimple's typemap (or
you didn't mention it).
Does that help? Sorry, I've never looked at CCsimple.
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
Date: Thu, 3 Dec 1998 19:16:39 +0800
From: "Perl Writer" <perl_writer@hotmail.com>
Subject: Re: XS / C++ and the 'simple' example CCsimple - HELP!
Message-Id: <745rps$945$1@imsp009a.netvigator.com>
You can look at the perlobject.map file at one directory level up from the
CCsimple dir. O_OBJECT INPUT and OUTPUT definition are defined there.
However, I can make the CCsimple example without changing the typemap file.
Did you change any config in Makefile.PL?
Tye McQueen wrote in message <745gps$dd6@fohnix.metronet.com>...
>Howard Price <priceh@ms.com> writes:
>) Error: No INPUT definition for type 'color *' [...]
>) Error: No OUTPUT definition for type 'color *' [...]
>[...]
>) Inside the typemap file I see:
>)
>) TYPEMAP
>) color * O_OBJECT
>)
>) What is it expecting?
>
>Inside its typemap file or Perl's typemap file:
>
> INPUT
> [...]
> O_OBJECT
> <C code to convert Perl item to things like (color *)>
> [...]
> OUTPUT
> <C code to convert things like (color *) to Perl item>
> [...]
> O_OBJECT [...]
>
>I don't see O_OBJECT in the standard typemap of the latest real
>release of Perl, so it must be missing from CCsimple's typemap (or
>you didn't mention it).
>
>Does that help? Sorry, I've never looked at CCsimple.
>--
>Tye McQueen Nothing is obvious unless you are overlooking something
> http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
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 4349
**************************************