[16048] in Perl-Users-Digest
Perl-Users Digest, Issue: 3460 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 23 06:05:39 2000
Date: Fri, 23 Jun 2000 03:05:24 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <961754724-v9-i3460@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 23 Jun 2000 Volume: 9 Number: 3460
Today's topics:
Re: 'Wilderness' <internet@network-services.fsnet.co.uk>
Re: *** Urgent: Perl Access to MySql without DBI.pm pos <gellyfish@gellyfish.com>
Re: basic ipchains perl scripts <gellyfish@gellyfish.com>
Re: basic ipchains perl scripts <gellyfish@gellyfish.com>
Re: Consistently getting "(in cleanup) Can't call metho <thunderbear@bigfoot.com>
Re: Creating a cause from information. (Csaba Raduly)
Dereferencing a two dimensional array? <shanen@my-deja.com>
Re: eof for sendmail .. (Villy Kruse)
Re: GCC Installation <peter.sundstrom@eds.com>
Re: GCC Installation <gellyfish@gellyfish.com>
Re: Good Win32 Perl books for UNIX Perl programme? <gellyfish@gellyfish.com>
Re: HELP PLEASE IM NEW <username@domianname.com>
Re: Help---Perl---Storage- <bill.kemp@wire2.com>
Re: HEPL: DBI driver fot Paradox 3.5 and NG for Perl <gellyfish@gellyfish.com>
Re: How do I pass var from command line? <gellyfish@gellyfish.com>
Re: I'm confused, help please... <gellyfish@gellyfish.com>
Re: Internet & scripting <gellyfish@gellyfish.com>
Re: Looking for mortgage calculations <gellyfish@gellyfish.com>
Re: NET::FTP Croak problem <gellyfish@gellyfish.com>
Re: Number or string item in an array? nobull@mail.com
Re: Passing filehandles to subroutines (Mike)
Re: Perl Builder 2.0 for LINUX - Beta Available (Mark W. Schumann)
Re: perl for automated scp (Rafael Garcia-Suarez)
Re: Perl Network Programming <gellyfish@gellyfish.com>
Re: Perl Programming Style Question <gellyfish@gellyfish.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 23 Jun 2000 09:43:36 +0100
From: "Dave Carney" <internet@network-services.fsnet.co.uk>
Subject: Re: 'Wilderness'
Message-Id: <8iv7qt$q4l$1@news5.svr.pol.co.uk>
Many thanks for the advice, I must admit I have committed a great deal of
time and momentum to perl (.pl)
I will thoroughly comb the perl website and take in the 'glyphs'
Dave C
------------------------------
Date: 23 Jun 2000 08:07:46 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: *** Urgent: Perl Access to MySql without DBI.pm possible ??? ***
Message-Id: <8iv2c2$3da$1@orpheus.gellyfish.com>
On Thu, 22 Jun 2000 19:37:57 +0100 WWW_DESIGN_HOSTING wrote:
> Hi
>
> can anybody tell me how i can access from a Perl-Script to a Mysql Database
> ( MySql is on a Linux Server ).
>
> I have to make the exam and the system administrator told me, that the
> DBI.pm Perl Module
> is not installed on the Server. He also told me, that they will never
> install DBI.pm on the server !
>
Sounds like a right plank to me.
Why cant you install it yourself ?
See the section entitled :
How do I keep my own module/library directory?
in perlfaq8.
> But how can i have access to MySql from a Perl-Script without the DBI Module
> ?????
>
The simple answer is that you're stuffed as now even the old Mysql.pm is
simply a wrapper around the DBI version.
The longer answer would be that if you obtain the source for the Mysql
client then you should be able to work out how to do this in Perl yourself
although the effort does seem to be a little bit of a waste.
Anyhow ask your sysadmin what point he thinks there is in having Mysql
installed without having anyway to access it from a common programming
language.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 22 Jun 2000 22:48:37 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: basic ipchains perl scripts
Message-Id: <8iu1jl$21r$1@orpheus.gellyfish.com>
On Thu, 22 Jun 2000 16:13:41 GMT wmcn@my-deja.com wrote:
> In article <395226E4.99FB02E0@attglobal.net>,
> Drew Simonis <care227@attglobal.net> wrote:
>> wmcn@my-deja.com wrote:
>> >
>> > Hi I'm looking for basic ipchains perl scripts to link to my
>> > forms to remote configure ipchains debian box.
>> > Thanks,
>> > Bill
>> >
>>
>> I'm looking for a new pair of shoes. But I don't do it here.
>
> You are also looking for a kick in the head.
And you have gained a permanent killfile entry.
> And keep your toss responses to alt.flame .
Except you wouldnt have read it.
> I was talking
> about perl afterall.
>
So you would have gone to comp.lang.c for some other program.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Fri, 23 Jun 2000 08:30:01 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: basic ipchains perl scripts
Message-Id: <deF45.690$My4.69656@news.dircon.co.uk>
On Thu, 22 Jun 2000 20:01:11 GMT, Dan Wilga Wrote:
> In article <39524CA0.3776C4D5@attglobal.net>, Drew Simonis
> <care227@attglobal.net> wrote:
>
>> You were not on topic in any case. This group is for the discussion
>> of the Perl programming language. It is not a source for free scripts.
>>
>> Talking about a Perl script you want is not the same as talking about
>> Perl.
>
> I, for one, disagree. I can think of far more off-topic questions
> than this. This post was not flame-worthy, IMHO. Jonathan also seems
> to think so as well, and his response was helpful in pointing the
> poster along the right path (which basically told him where to look
> in order to get started writing a routine to do what he wants.)
Except the OP *was* asking for the scripts. I was just too tired to type
'If you are simply looking to find the scripts rather than write ... '.
/J\
------------------------------
Date: Fri, 23 Jun 2000 11:11:54 +0200
From: =?iso-8859-1?Q?Thorbj=F8rn?= Ravn Andersen <thunderbear@bigfoot.com>
Subject: Re: Consistently getting "(in cleanup) Can't call method "FETCH"...
Message-Id: <395329DA.68A48964@bigfoot.com>
Tom Phoenix wrote:
> You may be able to use the debugger to find out which variable it is that
> became undefined, then run again to try to find whose code is doing that.
> Good luck with it!
Well, it was certainly worth a try.
Unfortunately, the error does not show when the script is run in the
debugger (which I take as an indication that the fault is not in my
code).
Has anyone else seen this error message consistently? I remember
getting it on Linux with a 5.006 also without any particular reason.
--
Thorbjørn Ravn Andersen "...plus...Tubular Bells!"
http://bigfoot.com/~thunderbear
------------------------------
Date: 23 Jun 2000 09:39:02 GMT
From: csaba_r@my-deja.com (Csaba Raduly)
Subject: Re: Creating a cause from information.
Message-Id: <8F5C64155quuxi@193.82.145.131>
23 Jun 2000: A formal bug report was sent to Seti@Home, because the
following message originated from malverian@my-deja.com was reported
as containing signs of intelligence:
>
>> Using $_ for your records also makes regex tests much nicer since
>> they use $_ as default data, so you'll go /blah/ in stead of $data
>>=~ /blah/
>
>Thankya thankya =)
>But why wouldn't this have the same loss of data that was mentioned
>if I were to use $data? That's my main concern now.
>
>
This is what your code was:
while(<SOCK>) # read a 'line' from SOCK, give it to $_
{
$data = <SOCK>; # read a 'line' from SOCK, give it to $data
# work on $data
if( $data =~ /someregexp/ ){
# ...
}
}
Data is not lost, your code just puts every odd numbered line into $_ and
ignores it, and only works on the even numbered lines read into $data.
The usual way to process all lines is
while(<SOCK>) # read a 'line' from SOCK, give it to $_
{
# work on $_
if( /someregexp/ ){
# ...
}
}
Note also that $data = <SOCK> does not check for end-of-file condition. <SOCK>
returns undef in this case, and your code will happily use it. The while(
<SOCK> ) construct does check for this condition and terminates the loop at
the end of file.
HTH (hopefully my explanations are BOTH clear *AND* correct :-)
--
Csaba Raduly, Software Developer (OS/2), Sophos Anti-Virus
mailto:csaba.raduly@sophos.com http://www.sophos.com/
US Support +1 888 SOPHOS 9 UK Support +44 1235 559933
Life is complex, with real and imaginary parts.
------------------------------
Date: Fri, 23 Jun 2000 08:22:23 GMT
From: Shannon Jacobs <shanen@my-deja.com>
Subject: Dereferencing a two dimensional array?
Message-Id: <8iv6nm$j7c$1@nnrp1.deja.com>
Well, I've seen the kind of stuff that goes here, so I know I'll get
flamed for the clueless newbie question--but it mostly supports my
hypothesis that too much Perl causes brain damage and social
dysfunction. Fortunately, I am of course immune to the effects, having
already been damaged beyond scope of furtherness...
This line works:
@jr = split /\s/,$reslist[$i];
This line works:
$re[$i] = [split /\t/,$results[$i]];
This line does NOT work:
@jr <= $re[$i];
It returns "ARRAY nanika". I have tried many variations. I have been
all over the camel book, the docs, FAQs, and various parts of the
newsgroups and Internet and cannot figure out how to pass the correct
value to $jr. [But now that I look at what I just typed, I bet the
problem is that $reslist is not REALLY the same thing as $results, but
I don't have more time just now, so I'm going to post this anyway.]
By the way, if I don't get flamed too excessively, I'll probably post
some hilarious examples of my code and ask how to do the same things
properly.
I'd appreciate an email copy of the mysterious but doubtless brief
answer, since I obviously don't have a good news server.
--
Spamnuts--not just for breakfast anymore. Be sure to crack the shells
before adding soy sauce.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 23 Jun 2000 08:12:53 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: eof for sendmail ..
Message-Id: <slrn8l6704.e02.vek@pharmnl.ohout.pharmapartners.nl>
On Thu, 22 Jun 2000 18:42:25 -0700, Tom Phoenix <rootbeer@redcat.com> wrote:
>On 22 Jun 2000, Chris Sorensen wrote:
>
>> would someone please tell me the EOF command for sendmail ?
>
>Perhaps you intended to post this to a newsgroup about sendmail. Cheers!
>
By the way, the eof to sendmail is like any other eof to any other program
you might be piping to. You send it when you close the pipe.
However, you might need the -oi option or you might cut your message short
if you happen to send a period all alone on a line.
Villy
------------------------------
Date: Fri, 23 Jun 2000 16:11:44 +1200
From: "Peter Sundstrom" <peter.sundstrom@eds.com>
Subject: Re: GCC Installation
Message-Id: <8iuo5u$t4a$1@hermes.nz.eds.com>
Kig-Keat Yong wrote in message <3951D8CD.ECE7D6B3@email.sps.mot.com>...
>Hi,
>
> I found some difficulties when installing Apache..it requires
>Perl and GCC.
Apache requires neither Perl nor gcc.
>When i want to install GCC..there several stages need togo through..
> install a precomplied GNU C compliler
> install GNU make
> use those to complile the current GCC suite
>
>but when i in stage 2..there is the problem i facing...
>
>phantom# ./configure --prefix=/opt/GNUmake
>loading cache ./config.cache
>checking for a BSD compatible install... ./install-sh -c
>checking whether build environment is sane... yes
>checking whether make sets ${MAKE}... ./configure: make: not found
>no
>checking for working aclocal... missing
>checking for working autoconf... missing
>checking for working automake... missing
>checking for working autoheader... missing
>checking for working makeinfo... missing
>checking whether make sets ${MAKE}... (cached) no
>checking for gcc... no
>checking for cc... no
>configure: error: no acceptable cc found in $PATH
You obviously don't have gcc in your PATH.
Anyway, this is a *very* offtopic question for this newsgroup
------------------------------
Date: Fri, 23 Jun 2000 08:31:29 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: GCC Installation
Message-Id: <BfF45.691$My4.69656@news.dircon.co.uk>
On Fri, 23 Jun 2000 16:11:44 +1200, Peter Sundstrom Wrote:
>
> Kig-Keat Yong wrote in message <3951D8CD.ECE7D6B3@email.sps.mot.com>...
>>Hi,
>>
>> I found some difficulties when installing Apache..it requires
>>Perl and GCC.
>
> Apache requires neither Perl nor gcc.
>
It likes to have perl installed and does require some C compiler though.
/J\
------------------------------
Date: 23 Jun 2000 09:21:56 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Good Win32 Perl books for UNIX Perl programme?
Message-Id: <8iv6n4$3km$1@orpheus.gellyfish.com>
On Thu, 22 Jun 2000 12:41:10 GMT ddui@iee.org wrote:
> One question:
>
> I have already experience with Perl on UNIX. I'll have to use Perl on
> Windows. What is a good book to learn the differences between Win32 and
> UNIX.
>
The perlport manpage might be a good place to start. If you have 5.6.0
then you might also want to look at the perlwin32 manpage.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Fri, 23 Jun 2000 05:22:19 -0700
From: username <username@domianname.com>
Subject: Re: HELP PLEASE IM NEW
Message-Id: <3953567B.546D0119@domianname.com>
Sounds like a really strange/interresing way to violate copyright laws?!?
<-- joke
What OS?
cass_x@my-deja.com wrote:
> HI All
>
> I am having a problem with a script i have that sort of acts like a web
> browser. This script will parse an HTML page for the expressions i
> enter and write the output to an HTML doc on my hard drive. This works
> on all sites except the ones who ask for cookies. Does anyone know how
> to return a cookie via a Perl script ?? I already have the cookie i
> need to log on to the site, is there any way to connect the cookie file
> generated by Netscape to my Perl script ??
>
> Any help would be greatly appreciated !!
>
> Thanks in advance
>
> Cass
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Fri, 23 Jun 2000 09:18:26 +0100
From: "W Kemp" <bill.kemp@wire2.com>
Subject: Re: Help---Perl---Storage-
Message-Id: <961748427.4671.0.nnrp-09.c3ad6973@news.demon.co.uk>
Drew Simonis wrote in message <39524C30.867D43DE@attglobal.net>...
>W Kemp wrote:
>>
>> >Here is a lesson in manners.
>>
>> haha
>> lets laugh at someone who isn't very good at english.
>
>Language has nothing to do with it. If you are aware that
>your post is off topic before making it, and thus appologise,
>you shouldn't post in the first place.
That's how you started off, but you then chose to do the following:-
Make out it was a riddle. The use of 'who' instead of 'that' for describing
a perl script, not realising that 'who' strongly implies a person, and is
not used for an object/thing (common mistake).
'I got no' - again a simple fault in english that you choose to ridicule.
There was no need to add the above points, unless you revel in ridicule.
I am now way off topic. The original poster was looking for a perl script,
not completely off topic.
Which is worse -off topic posting or making fun of someone because their
english isn't very good.
If you think its the former, you need to get out more often.
------------------------------
Date: 23 Jun 2000 07:58:49 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: HEPL: DBI driver fot Paradox 3.5 and NG for Perl
Message-Id: <8iv1r9$3bc$1@orpheus.gellyfish.com>
On Thu, 22 Jun 2000 22:28:19 +0400 Victor Tsch wrote:
> Hi all,
>
> While trying to find a way to operate with Paradox 3.5 bases (just now
> I deal with dbf files using XBase), I found a DBI pm; but they say the
> driver must be indicated... Could you tell me a place I can take the driver?
There still isnt a DBD::Parado I'm afraid. If you are on a windows machine
you will need to use DBD::ODBC with the appropriate Paradox ODBC driver
and DSN set up (ask in the ODBC group if you are unsure about that last bit)
> Or maybe you know whether there is a NortonGuide file about Perl?
You are probably better off using the ODBC driver if you are likely to
be using this in a multiuser setting as the driver implements its own
locking mechanism and understands all that BDE stuff about aliases and
so forth. If however you should find a description of the format of the
datafiles then I would hope that you would make a proper DBD module from
it and submit to CPAN for the next person who has this problem.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 23 Jun 2000 08:32:58 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How do I pass var from command line?
Message-Id: <8iv3ra$3gd$1@orpheus.gellyfish.com>
On Thu, 22 Jun 2000 16:13:47 GMT Rodney Engdahl wrote:
> In article <8itd32$8ia$1@nnrp1.deja.com>,
> fperkins@my-deja.com wrote:
>> My script is expecting to receive $file.
>>
>> From an unix command line, I do:
>>
>> /usr/local/bin/perl /script/script.cgi?$file=test.dat
>>
>> However, in unix, it tells me that it cant find the script, which
>> makes sense cause it uses ?* as part of the file name.
>>
>> I know the above notation is to pass a variable from a web browser,
>> how can I do it from a command line?
>>
>>
> perldoc perlvar | grep @ARGV
>
> One way to do it:
> /usr/local/bin/perl /path/to/file.name arg1 arg2 arg3
>
> in the script (/path/to/file.name), use @ARGV to get the input params
>
> hint: $ARGV[0] will be 'arg1'
>
Alternatively the OP might look at the '-s' switch as described in the
perlrun manpage.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 23 Jun 2000 08:46:53 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: I'm confused, help please...
Message-Id: <8iv4ld$3hk$1@orpheus.gellyfish.com>
On Thu, 22 Jun 2000 10:50:08 -0400 Nathan Wright wrote:
> The following script is giving me trouble...
>
> #!/usr/local/bin/perl5
> print "Content type: text/html \n\n";
> my $WEEKDAY = `date +%u`;
> print "$WEEKDAY";
>
> The output is always one value greater than what the unix shell window
> displays when I just type "date +%u.
>
That an external program behaves differently when run from a Perl program
in a different environment is not really Perl's problem. What output
do you get when you run your Perl program from the command line ?
What do you get when you run the equivalent shell script as a CGI program ?
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 23 Jun 2000 09:11:48 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Internet & scripting
Message-Id: <8iv644$3jh$1@orpheus.gellyfish.com>
On 22 Jun 2000 06:39:51 -0700 locate@locate-now.com wrote:
^^^^^^^^^^^^^^^^^^^^^
> --=200006220639=
> Content-Type: text/plain;charset=US-ASCII
>
I would recommend that you get a better newsreader.
> For you programmers or those who are interested in computer
> langage. I found while surfing the internet a source that explains, html,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> pearl, asp, python, smil,javascrip, etc.
>
> Check At: http://www.locate-now.com/adcomp1.htm
^^^^^^^^^^^^^^^^^^^^^^^^^
There appears to be no Perl content here. At least some of the marginally
less stupid spammers make the effort to change their e-mail addresses
before posting these things.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 23 Jun 2000 08:23:43 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Looking for mortgage calculations
Message-Id: <8iv39v$3fh$1@orpheus.gellyfish.com>
On Thu, 22 Jun 2000 16:57:09 GMT nater@vlender.com wrote:
> Hello,
> I am looking for the formulas for mortgage calculators, specifically
> rent vs own (buy) calculation. I have browsed the web, but have only
> been able to find the actual calculators running behind cgi scripts
> that I cannot Seem to find any help on the source.
>
> If anyone has these formulas that would be willing to share them, I
> would greatly appreciate it.
>
The formulae are the same whatever language you might use to actually
do the calculation - I seem to recall that there was an example for
GWBASIC that shipped with ms-DOS prior to version 5 - I would also
imagine that most spreadsheet software has an example of this. There
doesnt appear to be a CPAN module that will do it. I would recommend
that you talk to an accountant or read a basic book on acountancy.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 23 Jun 2000 09:03:13 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: NET::FTP Croak problem
Message-Id: <8iv5k1$3is$1@orpheus.gellyfish.com>
On Thu, 22 Jun 2000 14:35:05 GMT BillyBob wrote:
> I am using NET::FTP. It works fine until I try to get an error
> message. I have no documentation on NET::FTP and I can't seem to
> find any on the net (nor in cpan).
Of course you have documentation for Net::FTP - it comes with it. You
can type 'perldoc Net::FTP' at a command prompt to get at it. If you
are one of these strange people who dont actually have access to the
command prompt on the machine that they run their Perl programs then
you should be able to find the documentation via <http://search.cpan.org>
> Here is an example of what I
> am using... $ftp = Net::FTP->new($form_results{'TARGET_SERVER'})
> || croak "Problem With Host Name Or IP Address<BR>\n";
> $ftp->login($form_results{'TARGET_USERID'},$form_results{'TARGET_PASSWORD'})
> || die "Wrong User ID or Password<BR>\n";
> The croak command I copied from someone else here in the newsgroup and
> it does not work at all - totally aborts the program.
Prey tell why did you simply copy this from someone ? What did you
think that it would do for you ? Do you have :
use Carp;
in your program. It is highly unlikely that croak will give you anything
that die doesnt do outside of a module or subroutine.
> The die command
> is not working properly either - the program seems to die but no message
> is printed out. If I "|| print "error\n" then the message prints out
> but the program continues without dying. Any suggestions? Steve
Yes this is very probable. I gather you are running this in the CGI
environment. The output of both croak and die go to STDERR which will
end up in the web servers error log - only the STDOUT will go to the
server and thence to the users browser. You have a few choices -
you can redirect your STDERR to STDOUT, you can use print and then exit
or you can use the module CGI::Carp - there are probably others but
you can find those for yourself.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 23 Jun 2000 09:39:12 +0100
From: nobull@mail.com
Subject: Re: Number or string item in an array?
Message-Id: <u9itv06bbj.fsf@wcl-l.bham.ac.uk>
"Ross Xu" <rossxu@127.0.0.1> writes:
> Could you please tell me how I can know which items are number, and which
> are strings in an array(e.g. @array)?
Please think about what your question really is before you post.
Do you really think the answer would be different for an array element
than for any other scalar? Obviously not - so any mention of arrays
only serves to confuse the issue.
Are you say "are number" do you mean "look like numbers" or "are
stored by Perl as numbers"?
You have been pointed to the FAQ and that is the answer to one
possible interpretation of your question.
Here's one answer to the other possible interpretation:
#!/usr/bin/perl -w
use strict;
sub is_a_number ($) {
( $_[0] ^ $_[0] ) eq 0;
}
my @array = ( '1', 1 );
for (0..$#array) {
print "\$array[$_] is a ",
is_a_number $array[$_] ? "number.\n" : "string.\n";
}
__END__
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 23 Jun 2000 01:12:20 -0700
From: tcsh@holly.colostate.edu (Mike)
Subject: Re: Passing filehandles to subroutines
Message-Id: <slrn8l63ek.s06.tcsh@faure.cs.colostate.edu>
gbacon@HiWAAY.net (Greg Bacon):
>
> to help yourself. That's why we ask people to read the FAQ first,
> *BEFORE* posting. As you've so nicely demonstrated, when people don't
The FAQ is not something I can see reading from start to finish. When I need
an answer, I search for it. I didn't think is was a FAQ, as a search for
'filehandle' at perlfaq.com didn't turn up the needed information.
>
> You need to upgrade. It's often easier to just grep the pods. Do
> you know how to find the pods in your Perl installation?
I'm not the sysadmin and have a tight disk usage quota so an upgrade isn't
possible. But thanks for the grepping the pods idea, I'll surely use that
in the future.
--
Mike
------------------------------
Date: 23 Jun 2000 00:58:18 -0400
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: Perl Builder 2.0 for LINUX - Beta Available
Message-Id: <8iuqpa$5c0@junior.apk.net>
In article <39511AC6.2866@solutionsoft.com>,
Marty Ford <marty@solutionsoft.com> wrote:
>Hi,
>
>> I'm not the original griper, but you're missing the point.
>>
>> If I'm a Perl programmer who uses Linux, and I want to use your Perl
>> IDE on Linux, I have to install and configure some completely unrelated
>> bit of software to do it.
>>
>
>> And Wine itself is so doggone big and complicated that you've just
>> about eliminated the possibility that someone might download and
>> try the demo on a lark.
>
>I guess I need to clarify....
>
>* The Wine RPM is only 2.8 MB is size.
>
>* Wine is included in the Perl Builder download file (4.8 MB) total.
>
>* We provide a script to install and configure everything. The entire
>process takes about 5 minutes.
*whooooooosh*
>Thus, we view Wine as supporting files that are installed along with our
>application. It is certainly not the case that we are expecting people
>to go out and find/install/configure Wine just to install our software.
>
>The only caveat to the above is that you need a recent version of glibc
>and so forth for everything to work. However, this is documented clearly
>on the download page, so you will know in advance.
Ahem. Yeah. Okay.
------------------------------
Date: Fri, 23 Jun 2000 06:18:41 GMT
From: garcia_suarez@hotmail.com (Rafael Garcia-Suarez)
Subject: Re: perl for automated scp
Message-Id: <slrn8l60hn.eh8.garcia_suarez@rafael.kazibao.net>
Tom Phoenix wrote in comp.lang.perl.misc:
>On Thu, 22 Jun 2000, Rafael Garcia-Suarez wrote:
>
>> SUID doesn't work on scripts on decent OSes.
>
>Actually, this is no longer the case.
>
>On bad old OSes, set-id scripts were - and still are - a security hole.
>These should be replaced.
>
>On some good new OSes, set-id scripts are just as good as set-id binaries.
>Solaris and SunOS work like this.
>
>On other good new OSes, Perl can emulate set-id scripting. Linux works
>like this.
Well, you're right -- I've just tested that on a Solaris 7 machine.
My only previous experience about setuid scripts was on Linux 2.2.
Where can I find some more documentation about suidperl and execution
of setuid scripts (not necesseraly perl scripts) in various OSes (besides
perlsec(1)) ?
--
Rafael Garcia-Suarez
------------------------------
Date: 23 Jun 2000 08:42:00 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl Network Programming
Message-Id: <8iv4c8$3h9$1@orpheus.gellyfish.com>
On Thu, 22 Jun 2000 14:54:05 GMT nfin8axs@hotmail.com wrote:
> I am fairly new to Perl, but one of the things that I am interested
> in is the ability to hand craft your own TCP packets. I am by convention
> C coder (within the Linux platform) and I want to be able to extend some
> of the functionality of my Perl code to have this capacity.
>
Er why ? If you insist then I am sure that you will find a module on
CPAN that can do this.
> As a separate issue, I was wondering about "type-casting: Is there any
> way I can force a numerical value upon a variable?
> E.G.
> $input = <STDIN>; #user inputs: 12345?
> chop ($input);
>
You almost certainly want to use chomp() there instead as it will only
take the line terminator character off.
> How can I be sure that $input is numerical and not a string value?
> I have been doing the equivalent to $input=$input+1 but i
> know there has to be a better way to perform this function. Ultimately,
> this value will be used for comparison to over 700,000 cells in a hash
> table, so I need the value to be numeric (because numeric comparisons
> are faster than string.)
If it looks like a number then it is a number. You should take a look at
the item entitled :
How do I determine whether a scalar is a
number/whole/integer/float?
in the perlfaq4 manpage in the first instance,
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 23 Jun 2000 09:17:52 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl Programming Style Question
Message-Id: <8iv6fg$3js$1@orpheus.gellyfish.com>
On 22 Jun 2000 13:30:07 GMT Jang Choe wrote:
> Just wondering if it's better to write a perl script like this:
>
> #!/usr/bin/perl -w
> use strict;
>
> {
> stuff here;
> }
>
> or like this:
>
> #/usr/bin/perl -w
> use strict;
>
> stuff here;
>
> The difference is the braces. Thanks
>
It really does depend on what the stuff is. If you need block scoping
by all means use the braces, if you dont need the scoping then most
people would leave them out. There is probably no need to place the
braces round the whole program though (well there might be but I guess
if you have to ask the question then you are unlikely to run into it :)
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
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 3460
**************************************