[12132] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5732 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 20 08:07:14 1999

Date: Thu, 20 May 99 05:00:21 -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           Thu, 20 May 1999     Volume: 8 Number: 5732

Today's topics:
    Re: best way to database stuff using Perl? <michiel.verhoef@wkap.nl>
    Re: best way to database stuff using Perl? smnayeem@my-dejanews.com
    Re: best way to database stuff using Perl? <gellyfish@gellyfish.com>
    Re: best way to database stuff using Perl? <gellyfish@gellyfish.com>
    Re: best way to database stuff using Perl? (Bart Lateur)
    Re: Binary image file reading or $x as a number. (Larry Rosler)
    Re: Binary image file reading or $x as a number. armchair@my-dejanews.com
        conditional regexp matching. Please advise. <ravik@cyrix.com>
        Copy/paste on Win95 with Tk <patrick.renaud@transport.alstom.com>
        Help install perl5 <bakulin@eximb.kiev.ua>
    Re: How can I skip the "." and ".." files when reading  <brandy@brandy.com>
    Re: How do I get the IP of the server I am on. <michiel.verhoef@wkap.nl>
    Re: How do I get the IP of the server I am on. <gellyfish@gellyfish.com>
    Re: How to catch the return value in Perl? <peary@ms1.url.com.tw>
    Re: How to move a directory? (Hans-Georg Rist)
    Re: If possible, then how do I remove the last line in  (Bart Lateur)
    Re: No classes.zip file found (Juho Cederstrom)
        out of memory! <M.Eilens@DeutschePost.de>
    Re: Parsing email headers.. (Larry Rosler)
    Re: Parsing email headers (Larry Rosler)
        Q: how do i get the lenght of a string erik_lembke@my-dejanews.com
    Re: Q: how do i get the lenght of a string <gellyfish@gellyfish.com>
    Re: Search and Fetch Newsgroup <gellyfish@gellyfish.com>
    Re: Tie Fighter (Bart Lateur)
    Re: Tie Fighter (Chris Nandor)
    Re: Verifying passwd in FreeBSD <gellyfish@gellyfish.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 20 May 1999 09:40:28 +0200
From: Michiel Verhoef <michiel.verhoef@wkap.nl>
Subject: Re: best way to database stuff using Perl?
Message-Id: <3743BC6C.737B5898@wkap.nl>



"Dr. A R Daniels" wrote:

> I have found that Win32 - ODBC works well.  Try the following web site for
> more information:
>
> http://www.roth.net/perl/odbc/
>
> Note:  This only applies to WinNT based servers - and lets face it lots of
> people (apart from the die hard 'shag microsoft' strange people) are moving
> over to this platform according to a survey by a leading IT company over
> here in the UK.

True, but that's largely a management thing: the inital costs of NT are lower
(cheaper
hardware mainly), which is what most non-IT managers look at. The real costs
only
come _during_ the use of the system, when one needs someone to pat the NT server

on it's back 24 hrs a day or otherwise it'll crash. Admitted, this is a slight
exaggeration
but still true: the average UNIX server gives a lot less trouble than the
average NT
server.

But hey, there's room for both in my world :-)

Regards,

Michiel




>
>
> Tony
>
> <owner@btinternet.com> wrote in message
> news:373B76BE.34D09921@btinternet.com...
> > OK.....to be short and sweet, access to a cgi-bin on a virtual server.
> I've
> > heard a lot about these modules, and am wondering if someone can
> > explain/advise on the best way of modifying/querying a database file
> (created
> > from scratch or an existing, preferably MS Access, one)
> >
> > Thanks again
> >
> > Ben
> >
> > Charles R. Thompson wrote:
> >
> > > [ Congratulations, owner@btinternet.com you could be a winner! Return to
> > > comp.lang.perl.misc to claim your prize. ]
> > >
> > > In article <373B6C9D.7F18C9B@btinternet.com>, owner@btinternet.com
> > > says...
> > > > I know that the preffered way these days is Cold Fusion, but
> > >
> > > Like #%(*%# it is. Bad newbie! Bad! :)
> > >
> > > > say I want to do this via Perl, how would I go about this?
> > >
> > > Depends on alot. There is a big difference between your choices if you
> > > are running your own server in a LAN or WAN deal and renting a little
> > > virtual server. Also, depends on what platform you are going to run on.
> > >
> > > What is the target enviroment for the script(s)? Owned LAN, Virtual
> > > Server, Self Maintained Web Server, Windows, UNIX, MAC. The list goes
> on.
> > >
> > > --
> > > Charles R. Thompson
> > > RainCloud Studios
> > > "That? That's no script. That's your attempt at a rather complex README
> > > file."
> >
> >
> >



------------------------------

Date: Thu, 20 May 1999 09:02:50 GMT
From: smnayeem@my-dejanews.com
Subject: Re: best way to database stuff using Perl?
Message-Id: <7i0j3q$ig3$1@nnrp1.deja.com>

In article <7hvaoj$j6$1@gellyfish.btinternet.com>,
  Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> In comp.lang.perl.misc Jared Hecker <jhecker@iago.nac.net> wrote:
> > In comp.lang.perl Dr. A R Daniels <a.daniels@umist.ac.uk> wrote:
> >> I have found that Win32 - ODBC works well.  Try the following web
site for
> >
> >> Note:  This only applies to WinNT based servers - and lets face it
lots of
> >> people (apart from the die hard 'shag microsoft' strange people)
are moving
> >> over to this platform according to a survey by a leading IT company
over
> >> here in the UK.
> >
> >
> > Actually, here in the "colonies", Linux servers grew as much
> > percentage-wise last year as NT for databases.  I would put an
> > equally-configured box running Red Hat 5.2 against NT with both
running,
> > say, Oracle or Sybase any day of the week.
> >
>
> I'd like to throw in Informix here as well,  I've got a copy of a
largish
> billing database from work on this here machine at home with a view to
> shifting the 4GL code base over to a web-based system in Perl.
>
> /J\
> --
> Jonathan Stowe <jns@gellyfish.com>
> Some of your questions answered:
> <URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
> Hastings:
<URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
>
Oracle, Ingres and MySQL are all very good no doubt. But theres one
little difference between these and Perl and Linux, they are not free.
Isnt there any free GOOD RDBMS i can use with perl? PostGres is free but
anyone knows where i can find a DBI driver for Postgres?

thanks
smnayeem


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


------------------------------

Date: 20 May 1999 11:14:17 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: best way to database stuff using Perl?
Message-Id: <3743e079@newsread3.dircon.co.uk>

[ comp.lang.perl is dead - removed from groups ]

smnayeem@my-dejanews.com wrote:
> In article <7hvaoj$j6$1@gellyfish.btinternet.com>,
>   Jonathan Stowe <gellyfish@gellyfish.com> wrote:
>> In comp.lang.perl.misc Jared Hecker <jhecker@iago.nac.net> wrote:
>> > In comp.lang.perl Dr. A R Daniels <a.daniels@umist.ac.uk> wrote:
>> >> I have found that Win32 - ODBC works well.  Try the following web
> site for
>> >
>> >> Note:  This only applies to WinNT based servers - and lets face it
> lots of
>> >> people (apart from the die hard 'shag microsoft' strange people)
> are moving
>> >> over to this platform according to a survey by a leading IT company
> over
>> >> here in the UK.
>> >
>> >
>> > Actually, here in the "colonies", Linux servers grew as much
>> > percentage-wise last year as NT for databases.  I would put an
>> > equally-configured box running Red Hat 5.2 against NT with both
> running,
>> > say, Oracle or Sybase any day of the week.
>> >
>>
>> I'd like to throw in Informix here as well,  I've got a copy of a
> largish
>> billing database from work on this here machine at home with a view to
>> shifting the 4GL code base over to a web-based system in Perl.
>>
> Oracle, Ingres and MySQL are all very good no doubt. But theres one
> little difference between these and Perl and Linux, they are not free.
> Isnt there any free GOOD RDBMS i can use with perl? PostGres is free but
> anyone knows where i can find a DBI driver for Postgres?
> 

Except of course that MySQL *is* free to all intents and purposes :
check out:

<http://www.tcx.se/Manual_chapter/manual_Licensing_and_Support.html>

For personal (Development use) both Informix SE and Sybase are free
for the Linux platform - I dont know about Oracle.

For Postgres you can can get the DBD Driver from CPAN :

<http://www.cpan.org/authors/id/MERGL/DBD-Pg-0.91.tar.gz>

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



------------------------------

Date: 20 May 1999 11:30:41 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: best way to database stuff using Perl?
Message-Id: <3743e451@newsread3.dircon.co.uk>

[ Removed the extinct comp.lang.perl from groups ]

Dr. A R Daniels <a.daniels@umist.ac.uk> wrote:
> 
> Note:  This only applies to WinNT based servers - and lets face it lots of
> people (apart from the die hard 'shag microsoft' strange people) are moving
> over to this platform according to a survey by a leading IT company over
> here in the UK.
> 

Not for Web Servers they arent :

  <http://www.netcraft.com/survey/>


/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



------------------------------

Date: Thu, 20 May 1999 11:29:59 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: best way to database stuff using Perl?
Message-Id: <3745ee61.1419152@news.skynet.be>

Michiel Verhoef wrote:

>True, but that's largely a management thing: the inital costs of NT are lower
>(cheaper hardware mainly), which is what most non-IT managers look at. 

Huh? I thought Linux and Free-BSD both run on ordinary PC hardware, so
where's that difference?

	Bart.


------------------------------

Date: Wed, 19 May 1999 23:54:27 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Binary image file reading or $x as a number.
Message-Id: <MPG.11ad51697f06d7c3989ac4@nntp.hpl.hp.com>

In article <7i06mu$9f6$1@nnrp1.deja.com> on Thu, 20 May 1999 05:31:09 
GMT, armchair@my-dejanews.com <armchair@my-dejanews.com> says...
 ...
> open(FILE,"test.txt") || die "could not open file ";
                                                    $!.\n";

> binmode(FILE);
> 
> my $data;
> my $bytes = 4;
> read(FILE,$data,$bytes);
                         == $bytes or die "Read error. $!\n";

> my ( $byte1, $byte2a, $byte3, $byte4) = unpack("C$bytes",$data);
> printf "%x", $byte1;
> printf "%x", $byte2a;
> printf "%x", $byte3;
> printf "%x", $byte4;

That wouldn't distinguish "\x01\x11\x00\x00" from "\x11\x1\x00\x00", for 
example (output 11100).  The format has to force two-character output 
fields (01110000 or 11010000).

Five lines to one:

  printf '%.2x' x $bytes, unpack "C$bytes", $data; # or just 'C*'

Or (much more directly):

  print unpack 'H*', $data;

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Thu, 20 May 1999 09:29:01 GMT
From: armchair@my-dejanews.com
Subject: Re: Binary image file reading or $x as a number.
Message-Id: <7i0kks$jiv$1@nnrp1.deja.com>

In article <MPG.11ad51697f06d7c3989ac4@nntp.hpl.hp.com>,
  lr@hpl.hp.com (Larry Rosler) wrote:
> In article <7i06mu$9f6$1@nnrp1.deja.com> on Thu, 20 May 1999 05:31:09
> GMT, armchair@my-dejanews.com <armchair@my-dejanews.com> says...
> ...


>
> Five lines to one:
>
>   printf '%.2x' x $bytes, unpack "C$bytes", $data; # or just 'C*'

(  "format specifier" x $value  )
Very interesting. Reminds me of the ( (1) x @array )  I have been seeing
elsewhere to assign values to hashes.


>
> Or (much more directly):
>
>   print unpack 'H*', $data;





"How's the programming group doing, Samuels?"
"Not bad. Fine group, and we have one standout who is putting out about
5 times as many lines of code per day as the rest of them."


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


------------------------------

Date: Mon, 17 May 1999 13:01:35 -0500
From: Ravi Kumar <ravik@cyrix.com>
Subject: conditional regexp matching. Please advise.
Message-Id: <3740597F.275B92B@cyrix.com>

All,

    I have to read in hex numbers specifiable either as 0xffffffff or
fffffffh.
but not both. I cannot exhaustively try all combinations with several
regexps. How can I do this with one regexp ?


--
Cheers,
--ravi, (ravik,8643)





------------------------------

Date: Thu, 20 May 1999 10:24:17 +0200
From: Patrick Renaud <patrick.renaud@transport.alstom.com>
Subject: Copy/paste on Win95 with Tk
Message-Id: <3743C6B1.FC6A7F50@transport.alstom.com>

Hi all,

I'm working with Perl (ActiveState) and Tk on Win95 and don't find in
the documentation a way to use the window's clipboard to copy and paste
datas beetween 2 applications.

Thanks for your help.
-- 
   _____________________________________
 /                                       \
|           Patrick RENAUD                |
|                                         |
|   patrick.renaud@transport.alstom.com   |
 \_______________________________________/


------------------------------

Date: Thu, 20 May 1999 09:04:09 +0300
From: "Boris Bakulin" <bakulin@eximb.kiev.ua>
Subject: Help install perl5
Message-Id: <2.07b3.27FV3.FC0OUX@eximb.kiev.ua>

I am very new in Perl and first time try to setup Perl5 and three days
push a wall

1   SCO UNIX
2   version P500503
3   inside directory /P500503 start command 'sh configur'
4   all time answer

Sorry, I can't seem to locate the source dir for perl5.  Please start
Configure with an explicit path -- i.e. /some/path/Configure.

/u1/home/bba/perlusha/P500503 >

Please help Me !!!!!!!!!

Boris



------------------------------

Date: Thu, 20 May 1999 21:39:20 +0930
From: "brandy" <brandy@brandy.com>
Subject: Re: How can I skip the "." and ".." files when reading in a directory
Message-Id: <I4S03.33285$MB3.52372@newsfeeds.bigpond.com>


Bart Lateur wrote in message <3742c2db.18149801@news.skynet.be>...
>Barcode wrote:
>
>>I have a script which reads a named directory, opens each file and removes
>>the specified line.  However, when I encounter the working and parent
>>directory files (. and ..) the rename function fails.
>>
>>How can I skip the opening of the two files and continue with the rest?
>
> foreach (readdir(DIR)) {
> next if $_ eq '.' or $_ eq '..';
> # go ahead!
> print "Entry: $_\n"; #example
> }
>
>BTW shouldn't you check for subdirectories too?

Smart thinking 99 ;-)






------------------------------

Date: Thu, 20 May 1999 09:46:47 +0200
From: Michiel Verhoef <michiel.verhoef@wkap.nl>
Subject: Re: How do I get the IP of the server I am on.
Message-Id: <3743BDE7.8EDC4F2F@wkap.nl>

Try to ping the machine and you'll have the ip address.

Mark Conlin wrote:

> How can I get the IP of the server I am running on ?
>
> Thanks
> Mark



------------------------------

Date: 20 May 1999 10:39:58 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How do I get the IP of the server I am on.
Message-Id: <3743d86e@newsread3.dircon.co.uk>

Mark Conlin <Mark.Conlin@bridge.bellsouth.com> wrote:
> How can I get the IP of the server I am running on ?
> 

you can find out from perlfaq9 :

       How do I find out my hostname/domainname/IP address?

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



------------------------------

Date: Thu, 20 May 1999 16:42:28 +0800
From: "peary" <peary@ms1.url.com.tw>
Subject: Re: How to catch the return value in Perl?
Message-Id: <7i0i6d$q2j$1@news1.sinica.edu.tw>

Hi,
I don't think it's permission...
Cause if i compile it by cc then it can run on web, but if i compile by esql
it can't.
And the '.' is not directory, it's the execution command on Redhat
Linux(bash).
I have to type "./filename" to execute a file.

Peary


> >Hi, all,
> >I have asked the following problem for a few days, and someone ever
> >answered me. But the problem still not solved.
> >Does anyone know how to solve the problem?
> >
> >And I found the web seems can't find the path of C execution file,
> >and don't execute it. But I have put the pl and C in the same path, WHY?
> >Could anyone tell me ?
> >
> >Thanks!!
> >Peary
> >
> >
> >Here is my problem,
> >
> >I use the Linux system with informix & perl,
> >We know we can use the perl statement  " qx (ls -al) "
> >to capture the output of "ls -al" , and it really works.
> >Then I tried to write a C program and compiled to execution file as
> >"add".
> >the code is as following....
> >
> >/*--add.c--*/
> >#include <stdio.h>
> >main(int argc, char *argv[]){
> >       printf("%s",argv[1]);
> >       return;
> >}
> >
> >and my perl example code :
> >
> >#!/usr/bin/perl
> >#--tt.pl
> >use CGI;
> >use CGI::Carp;
> >
> >$|=1;
> >print "Content-type:text/html\n\n";
> >$p="123abc";
> >
> >#--this is where i call the C  program and want to capture the output
value
> >$val=qx(./add $p);
> >print "<h1>return value--$val</h1>";
> >
> >When I execute the perl program under the linux command mode,
> >"perl  tt.pl", it really print out the result as
> >"<h1>return value--123abc</h1>".
> >But when i run it on BROWSER and submit to call the tt.pl ,
> >the result(123abc) won't print out on browser(the result is "return
> >value--"), why?
> >Is somewhere wrong? or
> >Is there anyother  method to catch the output or the return value
> >of the C program ?
>
> A few ideas you might look at.
>
> What user id is yiur web server running under? Does it have permission
> to run your add program?
>
> Which directory is '.' when your browser is running?
>
> hth,
>
> Dave...
> Dave Cross <dave@dave.org.uk>
> <http://www.dave.org.uk>



------------------------------

Date: Thu, 20 May 1999 11:54:25 GMT
From: hans-georg@rist.net (Hans-Georg Rist)
Subject: Re: How to move a directory?
Message-Id: <3743f792.1757304@news.uni-ulm.de>

"Jalil Feghhi" <jalil@corp.home.net> wrote:

>I also noticed that rename does not work accross file system boundaries or
>network, which is what I want
>
>Is there any perl function or module that can help me with that? Or, should
>I write my own function and move all the files one by one?

use File::Copy;

H-G

-- 
Hans-Georg Rist
hans-georg@rist.net


------------------------------

Date: Thu, 20 May 1999 11:52:50 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: If possible, then how do I remove the last line in a text file via CGI? (txt)
Message-Id: <3748f6e1.3595006@news.skynet.be>

limbeck wrote:

>    I use a script that adds one new line to a text file every time it is
>executed via a form. I need it to remove the last line in that text file,
>however, every time it adds a new one to the top (executes the script via
>form).

What do you mean "add a new line to the top"? It sounds like you need to
rewrite the whole file anyway. I suppose that you want to keep, say, at
most 20 lines in the file. In that case, read the whole file into an
array, unshift the new line at the front, make sure the array contains
no more than 20 lines, and print out the entire array again to the file.

Here's some code, which includes flocking the file, and opening it for
both reading+writing.

  open (FILE,"+<data.txt") or die "Can't open file: $!"; 
	# File must exist!
  use Fcntl qw(:flock);
  flock FILE, LOCK_EX;
  @lines = <FILE>;
  unshift @lines, "This is my new line!\n"; #include newline!
  splice @lines, 20; # keep only lines 0..19, if there were more
  # advantage over { $#lines = 19 }:
  # splice() creates no new (undefined) array items
  print @lines;
  seek FILE,0,0; truncate FILE,0; # rewind and clear file
  print FILE @lines;
  close FILE;

	Bart.


------------------------------

Date: Wed, 19 May 1999 20:05:07 +0300
From: cederstrom@kolumbus.REMOVE_THIS.fi (Juho Cederstrom)
Subject: Re: No classes.zip file found
Message-Id: <slrn7k5rq3.e0u.cederstrom@vortex.cede.net>

On 18 May 1999 10:28:09 -0600, 
Eric The Read <emschwar@rmi.net> wrote:
> This is buggy.

Yikes! I hate when someone says that to me... :)

> > 	print "$_ is Perl!\n"		if	/Perl/;
> PerlScript is Perl!

Yikes! Nightmare!

> Which it obviously isn't.  Add some anchors to that regexp, and we'll
> all be happy. :^)

How about this one:

print "$_ is Perl!\n"		if	/^[Pp]erl(\n)?$/;
print "$_ is *NOT* Perl!\n"	unless	/^[Pp]erl(\n)?$/;


Now it recognises even perl and Perl\n (when somebody forgets to use
chomp).

BTW: Are there better ways to write that one? I don't like using two
same regexes that way. And I like this neither:

if( /^[Pp]erl(\n)?$/ ) {
	print ...
} else {
	print ...
}

--
#!/usr/bin/perl -wT # Please take a look at my mail address when replying
use CGI;$a=reverse"r56%b6%36%16%H02%l27%56%P02%r56%86%47%f6%e6%A02%t37%".
"57%J=japh";$b=new CGI($a);$c=$b->param(lc(reverse("JAPH")));print"$c\n";


------------------------------

Date: Thu, 20 May 1999 10:55:46 +0200
From: Marc Eilens <M.Eilens@DeutschePost.de>
Subject: out of memory!
Message-Id: <3743CE12.2DE4@DeutschePost.de>

Hi everybody,

I've written one of my first perl-scripts and have got a question about
memory usage.

The task is to read a file and split different rows into different
files.
I open the file and then read the complete file with the while(<>) loop.
Then I deal with the different rows.
Running the script on a file of about 100 KB works fine. But when
running it on a file of 2.5 Meg I get the message "out of memory!". It
seems that the file was read in correctly (debug-statement is written
out after the while-loop). But after that, there somewhere seems to be
no more memory.

Has anybody an idea. It's urgent.
Pleas cc me as I'm not always on the list.

Thank's in advance.

Marc
-----------------
Marc Eilens, Student
mailto: M.Eilens@DeutschePost.de


------------------------------

Date: Thu, 20 May 1999 00:14:06 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Parsing email headers..
Message-Id: <MPG.11ad561a325e4c62989ac5@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <37444989.89AB4C2@home.com> on Thu, 20 May 1999 05:43:03 GMT, 
David Raufeisen <raufeisen@home.com> says...
> I have "John Doe <jdoe@somewhere.com>" in variable $HEADER{'from'}
> 
> how would i do the following
> 
> put
> 
> John into $fname
> Doe into $lname
> jdoe@somewhere.com into $email
> jdoe into $user

my $fname = 'John'; 
my $lname = 'Doe'; 
my $email = 'jdoe@somewhere.com'; 
my $user  = 'jdoe';

That was easy.  Too easy.  :-)  I think you mean something else.

my ($fname, $lname, $email, $user) =
    $HEADER{from} =~ /(\S+)\s+(\S+)\s+<(([^@]+)[^>]+)>/; 

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Thu, 20 May 1999 00:38:01 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Parsing email headers
Message-Id: <MPG.11ad5bb04b0bc1a2989ac6@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <7i0ava$ccc$1@nnrp1.deja.com> on Thu, 20 May 1999 06:43:54 
GMT, fortyoz@my-dejanews.com <fortyoz@my-dejanews.com> says...
 ...
> --== Sent via Deja.com http://www.deja.com/ ==--
> ---Share what you know. Learn what you don't.---

Posting the same query three times from two sources is two times and one 
source too many.  Give your tools a chance!

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Thu, 20 May 1999 07:57:45 GMT
From: erik_lembke@my-dejanews.com
Subject: Q: how do i get the lenght of a string
Message-Id: <7i0f9o$g4q$1@nnrp1.deja.com>

Hi folks,

Is the a simple method (build in function)
to get the lenght of a string

f.e.:
$lenght = lot("Hallo");

$lenght is now 5

cheers Erik


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


------------------------------

Date: 20 May 1999 10:29:06 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Q: how do i get the lenght of a string
Message-Id: <3743d5e2@newsread3.dircon.co.uk>

erik_lembke@my-dejanews.com wrote:
> Hi folks,
> 
> Is the a simple method (build in function)
> to get the lenght of a string
> 
> f.e.:
> $lenght = lot("Hallo");
> 
> $lenght is now 5
> 

length()

as documented in the perlfunc manpage

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



------------------------------

Date: 20 May 1999 09:54:57 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Search and Fetch Newsgroup
Message-Id: <3743cde1@newsread3.dircon.co.uk>

Ying Hu <yhu@mail.nih.gov> wrote:
> Hi:
> Which win32 module is with the function that can search newsgroups
> and/or download some pieces of news from newsgroups by the subject?
> For example, the perl script can search the Subject of comp.soft-sys.sas
> with ANOVA key word and download the news (with ANOVA)
> from the newsgroup.
> 

You would probably want to use LWP::UserAgent to search DejaNews if that
was what you had in mind - alternatively you could use Net::NNTP if you
wanted to retrieve from a news-server.

I have written something that uses the module WWW::Search unfortunately
that isnt available on Win32.

However you are in luck because one Mr Matthew Bafford has written a
program 'dejaview' that will do just what you require :

   <http://dragons.home.duesouth.net/dejaview.html>

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



------------------------------

Date: Thu, 20 May 1999 11:30:01 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Tie Fighter
Message-Id: <3746ef7d.1702784@news.skynet.be>

Fuzzy Warm Moogles wrote:

>I localize it to a block, you still call it a
>global.  Care to explain why?

Simple. "strict" says it is.

	# perl -w
	use strict;
	{
		local($test) = 123;
	}
__END__
Global symbol "$test" requires explicit package name at test.pl line 4.
Execution of test.pl aborted due to compilation errors.

	Bart.


------------------------------

Date: Thu, 20 May 1999 11:54:49 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Tie Fighter
Message-Id: <pudge-2005990754520001@192.168.0.77>

In article <37438267.185122451@news.oz.net>, tgy@chocobo.org wrote:

# On Wed, 19 May 1999 12:02:15 GMT, pudge@pobox.com (Chris Nandor) wrote:

# >And yes, you did use a global variable.  All package variables are global
# >variables.  Any time you manipulate the symbol table, you are using a
# >global / package variable.
# 
# I used a package variable.  I used a localized variable.  I did not use a
# global variable.

Please reread what I wrote.  All package variables are global variables. 
I did not write that by accident.  I did not misspeak.  I am not wrong.


# This is a package variable.  It is also a local variable.  It is not a global
# variable.

All package variables are global variables.  local()izing it does not
change that fact.  The variable is still the same variable, but its value
is now confined to a dynamic scope, which ends when the current scope
ends.  Note I said "when".  The value is available from anywhere in the
program as long as the dynamic scope is still active.  It is global.


# We seem to be using different terminologies.  What I call a package variable,
# you call a global variable.

Funny, that.  It is because, one more time, they are the same thing. 
There is no difference, in any way, between a global variable and a
package variable.  I could see how some people might consider special
variables like $_ to be globals and not package variables, though I
disagree.  Regardless, all package variables are global all the time, even
when the VALUE of the variable is confined to a dynamic scope.  Using
local does not magically change the variable to something else or create a
new variable.  It just gives it a temporary value.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


------------------------------

Date: 20 May 1999 10:36:26 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Verifying passwd in FreeBSD
Message-Id: <3743d79a@newsread3.dircon.co.uk>

anakim@my-dejanews.com wrote:
> I'm writing a set of scripts to check passwords on
> a FreeBSD system. Because FreeBSD doesn't use
> a shadow file and stores the passwd string in a db
> file, I'm having trouble getting the original
> encrypted passwd for comparison.
> 
> Does anyone know how to go about doing this?
> 

Why cant you use the getpw* builtins rather than going at the passwd
file directly - they should do the right thing regardless of the 
underlying mechanism.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



------------------------------

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 5732
**************************************

home help back first fref pref prev next nref lref last post