[17606] in Perl-Users-Digest
Perl-Users Digest, Issue: 5026 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 4 14:10:40 2000
Date: Mon, 4 Dec 2000 11:10:18 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <975957018-v9-i5026@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 4 Dec 2000 Volume: 9 Number: 5026
Today's topics:
Re: Newbie who can't get Perl started in Win98 dtbaker_dejanews@my-deja.com
Re: Newbie who can't get Perl started in Win98 <jeff@vpservices.com>
Re: Newbie who can't get Perl started in Win98 <ccx138@coventry.ac.uk>
Re: Newbie who can't get Perl started in Win98 <jeff@vpservices.com>
NEWBIE: Help me make a module 'USE-able' on my web site <clarityassoc@earthlink.net>
Non-blocking sockets on NT <jlavery@bigfoot.com>
Re: passing !~ (Abigail)
Re: Perl Illiterate <David.Hiskiyahu@alcatel.be>
Re: PERL thread support building woes (Andy Dougherty)
Re: PERL thread support building woes <mwoodyard@earthlink.net>
pl/sql stored procedure <jack.haberle@bigfoot.com>
Re: pl/sql stored procedure (Honza Pazdziora)
Problem getting GD configured <koke36@hotmail.com>
Re: Problem getting GD configured <koke36@hotmail.com>
Re: qmail - perl <michael@omon.net.au>
Re: Regex multiline html <vmurphy@Cisco.Com>
Re: Retrieving Files from a Linux Parition to DOS/NT <jeff@vpservices.com>
Script doesn't see string terminator; blackpike@my-deja.com
Re: Script doesn't see string terminator; (Flint Slacker)
semget - no space left on device? <mungert@stripe.colorado.edu>
Re: semget - no space left on device? <ajp@fred.ocsystems.com>
Re: semget - no space left on device? <joe+usenet@sunstarsys.com>
Re: Sort (Jens)
sorting an array of hashes <kcount@ardenhouse.com>
Re: sorting an array of hashes (Honza Pazdziora)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 04 Dec 2000 15:51:04 GMT
From: dtbaker_dejanews@my-deja.com
Subject: Re: Newbie who can't get Perl started in Win98
Message-Id: <90geh4$31a$1@nnrp1.deja.com>
In article <3A2B019B.9E5B64FF@mindspring.com>,
Gary Burton <glburton@mindspring.com> wrote:
> I have the book "Programming Perl", 3rd edition. I am reading
it from page 1 on, and I can't
> seem to execute the first command in the book:
>
> % perl -e 'print "Hello, world!\n";'
--------------
you will probably want to set up windows to recognize the .pl extension,
and open with perl so you can use the standard double-click to execute
scripts.
also, there is a good OReilly book "learning perl on win32 systems" that
includes a lot of good info on the gotchas of the windows ports.
D
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 04 Dec 2000 08:35:33 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Newbie who can't get Perl started in Win98
Message-Id: <3A2BC7D5.E675F6B2@vpservices.com>
dtbaker_dejanews@my-deja.com wrote:
>
> In article <3A2B019B.9E5B64FF@mindspring.com>,
> Gary Burton <glburton@mindspring.com> wrote:
> > I have the book "Programming Perl", 3rd edition. I am reading
> it from page 1 on, and I can't
> > seem to execute the first command in the book:
> >
> > % perl -e 'print "Hello, world!\n";'
> --------------
>
> you will probably want to set up windows to recognize the .pl extension,
> and open with perl so you can use the standard double-click to execute
> scripts.
I'd disagree. I suggest you always open a DOS console box and run your
Perl scripts from the command line. That will give you an interface
much more similar to the one you are reading about in the book you are
using and is much more usable for debugging and error messages.
> also, there is a good OReilly book "learning perl on win32 systems" that
> includes a lot of good info on the gotchas of the windows ports.
Agreed.
--
Jeff
------------------------------
Date: Mon, 04 Dec 2000 16:39:29 +0000
From: John Tutchings <ccx138@coventry.ac.uk>
Subject: Re: Newbie who can't get Perl started in Win98
Message-Id: <3A2BC8C1.5B00A456@coventry.ac.uk>
try
perl -e "print 'Hello, world!\n';"
I guess perl\bin is in your path.
dtbaker_dejanews@my-deja.com wrote:
> In article <3A2B019B.9E5B64FF@mindspring.com>,
> Gary Burton <glburton@mindspring.com> wrote:
> > I have the book "Programming Perl", 3rd edition. I am reading
> it from page 1 on, and I can't
> > seem to execute the first command in the book:
> >
> > % perl -e 'print "Hello, world!\n";'
> --------------
>
> you will probably want to set up windows to recognize the .pl extension,
> and open with perl so you can use the standard double-click to execute
> scripts.
>
> also, there is a good OReilly book "learning perl on win32 systems" that
> includes a lot of good info on the gotchas of the windows ports.
>
> D
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Mon, 04 Dec 2000 08:44:26 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Newbie who can't get Perl started in Win98
Message-Id: <3A2BC9EA.9AFE50A9@vpservices.com>
[please put your response after a suitably trimmed version of the thing
you are responding to, thanks]
John Tutchings wrote:
>
> try
> perl -e "print 'Hello, world!\n';"
Nope, that's wrong. Did *you* try it? That will not interpolate the
"\n" because it is between single quotes. Better to use the qq()
operator as already suggested.
--
Jeff
------------------------------
Date: Mon, 04 Dec 2000 17:04:40 GMT
From: "Alan Mailer" <clarityassoc@earthlink.net>
Subject: NEWBIE: Help me make a module 'USE-able' on my web site STEP-BY-STEP???
Message-Id: <I8QW5.45250$nh5.3258849@newsread1.prod.itd.earthlink.net>
A week or so ago I posted the following message:
> >Please excuse the complete naivete of this question but: since I may be
> >deploying my perl scrips on a Unix based web server... am I able to
assume
> >that most servers know how to deal with my use of the Calc and Manip
> >modules?
The message was thankfully responded to by Tad McClellan. Tad advised that
I would find my answer in Part 8 of the Perl FAQ.
I took Tad's advise and looked up Part 8 of the Perl FAQ. Unfortunately,
I've pretty consistantly found that neither the Perl FAQ (nor many of the
Perl books) are written so that they can be comprehended by a Newbie. The
information in Part 8 certainly seems to address what I'm trying to get
at...but frankly (and not for the first time), I have no clue how I
implement what they say. And, by the way, I am not new to programming per
se; I'm just new to Perl.
The FAQ answer that Tad thankfully sent me to says:
>> When you build modules, use the PREFIX option when generating Makefiles:
>> perl Makefile.PL PREFIX=/u/mydir/perl
>> then either set the PERL5LIB environment variable before you run scripts
that use the modules/libraries (see the perlrun >>manpage) or say
>>use lib '/u/mydir/perl';
>>This is almost the same as:
>>BEGIN {
>>unshift(@INC, '/u/mydir/perl');
>>}
>>except that the lib module checks for machine-dependent subdirectories.
See Perl's the lib manpage for more information.
...but, again, all this means next to nothing to a newbie. Tad, if you're
reading this (or anyone else reading this)... could you please take this
Newbie by the hand and lead me through a step-by-step hypothetical. Say
several of the Perl scripts I've written 'use' the Date::Calc module. What
steps would I need to take in order to make sure that the Date:Calc module
could be placed in my internet Web directory and used by other Perl scripts
in that directory? (I'm under the impression that merely copying the
Date:Calc module to the site would not be enough... though I may be wrong
about even this!)
Sorry I need this spelled out for me, but there's a first time for everyone!
Thanks again in advance.
------------------------------
Date: Mon, 04 Dec 2000 17:32:11 GMT
From: James Lavery <jlavery@bigfoot.com>
Subject: Non-blocking sockets on NT
Message-Id: <90gker$8bc$1@nnrp1.deja.com>
We've got a system which communicates extensively with non-blocking
sockets - this all works fine on Irix.
However, we're having problems making our sockets non-blocking on NT
clients, as we get the error to the tune of:
'Your vendor has not defined Fcntl macro F_GETFL...' in fcntl.pm
Looking at previous posts across newsgroups indicates that this is a
known problem, and the way round it is to use setsockopt.
However, I'm finding it very difficult to discover *how* to use
setsockopt() to achieve this! Unfortunately, 'man setsockopt' gives no
joy at all...
Has anyone got an example of how to do this? I've found snippets here
and there, and C header files socket.h etc., but not enough info to get
me going...
Thanks,
James Lavery
MicroSec Ltd
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 4 Dec 2000 19:01:48 GMT
From: abigail@foad.org (Abigail)
Subject: Re: passing !~
Message-Id: <slrn92nqgs.vnu.abigail@tsathoggua.rlyeh.net>
On Fri, 1 Dec 2000 13:04:43 -0500, Phil R Lawrence (prlawrence@lehigh.edu) wrote in comp.lang.perl.misc <URL: news:<908p7l$i8o@fidoii.CC.Lehigh.EDU>>:
++ Hello, I want to roll the logic of !~ into the qr// I am passing around. In
++ other words, can you help make the following work?
++
++ # I want SUCCESS if $str doen not contain string 'boo'
++
++ $str = ' whatever ';
++
++ # Please replace the '_not boo_' part
++ $regex = qr/ _not boo_ /;
++
++ # Note I'm using the =~ operator, not !~
++ print 'SUCCESS' if $str =~ $regex;
This is in the Cookbook
/^(?!.*)boo/s;
Abigail
------------------------------
Date: Mon, 04 Dec 2000 19:51:52 +0100
From: David Hiskiyahu <David.Hiskiyahu@alcatel.be>
Subject: Re: Perl Illiterate
Message-Id: <3A2BE7C8.C579CB08@alcatel.be>
There are many interpretations of Perl, the following came to my mind:
- Pascal Experiences Record Low,
- Pain, Envy, Revenge, Love,
- Practical Enormously Rich Language,
- Play & Enjoy this Rubbish Lister,
- Pinguins Expect Romance & Love
- Pathologically Eclectic Rubbish Lister,
- Poorly Educated Romantic Lover,
- Playing Environment for Rubbish Lovers,
- ...
anyone wants to continue the list?
Matt Miller wrote:
>
> What is perl?
...
Thought of the day:
"Computers in the future may weigh no more than 1.5 tons."
Popular Mechanics, 1949
"I think there is a world market for maybe five computers."
-Thomas Watson, IBM Chairman, 1943
------------------------------
Date: Mon, 04 Dec 2000 17:13:24 -0000
From: doughera@maxwell.phys.lafayette.edu (Andy Dougherty)
Subject: Re: PERL thread support building woes
Message-Id: <slrn92nk7m.1ud.doughera@maxwell.phys.lafayette.edu>
>i have swiped the latest perl 5.6.0 tarball from perl.com
[build errors ]
>intrpvar.h: In function `Perl_Iorigargc_ptr':
>intrpvar.h:14: structure has no member named `Iorigargc'
>using the ./Configure as well as
>./Configure -Dusethreads -Duse5005threads
This sequence might be your problem. It looks like you ran
Configure with the defaults (no threads) and then re-ran it with
threads. Depending on exactly what you did, this could result
in a confused config.sh.
>then i do : make clean
Why are you running 'make clean' _after_ running Configure?
>then i do make dep: no problems
Are you sure? I get
make: *** No rule to make target `dep'. Stop.
If you're looking to run 'make depend', note that Configure offers to
do that for you.
In short, I recommend you start with a completely fresh distribution
and then follow the instructions in the INSTALL file.
>to have to move my project from perl (highly text intensive) but if threads
>dont work??
The compilation should work fine. Whether threads "work" or not is up
to you to decide. You have read the big scary warning at the top of
README.threads, haven't you?
--
Andy Dougherty doughera@lafayette.edu
Dept. of Physics
Lafayette College, Easton PA 18042
------------------------------
Date: Mon, 04 Dec 2000 19:02:05 GMT
From: "Matt Woodyard, Genius" <mwoodyard@earthlink.net>
Subject: Re: PERL thread support building woes
Message-Id: <B6515424.D2F%mwoodyard@earthlink.net>
in article slrn92nk7m.1ud.doughera@maxwell.phys.lafayette.edu, Andy
Dougherty at doughera@maxwell.phys.lafayette.edu wrote on 12/4/00 12:13 PM:
>> i have swiped the latest perl 5.6.0 tarball from perl.com
>
> [build errors ]
>> intrpvar.h: In function `Perl_Iorigargc_ptr':
>> intrpvar.h:14: structure has no member named `Iorigargc'
>
>> using the ./Configure as well as
>
>> ./Configure -Dusethreads -Duse5005threads
>
> This sequence might be your problem. It looks like you ran
> Configure with the defaults (no threads) and then re-ran it with
> threads. Depending on exactly what you did, this could result
> in a confused config.sh.
actually i did the interactive config and answered yes to the thread options
since i then did a make that did not compile i did
>> then i do : make clean
>
> Why are you running 'make clean' _after_ running Configure?
>
>> then i do make dep: no problems
>
> Are you sure? I get
>
> make: *** No rule to make target `dep'. Stop.
>
ok so in actuality i was doing depend (dep is all the kernel compiling i
have been doing talking)
> If you're looking to run 'make depend', note that Configure offers to
> do that for you.
>
> In short, I recommend you start with a completely fresh distribution
> and then follow the instructions in the INSTALL file.
>
>> to have to move my project from perl (highly text intensive) but if threads
>> dont work??
>
> The compilation should work fine. Whether threads "work" or not is up
> to you to decide. You have read the big scary warning at the top of
> README.threads, haven't you?
ok well ive read the big scary warning ... and the word experimental doesnt
scare me considering that 25% of internet servers are running on windows.
:P matt
------------------------------
Date: Mon, 04 Dec 2000 15:50:42 GMT
From: RUATurtle <jack.haberle@bigfoot.com>
Subject: pl/sql stored procedure
Message-Id: <90gege$315$1@nnrp1.deja.com>
Hi,
I'm trying to run an Oracle stored procedure via script.
This works:
$csr = $dbh->prepare ('begin insert_content (:p_AD_CREATIVE_ID,
:p_CONTENT_TYPE, :p_BITRATE_ID, :p_FORMAT_ID,
:p_CONTENT_ID,:p_AD_CREATIVE_CONTENT_ID, :p_EXE_STATUS, :p_SQLCODE,
:p_SQLERRMSG); end;');
$csr->bind_param (":p_AD_CREATIVE_ID", $ACID);
$csr->bind_param (":p_CONTENT_TYPE", $TYPE);
$csr->bind_param (":p_BITRATE_ID", $p_bitrate);
$csr->bind_param (":p_FORMAT_ID", $p_format);
$csr->bind_param_inout (":p_CONTENT_ID", \$content_id, 1);
$csr->bind_param_inout (":p_AD_CREATIVE_CONTENT_ID",
\$ad_creative_content_id, 1);
$csr->bind_param_inout (":p_EXE_STATUS", \$exe_status, 1);
$csr->bind_param_inout (":p_SQLCODE", \$sqlcode, 1);
$csr->bind_param_inout (":p_SQLERRMSG", \$sqlerrmsg, 80);
$csr->execute;
This doesn't:
$dbh->do ("begin insert_content (?,?,?,?,?,?,?,?,?); end;",
{},
$ACID, 'ad', $p_bitrate, $p_format,
$content_id, $ad_creative_content_id, $exe_status,
$sqlcode, $sqlerrmsg);
Anyone see any obvious flaw? Or know of any useful documentation?
TIA,
-Jack
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 4 Dec 2000 18:29:37 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: pl/sql stored procedure
Message-Id: <G523DD.GG5@news.muni.cz>
On Mon, 04 Dec 2000 15:50:42 GMT, RUATurtle <jack.haberle@bigfoot.com> wrote:
>
> This works:
> $csr = $dbh->prepare ('begin insert_content (:p_AD_CREATIVE_ID,
> :p_CONTENT_TYPE, :p_BITRATE_ID, :p_FORMAT_ID,
> :p_CONTENT_ID,:p_AD_CREATIVE_CONTENT_ID, :p_EXE_STATUS, :p_SQLCODE,
> :p_SQLERRMSG); end;');
> $csr->bind_param (":p_AD_CREATIVE_ID", $ACID);
> $csr->bind_param (":p_CONTENT_TYPE", $TYPE);
> $csr->bind_param (":p_BITRATE_ID", $p_bitrate);
> $csr->bind_param (":p_FORMAT_ID", $p_format);
> $csr->bind_param_inout (":p_CONTENT_ID", \$content_id, 1);
> $csr->bind_param_inout (":p_AD_CREATIVE_CONTENT_ID",
> \$ad_creative_content_id, 1);
> $csr->bind_param_inout (":p_EXE_STATUS", \$exe_status, 1);
> $csr->bind_param_inout (":p_SQLCODE", \$sqlcode, 1);
> $csr->bind_param_inout (":p_SQLERRMSG", \$sqlerrmsg, 80);
> $csr->execute;
>
> This doesn't:
> $dbh->do ("begin insert_content (?,?,?,?,?,?,?,?,?); end;",
> {},
> $ACID, 'ad', $p_bitrate, $p_format,
> $content_id, $ad_creative_content_id, $exe_status,
> $sqlcode, $sqlerrmsg);
>
> Anyone see any obvious flaw? Or know of any useful documentation?
The obvious flaw is that you didn't include
or warn $dbh->errstr;
or
$dbh->{'RaiseError'} = 1;
or forgot to send us the result or didn't tell use, what exactly went
wrong (where your expectations started to differ from reality). ;-)
But anyway, I don't think the variables get binded as INOUT in the
second call, and also you're sending them as scalars, not as
references to scalars.
I'd say that you cannot shortcut the command much if you want to use
INOUT parameters. You could bind_param_inout only those that need it
and provide the other ones in the execute call, but you cannot avoid
the prepare step.
Yours,
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
.project: Perl, DBI, Oracle, MySQL, auth. WWW servers, MTB, Spain.
Petition for a Software Patent Free Europe http://petition.eurolinux.org
------------------------------------------------------------------------
------------------------------
Date: Mon, 4 Dec 2000 10:26:37 -0500
From: "mk" <koke36@hotmail.com>
Subject: Problem getting GD configured
Message-Id: <90gd48$bov$1@news.kellnet.com>
I am attempting to use a perl cgi that utilizes Graph.pm and GD.pm. I have
installed libz and truetype. I believe that the make went well with GD
(didn't see any errors). But when running the cgi I get an error saying
can't locate loadable objec for module GD...
Looking through all of the notes etc with the script and with Graph and GD
the only think I can see missing is Xpm, which I am looking for right now.
I need to get this cgi running - and am willing to pay $100-$150 for good
assistance.
Where would errors from GD end up?
If you are available to assist in getting this running - contact me at
mike@midoh.com
If you have suggestions on the problem, I will watch this and a few other
perl newsgroups for responses.
Michael D. Kokinda
Chief Technology Officer
Mid Ohio Securities
------------------------------
Date: Mon, 4 Dec 2000 13:19:19 -0500
From: "mk" <koke36@hotmail.com>
Subject: Re: Problem getting GD configured
Message-Id: <90gn8d$lbf$1@news.kellnet.com>
Update
I have gotten through the config of the GD and GD.pm now. I am still
getting an error that says "can't find string terminator....anywhere before
end of file....
I am not a perl programmer but have done scripting in c and java. If
someone can save me a little time with a little info and how a string
terminator should appear in Perl I would appreciate it.
Mike Kokinda
------------------------------
Date: Mon, 04 Dec 2000 23:01:08 +0800
From: Michael Salleo <michael@omon.net.au>
Subject: Re: qmail - perl
Message-Id: <3A2BB1B3.B023FD2E@omon.net.au>
Chris Fedde wrote:
> What aspect of Qmail are you trying to automate with perl? If you want to
> just post mail or pop it off then the MIME::whatever, Net::SMTP and
> Net::POP3 modules should do it for you. If you want to do something deeper
> like manage qmail's configuration you are probably going to need to coble
> something together. Still it would not hurt to ask your question in a news
> group that has 'qmail' somewhere in its name.
>
> Good Luck
> chris
> --
> This space intentionally left blank
Thanks
------------------------------
Date: 04 Dec 2000 11:25:12 -0500
From: Vinny Murphy <vmurphy@Cisco.Com>
Subject: Re: Regex multiline html
Message-Id: <ud7f817dj.fsf@Cisco.Com>
On Mon, 04 Dec 2000 02:19:36 GMT, Vinny Murphy
<VincentMurphy@mediaone.net> wrote:
> Tony> Have been trying to remove five lines in one chunk from
> Tony> html pages. Single lines are no problem but need to
> Tony> remove their following <BR> tags also. Removing the <BR>
[snip]
>you probably want to use the range operator ...
>
>print while <DATA>; # show all output.
>print '-' x 72, "\n";
>while ( <DATA> ) {
> # BEGIN TOKEN ... END TOKEN
> next if /\# remove from here/ ... /\# to here .*$/;
> # notice the three dots. ------^
Garry>
Garry> This is from the perlop manual page:
Garry>
Garry> Range Operators
Garry>
Garry> Binary ".." is the range operator,
Garry>
Garry> Notice the *two* dots.
Garry>
Garry> > print;
Garry> >}
Garry>
Garry> Did you even try to run the code you posted?
Why yes I did - did you try to run my code as posted? I believe that
you should pay closer attention to the code and verify that I was
incorrect before you decided to slam me. You could also look at the
perl cookbook for Section 6.8 for explaination of .. or ... and what the
difference is.
Garry>
Garry> readline() on closed filehandle main::DATA at x line 3.
Garry> ------------------------------------------------------------------------
Garry> readline() on closed filehandle main::DATA at x line 5.
Garry>
Garry> Why would you post such a thing?
Because I knew what I was doing.
-vjm
------------------------------
Date: Mon, 04 Dec 2000 08:19:26 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Retrieving Files from a Linux Parition to DOS/NT
Message-Id: <3A2BC40E.C72ACD24@vpservices.com>
[in the future, please put your reply after a suitably trimmed version
of the thing you are replying to, thanks]
Wayne Watson wrote:
>
> Let me simplify the question. I do believe Perl has an open statement
> to get to a disk drive. When I last programmed in Perl on Unix some years
> ago, I recall being able to open a directory. Probably something like
> open("/mydirectory", ...).
There is a list of Perl functions that comes with every copy of perl.
It is called perlfunc. It starts with a listing by category, including
the category "Functions for filehandles, files, or directories". In
that category are listed such functions as "opendir" and "readdir". You
can find out the complete usage of those functions by typing, for
example, "perldoc -f opendir" at a command line prompt, or by browsing
the perlfunc file itself, or by any of several of the other FAQ access
methods listed in many places on and off line.
--
Jeff
------------------------------
Date: Mon, 04 Dec 2000 17:55:39 GMT
From: blackpike@my-deja.com
Subject: Script doesn't see string terminator;
Message-Id: <90glqn$9op$1@nnrp1.deja.com>
Hi everybody;
I'm new to perl, and I'm working through
the O'reilly "learning perl" 2nd Edition lama book
I've fiddled around with the CGI script on page 186
but I get the message :-
Can't find string terminator "END_of_Start" anywhere before EOF .. ..
yet its in the script.
any help in resolving this would be muchly appreciated.
thanks in advance.
#!/usr/bin/perl -w
#howdy--the easiest of cgi programs
use CGI qw(param);
print <<END_of_Start;
content-type: text/html
<HTML>
<HEAD>
<TITLE>Hello World</TITLE>
</HEAD>
<BODY>
<H1>Grettings, people</H1>
END_of_Start
my $favorite=param("flavor");
print <<All_Done;
</BODY>
</HTML>
All_done
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 04 Dec 2000 18:15:07 GMT
From: flint@flintslacker.com (Flint Slacker)
Subject: Re: Script doesn't see string terminator;
Message-Id: <3a2bdecf.11852881@news.tcn.net>
On Mon, 04 Dec 2000 17:55:39 GMT, blackpike@my-deja.com wrote:
>
>
> my $favorite=param("flavor");
>
>print <<All_Done;
> </BODY>
> </HTML>
>All_done
All_Done and All_done are different, watch your case.
Flint
------------------------------
Date: Mon, 4 Dec 2000 09:12:30 -0700
From: Scott <mungert@stripe.colorado.edu>
Subject: semget - no space left on device?
Message-Id: <Pine.GSO.3.96.1001204090853.28875B-100000@stripe.colorado.edu>
SunOS 5.7 Generic_106541-06 sun4u sparc SUNW,Ultra-Enterprise
I've a Perl program making use of IPC::Shareable, which uses
IPC:Semaphore, which is bombing on it's new method at the call for the
system call "semget" with
Could not create semaphore set: No space left on device
Which seems simple enough, but df -k doesn't indicate any of the disks
being full.
Does anyone know what device semget attempts to read from? My
understanding is that it's a memory allocation from a shared memory
segment so such an error doesn't make much sense to me.
Any info would be appreciated,
Thanks,
--Scott
------------------------------
Date: Mon, 4 Dec 2000 13:05:55 -0500
From: "Andy Platt" <ajp@fred.ocsystems.com>
Subject: Re: semget - no space left on device?
Message-Id: <3a2bdcd5$1_3@vienna7.his.com>
That's probably just general purpose code translating ENOSPC into "No space
left on device".
The actual reason, from man semget, is likely one of these:
ENOSPC A semaphore identifier is to be created but
the system-imposed limit on the maximum
number of allowed semaphore identifiers sys-
tem wide would be exceeded.
ENOSPC A semaphore identifier is to be created but
the system-imposed limit on the maximum
number of allowed semaphores system wide
would be exceeded.
Andy.
--
I'm not really here - it's just your warped imagination.
"Scott" <mungert@stripe.colorado.edu> wrote in message
news:Pine.GSO.3.96.1001204090853.28875B-100000@stripe.colorado.edu...
>
> SunOS 5.7 Generic_106541-06 sun4u sparc SUNW,Ultra-Enterprise
>
> I've a Perl program making use of IPC::Shareable, which uses
> IPC:Semaphore, which is bombing on it's new method at the call for the
> system call "semget" with
> Could not create semaphore set: No space left on device
>
> Which seems simple enough, but df -k doesn't indicate any of the disks
> being full.
>
> Does anyone know what device semget attempts to read from? My
> understanding is that it's a memory allocation from a shared memory
> segment so such an error doesn't make much sense to me.
>
> Any info would be appreciated,
> Thanks,
> --Scott
>
------------------------------
Date: 04 Dec 2000 13:27:11 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: semget - no space left on device?
Message-Id: <m3itp0oxds.fsf@mumonkan.sunstarsys.com>
Scott <mungert@stripe.colorado.edu> writes:
> SunOS 5.7 Generic_106541-06 sun4u sparc SUNW,Ultra-Enterprise
>
> I've a Perl program making use of IPC::Shareable, which uses
> IPC:Semaphore, which is bombing on it's new method at the call for the
> system call "semget" with
> Could not create semaphore set: No space left on device
>
You probably have used up all your shm's. What happens with IPC::Shareable
is that it will silently create shared memory segments to hold referenced
data structures (like arrays) within your tied hash values. If you don't
free these segments carefully, they stick around between incantations of
your script, and you'll eventually hit your limit.
Read the documentation carefully for IPC::Shareable again, and use something
like ipcs -m
% man ipcs
to keep track of your shared memory segments.
HTH
--
Joe Schaefer
------------------------------
Date: Mon, 04 Dec 2000 10:14:59 +0100
From: "Ellegiers, J. M. (Jens)" <jellegie@ford.com>
Subject: Re: Sort
Message-Id: <3A2B6093.CDC0C013@ford.com>
Hi,
A much simpler perl solution ( see perldoc -f sort ) to sort numerically
which is what you would like to have:
foreach $key (sort { $a <=> $b } keys %DB){
($db_contact_name, $db_email, $db_title, $db_url, $db_desc,
$db_keywords, $db_hits, $db_flag, $db_date, $db_time) = split (/\t/,
$DB{$key});
#...etc here I print html code
}
"Daniel J. Brill" wrote:
>
> Dear John,
>
> One solution is to enter your data differently in your db. If you enter 1
> as 01 and 2 as 02, then this will force your list to sort as 01, 02, 03,
> ... 09, 10. If your list will go past 100, then enter 1 as 001. If it
> will go past 1,000, then enter 1 as 0001, etc.
>
> If you are entering your data with Excel, a very common situation, this can
> be a real pain because Excel doesn't like to have leading zeros. You need
> to set the column format to text, as opposed to a number format. It will
> then take 01. However, you can't do any computations with the number
> because it isn't a number -- its text. Thankfully perl doesn't care.
>
> Dan
>
> jtjohnston wrote:
>
> > I'm using this to sort the lines in a db file. The problem is each line
> > begins with a number.
> >
> > When the number is below 10, it sorts like this:
> >
> > 1 asdasd
> > 10 asdasd
> > 2 asdasda
> > 3 wsfdsdfs
> >
> > etc
> >
> > I would like to sort so that it would come out like:
> >
> > 1 asdasd
> > 2 asdasda
> > 3 wsfdsdfs
> > 10 asdasd
> >
> > What do I have to do differently?
> >
> > Thanks,
> >
> > John
> >
> > ---------snip----------
> >
> > foreach $key (sort keys %DB){
> > ($db_contact_name, $db_email, $db_title, $db_url, $db_desc,
> > $db_keywords, $db_hits, $db_flag, $db_date, $db_time)
> > = split (/\t/, $DB{$key});
> >
> > #...etc here I print html code
> > }
--
Viele Gruesse, regards, saludos
Jens Ellegiers
---------------------------------------------------------------
FORD-Werke AG, Spessartstrasse, 50725 Koeln
Jens Ellegiers Email: jellegie@ford.com /"\
Engineer (I-Engine CAE) Phone: +49-221-90-31467 \ /
Mail Sym: D-ME/PN-S Fax : +49-221-90-33025 X
ASCII Ribbon campaign against HTML E-mail & Usenet News >------> / \
------------------------------
Date: Mon, 4 Dec 2000 10:43:01 -0500
From: "kcount" <kcount@ardenhouse.com>
Subject: sorting an array of hashes
Message-Id: <90gdt8$nij$1@news.warwick.net>
I need to sort an array of hashes. The array of hashes pretty much
simulates a database table. A mailing list more or less with about 27
fields. The field I want to sort on is the MemberName. But first I need to
regex out the last name. I can deal with filtering out the last name with
something like m/(\w+$)/ or something of that nature. But what is the best
way to go about sorting this. Can I use the sort function with an array of
hashes, and if so, how would I apply it? Any input would be greatly
appreciated. Thanks.
------------------------------
Date: Mon, 4 Dec 2000 18:25:01 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: sorting an array of hashes
Message-Id: <G5235p.C8F@news.muni.cz>
On Mon, 4 Dec 2000 10:43:01 -0500, kcount <kcount@ardenhouse.com> wrote:
> I need to sort an array of hashes. The array of hashes pretty much
> simulates a database table. A mailing list more or less with about 27
> fields. The field I want to sort on is the MemberName. But first I need to
> regex out the last name. I can deal with filtering out the last name with
> something like m/(\w+$)/ or something of that nature. But what is the best
> way to go about sorting this. Can I use the sort function with an array of
> hashes, and if so, how would I apply it? Any input would be greatly
> appreciated. Thanks.
my @array_of_hashes = (
{
'MemberName' => 'Joe Kcount',
'data' => 'some data',
},
{
'MemberName' => 'Robie Williams',
'data' => 'some other data',
},
);
my @sorted = sort { $a->{'MemberName'} cmp $b->{'MemberName'} }
@array_of_hashes;
Now you can use any other expression instead of the $a->{'MemberName'}
values including match with regexp, but it would be unefficient to do
the regexp matching for each comparison. That's why you probably want
to precompute the last name values, resulting in something like (edit
to your liking)
my @sorted = sort { $a->{'last'} cmp $b->{'last'} }
map { my ($last) = ($_->{'MemberName'} =~ /(\w+$)/);
$_->{'last'} = $last;
$_; } @array_of_hashes;
Yours,
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
.project: Perl, DBI, Oracle, MySQL, auth. WWW servers, MTB, Spain.
Petition for a Software Patent Free Europe http://petition.eurolinux.org
------------------------------------------------------------------------
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 V9 Issue 5026
**************************************