[13318] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 728 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 7 07:07:39 1999

Date: Tue, 7 Sep 1999 04:05:09 -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           Tue, 7 Sep 1999     Volume: 9 Number: 728

Today's topics:
    Re: case for open lang on win32 - fill in the table (Arved Sandstrom)
    Re: editing images with perl <rpsavage@ozemail.com.au>
    Re: Emacs Freezes Editing Perl Scripts (Sam Holden)
    Re: Find MAC address <rpsavage@ozemail.com.au>
    Re: Help! Newbie can't see print error in code (Arved Sandstrom)
    Re: Hopefully on-topic CGI question: simple db routine  (David Cantrell)
        How do I delete apostraphe from a string? <matt@insnet.net>
    Re: Insecure $ENV{PATH} while running setuid at /dev/fd (Joe Smith)
        Issues using Perl5.004 XSUB C modules with Perl5.005 <sewell_david@jpmorgan.com>
    Re: mysql interview <green@argonet.co.uk>
        OpenVMS, Perl parameters <anders.wallin@sebank.se>
        Perl/Tk Installation (KJPhilbr13)
    Re: Playing .au or .wav file? <dada@divinf.it>
    Re: reading complex data from a file <rhomberg@ife.ee.ethz.ch>
        reading special character(? EOF or NULL?) from Socket h (Gilly)
    Re: reading special character(? EOF or NULL?) from Sock <dada@divinf.it>
    Re: Routine for normalising file paths <rhomberg@ife.ee.ethz.ch>
    Re: Thanks for the quick Reply. 1 Other question - Limi (Joe Smith)
        Unix Trouble ljl_ljl@my-deja.com
    Re: Unix Trouble <c4jgurney@my-deja.com>
    Re: Unix Trouble <gellyfish@gellyfish.com>
    Re: using code written in C (anyone know about stemming <rpsavage@ozemail.com.au>
    Re: XML::Parser help needed (Arved Sandstrom)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Tue, 07 Sep 1999 06:51:19 -0300
From: Arved_37@chebucto.ns.ca (Arved Sandstrom)
Subject: Re: case for open lang on win32 - fill in the table
Message-Id: <Arved_37-0709990651190001@dyip-11.chebucto.ns.ca>

In article <7r1lhb$fm6$1@ash.prod.itd.earthlink.net>, "Jason Kohlhoff"
<jwk6@earthlink.net> wrote:

> I have something to add...
> 
> You Perl guys are all full of "open" shit...
> 
> I doubt you could write a script for a Windows machine that could not be
> done(possibly even better) with WSH and VBS, or JS.
> 
> Jason Kohlhoff
> 
No need to be so defensive, Jason. If the stuff you mention is all they
taught during that short but expensive mail-order Windows programming
course, be proud of what *you* learned.

Arved


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

Date: Tue, 7 Sep 1999 20:08:48 +1000
From: "Pen and Ron Savage" <rpsavage@ozemail.com.au>
Subject: Re: editing images with perl
Message-Id: <Ty5B3.8730$1E2.58926@ozemail.com.au>

1)
-----------------------
Programming Web Graphics
Shawn Wallace
O'Reilly
1-56592-478-9
-----------------------

2)
Installing PerlMagick can be a pain. See my web site for a tutorial.

--
Cheers
Home: ron@savage.net.au. Work: rons@hpaco.aus.hp.com
Home: pen@savage.net.au. Work: pen.savage@education.monash.edu.au
http://savage.net.au/
Kim Saunders <kims@emmerce.com.au> wrote in message
news:936660122.82371@draal.apex.net.au...
> >Somebody I know is interested in being able to use perl to edit an
> >image. I was wondering if this could even be done. Please take a look at
> >this site http://198.173.33.250/signs/display.asp?temptype=WE If you
> >choose one of the templates you are sent to a form to fill in
> >information you would like to have on the sign and then you can preview
> >the changes before requesting that the sign be made. I know that site is
> >using ASP. But I was wondering if perl could do it. If perl can, is
> >there a resource I can read to find out how to do it.
>
>
> You use ImageMagick (compile install for your OS. Compiling is not
pretty),
> and then get the PerlMagick module for it (comes with it these days I
> think), and bobs your uncle.
>
> Reads and writes all the different formats (if you have the libs and
compile
> with them), and it's pretty easy to use, but you can do a *hell* of a lot
> with it. Also, buy yourself the o'rielly book "Creating Graphics for the
Web
> with Perl and GNU Software" or words to that effect (shawn p. wallace from
> memory) if you're serious, it's got nearly everything you need to know.
>
> KimS
>




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

Date: 7 Sep 1999 09:30:18 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Emacs Freezes Editing Perl Scripts
Message-Id: <slrn7t9mpa.j3t.sholden@pgrad.cs.usyd.edu.au>

On 07 Sep 1999 09:35:05 +0200,
    Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> wrote:
>hile@cse.psu.edu (Coy A Hile) writes:
>
>> best solution i know of is NOT to use Emacs.  Use pico or vi instead
>
>"The engine of my car keeps having problems."
>"Ride a bike, then, no more engine problems, ever!"
>
>I'm sure that pico and vi are nice programs, but their functionality
>does not compare with Emacs, and thus they are not good substitutes
>for Emacs.

What functionality does emacs have that vi doesn't - for editing text, I don't
care about reading news, etc just editing text...

I'll just run off and grab some marshmallows now...


-- 
Sam

I don't want Perl to be beautiful--I want you to write beautiful
programs in Perl.
	--Larry Wall


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

Date: Tue, 7 Sep 1999 20:11:42 +1000
From: "Pen and Ron Savage" <rpsavage@ozemail.com.au>
Subject: Re: Find MAC address
Message-Id: <BB5B3.8739$1E2.59073@ozemail.com.au>

Or (tested code)...

-----Start-----8<>-----
#!perl -w
#
# Name:
# nbtstat.pl.
#
# Purpose:
# Get MAC address etc.

use integer;
use strict;

my($computerName) = Win32::NodeName;
my(@nbtstat)  = `nbtstat -a $computerName`;
@nbtstat   = grep(/MAC Address/, @nbtstat);
chomp(@nbtstat);
print join("\n", @nbtstat);
-----End-----8<>-----


--
Cheers
Home: ron@savage.net.au. Work: rons@hpaco.aus.hp.com
Home: pen@savage.net.au. Work: pen.savage@education.monash.edu.au
http://savage.net.au/
Richard Warkentin <"rdw2 at mindspring dot com"@test.com> wrote in message
news:37d3fdbd.3165932@news.mindspring.com...
> On Mon, 06 Sep 1999 14:59:31 GMT, "Wylie Gerdes"
> <wgerdes@oeonline.com> wrote:
>
> >I'd like to retrieve MAC address from network clients for a wake-on-lan
> >effort. I see no hints in the documentation; any ideas or leads?
> >
> >
>
> You didn't mention the OS you are using.
>
>  For Win NT, the answer is parse ipconfig /all.
>
> For W95,  there are undocumented switches (after somone told me, I was
> able to find on web) to winipcfg.  From memory, the options are /batch
> /all.  There is also a way to specify where the output goes but, by
> default, it goes into c:\--again, from memory.




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

Date: Tue, 07 Sep 1999 06:58:49 -0300
From: Arved_37@chebucto.ns.ca (Arved Sandstrom)
Subject: Re: Help! Newbie can't see print error in code
Message-Id: <Arved_37-0709990658490001@dyip-11.chebucto.ns.ca>

In article <37D46B48.CDF3430B@andrew.cmu.edu>, Cathy Huang
<huang2@andrew.cmu.edu> wrote:

> I can't figure out why after I run this portion of code, the file
> paths.dat has been created, but is totally empty - 
> though volume3.dat is getting printed to fine. It's prob. something 
> obvious I can't see. 
> 
[ snippage ]
> 
> ($protocol,@directories) = directory_selector();
> print VOLDATA "protocol = $protocol\n";
> print VOLDATA "directories before = @directories\n\n";
> @directories = map { add_share_path($_) } @directories;
> #print PATHS "directories after = @directories\n";
> 
> print PATHS "what the heck???!!\n";
> print VOLDATA "directories after = @directories\n";
> 
> ############### PATHS empty!!!!!!!!!!

Well, I hope 'paths.txt' at least has "what the heck???!!\n" in it. :-)

Seriously, if directory_selector() and add_share_path($_) are working to
your satisfaction, then once you take the comment out of the print PATHS
then you'll write something to that file. :-)

Arved


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

Date: Tue, 07 Sep 1999 09:47:58 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: Hopefully on-topic CGI question: simple db routine works stand-alone but not as CGI.
Message-Id: <37d4de44.59427582@news.insnet.net>

On Mon, 6 Sep 1999 18:39:53 -0400, "Floyd Morrissette"
<Floyd@NewWebSite.com> said:

>>print <<PRINT_END;
>>Content-type: text/html
>
>Should be Content-type: text/html\n\n;

Note the blank line after text/html.  And in any case, he says that it
_does_ work as a CGI if he comments out the dbm stuff.

I'd be willing to bet that it's a permissions problem.  If the web
server runs the CGI script with the user set to 'nobody' (for
instance) and 'nobody' doesn't have access to the DBM file, then it
won't work.

Also note that if the DBM file doesn't already exist and your script
tries to create it, it must be running as a user who has permission to
create files in that directory.

[Copying newsgroup posts to me by mail is considered rude]

-- 
David Cantrell, part-time Unix/perl/SQL/java techie
                full-time chef/musician/homebrewer
                http://www.ThePentagon.com/NukeEmUp


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

Date: Tue, 07 Sep 1999 10:40:39 +0000
From: Matt Duggan <matt@insnet.net>
Subject: How do I delete apostraphe from a string?
Message-Id: <37D4EBA7.C8F3090C@insnet.net>

Hi everyone, 

Has anyone got an idea of what the regular expression
to delete an apostraphe from a string would be?

i.e. the string is  "monster's" I need it to become
"monsters".

Thankyou in advance!

Regards, 
Matt.


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

Date: 7 Sep 1999 02:10:55 -0700
From: inwap@best.com (Joe Smith)
Subject: Re: Insecure $ENV{PATH} while running setuid at /dev/fd/4 line 2.
Message-Id: <7r2kqv$s5h$1@shell3.ba.best.com>

In article <37C2FDC7.6CEA2601@bloomberg.net>,
Art S. Kagel <kagel@bloomberg.net> wrote:
>Sounds like a permissions problem.

Nope.  The problem is `date` without an explicit $ENV{PATH}.

>> get  the following error: "Insecure $ENV{PATH} while running setuid at
>> /dev/fd/4 line 2.".  Can anyone show me what line I need to add to get
>> rid of this error?  Thanks in advance...
>> 
>> #!/usr/local/bin/perl
>> $mmddhhmmss = `date +%m%d%H%M%S`;
>> chop $mmddhhmmss;

1) Change line 2 to be $mmddhhss = `/usr/bin/date +%m%d%H%M%S`;
	or
2) Add $ENV{PATH} = "/usr/bin:/bin"; just before line 2.
	or
3) Replace lines 2 and 3 with
  ($sec,$min,$hour,$day,$mon) = localtime;
  $mmddhhmmss = sprintf "%02d%02d%02d%02d%02d",$mon+1,$day,$hour,$min,$sec;

	-Joe
-- 
INWAP.COM is Joe Smith, Sally Smith and our cat Murdock.
  (The O'Hallorans and their cats moved to http://www.tyedye.org/ Nov-98.)
See http://www.inwap.com/ for PDP-10, "ReBoot", "Shadow Raiders"/"War Planets"


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

Date: Tue, 07 Sep 1999 10:04:45 +0100
From: David Sewell <sewell_david@jpmorgan.com>
Subject: Issues using Perl5.004 XSUB C modules with Perl5.005
Message-Id: <37D4D52D.B0982447@jpmorgan.com>

Is there any way to circumvent the symbol name compatibility issues
between 5.005 and previous versions when using compiled XSUB C modules?

e.g.

When using a XSUB C library compiled with Perl 5.004 and executed
against Perl 5.005, the following error is produced:

Can't load 'TEST.so' for module TEST: ld.so.1: perl: fatal: relocation
error: file TEST.so: symbol stack_sp: referenced symbol not found at
/export/opt/perl/5.0.5.3/solaris/lib/DynaLoader.pm line 169.

 at test.pl line 1
BEGIN failed--compilation aborted at test.pl line 1.

The symbols such as stack_sp have been renamed to PL_stack_sp.





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

Date: Tue, 07 Sep 1999 10:33:50 +0100
From: Andrew Green <green@argonet.co.uk>
Subject: Re: mysql interview
Message-Id: <493dbf5986green@argonet.co.uk>

In article <slrn7t93f6.lt8.abigail@alexandra.delanet.com>,
   Abigail <abigail@delanet.com> wrote:

> I'm just trying to prevent people from spending money to buy your books.

Too damn late for me, I'm afraid.

I've wanted to learn how to use MySQL databases in my Perl programs for
quite some time, and so when this book came out, I was delighted: I learn
things *much* better from books than on screen documents, particularly as
I tend to find the online docs quite terse, unless it comes to using them
for reference purposes.

Happily, given the way this thread has developed, I've noticed that Mr
Reese isn't the sole author of the book, and I'm hoping that the chapter
of the book which specifically deals with Perl was authored by a (more
respected) member of the Perl community.  Perhaps Mr Reese might care to
clarify?

Failing that, I'd find it *very* interesting to read an informed critique
of the book - especially that chapter - which points out errors or poor
code, such that it's relatively easy for a learner to grasp.

Failing *that*, some pointers to other *tutorial* documents on How To Use
MySQL In Perl would be extremely useful.

Many thanks,
Andrew.



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

Date: Tue, 07 Sep 1999 09:46:38 GMT
From: Anders Wallin <anders.wallin@sebank.se>
Subject: OpenVMS, Perl parameters
Message-Id: <7r2mts$6nr$1@nnrp1.deja.com>

Hello !

I have some trouble passing parameters to Perl scripts running under
VMS.
Using awk there is the -v option for passing variables that pop into
existence in the awk script.

Is there a similar option for Perl?  Using the ARGV mechanism seems to
interfere with the input/output files specified on the command line.
I am currently using Perl 5_005_03.

All help is greatly appreciated.

Anders Wallin


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


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

Date: 07 Sep 1999 10:15:53 GMT
From: kjphilbr13@aol.com (KJPhilbr13)
Subject: Perl/Tk Installation
Message-Id: <19990907061553.12557.00003149@ng-fp1.aol.com>

I am running version 5.005_03 built for i386-linux.  (RedHat Linux version 6.0)

After unpacking Tk800.015.tar, I have done the following in the distribution
directory:
    Makefile.PL
    make
    make test
And that went fine.  Now what do I do?  There must be more to do because when I
do the following:
    perl -e 'use Tk'
I get this reply:
    Can't locate Tk.pm in @INC (@INC contains:
/usr/lib/perl5/5.00503/i386-linux         /usr/lib/perl5/5.00503
/usr/lib/perl5/site_perl/5.005/i386-linux        
/usr/lib/perl5/site_perl/5.005 .) at -e line 1.
    BEGIN failed--compilation aborted at -e line 1.

By the way, /perl/bin is in my path.

Please email me directly as I don't get to check this newgroup as often as I
would like.  Thanks in advance for the help.  

KJP


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

Date: Tue, 7 Sep 1999 12:00:11 +0200
From: "Aldo Calpini" <dada@divinf.it>
Subject: Re: Playing .au or .wav file?
Message-Id: <7r2nlu$djj$1@fe1.cs.interbusiness.it>

xdiv@hotmail.com wrote:
> Is there a module for playing a .au or .wav file from perl running on
> Win98?  (I'm using 5.005_03 build 518 from ActiveState).

for .wav files, get Win32::Sound:

    http://www.perl.com/CPAN/authors/Aldo_Calpini/

you can also install a prepared version from ActiveState
using PPM:

    ppm install Win32-Sound

__END__
# Aldo Calpini
print sort {$_{$a} cmp $_{$b}} values %{{split undef,
"xritajbugne fahokem csuctawer jhdtlrnpqloevkshpr"}};





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

Date: Tue, 07 Sep 1999 12:00:22 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
To: Peter Bismuti <bismuti@cs.fsu.edu>
Subject: Re: reading complex data from a file
Message-Id: <37D4E236.AD2928C@ife.ee.ethz.ch>

[posted and emailed)

Peter Bismuti wrote:
> 
> How can I read complex data from a file?
> 
> 0 0 0.110580708557129+1.3236201534729i
> 
> chop($line); ($x,$y,$cnum) = split(/\s+/,$line);
>      $ppm[$x][$y]{real} = $cnum->Re();
>      $ppm[$x][$y]{imag} = $cnum->Im();
> 
> This doesn't work.

Cool, I just learned how to do complex numbers in Perl.
Dind't even know it was possible :-)
The complex module is inconsistent, as it's output doesn't match it's
input.
You have to replace any occurrence of 432i (number followed by i) with
432*i, which means insert a *. The resulting expression can then be fed
to 'eval' to get a complex number:

#!/usr/bin/perl

require 5.005;  # needed for lookbehind (?<=regexp)

use Math::Complex;

$_ = "1 i 2+i 3+4i"; # test four different cases

s/(?<=\d)(?=i)/*/;   #this needs 5.005
# This inserts a * between any number immediately followed by i
# does the same as s/(\d)i/$1*i/, only perlier :-)

($w,$x,$y,$z) = map eval, split;  # split the numbers and eval each.
     # After the replace, all of them can be interpreted as complex or
real

map {$_ += 1+i}  #This is only a test how the numbers behave in complex
context.
  ($w,$x,$y,$z)  #every number gets 1+i added
   #Can you tell I'm recently a fan of 'map' :-)

$z2 = $z + 4*i+5; #some more complex math

print $z->Re() ."\n";

print "$w, $x, $y, $z, $z2\n";


> A related question, how can you output complex data
> in the various formats?

read perldoc complex, search for display_format

-- 
  _________________________________________________________________
 /                                                                 \
|  Alex Rhomberg                           Tel: +41 1 632 49 18     |
|  Institut fuer Elektronik                Fax: +41 1 632 12 10     |
|  ETH Zuerich                        Zentrale: +41 1 632 11 11     |
|  Gloriastrasse 35                                                 |
|  8092 Zuerich               email: rhomberg@ife.ee.ethz.ch        |
 \_________________________________________________________________/


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

Date: Tue, 07 Sep 1999 09:33:59 GMT
From: mingtian@hanmail.net (Gilly)
Subject: reading special character(? EOF or NULL?) from Socket handle?
Message-Id: <37d4da86.26235738@news.nuri.net>

I was trying to get AVI file data from VDO server.


telnet some.server 80

GET /file.avi
Accept: video/x-msvideo video/*
User-Agent: VDOnet-Player/768
LastBW: 62
BurstSize: 20000
SlideShow: 0
VCR: -1 -1 512 0

then i could see lots of binary data

but when i try to get the data with Socket handle then i always get
206(?) bytes only

	print S "GET $path\r\n";
	print S "Accept: video/x-msvideo video/*\r\n";
	print S "User-Agent: VDOnet-Player/768\r\n";
	print S "LastBW: 62\r\n";
	print S "BurstSize: 20000\r\n";
	print S "SlideShow: 0\r\n";
	print S "VCR: -1 -1 512 0\r\n";

	...

	read(S, $DATA, 2000000);

why this happens?


@}`,--- ¢¾£Æ¨Û¥Ôg¥å©à  £íe  ¥Í¥ï¨à
ICQ: 15668514


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

Date: Tue, 7 Sep 1999 12:02:38 +0200
From: "Aldo Calpini" <dada@divinf.it>
Subject: Re: reading special character(? EOF or NULL?) from Socket handle?
Message-Id: <7r2nqj$dvm$1@fe1.cs.interbusiness.it>


Gilly wrote:
> I was trying to get AVI file data from VDO server.
>
>
> telnet some.server 80
>
> GET /file.avi
> Accept: video/x-msvideo video/*
> User-Agent: VDOnet-Player/768
> LastBW: 62
> BurstSize: 20000
> SlideShow: 0
> VCR: -1 -1 512 0
>
> then i could see lots of binary data
>
> but when i try to get the data with Socket handle then i always get
> 206(?) bytes only

did you try

    binmode(S);

before the read?

__END__
# Aldo Calpini
print sort {$_{$a} cmp $_{$b}} values %{{split undef,
"xritajbugne fahokem csuctawer jhdtlrnpqloevkshpr"}};





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

Date: Tue, 07 Sep 1999 11:16:09 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: Routine for normalising file paths
Message-Id: <37D4D7D9.83511D6A@ife.ee.ethz.ch>

Larry Rosler wrote:
> 
> In article <uaer0rgzp.fsf@infoscience.otago.ac.nz> on 06 Sep 1999
> 13:00:42 +1200, Andrew Gray <agray@infoscience.otago.ac.nz> says...
> > Neale Morison <nmorison@ozemail.com.au> writes:
> > > I have in my confused way been attempting to write a subroutine meant to
> > > take a path such as  ../mary/alice/george/../fred/../../ralph/ted and
> > > convert it to ../mary/ralph/ted

> One might make that slightly more complicated to accept a trailing '..':
> 
>     1 while s![^/]+/\.\.(?:/^$)!!;
> 
I don't quite get the        '^'  here. Shouldn't it be a '|'??
Additionally, for normalizing the file path, you'll want to remove any
occurrences of '/.', './' or //: s![^/]+/\.(?:/|$)!!g

s|//+|/|g;                 #replace multiple slashes with one

s!^\./|/\.(?=$|/)!!g;      # remove leading './', intermediate and
trailing '/.'

1 while s![^/]+/\.\.(?:/|$)!!g;  #remove 'subdir/..'

- Alex

perl -e'$_
".////Just/not/./../another/one/more/../../Python/./Java/../..//.//./
Perl/Newbie/../Hacker\n";s@//+@/@g;s@(?=^|/)\./|/\.(?=$|/)@@g;1 while
s@[^/]+/\.\.(?:/|$)@@g;y@/@ @;print'


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

Date: 7 Sep 1999 02:35:19 -0700
From: inwap@best.com (Joe Smith)
Subject: Re: Thanks for the quick Reply. 1 Other question - Limitations?
Message-Id: <7r2m8n$7lj$1@shell3.ba.best.com>

In article <37C3282D.255CBAC0@home.com>, Paul Dobbs  <pdobbs@home.com> wrote:
>Now just one thing I'm curious about - limitations.
>What are the specific limits perl has for things like maximum array size,
>string length, and such? I want to be sure I don't overflow a variable
>like a string by making it too long with some of what I'm doing (which at
>the moment, is taking a string, ripping it up a little, then tying it back
>together with new stuff added in). The string might get as large as 30 or 40K
>I guess.. can Perl handle that in one variable?

I opened up an MS-DOS window on my Windows-98 machine (which already had
five telnet windows and two netscape windows opened) and typed in this
one-line perl program.

C:\>perl -e "$_='x'; $| = 1; while(1) {$_ = $_ . $_; print ' ',length($_); }"
 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144
524288 1048576 2097152 4194304 8388608 16777216 33554432 67108864

After the string had reached 32 megabytes (33554432), I could hear the
disk rattling as it started using up swap space.  It only took a few
seconds to output the first 25 numbers, and about 5 minutes to output the
26th, and the program is still running as I type.

So, the answer to your question is "perl has no limitations, other than
the one imposed by using up all available (virtual) memory".
	-Joe

-- 
INWAP.COM is Joe Smith, Sally Smith and our cat Murdock.
  (The O'Hallorans and their cats moved to http://www.tyedye.org/ Nov-98.)
See http://www.inwap.com/ for PDP-10, "ReBoot", "Shadow Raiders"/"War Planets"


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

Date: Tue, 07 Sep 1999 09:18:07 GMT
From: ljl_ljl@my-deja.com
Subject: Unix Trouble
Message-Id: <7r2l89$5jc$1@nnrp1.deja.com>

there are some questions (very basic ones) that i want to know

must i be using Unix as my os to be able to use perl??
if no, how come i saw so many tutorials teaching people Perl using Unix?
if yes, i am using Windows98 and how am i going to debug my script?

what does it means to be a Unix server, how do i know whether mine is
one??

what other things do i need before i could learn to write perl scripts??

thanx in advance


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


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

Date: Tue, 07 Sep 1999 09:34:13 GMT
From: Jeremy Gurney <c4jgurney@my-deja.com>
Subject: Re: Unix Trouble
Message-Id: <7r2m6l$61n$1@nnrp1.deja.com>

In article <7r2l89$5jc$1@nnrp1.deja.com>,
  ljl_ljl@my-deja.com wrote:
> there are some questions (very basic ones) that i want to know
>
> must i be using Unix as my os to be able to use perl??
No, perl has been ported to numerous OSs. For a win32 version go to
www.activestate.com

> if no, how come i saw so many tutorials teaching people Perl using
Unix?
Unix is where perl started. You could also say that the unix people are
better at getting round to writing tutorials for new folk. For a windows
orientated tutorial go to
http://www.free-ed.net/fr03/lfc/course%20030207_01/index.html

> what other things do i need before i could learn to write perl
scripts??
A good text editor and a good book (the gecko book is a good place to
start http://www.oreilly.com/catalog/lperlwin/index.html ). Also if you
want to do CGI programming then a you'll want a web server to run on
your PC try apache from www.apache.org or PWS.

> thanx in advance

You're welcome.

Jeremy Gurney
SAS Programmer  |  Proteus Molecular Design Ltd.
"Sometimes I think the so-called experts
 actually are experts."


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


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

Date: 7 Sep 1999 10:45:19 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Unix Trouble
Message-Id: <37d4deaf_1@newsread3.dircon.co.uk>

ljl_ljl@my-deja.com wrote:
> 
> must i be using Unix as my os to be able to use perl??

No.

> if no, how come i saw so many tutorials teaching people Perl using Unix?

Because most of the people who are most enthusiastic about Perl also
happen to prefer Unix.

> if yes, i am using Windows98 and how am i going to debug my script?
> 

Well the answer was 'no' but I would answer by saying install Linux instead.

> what does it means to be a Unix server, how do i know whether mine is
> one??
> 

In common parlance a server is any large computer that does something for
other computers.  However when you say 'mine' I dont know what you mean
as you already said you are using Win98.

> what other things do i need before i could learn to write perl scripts??
> 

Perl   - <http://www.activestate.com/ActivePerl>.
A good text editor see <http://reference.perl.com/query.cgi?editors>
A good book see <http://reference.perl.com/query.cgi?books>

/J\
-- 
"Boring: See Civil Engineers" - Yellow Pages


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

Date: Tue, 7 Sep 1999 20:14:48 +1000
From: "Pen and Ron Savage" <rpsavage@ozemail.com.au>
Subject: Re: using code written in C (anyone know about stemming?)
Message-Id: <vE5B3.8748$1E2.59089@ozemail.com.au>

There are modules on CPAN which may help.

Mine is called Lingua-En-Infinitive.

--
Cheers
Home: ron@savage.net.au. Work: rons@hpaco.aus.hp.com
Home: pen@savage.net.au. Work: pen.savage@education.monash.edu.au
http://savage.net.au/
Bill Moseley <moseley@best.com> wrote in message
news:MPG.123d7071c29264b4989708@nntp1.ba.best.com...
> I'm using Text::English to try to match stemmed words used in a search
> engine.  Just my luck that they don't stem the same.
>
> Text::English Indexer -> Indexer
> stem.c        Indexer -> Index
>
> Hard to know (for me) which is right.
>
> I have access to the stem.c routine used by the search engine.  If I
> want to use that in my perl program is XS the only way to go?  I guess I
> could compile a separate C program and call it, but I have to call it
> thousands of times each time the program is run.
>
> Am I correct that if I want to use XS I need to re-link perl?  And if I
> don't have access to the perl installed then I'd need to build a
> separate version of perl for my use?
>
> Do I have any other options for using this C code in my perl program?
>
> Thanks,
>
>
> --
> Bill Moseley mailto:moseley@best.com
> pls note the one line sig, not counting this one.




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

Date: Tue, 07 Sep 1999 07:18:03 -0300
From: Arved_37@chebucto.ns.ca (Arved Sandstrom)
Subject: Re: XML::Parser help needed
Message-Id: <Arved_37-0709990718030001@dyip-25.chebucto.ns.ca>

In article <7qj7p2$29tv$1@news2.vas-net.net>, "Chris Denman"
<chris@inta.net.uk> wrote:

> <people>
>   <person>
>     <name>Chris</name><age>28</age><sex>Male</sex>
>     <friends>
>       <friend><name>John</name><age>22</age><sex>Male</sex></friend>
>       <friend><name>Bob</name><age>21</age><sex>Male</sex></friend>
>       <friend><name>Sally</name><age>18</age><sex>Female</sex></friend>
>     </friends>
>   </person>
>   <person>
>     <name>Charlie</name><age>29</age><sex>Male</sex>
>     <friends>
>       <friend><name>Cyril</name><age>22</age><sex>Male</sex></friend>
>       <friend><name>Mark</name><age>21</age><sex>Male</sex></friend>
        <friend><name>Samantha</name><age>18</age><sex>Female</sex></friend>
>     </friends>
>   </person>
> </people>
> 
> and extract the content above into files stored in relevant directories-
> 
> directory people would contain subdirectories for each person
> directory person.1 would contain a single file containing data for the first
> person
> directory person.2 woudl contain a single file containing data for the
> second person
> and so on....
> 
> in each person directory there would be a subdirectory for friends
> in the friends directory there would be subdirectories for each friend
> directory friend.1 would contain a single file containing data for the first
> friend
> and so on....
> 
> each single file would have the format:
> 
> field:data like so:
> 
> name:Chris\n
> age:28\n
> sex:Male\n
> 
Most straightforward approach is to just set up handlers for the Start,
End and Char events. The POD synopsis for XML::Parser has an example.

XML tags are parsed in document order. Based on what you want to do, you
could be generating new directories and entering them on a Start tag,
because there is sufficient info to do that then. You could be moving one
directory up on all End tags except the ones that represent field data for
a file, such as Age.

On the End tag for a data field you write the text which you have
assembled with the Char handler in the format you've described. Don't
forget to clear the variable storing your text (on each Start tag is one
possibility).

You'd also maintain a couple of counters to count Persons and Friends for
the current Person. The way your data is, you could have millions of
records and still only have to maintain a few top-level variables.

This should be enough to go on. :-)

Arved


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

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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


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