[12670] in Perl-Users-Digest
Perl-Users Digest, Issue: 79 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 8 15:07:12 1999
Date: Thu, 8 Jul 1999 12:05:13 -0700 (PDT)
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, 8 Jul 1999 Volume: 9 Number: 79
Today's topics:
ActiveState OLE and SQLCODE <dlewright@nuworld.com>
cgi timeout <nicolabo@prof.it>
Re: Computing log base 10 in perl (Craig Berry)
Re: Computing log base 10 in perl (Abigail)
connecting to a phone number <pbm@iotp.demon.co.uk>
Connecting to an Oracle DB with PERL 5 <driggs@dsw.net>
Re: Floating Point Number With Time Function <cassell@mail.cor.epa.gov>
Re: Floating Point Number With Time Function <troyknight@troyknight.eurobell.co.uk>
Re: Floating Point Number With Time Function <tchrist@mox.perl.com>
FOR Sale: Learning Perl/Tk. Perl/Tk Pocket Reference <brannon@quake.usc.edu>
Re: How do YOU format your << data? (Abigail)
Re: How to open text file for reading from Sever side? <cassell@mail.cor.epa.gov>
How to run a Perl script as an NT Service? tbittner@my-deja.com
Re: I need to hide the source <juex@my-dejanews.com>
Re: Internetworking Engineers... <tarrigoni@arrigoni.com>
Re: Is PERL the way to create a pop-up window ? <flavell@mail.cern.ch>
Re: Is PERL the way to create a pop-up window ? <cd156@att.net>
Re: Min/Max Problem <cassell@mail.cor.epa.gov>
Re: My last hope <cassell@mail.cor.epa.gov>
Re: My last hope (Abigail)
Re: Need Expert Help! (Bart Lateur)
Re: Need Expert Help! <dafydd@gointernet.co.uk>
Re: Need to install perls DBI for NT gene158@my-deja.com
Re: newbie question (Bart Lateur)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 08 Jul 1999 17:17:23 GMT
From: Dorr Lewright <dlewright@nuworld.com>
Subject: ActiveState OLE and SQLCODE
Message-Id: <3784DD22.C0DE8544@nuworld.com>
Two questions:
1) What are the differences between using ActiveState (use OLE;) and
CPAN (use Win32::OLE) for database access to SQLServer DBMS?
2) When using (use OLE;), how do I get ahold of the SQLCODE value?
------------------------------
Date: Thu, 8 Jul 1999 17:08:19 +0200
From: "Nicola" <nicolabo@prof.it>
Subject: cgi timeout
Message-Id: <7m2f5j$o51$1@serv1.iunet.it>
I'd want to run a perl script that need 30 minutes to execute,
but this is killed by the cgi-timeout limit of the server.
Is there a method to avoid the timeout limit?
Thank you.
Nicola
------------------------------
Date: Thu, 08 Jul 1999 17:56:40 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Computing log base 10 in perl
Message-Id: <sD5h3.1108$tD3.5656@newsfeed.slurp.net>
Abigail (abigail@delanet.com) wrote:
: Greg Miller (gmiller@iglou.com) wrote on MMCXXX September MCMXCIII in
: <URL:news:377ff726.650266004@news.alt.net>:
: @@ The log function in perl is base e. I know there's a way to
: @@ use the base e log to compute the log base 10. Does anyone know how
: @@ it's done?
:
: That's both a FAQ and a second grade math rule.
I'd love to know where you went to second grade!
--
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "It's not an optical illusion; it just looks like one."
------------------------------
Date: 8 Jul 1999 13:38:56 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Computing log base 10 in perl
Message-Id: <slrn7o9s19.vka.abigail@alexandra.delanet.com>
Craig Berry (cberry@cinenet.net) wrote on MMCXXXVII September MCMXCIII in
<URL:news:sD5h3.1108$tD3.5656@newsfeed.slurp.net>:
## Abigail (abigail@delanet.com) wrote:
## :
## : That's both a FAQ and a second grade math rule.
##
## I'd love to know where you went to second grade!
At my school.
Abigail
--
perl -wle '$, = " "; print grep {(1 x $_) !~ /^(11+)\1+$/} 2 .. shift'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 8 Jul 1999 18:34:43 +0100
From: In off the Post <pbm@iotp.demon.co.uk>
Subject: connecting to a phone number
Message-Id: <WoyhVOAzEOh3EwN1@iotp.demon.co.uk>
Is it possible to connect to a phone line using a Perl server-side
script?
If so, how? If not, why not?
For example, on submission of a form a Perl script would connect with a
phone line and transmit the form data using X.25 protocol. I want to be
able to do this from an independently hosted website.
Any help appreciated, thanks,
--
In off the Post, PO Box 302, HALSTEAD, CO9 2LA. ENGLAND
Phone: +44 (0) 1787 478 468 Fax: +44 (0) 1787 477 635
e-mail: pbm@iotp.co.uk http://www.iotp.co.uk
http://www.iotp-online.co.uk http://www.soccerweb.co.uk
------------------------------
Date: Thu, 08 Jul 1999 17:17:52 GMT
From: David Riggs <driggs@dsw.net>
Subject: Connecting to an Oracle DB with PERL 5
Message-Id: <3784DD48.4D999E1E@dsw.net>
Hi -
Basically what I'd like to be able to do is jump into an oracle database
within a perl script and, within the perl script, run select statements
to extract the data out of the database and put it in variables in the
script. For instance, at the command line on the UNIX system, I type:
sqlplus
<then I enter my user name and pw>
select colname1, colname2, colname3 from table1;
From here it outputs a few rows of data from the 3 columns in table1.
This should be clear to anyone familiar with SQL. I'm just not sure how
to get those rows of data into variables in my perl program. I imagine
that I need some library that contains functions to connect to the
database and functions to run select statements and store the results.
I really appreciate any help! Thanks!
- Dave
------------------------------
Date: Thu, 08 Jul 1999 11:19:17 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Floating Point Number With Time Function
Message-Id: <3784EBA5.96995679@mail.cor.epa.gov>
Tom Christiansen wrote:
>
> Was there some mistake in your distribution or its installation, or just
> a misunderstanding? I cannot verify it for myself, as I remain untainted,
> having never touched the Dark Side in my life, but surely someone else of
> a greyer alignment might check it. If what you're saying is true, then
> this is unconscionable. The FAQs are part of the standard documentation
> that comes with Perl. Without them, Perl is virtually useless. Plus it
> guarantees that you'll get a tongue-lashing when you ask about such
> things in these parts.
Yes Jedi, you fail to see the power of the Dark Side. The Sith can,
if need be, even louse up the automatic installation of the FAQs and
docs as done by ActiveState. AS will put the Perl FAQ, the ActivePerl
FAQ, all the POD files for the manapages, their HTML equivalents, all
the docs for the modules, and even more introductory materials on the
hard disk.. unless the installer goes out of his/her/its way to s#!$can
them. Let me demonstrate, with my double-bladed light saber.. errm..
uhh.. wait a minute.. oh heck, it GPF'ed. Darn LightSaber-for-NT...
Darth Dave
------------------------------
Date: Thu, 8 Jul 1999 19:40:54 +0100
From: "Troy Knight" <troyknight@troyknight.eurobell.co.uk>
Subject: Re: Floating Point Number With Time Function
Message-Id: <7m2r6t$1pc$1@slrn.eurobell.net>
>> :I did not get the faq's with the perl distribution (Activestate
version),
>> :but have downloaded it now.
-------
> Was there some mistake in your distribution or its installation, or just
> a misunderstanding? I cannot verify it for myself, as I remain untainted,
> having never touched the Dark Side in my life, but surely someone else of
> a greyer alignment might check it. If what you're saying is true, then
> this is unconscionable. The FAQs are part of the standard documentation
> that comes with Perl. Without them, Perl is virtually useless. Plus it
> guarantees that you'll get a tongue-lashing when you ask about such
> things in these parts.
-------
Activeperl 5.307 does include the docs but not the faq's, not even an option
to include them on setup. I have now downloaded the newest win32 version
Activeperl 5.518 which does have the faq's included. :)
I seem to be going off the original subject though which was that there
seems to be no faq question for getting the time more exact than just whole
seconds, or is it just me?
------------------------------
Date: 8 Jul 1999 12:39:50 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Floating Point Number With Time Function
Message-Id: <3784f076@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
David Cassell <cassell@mail.cor.epa.gov> writes:
:Tom Christiansen wrote:
:FAQ, all the POD files for the manapages, their HTML equivalents, all
:the docs for the modules, and even more introductory materials on the
:hard disk.. unless the installer goes out of his/her/its way to s#!$can
Not installing the documentation should *NOT* be an option.
So much for use diagnostics.
--tom
--
Even if you aren't in doubt, consider the mental welfare of the person who
has to maintain the code after you, and who will probably put parens in
the wrong place. --Larry Wall in the perl man page
------------------------------
Date: 8 Jul 1999 10:38:05 -0700
From: tbrannon <brannon@quake.usc.edu>
Subject: FOR Sale: Learning Perl/Tk. Perl/Tk Pocket Reference
Message-Id: <ysizu2rf6o05.fsf@nunki.usc.edu>
title says it all.
name a price.
Terrence Brannon (brannon@LNC.USC.EDU)
213-740-3397
------------------------------
Date: 8 Jul 1999 13:55:38 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How do YOU format your << data?
Message-Id: <slrn7o9t0j.vka.abigail@alexandra.delanet.com>
Ian Smith (iansmith@pepper.ncinter.net) wrote on MMCXXXVII September
MCMXCIII in <URL:news:TN2h3.551$s73.13857@typ21b.nn.bcandid.com>:
$$ Ok... I need some advice on Perl5 style. I have lost sleep on this
$$ problem and have decided to ask the Perl community to help. When I
$$ write a Perl program to produce web code, I like to format my multi-
$$ line print starements like this...
$$
$$ print <<EOF;
$$ <BLINK><HR>This is my first wuh-wuh-wuh page.</HR>
$$ <A HREF="LINK">LINK</A>
$$ EOF
Blink is in invention from the devil. Even one the devil isn't proud
of. But you need to close it. And HR doesn't take content.
$$ But when I have to nest the code, it looks ugly.
$$
$$ foreach $filehandle (@outputs)
$$ {
$$ if ($browser =~ /mozilla/)
User agent dependent HTML? You obviously don't know the purpose of HTML.
$$ {
$$ print <<EOF;
$$ <HR> This is my first wuh-wuh-wuh page.</HR>
$$ <A HREF="LINK">LINK</A></BLINK>
$$ EOF
$$ }
$$ }
$$
$$ So... anyone as picky as me have a nice-looking solution to this
$$ terrible monster? Anyone else use Perl to brute-force solutions
$$ to the Discover magazine puzzles? :-)
I can't of fail to see your problem. What do you mean with nested code?
Abigail
--
perl -wlne '}print$.;{' file # Count the number of lines.
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 08 Jul 1999 11:12:09 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How to open text file for reading from Sever side?
Message-Id: <3784E9F9.D86B7A1D@mail.cor.epa.gov>
MyName wrote:
>
> my text file is in the same directory of my perl script.
>
> but when I try to open the text file for reading by :
>
> open (INFILE, "myfile.txt");
>
> it does not work. The error seem to be, Perl cannot locate the text file.
Well, there are several problems:
You're not checking the return. Make sure your open()
worked before diving headlong into the rest of your script,
open (INFILE, 'myfile.txt') or die "can't open for read: $!";
is nice in scripts which aren't used in CGI, but within a CGI
script you'd want a more elegant alternative to die()ing in
the middle of a page. See CGI.pm and the CGI::* modules.
And note that I used single quotes around your filename, since
there's no interpolation going on in there.
You'll want to do some other things to get decent error
messages. When working from the command line, use -w.
When working with CGI scripts, learn about CGI::Carp .
And learn what this means:
use CGI::Carp qw(carpout);
Finally, when working with web servers, be aware that many
servers do *not* use the same environment that you do. You
need to give your files absolute paths, so that the strange
locale given to your running script does not mess up your
script's efforts to get to your files.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Thu, 08 Jul 1999 18:31:19 GMT
From: tbittner@my-deja.com
Subject: How to run a Perl script as an NT Service?
Message-Id: <7m2qpn$j5o$1@nnrp1.deja.com>
I'd really like to know how you can run a perl script as an NT
service. Anyone know how? We're already using Activestate Perl for
login scripting. The program I need to run watches for requests to
change account information that are sent at all times of day, so it
needs to be run as a system-level service. Any help is *greatly*
appreciated. Thanks!
Tyler
Purdue University
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 8 Jul 1999 11:41:33 -0700
From: "Jürgen Exner" <juex@my-dejanews.com>
Subject: Re: I need to hide the source
Message-Id: <7m2rau$lgr@news.dns.microsoft.com>
Abigail <abigail@delanet.com> wrote in message
news:slrn7o7lb6.ued.abigail@alexandra.delanet.com...
> rdosser@my-deja.com (rdosser@my-deja.com) wrote on MMCXXXVI September
> MCMXCIII in <URL:news:7m09vd$m44$1@nnrp1.deja.com>:
> ``
> `` I should have explained more: I'm trying to conceal a decryption
> `` algorithm for confidential data.
>
> And you don't trust root? Buhahhahhahahhahaa. That's stupid.
> Find a root who you can trust.
Although I have to aggree that security by obsfucation is not the right way
to go, still the administrator of e.g. a hospital network has no business
reading my medical records.
So not trusting root for confidential data is a very valid case.
jue
--
Jürgen Exner
------------------------------
Date: Thu, 8 Jul 1999 11:49:52 -0700
From: "Tyler Arrigoni" <tarrigoni@arrigoni.com>
Subject: Re: Internetworking Engineers...
Message-Id: <bw6h3.229$3v.25761@typhoon-sf.snfc21.pbi.net>
I would be interested in looking at your scripts. I have started dabbling
in a script myself using Expect/Perl to monitor/config Cisco equipment.
Just getting started though!
--
Thanks,
Tyler M. Arrigoni, VP Arrigoni & Associates, Inc.
Network Design & Integration Consulting Electrical Engineers
tarrigoni@n-o-s-p-a-m.arrigoni.com
(Remove "n-o-s-p-a-m" from above address)
John Baird <jbaird@idirect.com> wrote in message
news:3783FE3A.F84F3D53@idirect.com...
> Hello,
>
> I have just finished working on a series of PERL scripts which automate
> the configuration of non-interface specific parameters (however it could
>
> work for interface specific paramsl) on CISCO devices (switches, and
> routers).
>
> There are two scripts that the user would run: 'devices.pl' and
> 'autoconf.pl'.
>
> The 'devices.pl' script will parse the seed file** from any one of the
> following Network Mngt Systems(NMS): NetView6000, HP OpenView, and
> Tivoli TME 10, extract the hostnames by device type (i.e. Catalyst
> 1900, 2900xl, 3900, 5000, all routers) and OSPF Area as specified by the
>
> user. Currently in order to take full advantage of the OSPF filtering
> the organization would need to be using an internal 'Class A' network
> address space and the second octet would represent the OSPF area. In
> most large Internetworks that are utilizing the routing protocol OSPF
> this is how it is usually done!
>
> The 'autoconf.pl' script reads in hostnames from a hostname file(as
> created by 'devices.pl'), telnets to the targeted device and executes
> what ever commands are located in the command file closes the TCP
> connection and reads in the next hostname until it reaches the end of
> the hostname file.
>
> As an Internetworking Professional, it goes with-out saying that I am
> not a professional programmer however I do enjoy scripting, as such as
> professional PERL programmer you may find the scripts peppered with "bad
>
> coding" techniques; however these scripts enable me to reconfiure vty,
> aux and enable passwords and various other parmas on 1000 Cisco routers
> in approximately 2 hours!!!
>
> Every Internetworking Engineer could benefit from these scripts and I
> would like to make them publicly available.
>
> If you think that these sound interesting and would like to look at them
>
> feel free to contact me.
>
> ** A seed file is a textual representation of the Internetwork as seen
> by NMS, in order to create a seed file a user will issue the following:
> /usr/OV/bin/ovtopodump -lr > <filename>
>
> regards,
>
> Jonathan Baird
> Telecommunications Analyst
> Toronto, Ontario
> Canada
>
>
>
------------------------------
Date: Thu, 8 Jul 1999 19:41:51 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Is PERL the way to create a pop-up window ?
Message-Id: <Pine.HPP.3.95a.990708191401.8934G-100000@hpplus01.cern.ch>
[posted and emailed]
On 8 Jul 1999, Tom Christiansen wrote:
> I certainly hope you've read
>
> http://language.perl.com/misc/div-www.html
[I realise that this is off-topic for the current group, so I've set
f'up to poster. Anyone who feels strongly enough is welcome to apply
their own override to that, of course.]
Tom, I think you have a valuable message to convey, and some very
appropriate tips to go with it. There's one aspect of your approach
that, with respect, I think represents a potential own-goal, though.
You write, pretty much up-front:
If the choice ever comes down to making something look nice for some
people at the expense of being virtually unusable to others, you must
choose the more humdrum look.
I'd say that's a big "if", and by using this phrasing up-front you
risk turning-off a subset of your audience who would otherwise stand to
benefit from your advice.
The origins of the WWW were precisely in making the same information
available to a wide range of browsing situations (yes, hardware,
software, _and_, last not least, "peopleware"). Many ignorant
wannabe-web-authors are unfortunately busily propagating the
superstition that accessibility _of_necessity_ demands the "humdrum
look" on all browsing situations. I don't for a moment believe that you
subscribe to this superstition, but by putting that sentence of yours so
prominently, it seems to me that you are playing into their hands.
There are many ways of improving the visual appearance of information
for those who are in a position to appreciate it, without impairing its
accessibility to other browsing situations.
With respect, I'd suggest that you could make your point about "IF the
choice ever comes down to" in a way that would be less liable to be
hijacked by the ignorant propagators of the "only boring text" straw-man
argument (my modest contribution to that debate is at
http://ppewww.ph.gla.ac.uk/~flavell/www/html-smac.html#smac3 )
Indeed it's a pity that the default presentation of the big-two browsers
is so dreadful. But it can be improved in many ways without impairing
accessibility. Yes, I know that you said "if...ever", and when a reader
has understood what that means, that's quite accurate. My point is not
about the accuracy of what you say, but about the effect that it's
liable to produce when taken in conjunction with the misleading messages
from the "if it isn't WYSIWYG visual web design then it must be only
boring text" camp.
Readers who already understand what you mean, probably already accepted
the message that you're trying to convey. More important is to capture
those who are not yet convinced by the benefits of your approach, and
this is where your potential "turn-off" worries me.
Finally, let's not forget those web indexing robots, without whose help
any normal web page is doomed to remain in oblivion. Working "with"
them is not so very different than making the information accessible to
a wide range of browsing situations, IMHO.
best regards
------------------------------
Date: Thu, 8 Jul 1999 13:14:02 -0500
From: "cd156" <cd156@att.net>
Subject: Re: Is PERL the way to create a pop-up window ?
Message-Id: <7m2pob$rlf$1@bgtnsc01.worldnet.att.net>
Thankyou all very much for your input .... my approach to web design is in
line with many of you. I want things simple, and cross browser supported,
without plug-ins, etc., I don't care for javascript, jscript, asp, dhtml,
etc .... because they do not encourage standards, but seem to focus on one
or the other.
Basically I had a client, demand, not just request, but demand a popup to
contain some advertising content, I tried to discourage it. When I
discouraged the use of javascript, I guess they thought I just wasn't
capable. So I built it for them in javascript and showed them how differant
browsers display the content differantly or not at all ...... as opposed to
good standard html methods with consistent content.
All of the input from this group has given me the ammunition I needed to
discourage this client. When I laid printed copies of this thread on the
clients desk. All they could could say was, "OH" ...... I like some of
the flash and glitter on some personal content but the net just can't carry
that type of content consistently and efficiently, "yet" .
Thankyou again for all of the input ...... you guys saved me from creating
content that goes against my train of thought . They simply couldn't argue
with us all :o)
A great day to all,
cd
------------------------------
Date: Thu, 08 Jul 1999 11:26:34 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: Mark Mykkanen <mykkam@krypton.mankato.msus.edu>
Subject: Re: Min/Max Problem
Message-Id: <3784ED5A.29AC5547@mail.cor.epa.gov>
[courtesy cc mailed to poster, since address isn't munged]
Mark Mykkanen wrote:
>
> Why doesn't the maximum in this program work correctly? The minimum value works fine but it
> also matches numbers over 11 digits.
>
> open(INPUT,"sample");
> while(chomp($value = <INPUT>))
> {
> print $value,"\n" if $value =~ /\d{7,11}/;
> }
> [snip of examples]
Mark, you're checking to see if the regex matches anything inside
the entire string. If you want to make sure that the regex
matches all the way from the front to the end of the string,
use anchors.
print $value,"\n" if ( $value =~ /^\d{7,11}$/ ) ;
Now it won't match a number of 12 digits.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Thu, 08 Jul 1999 11:01:23 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: My last hope
Message-Id: <3784E773.A9E1F46A@mail.cor.epa.gov>
Abigail wrote:
> [snip of very funny stuff]
> where <value> can be "chocolate chip", "classy Europian", "Bakhlava",
> "short bread", "ginger", or "oreo". <values> starting with 'x-' are
> reserved for private use, and the HTTP specification will never use
> a value starting with 'x-'. <values> are case insensitive.
Hey, Bakhlava isn't a cookie! You're not using those non-standard
Microsoftbake cookie extensions, are you?
David, running away quickly...
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 8 Jul 1999 13:45:36 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: My last hope
Message-Id: <slrn7o9sdn.vka.abigail@alexandra.delanet.com>
David Cassell (cassell@mail.cor.epa.gov) wrote on MMCXXXVII September
MCMXCIII in <URL:news:3784E773.A9E1F46A@mail.cor.epa.gov>:
~~ Abigail wrote:
~~ > [snip of very funny stuff]
~~
~~ > where <value> can be "chocolate chip", "classy Europian", "Bakhlava",
~~ > "short bread", "ginger", or "oreo". <values> starting with 'x-' are
~~ > reserved for private use, and the HTTP specification will never use
~~ > a value starting with 'x-'. <values> are case insensitive.
~~
~~ Hey, Bakhlava isn't a cookie! You're not using those non-standard
~~ Microsoftbake cookie extensions, are you?
The protocol was designed by a committee. And it had to satisfy
people from all parts of the world.
Abigail
--
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 08 Jul 1999 17:44:47 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Need Expert Help!
Message-Id: <3785e267.560729@news.skynet.be>
Dafydd Hopkin wrote:
>> Do you intend to open 100 files at the same time, and then have your
>> "filehandlearray" print to them?
>
>Something like that yes - I want to write a script which will open a
>differing number of files dependent on the number of command line
>arguments, and rather than writing separate code for each of the
>possible files that could be opened. I want to reference each as an
>element of an array, so I can step through the list one by one and do
>similar operations on each of them.
That sound like a FAQ.
It is: see perlfaq5. However, I find the anser not very helpful.
How do I print to more than one file at once?
Bart.
------------------------------
Date: Thu, 08 Jul 1999 19:26:08 +0100
From: Dafydd Hopkin <dafydd@gointernet.co.uk>
Subject: Re: Need Expert Help!
Message-Id: <3784ED40.751428E2@gointernet.co.uk>
Rick Delaney wrote:
>
> [posted & mailed]
>
> It would have been a good idea to split these two questions up into
> separate posts. They you would have been able to use a subject relevant
> to each instead of the meaningless one you did use.
Okay, fair point - I'll try to be more formal in future.
> dafydd1@my-deja.com wrote:
> >
> > Secondly, how does one split a line by fields when a field can contain
> > a '\' escaped version of the separator? I'm not sure that something like
> > this would work without removing the '\' escaped characters?
>
> Well, try it out and see then.
>
> > split /[^\\](\\\\)*\t/ $line;
>
> To split on tabs unless they are escaped:
>
> split /(?<!\\)\t/, $line;
Parser doesn't like '<', and without it it doesn't work 'cos that's not
the way 'lookbehind' works - it'd be lookin to see if the tab itself
wasn't a '\' which obviously it wouldn't be. It will also miss out on a
valid separator like...
1\\ 2 3
because the last '\' will be assumed to escape the tab, whereas it was
actually escaping another '\'. <sigh> looking like I may have to be a
bit more devious than just using the split command - odd really, 'cos I
thought this kind of thing was what perl was particularly good at.
--
Many thanks,
Dafydd
------------------------------
Date: Thu, 08 Jul 1999 18:16:25 GMT
From: gene158@my-deja.com
Subject: Re: Need to install perls DBI for NT
Message-Id: <7m2pte$iq0$1@nnrp1.deja.com>
In article <378361ae.32111043@news.uniplus.ch>,
backwards.saerdna@srm.hc (Andreas Fehr) wrote:
> On Wed, 07 Jul 1999 13:55:56 GMT, gene158@my-deja.com wrote:
>
> >In article <7lj7rh$7p62@news.cyber.net.pk>,
> > "Faisal Nasim" <swiftkid@bigfoot.com> wrote:
> >> <gene158@my-deja.com> wrote in message news:7lgfh9
> >$mis$1@nnrp1.deja.com...
> >> > I am trying to install a DBI for perl. I tried to do what the
readme
> >> > file said perl Makefile.PL but only makefile.pl works, then make
> >did
> >>
> >> <snip>
> >>
> >> If you are using ActivePerl, then use PPM to download DBI.
> >>
> >> c:\winnt>ppm
> >> ppm>install DBI
> >> do you want to install DBI (y/n)? y
> >
> >I am using Active perl and I tried it but nothing happened.
> >Do I have to set my path to set HTTP_proxy=http://proxy:8080
> >like it said in perl faq for ppm to work?
> >
> >When I try I still get "fatal error U1073"
> >
> >
> >
> >Sent via Deja.com http://www.deja.com/
> >Share what you know. Learn what you don't.
>
> Goto http://www.activestate.com/packages/zips/
> and load the DBI zip.
> Unzip it and install it with ppm install DBI.ppg
>
> Andreas
>
Thanks That is what I needed. All there was to it was to go in the
perl\bin directory and run ppm.pl then install the downloaded package.
Everything is fine now, thank you all
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 08 Jul 1999 17:49:49 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: newbie question
Message-Id: <3786e3cf.920707@news.skynet.be>
Victor Gamov wrote:
> sub sub1 {
> @args = ("a1", "a2", "a3");
> $hash1{'args'} = \@args;
> }
Ouch. @args is a global.
> sub sub2 {
> @args = $hash{'args'};
Ouch. Same global.
> foreach $a (@args) {
> print "a=$a, "; # here I want to see a1, a2, a3
> }
> }
>
> Where I was wrong?
First, localize that @args by saying (for example)
my @args = ('a1,'a2,'a3);
Second: by doing
my @args = $hash{'args'};
Yo uassagn ONE scalar to the array, in fact creating an array of one
item. You can dereference it, getting the array contents, like this:
my @args = @{$hash{'args'}};
or you can wait until later:
my $args = $hash{'args'}; #scalar! -> array ref
foreach $a (@$args) { #here, dereference the array ref
print "a=$a, "; # here I want to see a1, a2, a3
}
HTH,
Bart.
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
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 V9 Issue 79
************************************