[10592] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4184 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 9 21:07:13 1998

Date: Mon, 9 Nov 98 18:00:25 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 9 Nov 1998     Volume: 8 Number: 4184

Today's topics:
    Re: a small question <ntu@ntu.edu.sg>
        CGI/popup menus and anonymous hashes (Will Dieterich)
    Re: CGI/popup menus and anonymous hashes (Alastair)
    Re: Compilation Error? <Pap22@erols.com>
    Re: Configuration PERL <rootbeer@teleport.com>
        Converting HTML tag and attribute case - Regular Expres (Lee Borkman)
        DOS to UNIX <Roderik.Valcke@unicall.be>
        Emulate dirname and basename in perl?? <dennis.moreno@safetran.com>
    Re: Exec Perl Offline with Webbrowser (Erik)
        FTP/doing file testing on an array? <arranp@datamail.co.nz>
    Re: HELP , I just can figure this out <rootbeer@teleport.com>
        History Lesson... <tonilynn@cgo.wave.ca>
    Re: History Lesson... (Erik)
    Re: how check if integer (Tad McClellan)
        Need help on whereami(); <rwilliamson@uno.gers.com>
    Re: Network Search Script (Martien Verbruggen)
    Re: ODBC problem........ <metcher@spider.herston.uq.edu.au>
    Re: Perl/Win'95 <ludlow@us.ibm.com>
    Re: Perl/Win'95 (Erik)
    Re: PERL (Martien Verbruggen)
    Re: pod2html and <BR> and L<text> tags (Snowhare)
    Re: Prof Help Needed (Martien Verbruggen)
        Querying the OS. mlentz@my-dejanews.com
        Reading mail from POP3 server <vgopinat@cisco.com>
    Re: Reading mail from POP3 server (Martien Verbruggen)
        Running perl scripts inside perl scripts (TIA) (Christian M. Aranda)
        Running perl scripts inside perl scripts (TIA) (Christian M. Aranda)
        Running perl scripts inside perl scripts (TIA) (Christian M. Aranda)
        Running perl scripts inside perl scripts (TIA) (Christian M. Aranda)
        Running perl scripts inside perl scripts (TIA) <christian.aranda@iiginc.com>
        Security problem with a simple CGI perl-ism (Andrew Allen)
    Re: Sending SOLICITED bulk mail. (Martien Verbruggen)
    Re: Shared CGI.pm from various directories <rootbeer@teleport.com>
        Shared Libs from XS code kellyj@advtech.uswest.com
    Re: VARIABLES DE ENTORNO CGI <sgordon@kenan.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Tue, 10 Nov 1998 09:09:36 +0800
From: ntu <ntu@ntu.edu.sg>
Subject: Re: a small question
Message-Id: <36479250.BD1C2737@ntu.edu.sg>

Thanks for the suggestion. However, if the -w option is used,
perl will give a warning on this.

Jeff Pinyan wrote:

> On Sat, 7 Nov 1998, Tk Soh wrote:
>
> > Tom Phoenix wrote:
> > >
> > > On Sat, 7 Nov 1998, Tk Soh wrote:
> > >
> > > >    print 'is an integer' if $var =~/^\d+$/;
> > >
> > > Isn't -3 still an integer? :-)
> > >
> >
> > Oops. Thanks for catching this. I should have said 'unsigned' integer ;-)
>
> Signed or unsigned, C<print 'integer' if $num == int $num;> works too,
> without wasting a regex.
>
> --
> Jeff Pinyan (jeffp@crusoe.net)
> www.crusoe.net/~jeffp
>
> Crusoe Communications, Inc.
> 973-882-1022
> www.crusoe.net



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

Date: 9 Nov 1998 23:51:42 GMT
From: wdieteri@shell.rmi.net (Will Dieterich)
Subject: CGI/popup menus and anonymous hashes
Message-Id: <727v6e$de7$1@news1.rmi.net>

I have been messing around with this problem, and finally don't have any
ideas of what to do.

I am tring to get a popup menu to work with CGI.pm where I specify
a value and label, and place that in an anonymous hash so that the 
CGI.pm popup menu would use my keys and values from the hash
to build the values and labels in the menu.

Will someone please send me an example where this works.

Thanks



-- 
William Dieterich      Call Sign: KD4LZE       Email: wdieteri@rmi.net


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

Date: Tue, 10 Nov 1998 00:30:45 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: CGI/popup menus and anonymous hashes
Message-Id: <slrn74f27u.8c.alastair@calliope.demon.co.uk>

Will Dieterich <wdieteri@shell.rmi.net> wrote:
>I have been messing around with this problem, and finally don't have any
>ideas of what to do.

The documentation is a good place to start.

>I am tring to get a popup menu to work with CGI.pm where I specify
>a value and label, and place that in an anonymous hash so that the 
>CGI.pm popup menu would use my keys and values from the hash
>to build the values and labels in the menu.
>
>Will someone please send me an example where this works.

Sure - it's in the docs ;

Creating A Popup Menu
---------------------

print $query->popup_menu(-name=>'menu_name',
                         -values=>[qw/eenie meenie minie/], 
                         -labels=>{'eenie'=>'one',
                                   'meenie'=>'two',
                                   'minie'=>'three'},
                         -default=>'meenie');
or ;

print $query->popup_menu(-name=>'menu_name',
                         -values=>['eenie','meenie','minie'],
                         -default=>'meenie');
							
Check : http://stein.cshl.org/WWW/software/CGI/

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Sun, 8 Nov 1998 23:41:26 -0500
From: "Pap" <Pap22@erols.com>
Subject: Re: Compilation Error?
Message-Id: <725rql$atr$1@autumn.news.rcn.net>

Well here's what you gotta do.  First, always use

#!/usr/local/bin/perl -w
-this will check your syntax for typos and the like

Second, take out that last } all the way at the bottom.  at least thats what
it said for me to do when i used -w.  hope that helped a little.




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

Date: Tue, 10 Nov 1998 01:49:51 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Configuration PERL
Message-Id: <Pine.GSO.4.02A.9811091747170.2742-100000@user2.teleport.com>

On Mon, 9 Nov 1998, Sebastien Gontier wrote:

> Does anyone had this problem configuring Perl??

If someone didn't respond the first time you posted this, why should they
respond this time?

If you're having trouble building a recent version of perl on your system,
please check the installation instructions and your system's hints file to
see what to do next. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 10 Nov 1998 00:34:21 GMT
From: borkman@usa.net (Lee Borkman)
Subject: Converting HTML tag and attribute case - Regular Expression help
Message-Id: <36478897.73695804@gw>

Hi all,

I am trying to make an RE to convert all HTML tag names and tag
attribute names to upper case.  The attribute values must be
unchanged.  For example, I want to convert:

<font face="arial" size=3 color=red>

to

<FONT FACE="arial" SIZE=3 COLOR=red>


I have the entire HTML page stored in $newPage.  I can write a
substitution that will handle the tag name, and the LAST attribute
name, but it won't pick up the intervening attribute names.

Any ideas?

Thanks,
Lee Borkman


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

Date: Tue, 10 Nov 1998 01:32:40 +0100
From: "Roderik Valcke" <Roderik.Valcke@unicall.be>
Subject: DOS to UNIX
Message-Id: <7281r3$9or$1@trex.antw.online.be>

Hi

I'm looking for a perl code to change in a $string the hexcode "0D 0A" to
only "0A";
before exporting by the string to a file

         open (FILE,">$filename");
         print FILE "$string";
         close (FILE);       .


I've tried   $string =~ s/\x0d\x0a/\x0a/g;  but it always changes the "0A"
to "0D 0A" once it's writen to the file;

If I use an extern  DOS-to-UNIX utility on the file and save it's OK. (I'm
working on WINDOWS)

But I want to export by the perl script so I don't have to change it.

can someone help me

roderikvalcke@unicall.be









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

Date: Mon, 09 Nov 1998 15:51:07 -0800
From: Dennis Moreno <dennis.moreno@safetran.com>
Subject: Emulate dirname and basename in perl??
Message-Id: <727v5a$1o8$1@news-2.news.gte.net>

Hi-

I'm lookin for an example of emulating the unix "basename" and "dirname"
commands
using perl. Anyone have an example they'd like to share??

thanks
Dennis



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

Date: 9 Nov 1998 21:53:06 GMT
From: eln@cyberhighway.net (Erik)
Subject: Re: Exec Perl Offline with Webbrowser
Message-Id: <727o82$mmq$1@news.cyberhighway.net>

In article <364762AE.8C8A67CF@xs4all.nl>,
	Frank <debot@xs4all.nl> writes:
> I need to find a method to test my scripts when I am offline. I know
> only the program perl.exe, but that isn't what I am looking for. It's
> debugging script, and it even doesn't debug very well (instead to good)

Use CGI.pm for all your CGI scripts...if you do, you can just run the
script from the command line, and it'll ask you to input the stuff it
would normally get from a form.  Consult the docs on CGI.pm (which are
quite detailed) for more information.

-- 
Erik Nielsen, Cyberhighway Internet Services NOC

The court finds everyone to be in contempt (including himself :-), and
orders everyone sentenced to five years hard labor.  (Working on Perl,
of course.)
             -- Larry Wall in <199807211548.IAA26184@wall.org>


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

Date: Tue, 10 Nov 1998 14:11:22 +1300
From: Arran Price <arranp@datamail.co.nz>
Subject: FTP/doing file testing on an array?
Message-Id: <364792BA.1145@datamail.co.nz>

Sorry if the title sounds confusing, my problem is thus:

Im using the cpan ftp module (which by the way makes life so much
easier).

I do an 
@SCONTENTS=$ftp->dir;
which gets me the contents of an ls -al type listing into the array.
eg ----------   1 owner    group        45252636 Oct 19  0:39 MD799.001
Now I need to grab the files that are newer than a day old.
The file matching -M would seem to be the best way to use it, but I cant
figure out how to check on the details in the array, rather than
checking out a probably non existant file on disk.

Anyone give me some pointers or alternative ways of doing it?
I thought about extracting the date fields and checking them but then I
would need to figure out the days in the month etc..

thanks

libnet-1.0605
This is perl, version 5.004_01

Arran
My opinions are my own and do not reflect those of my employer.


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

Date: Tue, 10 Nov 1998 01:35:02 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: HELP , I just can figure this out
Message-Id: <Pine.GSO.4.02A.9811091729060.2742-100000@user2.teleport.com>

On Mon, 9 Nov 1998, John Hardy wrote:

> Subject: HELP , I just can figure this out

> I just can't seem to figure this thing out. 

Well, make up your mind! :-)

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

    http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

> No matter what I do it gags at

> $CMD->Parameters("lname")->{value}=$linesin{$lname};

> The error I am now getting is use of uninitialized variable. A value
> used as either a hard refernce or symbolic reference must be a defined
> value. Can't use an undefined value as a Hash reference.

Well, let's look at that line a little at a time.

	$CMD

That's an ordinary scalar, although the name is unusual. 

	$CMD->Parameters("lname")

Now you're doing a method call. The method name is Parameters, and you're
passing it the string "lname" as a parameter. The method call is being
made upon the object $CMD. That must be a valid method for that object,
or you'd have gotten a different error.

	$CMD->Parameters("lname")->{value}

Now you're using that returned value as a hashref, and dereferencing it.
Hey, could that returned value have been undef?

	$CMD->Parameters("lname")->{value}=$linesin{$lname};

Now you're storing a value ($linesin{$lname}) into that hash. It looks as
if the only place where that error could have appeared is if that method
call's return value was undef. Maybe you should check to see whether the
method call is really doing what you want. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 09 Nov 1998 20:13:16 -0800
From: Toni-Lynn Hamilton <tonilynn@cgo.wave.ca>
Subject: History Lesson...
Message-Id: <3647BD5C.F4CB73D3@cgo.wave.ca>

I'm doing a group presentation at school on Perl and I have been elected
to find the history of Perl.  I checked out the one FAQ and it has
Perl's physical history, release dates and updates but it is not exactly
what I'm looking for.  I've also checked out a bunch of others as
well.   I was looking for who designed it, when, for what purpose etc...

I was hoping that I could find that on the 'Net.  If it's not, could
someone recommend a book possibly?

Thanks for your help...

Toni



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

Date: 10 Nov 1998 01:26:04 GMT
From: eln@cyberhighway.net (Erik)
Subject: Re: History Lesson...
Message-Id: <7284nc$uo1$1@news.cyberhighway.net>

[Posted and mailed]

In article <3647BD5C.F4CB73D3@cgo.wave.ca>,
	Toni-Lynn Hamilton <tonilynn@cgo.wave.ca> writes:
> I'm doing a group presentation at school on Perl and I have been elected
> to find the history of Perl.  I checked out the one FAQ and it has
> Perl's physical history, release dates and updates but it is not exactly
> what I'm looking for.  I've also checked out a bunch of others as
> well.   I was looking for who designed it, when, for what purpose etc...
> 
> I was hoping that I could find that on the 'Net.  If it's not, could
> someone recommend a book possibly?

I did a quick search on altavista for "history of perl" (admitedly
probably not the best search criteria, but it did knock out a lot of the
garbage a search usually includes).  I found a very brief history at
http://www.fdd.co.uk/jos/perl5/ch1.htm#ABriefHistoryofPerl
It appears to be pretty accurate, as far as it goes.  I'm sure if you
did an altavista search (searching yahoo does not appear to yield anything
of use), you'll probably find more.

You can also check out http://kiev.wall.org/~larry/natural.html.
It doesn't have a whole lot to do with the history of Perl, really, but
its written by the creator of Perl, and it might give you some more
insight on why perl is the way it is.

HTH!

-- 
Erik Nielsen, Cyberhighway Internet Services NOC

[End of diatribe.  We now return you to your regularly scheduled
programming...]
             -- Larry Wall in Configure from the perl distribution


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

Date: Mon, 9 Nov 1998 16:30:54 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: how check if integer
Message-Id: <ueq727.u98.ln@flash.net>

Steve . (syarbrou@nospam.ais.net) wrote:
: I have a variable with a value in it.  Want to check if it's an
: integer.  

: Any way to do this?  


   Yes.


: If so how?


   The way described in Perl FAQ, part 4:

      "How do I determine whether a scalar is a number/whole/integer/float?"


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Mon, 9 Nov 1998 17:56:42 -0800
From: "Rusty Williamson" <rwilliamson@uno.gers.com>
Subject: Need help on whereami();
Message-Id: <01N12.174$DA6.31518@news.connectnet.com>

Hi!

The scripts I'm writing need to access data files and other scripts which
reside in directories relative to where the scripts are installed.  This can
be anywhere.  What is the best way to determine this?

Thanks,
Rusty




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

Date: Tue, 10 Nov 1998 01:22:50 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Network Search Script
Message-Id: <KzM12.112$ay.210944@nsw.nnrp.telstra.net>

In article <726089$bk7$1@strato.ultra.net>,
	iacovm@rpi.edu writes:

> Need a cgi/perl script that can be run on a web page to search
> windows network neighborhood.

I need a lot of money. I tried working, and it is reasonably
successful.

What have you tried to achieve your goal?

Martien

PS. In other words: Don't beg for things. If you want to find stuff,
and not write stuff, you're in the wrong place. Search the web for
prewritten stuff. If you can't find anything, try it yourself. If you
run into problems at that point, feel welcome to come back.
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: Tue, 10 Nov 1998 11:33:14 +1000
From: Jaime Metcher <metcher@spider.herston.uq.edu.au>
Subject: Re: ODBC problem........
Message-Id: <364797DA.19817132@spider.herston.uq.edu.au>

Casema wrote:
> 
> Hi newsgroup,
> 
> I am trying to explore Dave Roth's ODBC module with following code and get
> this error message:
> 
> Can't locate object method "new" via package win32:ODBC at data.pl line 3
> Can you help? And most important, would you????
> 
> Code:
> 
> use WIN32::ODBC;
> 
> my($db) = new WIN32::ODBC('base');
<snip>

It's Win32::ODBC.  Perl is case sensitive.

-- 
Jaime Metcher


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

Date: Mon, 09 Nov 1998 17:09:47 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: Perl/Win'95
Message-Id: <3647763B.EA843DD3@us.ibm.com>

Erik wrote:
> 
> In article <3647236E.D763E906@patriot.net>,
>         Marquis de Carvdawg <carvdawg@patriot.net> writes:
> > Perl runs on both 95/98 and NT.  For the latest version of Perl for the
> > 32-bit Windows (ie, Win32) platforms, go to:
> >
> > http://www.activestate.com
> 
> Bad, bad, bad.  Win32 perl is included in the perl standard distribution,
> and it's a lot more likely to work with standard perl stuff (modules and
> such) than activestate's abomination.  You can pick up binaries for it
> at www.perl.com if you don't have a C compiler.

Actually, ActiveState's ActivePerl build 506 works very well.  Packages
are handled with a program called ppm, which is included.  I used build
506 with the Perl/Tk module, and had no problems at all.  

Have you actually tried using this "abomination", or are you just
guessing?  Perhaps you had a bad experience with some of their older
software?

-- 
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)


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

Date: 10 Nov 1998 00:33:52 GMT
From: eln@cyberhighway.net (Erik)
Subject: Re: Perl/Win'95
Message-Id: <7281lg$tgu$1@news.cyberhighway.net>

In article <3647763B.EA843DD3@us.ibm.com>,
	James Ludlow <ludlow@us.ibm.com> writes:
> Actually, ActiveState's ActivePerl build 506 works very well.  Packages
> are handled with a program called ppm, which is included.  I used build
> 506 with the Perl/Tk module, and had no problems at all.  
> 
> Have you actually tried using this "abomination", or are you just
> guessing?  Perhaps you had a bad experience with some of their older
> software?

I admit that my review of activestate is based on earlier versions.
However, it would seem to me to be wise to stick with the standard
distribution, thereby assuring that if your version of Perl acts strangely,
you can be reasonably sure it acts strangely in the same way it does for
everyone else using Perl.

I do appreciate that activestate is bringing perl to a wider audience, and
I'll have to take your word for it that their newer releases are actually
worthwhile (as I'm sure you know, the earlier ones tended to break basic
functionality in a lot of things), but I can't see any compelling reason to
champion a distribution put out by a third party when there is a port
included with the standard distribution, which you can be reasonably sure
is and probably will continue to be more compatible with everyone else's
perl, and thereby functionality-adding modules and such, than any other
port available.  There's no guarantees activestate won't start breaking
things again in later releases.  By the same token, there's no real
guarantee that the win32 port included in the standard distribution won't
break either, but knowing that its deemed worthy by the core developers to be
included as part of the standard distribution should give you some sort of
feeling of security about its functionality.

But then, I guess if you were all that concerned about functionality and
lack of bugs, you wouldn't be running win32 in the first place ;)

-- 
Erik Nielsen, Cyberhighway Internet Services NOC

There are still some other things to do, so don't think if I didn't fix
your favorite bug that your bug report is in the bit bucket.  (It may be,
but don't think it.  :-)  Larry Wall in <7238@jpl-devvax.JPL.NASA.GOV>


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

Date: Tue, 10 Nov 1998 01:29:29 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: PERL
Message-Id: <ZFM12.114$ay.210944@nsw.nnrp.telstra.net>

In article <36470043.20D1D2E4@dl.ac.uk>,
	Sebastien Gontier <s.gontier@dl.ac.uk> writes:
> Hi!!
> 
> Does someone know why I have got this problem configuring Perl 5.00404
> on UNIX...

It is quite important to mention which unix you use. They're all very
different.

> "ld32: ERROR 33: Unresolved text symbol "pow" --1st referenced by
> libperl.a(pp.o).
> *** Error code 1 (bu21)"
> after the command "sh Configure -Dcc=gcc" and "make" ???

pow is the power function from the math library. I bet you don't have
a -lm in your link rules.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Think of the average person. Half of
Commercial Dynamics Pty. Ltd.       | the people out there are dumber.
NSW, Australia                      | 


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

Date: 10 Nov 1998 01:45:27 GMT
From: snowhare@devilbunnies.org (Snowhare)
Subject: Re: pod2html and <BR> and L<text> tags
Message-Id: <7285rn$9ks$1@nnrp3.snfc21.pbi.net>



Nothing above this line is part of the signed message.

In article <fl_aggie-0911981718110001@aggie.coaps.fsu.edu>,
I R A Aggie <fl_aggie@thepentagon.com> wrote:
>In article <727mo0$qn6$1@nnrp4.snfc21.pbi.net>, snowhare@devilbunnies.org
>(Snowhare) wrote:
>
>+ pod2html generates broken HTML, period.
>
>You mean Pod::Html generates broken HTML. The guts of pod2html:
>
>use Pod::Html;
>
>pod2html @ARGV;

Yes.

>I took a look at Pod::Html to gauge how big a job it would be, and it
>ain't a 5 minute fix... :(

Nope. But I've continued to tweak on my post-processor. It handles all
the things I do with POD right now (IOW it turns the output of my
modules POD into something that can pass a validator). So it is at 
least a starting place for other people.

Revised Script:

#!/usr/bin/perl -w
use strict;

my $text = '';
my ($file);
while ($file = shift) {

	my ($text) = &read_file ($file);
	next if (not defined $text);
	my $fixed_text = &fix_screwups($text);
	&write_file($file,$fixed_text);
}

sub read_file {
	my ($file) = @_;

	if (not open (FILE,$file))  {
		warn ("Could not open '$file' for reading\n$!");
		return undef;
	}
	local $/ = undef;
	my $text = <FILE>;
	close (FILE);

	$text;
}

sub write_file {
	my ($file,$text) = @_;

	if (not open (FILE,">$file"))  {
		warn ("Could not open '$file' for writing\n$!");
		return undef;
	}
	my $old_select = select (FILE);
	$|++;
	print $text;
	$|--;
	select $old_select;
	close (FILE);

	1;
}


sub fix_screwups {
	my ($text) = @_;

	my $doctype = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'; 
	$_ = $text;

	# If I wanted my email address where a spam 
	# bot could snag it, I'd put it in myself  
	s/<LINK REV="made" HREF="mailto:[^"]+">//o;

	# =item C<$ui-E<gt>set_ui_mode($mode);>
	# WRONG WRONG WRONG!!!!! <STRONG> is illegal in <DT>. &gt; is the entity
	# for >. Failing to close <DT> screws up some HTML 'parsers'.
	# <DT><STRONG><A NAME="item__ui_gtset_ui_mode_mode_">$ui-gtset_ui_mode($mode);</A></STRONG><DD>
	# Right.
	# <dt><b><a name="item__ui_gtset_ui_mode_mode_">$ui-&gt;set_ui_mode($mode);</b></dt>\n<dd> 
	s/-gt/-\&gt;/go;
	s#<DT><STRONG>#<dt><b>#go;
	s#</STRONG><DD>#</b></dt><dd>#go;

	# Close the <DD> tags. Stylesheets don't work
	# right in the Big Two with implied block closures.
	s#</DL>#</dd></dl>#go;

	# <P><HR> is nonsense code.
	s#<P>([^<]*)<P>\s+<HR>#<p>$1</p>\n<hr>#go;

	# So is <P><PRE>
	s#<P>([^<]*)<P>\s+<PRE>#<p>$1</p>\n<pre>#go;
	s#<P>\s*<PRE>#<pre>#goi;

	# close the dangling <P>
	s#<P>([^<]*)</dd>#<p>$1</p>\n</dd>#go;

	# <P> IS NOT equivalent to '\n\n'. Grrr.....
	s#<P>([^<]*)<P>#<p>$1</p>#oig;
	s#</p>([^<]*)<P>#</p><p>$1</p>#oig;
	s#</p>([^<]*)<DL>#</p><p>$1</p>\n<dl>#oig;
	s#\n</p>([^<]*)</p>#</p><p>$1</p>#oig;
	s#\n</p>([^<]*)</p>#</p><p>$1</p>#oig;
	s#\n</p>([^<]*)</p>#</p><p>$1</p>#oig;

	# close dangling <li> 
	s#<UL>\s*<UL>#<ul>\n<li>\n<ul>#goi;
	s#</UL>\s*</UL>#</ul>\n</li>\n</ul>#goi;
	s#<LI><A HREF="([^"]*)">([^"]*)</A>(\s+)(?=<LI>)#<li><a href="$1">$2</a></li>$3#goi;
	s#</A>(\s+)</UL>#</a></li>$1</ul>#goi;
	s#</ul>(\s+)<li>#</ul></li>$1<li>#goi;

	# Gah.
	s#>\s+<P>\s+<HR>#>\n<hr>#go;
	s#<HR>\s+<P>\s+<H(\d)>#<hr>\n<h$1>#go;
	s#</H(\d)>\s+<P>\s+<HR>#</h$1>\n<hr>#go;

	# Patch up more P stuff
	s#([^\s>]+)\s*</dd>#$1\n</p></dd>#goi;
	s#([^\s>]+)\s*<dl>#$1\n</p>\n<dl>#goi;
	s#<P>\s*([^<]+)\s*<dl>#<p>$1</p>\n<dl>#goi;
	s#</CODE>(\s*)</dd>#</code>$1</p>\n</dd>#goi;
	s#</p>(\s*[^<\s])#</p><p>$1#goi; 
	s#([^>\s])\s*<p>#$1</p><p>#goi; 
	s#([^\s>]+)\s*</body>#$1</p>\n</body>#oi;

	"$doctype\n$_";
}


Benjamin Franz


Version: 2.6.2

iQCVAwUBNkebHejpikN3V52xAQHvfAQAqBRW6s1/WOfyWgNvsDJssICNIC5YQVQg
W451Tl9OYaSQaEKMU3r4g88M041SD558XbWiNRUP62HLWsUNF/Z84nVf5l3ROOtL
7fWSchrfKJ98tXr7kSNDDH6ppXGQBEC8bUkxdse5dlIOQRayIp6qc+PinjXvGyPe
ncv7OQNsGqc=
=3wvS
-----END PGP SIGNATURE-----


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

Date: Tue, 10 Nov 1998 01:51:54 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Prof Help Needed
Message-Id: <__M12.126$ay.210944@nsw.nnrp.telstra.net>

In article <36476242.C4346C41@xs4all.nl>,
	Frank <debot@xs4all.nl> writes:
> I need a script which can delete the first or last line of a data file.
> If the 11th line is added that the first line is deleted. Or reversed.

I hope you will use it to delete a bunch of lines from your 13 line
signature. Hopefully until there are no more than 4 left, which is the
normally accepted maximum.

And I suggest that you read the FAQ.

# perldoc perlfaq5
second question
     How do I change one line in a file/delete a line in a
     file/insert a line in the middle of a file/append to the
     beginning of a file?

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | I think I think, therefore I think I
Commercial Dynamics Pty. Ltd.       | am.
NSW, Australia                      | 


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

Date: Tue, 10 Nov 1998 01:01:50 GMT
From: mlentz@my-dejanews.com
Subject: Querying the OS.
Message-Id: <72839u$8lo$1@nnrp1.dejanews.com>

Ho do I query the OS from perl?  I'm trying to get the
number of open files I can have at one time.  I believe this
is in sys/param.h, but is there a way to check this file
within perl?  Can I just use $FileCache::maxopen?



-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 09 Nov 1998 17:27:02 -0800
From: Gopinath Venkataramanan <vgopinat@cisco.com>
Subject: Reading mail from POP3 server
Message-Id: <36479665.DFAD1ED3@cisco.com>

I need to read mails that are received to an id. I hv written filters
which will read these mails and input it into a database.
basically a requirement for storing the feedback on a business function
for analysis from a database

any help?



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

Date: Tue, 10 Nov 1998 01:59:19 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Reading mail from POP3 server
Message-Id: <X5N12.127$ay.210944@nsw.nnrp.telstra.net>

In article <36479665.DFAD1ED3@cisco.com>,
	Gopinath Venkataramanan <vgopinat@cisco.com> writes:
> I need to read mails that are received to an id. I hv written filters
> which will read these mails and input it into a database.
> basically a requirement for storing the feedback on a business function
> for analysis from a database
> 
> any help?

The above doesn't really make much sense, so I'll just take the
Subject line as your question. You want to get mail from a POP3
server.

# perl -MCPAN -e shell
cpan> i /pop/
Distribution    SDOWD/POP3Client-1_18.tar.gz
Module          Mail::POP3Client (SDOWD/POP3Client-1_18.tar.gz)
Module          Mail::UCEResponder (Contact Author Charlie Stross <charlie@antipope.org>)
Module          Net::POP3       (GBARR/libnet-1.0605.tar.gz)
Module          QPopupMenu      (AWIN/PerlQt-1.06.tar.gz)

The module Mail::POP3Client looks very promising to me. Maybe you
should get it from CPAN: http://www.perl.com/CPAN/
While you are there, you should probably check out all the other mail
related modules. There are many which will help you break up your
email messages in their constituant parts.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd.       | make a better idiot.
NSW, Australia                      | 


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

Date: Mon, 09 Nov 1998 22:50:53 GMT
From: christian.aranda@iiginc.com (Christian M. Aranda)
Subject: Running perl scripts inside perl scripts (TIA)
Message-Id: <727rkb$nd7$1@news-1.news.gte.net>

Hello all -

Here is the situation:  I have a number of perl scripts (6) that I
need to run unattended.  Here are the names of the files:

0 - load_employee.pl
1 - load_group_inbox.pl
2 - load_users.pl
3 - load_hou_company.pl
4 - load_wal_company.pl
5 - migrate_incident.pl

Scripts 0, 3, and 4 must be run first, but can be run at the same
time.  Script 1 must be run before script 2.  Script 5 must be run
last.  Each of these scripts takes a command line argument of a file
name.

What I was thinking of doing was using system(filename0 &bg),
system(filename3 &bg), system(filename4 &bg) to run them in the
background and then run scripts 1,2, and 5.  This doesn't seem like
the optimal way of doing things and because the dataload will take at
least 15 hours as it is, I'd like to save as many cycles as possible.

All of this is being done on HP-UX 10.x with perl v5.001.

Thanks in advance for any advice you may be able to provide.

Christian M. Aranda
Impact Innovations Group
christian.aranda@iiginc.com


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

Date: Mon, 09 Nov 1998 22:54:35 GMT
From: christian.aranda@iiginc.com (Christian M. Aranda)
Subject: Running perl scripts inside perl scripts (TIA)
Message-Id: <727rr9$ou7$1@news-1.news.gte.net>

Hello all -

Here is the situation:  I have a number of perl scripts (6) that I
need to run unattended.  Here are the names of the files:

0 - load_employee.pl
1 - load_group_inbox.pl
2 - load_users.pl
3 - load_hou_company.pl
4 - load_wal_company.pl
5 - migrate_incident.pl

Scripts 0, 3, and 4 must be run first, but can be run at the same
time.  Script 1 must be run before script 2.  Script 5 must be run
last.  Each of these scripts takes a command line argument of a file
name.

What I was thinking of doing was using system(filename0 &bg),
system(filename3 &bg), system(filename4 &bg) to run them in the
background and then run scripts 1,2, and 5.  This doesn't seem like
the optimal way of doing things and because the dataload will take at
least 15 hours as it is, I'd like to save as many cycles as possible.

All of this is being done on HP-UX 10.x with perl v5.001.

Thanks in advance for any advice you may be able to provide.

Christian M. Aranda
Impact Innovations Group
christian.aranda@iiginc.com


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

Date: Mon, 09 Nov 1998 22:56:31 GMT
From: christian.aranda@iiginc.com (Christian M. Aranda)
Subject: Running perl scripts inside perl scripts (TIA)
Message-Id: <727rut$dd5$1@news-2.news.gte.net>

Hello all -

Here is the situation:  I have a number of perl scripts (6) that I
need to run unattended.  Here are the names of the files:

0 - load_employee.pl
1 - load_group_inbox.pl
2 - load_users.pl
3 - load_hou_company.pl
4 - load_wal_company.pl
5 - migrate_incident.pl

Scripts 0, 3, and 4 must be run first, but can be run at the same
time.  Script 1 must be run before script 2.  Script 5 must be run
last.  Each of these scripts takes a command line argument of a file
name.

What I was thinking of doing was using system(filename0 &bg),
system(filename3 &bg), system(filename4 &bg) to run them in the
background and then run scripts 1,2, and 5.  This doesn't seem like
the optimal way of doing things and because the dataload will take at
least 15 hours as it is, I'd like to save as many cycles as possible.

All of this is being done on HP-UX 10.x with perl v5.001.

Thanks in advance for any advice you may be able to provide.

Christian M. Aranda
Impact Innovations Group
christian.aranda@iiginc.com


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

Date: Mon, 09 Nov 1998 22:44:56 GMT
From: christian.aranda@iiginc.com (Christian M. Aranda)
Subject: Running perl scripts inside perl scripts (TIA)
Message-Id: <727r95$l5g$1@news-1.news.gte.net>

Hello all -

Here is the situation:  I have a number of perl scripts (6) that I
need to run unattended.  Here are the names of the files:

0 - load_employee.pl
1 - load_group_inbox.pl
2 - load_users.pl
3 - load_hou_company.pl
4 - load_wal_company.pl
5 - migrate_incident.pl

Scripts 0, 3, and 4 must be run first, but can be run at the same
time.  Script 1 must be run before script 2.  Script 5 must be run
last.  Each of these scripts takes a command line argument of a file
name.

What I was thinking of doing was using system(filename0 &bg),
system(filename3 &bg), system(filename4 &bg) to run them in the
background and then run scripts 1,2, and 5.  This doesn't seem like
the optimal way of doing things and because the dataload will take at
least 15 hours as it is, I'd like to save as many cycles as possible.

All of this is being done on HP-UX 10.x with perl v5.001.

Thanks in advance for any advice you may be able to provide.

Christian M. Aranda
Impact Innovations Group
christian.aranda@iiginc.com


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

Date: Mon, 9 Nov 1998 18:00:40 -0500
From: "Christian M. Aranda" <christian.aranda@iiginc.com>
Subject: Running perl scripts inside perl scripts (TIA)
Message-Id: <727s6n$pqi$1@news-1.news.gte.net>

Hello all -

Here is the situation:  I have a number of perl scripts (6) that I need to
run unattended.  Here are the names of the files:

0 - load_employee.pl
1 - load_group_inbox.pl
2 - load_users.pl
3 - load_hou_company.pl
4 - load_wal_company.pl
5 - migrate_incident.pl

Scripts 0, 3, and 4 must be run first, but can be run at the same time.
Script 1 must be run before script 2.  Script 5 must be run last.  Each of
these scripts takes a command line argument of a file name.

What I was thinking of doing was using system(filename0 &bg),
system(filename3 &bg), system(filename4 &bg) to run them in the background
and then run scripts 1,2, and 5.  This doesn't seem like the optimal way of
doing things and because the dataload will take at least 15 hours as it is,
I'd like to save as many cycles as possible.

All of this is being done on HP-UX 10.x with perl v5.001.

Thanks in advance for any advice you may be able to provide.

Christian M. Aranda
Impact Innovations Group
christian.aranda@iiginc.com




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

Date: 9 Nov 1998 22:40:43 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Security problem with a simple CGI perl-ism
Message-Id: <727r1b$dur@fcnews.fc.hp.com>

I've made a rather troubling discovery. In perl, using the folowing
simple code:

  use CGI;
  use HTML::Entities;
  ...
  $cgi=new CGI;
  $field=encode_entities($cgi->param('somefield'));

can open up a security hole. If the query string has _two_ "somefield"
items in it, the $cgi->param will return a two-item
list. Unfortunately, the second parameter the encode_entities
specifies the "dangerous" characters to quote, and is passed to eval
as such:

  $subst{$_[1]} =
    eval "sub {\$_[0] =~ s/([$_[1]])/\$char2entity{\$1}/g; }";

It's not hard to imagine that this could be exploited to have a simple
form submission run an arbitrary command on the web server (hopefully,
however, as an underprivileged user such as "www"). I stumbled across
this problem when the second parameter contained a '/', causing the
eval to fail and my script to die with a syntax error.

I'm at a loss for simple solutions that don't break compatibility with
a large body of code that uses CGI::param and/or
HTML::Entities::encode_entities. For now, to make sure you don't have
this problem, use something like:

  $field=encode_entities(($cgi->param('somefield'))[0]);

or

  $field=encode_entities(join(",",$cgi->param('somefield')));

Hopefully I'm not just fretting over something already discussed
and/or fixed.

Andrew


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

Date: Tue, 10 Nov 1998 01:27:35 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Sending SOLICITED bulk mail.
Message-Id: <bEM12.113$ay.210944@nsw.nnrp.telstra.net>

In article <726n30$1ge$1@nnrp1.dejanews.com>,
	angus@od-site.com writes:

> Short of a foreach ($recp){ open(MAIL | sendmail $recp) etc}
> has anyone got a program which does this a little more efficiently without
> killing my server !  I can hack perl, but my sendmail knowledge is limited.
> 
> Any suggestion appreciated,

Let me suggest that you ask questions about sendmail in an appropriate
group. While there are probably many people here who know about
sendmail, your chances are a lot better in a group that specifically
talks about it.

You could use dejanews to find such a group.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: Tue, 10 Nov 1998 01:59:29 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Shared CGI.pm from various directories
Message-Id: <Pine.GSO.4.02A.9811091755050.2742-100000@user2.teleport.com>

On Mon, 9 Nov 1998 bill_mcintyre@my-dejanews.com wrote:

> > Good answer: Use 'use lib' properly and you can tell perl where to find
> > your module.

> I would love to 'use lib' properly. What should I read to learn how to
> do that. I tried the man pages but I guess I missed something.

Did you see that lib has its own manpage? 'perldoc lib' should show it to
you. But, in most cases, you want something like this, in which you give
the name of the directory which contains your modules.

	use lib '/my/lib/dir';

> > Best answer: Install 5.004 or later properly, and this problem (and
> > others) will go away.

> I will contact my ISP and ask them to do this. ( Does 5.004 come with
> CGI.pm? is this why te newer version would fix this problem? )

Exactly right. It may help to point out to the ISP that there are CERT
advisories suggesting upgrading any version prior to 5.004. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 10 Nov 1998 00:34:24 GMT
From: kellyj@advtech.uswest.com
Subject: Shared Libs from XS code
Message-Id: <7281mg$7bm$1@nnrp1.dejanews.com>

I have got some shared libraries for which I want to write an XS extension
(OS=Linux,CC=gcc).  I have everything working, except perl seems to insist
that my .so files be located in directory ../lib from wherever you are
executing.

I've tried all forms of addding -L to LIBS, LDDLFLAGS, LDFLAGS in Makefile.PL,
and I've tried coaxing LD_LIBRARY_PATH (which just seems to be ignored), I've
tried looking in "Advanced Perl Programming", "Effective Perl," etc., and I'm
getting nowhere.  Perl stubbornly tries "../lib/lib-mylib.so", fails (if not
there, succeeds otherwise), and quits.

I've taken a look at sybperl, which needs the Sybase *.so files, and I just
don't see what's different.  Perl goes straight to /opt/sybase/lib/*.so,
regardless of what's in LD_LIBRARY_PATH.

Can anybody tell me how perl finds external *.so files from extensions?

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 09 Nov 1998 15:34:16 -0500
From: Seth Gordon <sgordon@kenan.com>
To: lr@hpl.hp.com, fl_aggie@thepentagon.com
Subject: Re: VARIABLES DE ENTORNO CGI
Message-Id: <364751C8.FF445964@kenan.com>

Larry Rosler:
> + Actually, that's surprisingly comprehensible....

I R A Aggie:

> > I think you meant to say:
> >
> > Realmente, eso es asombrosamente comprensible....

Larry Rosler:

> No, I meant to say:
>
> Really, that is amazingly comprehensible...

"Realmente" does not mean "really".  It means "soon".

ObPerl: there has been some discussion on this group about "got-me"s in Perl.
The above is a "got-me" in Spanish....

--
perl -le'$m="r 0rJaa.u0cksthe";$c=967150;s/$/substr$m,($i\
+=$c%2?4:1)%=16,1or$i-2?"no":"Perl h"/e while$c>>=1;print'
== seth gordon == sgordon@kenan.com == standard disclaimer ==
== documentation group, kenan systems corp., cambridge, ma ==




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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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