[22638] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4859 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 18 00:05:45 2003

Date: Thu, 17 Apr 2003 21:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 17 Apr 2003     Volume: 10 Number: 4859

Today's topics:
    Re: another problem. <family2@aracnet.com>
    Re: changing the date <member17678@dbforums.com>
    Re: changing the date <member17678@dbforums.com>
    Re: Detached Server Process <cf@<Nooooo spaaammm>phased.co.uk>
    Re: GD::Graph axis font size <mgjv@tradingpost.com.au>
        Good Programming Practices - Avoiding Memory Leaks <kevin.vaughn@ttu.edu>
    Re: Good Programming Practices - Avoiding Memory Leaks (David James)
        GUI Development Options <anthony@nospam.safferconsulting.com>
    Re: GUI Development Options <knuteNOSPAMPLEASE@trinityproject.org>
    Re: HTTP::Headers - getting request headers (David Efflandt)
    Re: Interpolation problem with DB execute object (Jay Tilton)
    Re: lex/yacc problems with C++ program and libperl <peter@nospam.calweb.com>
        Need advice on my first Perl script (Scott Spencer)
    Re: Need advice on my first Perl script <jkeen@concentric.net>
        newbie lib dir question <eddy@NOSPAMaxa.it>
    Re: newbie lib dir question <knuteNOSPAMPLEASE@trinityproject.org>
        syntax error with XML::Simple <nutate@speakeasy.net>
    Re: syntax error with XML::Simple (Tad McClellan)
    Re: Using a pre-processor to generate POD <user2048@yahoo.removethis.com>
    Re: Using a pre-processor to generate POD <pkent77tea@yahoo.com.tea>
        What do these files have in common? <ericw@nospam.ku.edu>
    Re: What do these files have in common? (Malcolm Dew-Jones)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 17 Apr 2003 11:54:13 -0500
From: Abernathey Family <family2@aracnet.com>
Subject: Re: another problem.
Message-Id: <3E9EDC35.F6FF6ABF@aracnet.com>

Tad McClellan wrote:
> 
> Joe Creaney <mail@annuna.com> wrote:
> 
> > Subject: another problem.
> 
> Please become a good newsgroup citizen by putting the subject of
> your article in the Subject of your article.
> 
> You've been posting here long enough to know better, and this is
> the 3rd time I've asked you to be helpful to others while getting
> help for yourself.
> 
> You'll become even more widely killfiled if you don't acquire
> clue more quickly than that...
> 
> --
>     Tad McClellan                          SGML consulting
>     tadmc@augustmail.com                   Perl programming
>     Fort Worth, Texas

What forum pharisee!


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

Date: Thu, 17 Apr 2003 20:06:12 +0000
From: Mario542 <member17678@dbforums.com>
Subject: Re: changing the date
Message-Id: <2779957.1050609972@dbforums.com>


Originally posted by Steffen Beyer 
> "Mario542"  wrote:
> > 
> > Does anyone know if there is a way to change the date to the
>     following
> > day after someone enters it in a web form? I'm trying to get
>     info from a
> > date to another using the between command. If I enter 1.2.03 to
>     1.5.03
> > it gives me the total for 1.2.03 to 1.4.03 instead of 1.5.03
>     because of
> > the between command. What I would like to do is, if someone
>     enters
> > 1.5.03 I would like to change it to 1.6.03 before running the
>     execute
> > command. The first date would be entered in $name and the second
>     date
> > would be entered in $second. Here is my script.
> > Thanks,
> > Mario
>
> I'm not sure what you need, but you should probably have
> a look at Perl's extensive documentation:
>
> perldoc -q date
> perldoc -q yesterday
> perldoc perlfaq4
>
> Besides that, the module Date::Calc allows you to add
> a month, a day or whatever very easily:
>
> #!perl -w
>
> use strict;
> use Date::Calc qw(:all);
>
> my(@date) = (2003,4,17);
>
> my(@tomorrow)  = Add_Delta_Days(@date, +1);
> my(@yesterday) = Add_Delta_Days(@date, -1);
> my(@nextmonth) = Add_Delta_YM(@date, 0,+1);    # truncates day of
> month if necessary
> my(@nxtmonwrp) = Add_Delta_YMD(@date, 0,+1,0); # wraps into following
> month if necessary
>
> etc.
>
> (Truncation/wrapping occurs when the day of month, e.g. 31,
> does not exist in the month you end up with - e.g. February.
> Truncation simply sets the day of month to 28 or 29 instead
> (in this example), and wrapping would result in March 2nd or
> 3rd - depending on the resulting year being a leap year or not.)
>
> Hope this helps.
>
> Cheers,
> Steffen 

Thanks,
Mario

--
Posted via http://dbforums.com


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

Date: Thu, 17 Apr 2003 23:15:41 +0000
From: Mario542 <member17678@dbforums.com>
Subject: Re: changing the date
Message-Id: <2780638.1050621341@dbforums.com>


Originally posted by Steffen Beyer 
> "Mario542"  wrote:
> > 
> > Does anyone know if there is a way to change the date to the
>     following
> > day after someone enters it in a web form? I'm trying to get
>     info from a
> > date to another using the between command. If I enter 1.2.03 to
>     1.5.03
> > it gives me the total for 1.2.03 to 1.4.03 instead of 1.5.03
>     because of
> > the between command. What I would like to do is, if someone
>     enters
> > 1.5.03 I would like to change it to 1.6.03 before running the
>     execute
> > command. The first date would be entered in $name and the second
>     date
> > would be entered in $second. Here is my script.
> > Thanks,
> > Mario
>
> I'm not sure what you need, but you should probably have
> a look at Perl's extensive documentation:
>
> perldoc -q date
> perldoc -q yesterday
> perldoc perlfaq4
>
> Besides that, the module Date::Calc allows you to add
> a month, a day or whatever very easily:
>
> #!perl -w
>
> use strict;
> use Date::Calc qw(:all);
>
> my(@date) = (2003,4,17);
>
> my(@tomorrow)  = Add_Delta_Days(@date, +1);
> my(@yesterday) = Add_Delta_Days(@date, -1);
> my(@nextmonth) = Add_Delta_YM(@date, 0,+1);    # truncates day of
> month if necessary
> my(@nxtmonwrp) = Add_Delta_YMD(@date, 0,+1,0); # wraps into following
> month if necessary
>
> etc.
>
> (Truncation/wrapping occurs when the day of month, e.g. 31,
> does not exist in the month you end up with - e.g. February.
> Truncation simply sets the day of month to 28 or 29 instead
> (in this example), and wrapping would result in March 2nd or
> 3rd - depending on the resulting year being a leap year or not.)
>
> Hope this helps.
>
> Cheers,
> Steffen 


Steffen,

I tried what you said and it worked fine, but How do I take the date
that was entered in the web form($second) and change it to the @data
value so it can be changed?

--
Posted via http://dbforums.com


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

Date: Thu, 17 Apr 2003 21:25:15 +0100
From: CitFish <cf@<Nooooo spaaammm>phased.co.uk>
Subject: Re: Detached Server Process
Message-Id: <ic3u9v4p6dkupfag6vpnrrf4fhid7dp84t@4ax.com>

On 16 Apr 2003 18:00:00 +0100, Brian McCauley <nobull@mail.com> wrote:

>CitFish <cf@<Nooooo spaaammm>phased.co.uk> writes:
> 
>>  while(my ($client, $IP) = $server->accept()) { 
>> 
>> 	my $pid = fork();				
>> 	die("Cannot fork: $!\n") unless defined($pid);
>> 	$buffer = <$client>;
>> 	....read parameters from $buffer
>> 	close $client;
>> 	
>> 
>> 	... do other stuff here
>> }
>> 
>> I expected the client to finish as soon as the close $client statement
>> was issued, however it appears to wait until the "do other stuff" is
>> finished. I have also tried $client->shutdown(2) with no success.
>> 
>> I guess that I have not quite got the principles of forking and socket
>> connections right. Can somebody point me in the right direction.
>
>You need to close the socket if both the patent and child.

I did that, see below:-

print $socket "$commandString\n" ;
$reply = <$socket>;
close($socket);
alarm(0); # it worked so disable the alarm

CF


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

Date: Fri, 18 Apr 2003 09:21:04 +1000
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: GD::Graph axis font size
Message-Id: <slrnb9udn0.5s4.mgjv@martien.heliotrope.home>

On 17 Apr 2003 09:38:28 -0700,
	Valerie VANLERBERGHE <valerie_vanlerberghe@yahoo.fr> wrote:
> Is there a way to set x axis font size without changing font type??

Yes, by keeping the font the same as it already is.

> I tried $graph->set_y_axis_font(35); but it doesn't change anything...

No, that doesn't work. set_*_font only take font names with an optional
size. To only change the size, use the same font name that's already
been used.

Note that builtin fonts are fixed size. Only TTF fonts can be scaled.

Martien
-- 
                        | 
Martien Verbruggen      | I'm just very selective about what I accept
                        | as reality - Calvin
                        | 


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

Date: Thu, 17 Apr 2003 13:49:15 -0500
From: "Kevin Vaughn" <kevin.vaughn@ttu.edu>
Subject: Good Programming Practices - Avoiding Memory Leaks
Message-Id: <v9ttpi1bvs207a@corp.supernews.com>

I'm having a problem with a small memory leak (~20MB/day).  I have traced
the problem back to my Perl scripts.  I was wondering if someone here can
give me pointers on what NOT to do with Perl.  If anyone is willing to
impart their expert Perl wisdom on me, I would be EXTREMELY grateful.

I am using Active State Perl v5.6.1 build 626 on Windows 2000 Server.

I've written a 250 line Perl script and a bunch of smaller scripts that are
~50 lines.  All of these scripts run every five minutes, working together to
extract WMI information from servers (I'm also running MRTG, which could
conceivably be the culprit).

Here are some examples of what I'm using:

- I use a bunch of regular expressions
- I use DBI
- I am reading from one file handle
- I am writing to one file handle
- I use Win32::OLE for getting WMI info.

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

This is what I've done/know so far:

As far as DBI, I am closing my recordset and database connection with this
code:

$rsh->finish;
$dbh->disconnect;

I'm also closing my file handles.

I'm using transliteration in a couple of places (tr/a-z/A-Z/).

I'm using system() in two places, but I could easily change that.

I'm NOT using strict or declaring variables with "my" (I know this is
probably bad, but could it cause leaks?).

I'm NOT using local().

I don't think I have any circular references, but how can I know for sure?

In a couple of cases I open a file handle and read the contents of the file,
then close the handle.  I unlink the file.  Then I create a new file with
the same name using the same file handle, write to that file, then close the
handle.
-------------------------------------------

I've googled this for a long time, but I still haven't found what I'm
looking for.  I'm still sort of a beginner (maybe an intermediate) with
respect to Perl, so I welcome any criticism you have.

-Kevin




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

Date: 17 Apr 2003 20:08:11 -0700
From: david@jamesgang.com (David James)
Subject: Re: Good Programming Practices - Avoiding Memory Leaks
Message-Id: <bc11859e.0304171908.5f45ab6@posting.google.com>

> I'm NOT using strict or declaring variables with "my" (I know this is
> probably bad, but could it cause leaks?).

This will cause memory leaks. Any variable you don't declare with "my"
is a package variable. Package variables stick around forever unless
you explicitly get rid of them.


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

Date: Thu, 17 Apr 2003 13:13:46 -0500
From: "Anthony Saffer" <anthony@nospam.safferconsulting.com>
Subject: GUI Development Options
Message-Id: <3e9eef1c$1_1@nntp2.nac.net>

Hello Everyone,

I'm developing a mid-sized application that will be GUI based using Tk.
Right now, I'm finding myself hand coding all of the widget data and the
other code. I'm pretty sure that there is a RAD tool out there that would
let me design the GUI visually and then concentrate on the backend code
(something like WinGlade which I can't get to work). Can anyone direct me to
such a program? I'm on Win32 so it needs to work there.

Thanks!
Anthony




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

Date: Fri, 18 Apr 2003 03:35:31 GMT
From: "Knute Snortum" <knuteNOSPAMPLEASE@trinityproject.org>
Subject: Re: GUI Development Options
Message-Id: <7oKna.30243$Zx.8684@nwrddc01.gnilink.net>

http://www.activeperl.com/Products/Visual_Perl/

--
-- Knute Snortum
"Sure, I drink six 8-ounce glasses of water a day.  I just like my water
hot and filtered through ground coffee beans."


"Anthony Saffer" <anthony@nospam.safferconsulting.com> wrote in message
news:3e9eef1c$1_1@nntp2.nac.net...
> Hello Everyone,
>
> I'm developing a mid-sized application that will be GUI based using Tk.
> Right now, I'm finding myself hand coding all of the widget data and the
> other code. I'm pretty sure that there is a RAD tool out there that would
> let me design the GUI visually and then concentrate on the backend code
> (something like WinGlade which I can't get to work). Can anyone direct me
to
> such a program? I'm on Win32 so it needs to work there.
>
> Thanks!
> Anthony
>
>




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

Date: Fri, 18 Apr 2003 00:32:29 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: HTTP::Headers - getting request headers
Message-Id: <slrnb9uhst.dfc.efflandt@typhoon.xnet.com>

On Thu, 17 Apr 2003 11:23:27 +0930, Iain <iain@pcorp.nospam.com.au> wrote:
> I want to get some (any would do for now!) request headers, ie sent by 
> the client to the server.  I'm using HTTP::Headers as follows, but I 
> think I'm doing something wrong:

I am a little confused what you are attempting to do.  HTTP::Headers
appears to be for setting request headers (for HTTP client use), which you
are attempting to read when you have never set them.  Maybe you are
actually attempting to use it on a web server to read request headers from
a browser.  I do not think it is designed for that (normal web servers do
not necessarily pass on full HTTP request header, just certain variables
in the environment).

If you want to see what an actual HTTP request looks like, write a little
Perl server that listens on port 80 (perldoc perlipc) and reports anything
it receives from the socket up until the first empty line.  Then print
something back to the socket that looks like a normal server response with
something simple, so the browser does not hang waiting for a response (or
if that is too difficult, just hit the stop button on browser once it has
sent its request).

-- 
David Efflandt - All spam ignored  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/


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

Date: Thu, 17 Apr 2003 22:09:55 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Interpolation problem with DB execute object
Message-Id: <3e9f2527.17227729@news.erols.com>

libertybelle2112@yahoo.com (Liberty Belle) wrote:

: "st execute failed: called with 1 bind variables when 5 are needed"
: 
: it sees [...]
: only one variable in the execute, though it too is values 
: separated by commas.

: $inputdata = 'row1, 14, 150.34, 238.00, 12.50';
: $sth_loadstmt->execute($inputdata);

$inputdata is not several values.  It is one value--a string.

Perl has a considerable gift of DWIM, but it cannot reason that you
want that string burst at the commas to create a list of arguments to
pass to execute().  You must do that yourself.

Didn't you already ask this question?



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

Date: Thu, 17 Apr 2003 14:43:59 -0700
From: Penguinista <peter@nospam.calweb.com>
Subject: Re: lex/yacc problems with C++ program and libperl
Message-Id: <3e9f2db6$0$20986$d368eab@news.newshosting.com>

Chris Richmond - MD6-FDC ~ wrote:
> Hi Folks,
> 
>    I'm asking this thrid hand for someone I'm working with
> that is attepting to embed perl (version unknown) into a
> C++ program.  The issue he has is that he gets compiler
> warning/errors for lex/yacc variables that are defined
> multiple times.  The app is using lex/yacc and so does
> perl and he's assuming that's the source of the errors.
> I read the perlembed.pod and didn't find anything nor
> in the rest of the .pod from perl5.005_03.
> 
> Is there another resource I can try to get answers from?
> 
> Thx, Chris
> 
 From what I read, perl uses a painstakingly handcrafted lexer,
not lex.

What variables are you getting duplicates on?  and at what
level, compile or link?

source and header files (with grep a big help in searching)
are a valuable resource.



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

Date: 17 Apr 2003 16:22:51 -0700
From: scott@doppelgangerdesign.com (Scott Spencer)
Subject: Need advice on my first Perl script
Message-Id: <d88b4984.0304171522.266e4133@posting.google.com>

Regards all, 

I am trying my hand at perl with this little script which is supposed
to take the contents of a directory (they will be all tif files named
in numbered sequence, such as tif001.tif tif002.tif tif003.tif) and
keep only every 5th or 6 th file deleting the ones in between. For
instance, file001 will stay but file 002 thru 005 will be deleted. I
know its bad form to delete the files but it was the first and only
solution I found in my book. I suppose idealy I would create a new
directory and operate on that instead. I am having problems getting it
to step through the array elements and only remove the files I
specified. I hope my code is discernable, this is my first time ever
coding Perl so... : )

#perl script to sort and delete frames from a tiff sequence in
premiere.
# this will run on a win32 system

##variables
$current_file;         #filename unedited so it can be deleted if
needed
$current_file_number; #current number you are working on
$current_count = 0;   #counter to tell which array element to pull
$file_counter;        #next file to keep
$file_counter_control = 6; #6 is added to file counter to generate the
next file # to keep
$end_frame;          #user specified end frame

## get the path from stantard input then chomp the trailing newline
print "please enter path, use format /directory_name : ";
$path = <STDIN>;
chomp ($path);
print "Please enter end frame number";
$end_frame=<STDIN>; 
chomp ($end_frame); 

opendir (BOOGER, "$path") || die "cannot open your request??? $!"; 
#open a directory
	
								    #handle to specified path
@thefiles = readdir(BOOGER); 		#read the directory contents into an
array

## here is where things seem to break down. Everything in the dir is
delted. I #know I need to add some way for it not to deal with the
array elements . .. #and the script itself which onloy seems to work
when it is in the home #directory. I think thats cause I used the
unlink function.

while ($current_count ne $end_frame)  {
	$current_file = @thefiles [$current_count]; 
        $current_file_number = $current_file;
	$current_file_number =~ s/\D*//;  #regular expression to remove all
#alpha characters before numbers
# I need to figure out the regular expression to wipe the .tif
extension as #well.
	$file_counter = $current_file_number;

if ($current_file_number ne $file_counter) {
	unlink ($current_file);
}
		
	$file_counter = $file_counter+6;
	print $file_counter;
	print '\n';
	$current_count ++;

}			#end of while loop


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

Date: 18 Apr 2003 03:27:12 GMT
From: "James E Keenan" <jkeen@concentric.net>
Subject: Re: Need advice on my first Perl script
Message-Id: <b7nrag$mhj@dispatch.concentric.net>


"Scott Spencer" <scott@doppelgangerdesign.com> wrote in message
news:d88b4984.0304171522.266e4133@posting.google.com...
> Regards all,
>
> I am trying my hand at perl with this little script which is supposed
> to take the contents of a directory (they will be all tif files named
> in numbered sequence, such as tif001.tif tif002.tif tif003.tif) and
> keep only every 5th or 6 th file deleting the ones in between. For
> instance, file001 will stay but file 002 thru 005 will be deleted. I
> know its bad form to delete the files but it was the first and only
> solution I found in my book. I suppose idealy I would create a new
> directory and operate on that instead. I am having problems getting it
> to step through the array elements and only remove the files I
> specified. I hope my code is discernable, this is my first time ever
> coding Perl so... : )
>
1.  Generally speaking, this is not the place to get help on your first-ever
Perl script.  There are a number of Perl mailing lists that are *very* good
at handling beginners' questions; check out http://learn.perl.org or
http://groups.yahoo.com/group/perl-beginner .
2.  Having said that, if you want to seek help on this list, you should
demonstrate that you have first attempted to use Perl's built-in
documentation to help solve your problem.  That documentation is accessible
via command-prompt commands all beginning with 'perldoc', e.g., 'perldoc
perldoc' to get information on how the perldoc system works; 'perldoc -f
readdir' to learn how the built-in 'readdir' function works; etc.
3.  In addition, you should demonstrate that you have attempted to follow
proper Perl coding practices by beginning each Perl script with (at least)
'use warnings;' and (preferably) both 'use warnings;' and 'use strict'.
These pragmata will call attention to your coding errors much more
quickly -- and more charitably -- than people reading this list will.

Now, just a few comments on your script.
4.  Why do you want to 'keep only every 5th or 6 th file deleting the ones
in between'?  Does that mean that sometimes you want to skip over 5 files
and sometimes skip over 6?  What's the criterion for determining when 5 and
when 6?  (Computers can't handle such fuzziness.)

> #perl script to sort and delete frames from a tiff sequence in
> premiere.
> # this will run on a win32 system
>
> ##variables
> $current_file;         #filename unedited so it can be deleted if
> needed
> $current_file_number; #current number you are working on
> $current_count = 0;   #counter to tell which array element to pull
> $file_counter;        #next file to keep
> $file_counter_control = 6; #6 is added to file counter to generate the
> next file # to keep
> $end_frame;          #user specified end frame
>
> ## get the path from stantard input then chomp the trailing newline
> print "please enter path, use format /directory_name : ";
> $path = <STDIN>;
> chomp ($path);
> print "Please enter end frame number";
> $end_frame=<STDIN>;
> chomp ($end_frame);
>
> opendir (BOOGER, "$path") || die "cannot open your request??? $!";
> #open a directory
>
>     #handle to specified path
> @thefiles = readdir(BOOGER); #read the directory contents into an
> array
>
> ## here is where things seem to break down. Everything in the dir is
> delted. I #know I need to add some way for it not to deal with the

How did you delete files?  Perl's built-in function to delete files from a
disc is 'unlink'; you don't seem to have used it before this point (though
you use it below).  Are you aware of the fact that, as coded, readdir will
assign the 'files' '.' and '..' to @thefiles?

> array elements . .. #and the script itself which onloy seems to work
> when it is in the home #directory. I think thats cause I used the
> unlink function.
>
> while ($current_count ne $end_frame)  {
> $current_file = @thefiles [$current_count];

Are you sure you know what you're doing here?  It appears to me as if you're
computing the number of items in an array slice and assigning it to
$current_file.  Is that what you intended?


>         $current_file_number = $current_file;
> $current_file_number =~ s/\D*//;  #regular expression to remove all
> #alpha characters before numbers
> # I need to figure out the regular expression to wipe the .tif
> extension as #well.
> $file_counter = $current_file_number;
>
> if ($current_file_number ne $file_counter) {
> unlink ($current_file);
> }
>
> $file_counter = $file_counter+6;
> print $file_counter;
> print '\n';
> $current_count ++;
>
> } #end of while loop




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

Date: Fri, 18 Apr 2003 01:38:08 +0200
From: "Eddy" <eddy@NOSPAMaxa.it>
Subject: newbie lib dir question
Message-Id: <b7ndsj$1fv$1@lacerta.tiscalinet.it>

On my RH 6.2 I have tryed to upgrade Perl to 5.8 with source version

It seems that the lib directories have mixed together  with the old rpm
version from redhat:

/usr/local/lib/perl5/5.8.0/

and

/usr/lib/perl5/5.00503/
/usr/lib/perl5/site_perl/5.005/i386-linux/

perl -V says:
@INC:
    /usr/local/lib/perl5/5.8.0/i686-linux
    /usr/local/lib/perl5/5.8.0
    /usr/local/lib/perl5/site_perl/5.8.0/i686-linux
    /usr/local/lib/perl5/site_perl/5.8.0
    /usr/local/lib/perl5/site_perl

How can I "clean up" everything?
"rpm -e perl " fails because everything depends on perl,
how can I set @INC?

thank you
Eddy






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

Date: Fri, 18 Apr 2003 03:38:33 GMT
From: "Knute Snortum" <knuteNOSPAMPLEASE@trinityproject.org>
Subject: Re: newbie lib dir question
Message-Id: <ZqKna.30261$Zx.21641@nwrddc01.gnilink.net>

I don't see what's wrong.  It looks like you @INC is using all the new libs
like it should.  What problems are you experiencing?

--
-- Knute Snortum
"Sure, I drink six 8-ounce glasses of water a day.  I just like my water
hot and filtered through ground coffee beans."


"Eddy" <eddy@NOSPAMaxa.it> wrote in message
news:b7ndsj$1fv$1@lacerta.tiscalinet.it...
> On my RH 6.2 I have tryed to upgrade Perl to 5.8 with source version
>
> It seems that the lib directories have mixed together  with the old rpm
> version from redhat:
>
> /usr/local/lib/perl5/5.8.0/
>
> and
>
> /usr/lib/perl5/5.00503/
> /usr/lib/perl5/site_perl/5.005/i386-linux/
>
> perl -V says:
> @INC:
>     /usr/local/lib/perl5/5.8.0/i686-linux
>     /usr/local/lib/perl5/5.8.0
>     /usr/local/lib/perl5/site_perl/5.8.0/i686-linux
>     /usr/local/lib/perl5/site_perl/5.8.0
>     /usr/local/lib/perl5/site_perl
>
> How can I "clean up" everything?
> "rpm -e perl " fails because everything depends on perl,
> how can I set @INC?
>
> thank you
> Eddy
>
>
>
>




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

Date: Thu, 17 Apr 2003 15:16:37 -0400
From: "Rich Seymour" <nutate@speakeasy.net>
Subject: syntax error with XML::Simple
Message-Id: <pan.2003.04.17.19.16.35.604988@speakeasy.net>

Hello,

I am having a problem with XML::Simple v2.04, it is as follows:

require 'XML::Simple'
my $xs = new XML::Simple;
return $xs->XMLin("data.xml",
                   ForceArray => ['author', 'name',
                                  'discipline', 'issue',
                                  'area', 'subject',
                                  'code']);
the above code is crashing with this syntax error:
syntax error at 
/opt/perl5.6.1/lib/site_perl/5.6.1/XML/Simple.pm 
line 671, near ") foreach "

and:
syntax error at 
/opt/perl5.6.1/lib/site_perl/5.6.1/XML/Simple.pm 
line 671, near "})"

the code in XML/Simple.pm looks like this:

670  if($opt->{cache}) {
671    $_ = lc($_) foreach (@{$opt->{cache}});
672  }

I don't see a syntax error there...

Any ideas would be appreciated greatly.  Thanks.

-Rich


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

Date: Thu, 17 Apr 2003 16:57:59 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: syntax error with XML::Simple
Message-Id: <slrnb9u8r7.7mk.tadmc@magna.augustmail.com>

Rich Seymour <nutate@speakeasy.net> wrote:

> require 'XML::Simple'
                      ^^
                      ^^

Where is the semicolon?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 17 Apr 2003 17:41:20 GMT
From: user2048 <user2048@yahoo.removethis.com>
Subject: Re: Using a pre-processor to generate POD
Message-Id: <Xns93608BD3E5E89mytokxyzzy@129.250.170.99>

> I am currently working on a cpp look-a-like to generate my inline
> POD documentation. The reason is that I have a base class from which
> I stem numerous (30) other classes. Due to the shared base class,
> many methods are the same. 

I usually hardcode "see also" POD links to the parent class,
to cover the cases where the method is inherited (or at least,
where the interface and description are "inhertied").
But I'm interested in alternatives. I like the idea of seeing
all of a class's method descriptions in one place.



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

Date: Thu, 17 Apr 2003 20:50:56 GMT
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: Using a pre-processor to generate POD
Message-Id: <pkent77tea-72E536.21461017042003@dev.rsn.selsyn.co.uk>

In article <newscache$7suhdh$s02$1@news.emea.compuware.com>,
 Koos Pol <koos_pol@NO.nl.JUNK.compuware.MAIL.com> wrote:

> I am currently working on a cpp look-a-like to generate my inline POD
> documentation. The reason is that I have a base class from which I stem
> numerous (30) other classes. Due to the shared base class, many methods are
> the same. And as I don't want to write the same POD over and over again, I
> was trying to have cpp generate the POD for me. But cpp has it's
> limitations (tokens, terms, balanced quotes, etc). 

There is at least one other preprocessor on CPAN, e.g. 
http://search.cpan.org/author/GSPIVEY/Text-EP3-1.00/EP3.pm
but I haven't examined that too closely - maybe it just won't do what 
you need.

P

-- 
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply


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

Date: Thu, 17 Apr 2003 22:11:22 GMT
From: Eric Wilhelm <ericw@nospam.ku.edu>
Subject: What do these files have in common?
Message-Id: <pan.2003.04.17.16.11.37.864580.7207@nospam.ku.edu>

I have a large group of files, which I know all have one phrase in common
and would like to find as much as possible about what else they have in
common.

The commonalities could be easily found by lines (keep a hash key for
every line and increment its count every time that line is found), but I
would like to find a way to do it by phrases (not single words, but maybe
groups of three or more).  By-line matches could be misleading because
there is occasional date and other changed information.  Example:

File1:
I told Jane I was going home early.

File2:
I was going home early, but I could stay a while.

File3:
I was going home early monday morning and saw the funniest thing.

The files have already been chosen for examination based on some other
criteria, but what I want to report is that all of the selected files
contain the phrase "I was going home early".

I can conceive of a brute-force solution, but that would not be pretty or
even easy to code.

Computational resources are not a problem (until the 32-bit memory limit
at least).

The algorithm which came to mind as the by-line solution clearly does not
extend to by-phrase, (since 9 words would make 10 phrases of three-words
each and I don't really know the length of the phrase which would be
common).

Any suggestions on how to attack this?

Thanks,
Eric


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

Date: 17 Apr 2003 15:24:27 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: What do these files have in common?
Message-Id: <3e9f299b@news.victoria.tc.ca>

Eric Wilhelm (ericw@nospam.ku.edu) wrote:
: I have a large group of files, which I know all have one phrase in common
: and would like to find as much as possible about what else they have in
: common.

: The commonalities could be easily found by lines (keep a hash key for
: every line and increment its count every time that line is found), but I
: would like to find a way to do it by phrases (not single words, but maybe
: groups of three or more).  By-line matches could be misleading because
: there is occasional date and other changed information.  Example:

: File1:
: I told Jane I was going home early.

: File2:
: I was going home early, but I could stay a while.

: File3:
: I was going home early monday morning and saw the funniest thing.

: The files have already been chosen for examination based on some other
: criteria, but what I want to report is that all of the selected files
: contain the phrase "I was going home early".

: I can conceive of a brute-force solution, but that would not be pretty or
: even easy to code.

: Computational resources are not a problem (until the 32-bit memory limit
: at least).

: The algorithm which came to mind as the by-line solution clearly does not
: extend to by-phrase, (since 9 words would make 10 phrases of three-words
: each and I don't really know the length of the phrase which would be
: common).

: Any suggestions on how to attack this?

I assume that the words in a phrase must be next to each other.  (I.e. 
"old brown fox"  is *not* a three word match for "old dirty brown fox"). 

obviously untested, make all the "3 or more" word phrases for both files,
put in a hash, and compare.

	my @words1 = split into words $file1;

	my %phrases1 = ();

	for (my $i=0; $i<@words1-3; $i++)
	{
		for (my $j=$i+3; $j<@words1; $j++)
		{	my $phrase = join ' ', @words1[$i..$j];
			$phrases1{ $phrase }= $phrase;
		}
	}
	
	# now do the same for the 2nd file, then compare the keys of the
	# two hashes

	my @words2 = split into words $file2;
	my %phrases2 = ();
	for (my $i=0; $i<@words2-3; $i++)
	{	for (my $j=$i+3; $j<@words2; $j++)
		{	my $phrase = join ' ', @words2[$i..$j];
			$phrases2{ $phrase }= $phrase;
		}
	}

	# compare
	foreach my $phrase1 (keys %phrases1)
	{
		if ( $phrases2{$phrase1} )
		{
			print "$phrase1 is in both files\n";
		}
	}



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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 4859
***************************************


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