[11831] in Perl-Users-Digest
Perl-Users Digest, Issue: 5431 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 20 14:07:31 1999
Date: Tue, 20 Apr 99 11: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, 20 Apr 1999 Volume: 8 Number: 5431
Today's topics:
Re: [Perl For Win32] ActiveX control Question <swolfington@home.com>
Re: Eliminate to another array <555034897s@acadiau.ca>
Re: FAQ 8.12: How do I start a process in the backgroun <cassell@mail.cor.epa.gov>
Re: FAQ 8.12: How do I start a process in the backgroun <tchrist@mox.perl.com>
Re: FAQ 8.16: How can I sleep() or alarm() for under a (Tramm Hudson)
Re: Getting file creation date using perl (Larry Rosler)
Re: Getting file creation date using perl (Larry Rosler)
Re: how old is perl 5 (Abigail)
How to debug Perl source run by embedded engine? <mcowie@stc.com>
How to Manage, Scale & Integrate NT (especially with UN (Jennifer Radtke)
Re: Is it possible to have "..." appear while processin (Bart Lateur)
Re: Perl notation question? <cassell@mail.cor.epa.gov>
Re: Perl Script to append data to text file <cassell@mail.cor.epa.gov>
Re: Perl to display spreadsheet data (Michel Dalle)
pinging a subnet mjbower@my-dejanews.com
Re: pinging a subnet <tchrist@mox.perl.com>
Reading .ini files from Perl <swolfington@home.com>
Re: Removing elements of an array... (Abigail)
Re: scriptlet to add line breaks at even multiples? <cassell@mail.cor.epa.gov>
Re: SNMP <buga@ipm.lviv.ua>
Re: Tool Reuse Considered Beneficial (was: New FAQ: How (Daniel Beckham)
Re: Unix files in MacPerl <cassell@mail.cor.epa.gov>
Wanted: opinions on bytecode-compiling modules under 5. eryq@zeegee.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 20 Apr 1999 17:08:59 GMT
From: "Scott W" <swolfington@home.com>
Subject: Re: [Perl For Win32] ActiveX control Question
Message-Id: <Lw2T2.92$Rf5.120@news.rdc2.occa.home.com>
Thanks David-
After posting my message I came across the Win32:OLE module
that you mentioned. Works great.
Scott
David Cassell <cassell@mail.cor.epa.gov> wrote in message
news:371BB69D.45DC599C@mail.cor.epa.gov...
> Scott W wrote:
> >
> > Hi!
> >
> > Does Perl for Win32 currently support calling functions in ActiveX
> > controls? If anyone knows if this is possible or how to do it then
> > any help would be much appreciated. Thanks!
>
> I'm not exactly sure what you're asking for. But if you read the
> ActivePerl FAQ, you'll find info on PerlScript, which is an ActiveX
> Scripting version of Perl. You should have installed it with your
> installation of ActiveState Perl. If not, re-install.
>
> If you're asking whether Perl supports the underlying features of
> ActiveX, then I think the answer is also yes. But I can't point
> you to an instant read-up-on-it location. But you might start with
> the Win32::OLE documentation.
>
> David
> --
> David Cassell, OAO
> cassell@mail.cor.epa.gov
> Senior Computing Specialist phone: (541)
> 754-4468
> mathematical statistician fax: (541)
> 754-4716
------------------------------
Date: Tue, 20 Apr 1999 14:07:48 -0300
From: Tong <555034897s@acadiau.ca>
Subject: Re: Eliminate to another array
Message-Id: <371CB464.7FB0@acadiau.ca>
Exactly what I want! Thanks very much, Larry & Uri!
--
Anti-Spam: Remove triple 5 to reply
------------------------------
Date: Tue, 20 Apr 1999 10:13:35 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: FAQ 8.12: How do I start a process in the background?
Message-Id: <371CB5BF.D5A9B60B@mail.cor.epa.gov>
Tom Christiansen wrote:
>
> (This excerpt from perlfaq8 - System Interaction
> ($Revision: 1.37 $, $Date: 1999/04/14 03:46:19 $)
> part of the standard set of documentation included with every
> valid Perl distribution, like the one on your system.
> See also http://language.perl.com/newdocs/pod/perlfaq8.html
> if your negligent system adminstrator has been remiss in his duties.)
>
> How do I start a process in the background?
Tom, do you think a paragraph or two on doing this in win32 would be
helpful? The issues are similar, but obviously the fork() code in
perlfunc won't work [unless you have installed Cygwin32 yourself].
Why do I ask such a silly question? Because the people who keep
asking are on win32. Unix programmers usually know how to fork
off a child process and detach the tty if need be. Win32 people
often don't know this stuff. And the Win NT 'service' is not quite
the same thing as a detached child process.
I know, I know... Patches are welcome. :-)
Happy to Help^H^H^H^H cloud the issue,
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: 20 Apr 1999 11:33:09 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: FAQ 8.12: How do I start a process in the background?
Message-Id: <371cba55@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
David Cassell <cassell@mail.cor.epa.gov> writes:
:Tom, do you think a paragraph or two on doing this in win32 would be
:helpful?
cat >> faq8.12
Victims of brain-damaged, closed, proprietary, non-standard excuses
for program loaders probably aren't allowed to run processes this way.
Please contact your vendor for a patch that will make fork() work
correctly.
--tom
--
s = (char*)(long)retval; /* ouch */
--Larry Wall in doio.c from the perl source code
------------------------------
Date: 20 Apr 1999 10:34:45 -0600
From: hudson@swcp.com (Tramm Hudson)
Subject: Re: FAQ 8.16: How can I sleep() or alarm() for under a second?
Message-Id: <7fiab5$816@llama.swcp.com>
[posted and cc'd to perlfaq-suggestions and Graham Barr]
Tom Christiansen <perlfaq-suggestions@perl.com> wrote:
[snip header]
> How can I sleep() or alarm() for under a second?
>
> If you want finer granularity than the 1 second that the sleep()
> function provides, the easiest way is to use the select() function
> as documented in the section on "select" in the perlfunc manpage.
[snip the rest]
The perlfunc manpage gives an example of sleeping for 250 ms. 4 Legs: Good.
The IO::Select manpage does not specify the units on TIMEOUT. 2 Legs: Bad.
I would suggest adding a paragraph to IO::Select's POD (copied from
perlfunc):
The timeout, if specified, is in seconds, which may be fractional.
Additionally, I would suggest ammending the perlfunc entry:
WARNING: Do not attempt to mix buffered I/O (like
read() or <FH>) with select(). You have to use
sysread() instead or use the IO::Select interface
which works with IO::Handles and buffered I/O.
At least, I assume that it is acceptable to use IO::Select and
buffered I/O. I could not find it mentioned in the POD page.
Perhaps it should be explicitly stated one way or the other.
Tramm
--
o hudson@swcp.com tbhudso@cs.sandia.gov O___|
/|\ http://www.swcp.com/~hudson/ H 505.266.59.96 /\ \_
<< KC5RNF @ N5YYF.NM.AMPR.ORG W 505.284.24.32 \ \/\_\
0 U \_ |
------------------------------
Date: Tue, 20 Apr 1999 09:59:33 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Getting file creation date using perl
Message-Id: <MPG.1186524bc65b4ba9898ef@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <924625240.15408.0.nnrp-09.c2deb910@news.demon.co.uk> on Tue,
20 Apr 1999 17:14:19 +0100, Robert Carter <robert@chackmore.demon.co.uk>
says...
> I want to read the the file creation date and time of a html document.
>
> Does anyone know how to do this
On dain-bramaged Unix-like OSs, you cannot do this. All you can find
out is when an artificial file-system thingie called an 'inode' was last
changed.
On real OSs such as Windows/DOS, you can find the file creation date
using the '-C' operator (described under '-X' in perlfunc, natch!) or
the appropriate value in the list returned by the 'stat' function.
</SARCASM> about OSs. But it is nice to find *something* where the
Micro$..t so-called OSs provide a more useful result.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 20 Apr 1999 10:25:06 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Getting file creation date using perl
Message-Id: <MPG.1186584f41dc04c79898f0@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <371cac6d@cs.colorado.edu> on 20 Apr 1999 10:33:49 -0700, Tom
Christiansen <tchrist@mox.perl.com> says...
+ In comp.lang.perl.misc,
+ "Robert Carter" <robert@chackmore.demon.co.uk> writes:
+ :I want to read the the file creation date and time of a html
+ :document.
...
+ Anyway, have you looked at your friendly stat structure lately?
+ Permit me to help you:
+
+ struct stat {
...
+ time_t st_ctime; /* time of last file status change */
+ long st_ctimensec; /* nsec of last file status change */
...
+ };
+
+ Or perhaps you could read perlfunc's entry on stat:
+
...
+ 10 ctime inode change time (NOT creation time!) since the epoch
...
+
+ Now, which of those fields from eihter list hold the creation date?
+
+ NONE OF THEM.
OUCH. Shouting doesn't eliminate the problem.
Justly or not, Perl (and you!) are often accused of Unix-centrism. Here
is concrete evidence of that. Is it time to change the 'change time'
description of '-C' or (stat)[10]?
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 20 Apr 1999 17:47:40 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: how old is perl 5
Message-Id: <7fiejs$sfj$1@client2.news.psi.net>
charles (charles@twcny.rr.com) wrote on MMLVIII September MCMXCIII in
<URL:news:371C8D17.BC5541BA@twcny.rr.com>:
$$ I saw a job posting asking for a person with 3+ years Perl 5.x
$$ experience. Has Perl 5.x been around that long?
Yes.
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: Tue, 20 Apr 1999 18:40:57 +0100
From: Martin Cowie <mcowie@stc.com>
Subject: How to debug Perl source run by embedded engine?
Message-Id: <371CBC29.613E3E8E@stc.com>
This is a multi-part message in MIME format.
--------------532E43D2356D0D6DB3073218
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I've a particular problem that none of the FAQs (that I've seen), nor
DejaNews address.
I have a perl engine embedded in an application, and it works just fine.
The perl code implements a simple class with three methods, each of
which is called by the containing application at given stages of it's
life-span.
The Perl code is now quite complex, and I'd like to get the Perl
debugger involved. I'm a big fan of it, and it's saved my bacon many
times. To do this I initialise the PerlInterpreter including the '-d'
flag, but the debugger never gets involved.
In a nutshell, the problem is this ...
Calling perl_run() will invoke the debugger, but calling
perl_call_argv() or any of it's siblings (I found this problem using
perl_call_method), doesn't do so ... and I wish that it did.
The following section in perldebug doesn't apply to this case I think
...
> BUGS
>
> You cannot get the stack frame information or otherwise debug functions that were not compiled by Perl,
> such as C or C++ extensions.
>
Can anyone tell me what I'm doing wrong?
M.
--------------532E43D2356D0D6DB3073218
Content-Type: text/x-vcard; charset=us-ascii;
name="mcowie.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Martin Cowie
Content-Disposition: attachment;
filename="mcowie.vcf"
begin:vcard
n:Cowie;Martin
tel;fax:+44 118 989 6801
tel;work:+44 118 989 6834
x-mozilla-html:FALSE
url:http://www.stc.com
org:STC;R&D
version:2.1
email;internet:mcowie@stc.com
title:Senior Developer
note:Switchboard: +44 118 989 6800
adr;quoted-printable:;;Mizuno House,=0D=0A612 Reading Road,=0D=0AWinnersh, =0D=0A;Wokingham;Berkshire;RG41 5HE;UK
fn:Martin Cowie
end:vcard
--------------532E43D2356D0D6DB3073218--
------------------------------
Date: Tue, 20 Apr 1999 17:15:38 GMT
From: jennifer@usenix.org (Jennifer Radtke)
Subject: How to Manage, Scale & Integrate NT (especially with UNIX)
Message-Id: <FAHzy2.DBF@usenix.org>
Keywords: USENIX, SAGE, LISA, System Administration, Windows NT, LISA NT, Training, tutorial, unix, network management, homogeneous networks, PC, heterogeneous environments, Large-scale solutions, tools, utilities, security, software, engineering, developement, applications, debugging, Remote management, Distributed, Backups, restores, User accounts, NT Integration, high performance, Windows 2000, cross-platform distributed services, Remote access, NT tools, E-mail, domain, controller, Central name service, Software licensing, firewall, fixes, The registry, invited talks, tutorials, refereed papers, crash dump analysis, authentication, Samba servers, COM +, DCOM, memory, Perl, benchmarking, monitoring, tuning, porting, legacy, NFS, SMB, academic, commercial, SNMP
Intensive Learning and Sharing of Solutions-Information for You To Do Your
Job Now and in the Future-the Premiere Technical Conference for Managers of
Windows NT & Heterogeneous Sites
LISA-NT-2ND LARGE INSTALLATION SYSTEM ADMINISTRATION
OF WINDOWS NT CONFERENCE
July 14-17, 1999
Westin Hotel, Seattle, Washington, USA
-----------------------------------------------------------------------------
Save. Register by June 18.
See the Program at http://www.usenix.org/events/nt99
-----------------------------------------------------------------------------
Sponsored by the USENIX Association
Co-sponsored by SAGE, The System Administrators Guild
Direct from Microsoft Project Leaders-What's Coming in NT
*Report From the Windows 2000 Beta Team
*Inside the Microsoft Network (MSN)
Perspectives on NT from Respected 3rd Party Experts
Peer-Refereed Papers & In-depth Technology Analyses
*Remote Administration
*Software Installation
*NFS and SMB Data Sharing
*Connectivity to NT Networks
*With special concentration on NT Security
NT Products and Services Exhibit
Interactive Sessions, Demos, and Hosted Parties
Plenty of Get-Together Time with Your Peers
Bridging Windows NT and Traditional High Performance Systems
WINDOWS NT TUTORIALS
July 14-15 1999
Serious skills-training -Courses on: NT and UNIX Integration; NT Security;
Internals; Kernel Debugging & Crash Dump Analysis; DHCP/DNS; COM(+)
Programming Model; DCOM for Systems Administrators; Perl; Samba;
Performance Monitoring, Benchmarking and Tuning
Deals with the "real world" not marketing hype or expensive solutions, just
people showing and discussing tools that work. Many free! -Chad Conrow,
Primex Aerospace Co.
Very good program to learn how to incorporate NT and UNIX environments.
-Kevin Hansen, West Group
This conference allowed me to augment my current knowledge base with that
of others! You gotta love that! -Tim Goodwin, Gers Retail Systems
-----------------------------------------------------------------------------
The USENIX Association is a nonprofit association of scientists, engineers,
and systems administrators from around the world. Since 1975 we've been
reporting cutting-edge software and systems developments in an atmosphere
of peer review and vendor-neutrality. SAGE, the System Administrators
Guild, is devoted to the advancement and recognition of system management
as a profession. USENIX and SAGE are co-sponsors of the highly regarded
LISA-System Administrators Conference.
------------------------------
Date: Tue, 20 Apr 1999 17:44:41 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Is it possible to have "..." appear while processing?
Message-Id: <371ebc22.562267@news.skynet.be>
Steve Wells wrote:
> unless ($answer =~ # this works case insensitvely for
> # y, yes, yup, yeah, yep and (ye, yu, yus and yuah too)
> /^[Yy](?:[Ee]|[Uu])?(?:[Ss])?(?:[Aa][Hh])?(?:[Pp])?$/);
>
You really dispise this?
/^y[eu]?s(?:ah)?p?$/i
or
/^(?:y|yes|yup|yeah|yep)$/i
or even
(lc $answer) =~ /^y[eu]?s(?:ah)?p?$/
Which ALL are more easy to grasp?
Bart.
------------------------------
Date: Tue, 20 Apr 1999 10:45:16 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Perl notation question?
Message-Id: <371CBD2C.D96E94E4@mail.cor.epa.gov>
Philip Newton wrote:
>
> Larry Rosler wrote:
> >
> > TIMTOWTDI.
>
> Even with this abbreviation.
>
> I've seen both TMTOWTDI and TIMTOWTDI.
>
> Which of these, if any, is 'official'? Or are both 'officially correct'?
> (I believe the Camel uses TMTOWTDI, but don't have it handy to check;
> perlfaq1 and 7 both contain TMTOWTDI once each.)
Perhaps the answer is:
TIMTOWTSI - There Is More Than One Way To Spell It.
I prefer TIMTOWTDI, since the docs say it is supposed to be pronounced
'tim-toady'.
And I thought I'd 'toady' up to Larry, since I've harassed him on some
minor linguistic points in the last K weeks. :-)
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Tue, 20 Apr 1999 10:29:23 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Perl Script to append data to text file
Message-Id: <371CB973.6816D82C@mail.cor.epa.gov>
Uri Guttman wrote:
>
> >>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
>
> >> I think what you need is a good book, I'm a beginner as well and
> >> found a really easy book about perl. I would consider it the
> >> "coloring book" of perl, but it covers all fundementals.
Hey! A Perl coloring book! Perfect. My 4-year-old already loves the
animals on my O'Reilly books...
> >> PERL & CGI by Elisabeth Castro almost right out of the book page
> >> 193
>
> LR> Well, for sure it is sick-sick-sick.
>
> i am of the conclusion that if newbies find a perl book easy, it must be
> a bad book. not that perl is hard, but writing about it in a so-called
> easy style always seems to be frought with bugs. if you can't grok the
> llama or camel, you might not be in the right profession of vocation.
>
> oh, why is our field so easy to enter? how many newbies are there in
> medicine or accounting?
Because we don't insist on licensing boards?
"AP - Microsoft announces their new Programmer License System (tm)..."
Eeeewwwww.
> hey, that disease was covered in "liver infections for dummies". just pump
> him full of amoxycillin. it seems to work on my dog.
I hate to break it to you, but people really do this. I can't
estimate the [large] number of times my father [a retired pediatrician]
came home steamed because some mother/father said "Little Jimmy needs a
shot of penicillin. Just give it to him." Or "I know what he has, I
read about it in Reader's Digest." And there are a lot more cases of
people in emergency rooms because their parent/SO/friend 'knew' what
to give for that personally-diagnosed illness.
We see newbie programming problems. We just don't have to deal with
newbie medical problems. Not counting the increasing resistance of
germs to established antibiotics. :-(
> stand aside from that collapsed man, i can do a triple bypass on him
> with my swiss army knife and my fountain pen (shades of danny kaye's
> walter mitty!). i read about it in "learn cardiac surgery and
> needlepoint in 21 days".
It's been done. And in the papers. Only it was more like "Wull
hay-all, if that li'l Doogie Howser weenie ken do it, so ken Ah..."
Result: manslaughter. But at least he didn't post to Usenet about it.
:-)
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Tue, 20 Apr 1999 20:02:19 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Perl to display spreadsheet data
Message-Id: <7fif9n$35d$1@news.mch.sbs.de>
In article <7fhk0n$90h$1@nnrp1.dejanews.com>, vivekvp@yahoo.com wrote:
>Hello - I posted before, but was not clear in my post - my apologies.
>
>I would like to take data from an excel spreadsheet and display in on a web
>page. I do not want the brower to ask to open an excel spreadsheet. I just
>want to take the spreadsheet data (in .xls) format, and use perl to reorganize
>to display on a web page - so any browser can view it.
>
>I hope this is what perl will allow me to do. If you have any more info on
>what to do - or if you think my explanation is a bit vague - please email me
>at vivekvp@spliced.zzn.com
>
As an alternative, File / Save As HTML... is available in Office 97
Hint : create your graphs first :-)
Michel.
--
aWebVisit - extracts visitor information from WWW logfiles and shows
the top entry, transit, exit and 'hit&run' pages, the links followed
inside your website, the time spent per page, the visit duration etc.
For more details, see http://gallery.uunet.be/Michel.Dalle/awv.html
------------------------------
Date: Tue, 20 Apr 1999 16:51:50 GMT
From: mjbower@my-dejanews.com
Subject: pinging a subnet
Message-Id: <7fibb4$pk$1@nnrp1.dejanews.com>
Anyone know a decent way of trying to ping every IP address on a subnet in a
fast way ?
I currently loop round trying 1 second ping and then waiting for the result,
bu obviously this could take a while.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 20 Apr 1999 11:34:50 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: pinging a subnet
Message-Id: <371cbaba@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
mjbower@my-dejanews.com writes:
:Anyone know a decent way of trying to ping every IP address on a subnet in a
:fast way ?
I suppose a broadcast ping will just get you talked about. :-)
--tom
--
California is a fine place to live --if you happen to be an orange.
--Fred Allen
------------------------------
Date: Tue, 20 Apr 1999 17:10:25 GMT
From: "Scott W" <swolfington@home.com>
Subject: Reading .ini files from Perl
Message-Id: <5y2T2.93$Rf5.174@news.rdc2.occa.home.com>
Hi!
Is it possible to read and search .ini files in Perl For Win32? I know
I could just read in the file line by line, but was wondering if there is a
Perl module that makes it a little easier. Thanks in advance!
Scott
------------------------------
Date: 20 Apr 1999 17:58:03 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Removing elements of an array...
Message-Id: <7fif7b$sfj$2@client2.news.psi.net>
Federico Abascal (fabascal@gredos.cnb.uam.es) wrote on MMLVIII September
MCMXCIII in <URL:news:371C8BA4.310C6257@gredos.cnb.uam.es>:
// How can I remove an element of an array? If I do this way:
// undef $array[5];
// does the element $array[6] go to position 5?
No. It just means that the element in @index on index 5 is now undefined.
// What's the better way to remove an element in a way that the next
// elements go to the previous position?
Often, splice(). shift() and pop() are special cases. And sometimes,
you want to use grep().
Abigail
--
perl -wlne '}print$.;{' file # Count the number of lines.
------------------------------
Date: Tue, 20 Apr 1999 10:32:05 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: scriptlet to add line breaks at even multiples?
Message-Id: <371CBA15.C1138359@mail.cor.epa.gov>
Counsel.Net wrote:
>
> Hi all,
>
> Is there a simple solution for adding linebreaks on long fields? I have
> a field fed by a web form which I want to wrap at about 80 characters.
> Wrapping the field via the HTML input textarea is not an option here. I
> figure I want the data to wrap at the first word break less than 80
> characters for each line. Is there a simple substitution operation I
> can do on this data that will do this for me?
Besides the regex from LArry Rosler, you might also consider the
Text::Wrap module available from CPAN.
HTH,
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Tue, 20 Apr 1999 20:29:27 +0300
From: "Yaroslav Buga" <buga@ipm.lviv.ua>
Subject: Re: SNMP
Message-Id: <7fidel$oi0$1@MU.icmp.lviv.ua>
Just go to:
http://www.switch.ch/misc/leinen/snmp/perl/
Philip Smeuninx wrote in message <7fi7i7$nb7$1@nickel.uunet.be>...
>Hello,
>
>How can I send SNMPGETS in perl???
>
>Philip
>
>
------------------------------
Date: Tue, 20 Apr 1999 13:25:38 -0500
From: danbeck@scott.net (Daniel Beckham)
Subject: Re: Tool Reuse Considered Beneficial (was: New FAQ: How can I read in an entire file all at once?)
Message-Id: <MPG.1186829cc1b193e59896a9@news.idt.net>
In article <7fhva2$ain$1@shell1.ncal.verio.com>,
gerg@shell1.ncal.verio.com says...
> Ever looked at your Unix box's startup scripts? The author of
> those wanted to replicate 'cat' in a shell script. The reason
> is /usr/bin/cat lives on a mounted partition, and one or two of
> the startup scripts need to read the contents of files before
> /usr is mounted. Particularly if /usr is mounted from an NFS
> server - the network interfaces must be brought up first.
Mine's located at /bin/cat, which is mounted first... My real point was
though, if 1) you already have the tools available and 2) it makes sense
to use those tools, then why bother reinventing just for the sake of
writing pure code?
'cat' is sort of a bad example though because of the sheer simplicity of
doing that same thing in perl.
> There might only be a few script authors who would pay attention
> to such things, but the answer to your stated question is "reasons
> do exist."
Yes, sometimes reasons do exists, but the author of the post I responded
to was taking more of a religious standpoint in the matter and less of a
practical one.
Daniel
------------------------------
Date: Tue, 20 Apr 1999 10:54:30 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Unix files in MacPerl
Message-Id: <371CBF56.3CC6996F@mail.cor.epa.gov>
Dan Wilga wrote:
>
> > Major overkill...if Jason will simply set his ftp client to transfer his
> > perl code in ASCII mode and not binary, this "problem" will go away.
>
> Another alternative would be to install netatalk on the Unix machine,
> since it will do the EOL conversion automatically on a volume that is
> mounted through Appleshare or Appleshare IP.
True, but doesn't that create a *major* security hole on the network?
David, who is sadly off-topic now...
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Tue, 20 Apr 1999 17:27:10 GMT
From: eryq@zeegee.com
Subject: Wanted: opinions on bytecode-compiling modules under 5.005
Message-Id: <7fidd9$2v9$1@nnrp1.dejanews.com>
How mature is the Bytecode compiler under 5.005 when used with
modules; e.g., compiling Foo.pm to Foo.pmc for fast-loading?
Is the compilation fast? Is the bytecode reliable? Does "use Foo"
do the right thing and prefer a newer Foo.pmc to an older Foo.pm?
We have tons of Perl modules on my current project, and it takes
forever for our command-line scripts to start up. I've been
waiting years (literally) for Perl to support bytecode compilation
of modules the way -- for example -- languages like Emacs Lisp
and SWI Prolog support it.
Has anyone delved deep enough into this to have practical experience
with the pitfalls?
TIA,
Eryq
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5431
**************************************