[8897] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2513 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 6 10:17:15 1998

Date: Wed, 6 May 98 07:01:16 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 6 May 1998     Volume: 8 Number: 2513

Today's topics:
        Another Odd Regexp Question - Buggy Behaviour? <dballing@speedchoice.com>
    Re: CGI call: open or save as file??? (Hakan Hjelmstrom)
    Re: cgi-lib (Hakan Hjelmstrom)
    Re: chdir in Win NT scott@softbase.com
    Re: COUNTING DAYS UNTIL 2000 (I R A Aggie)
    Re: CPAN & Module gripes (was Re: Ever Wonder...?) (Chris Nandor)
    Re: deleting lines from file help (Mark-Jason Dominus)
    Re: Ever Wonder Why Not Everyone Uses Modules? (Chris Nandor)
    Re: Ever Wonder Why Not Everyone Uses Modules? (Chris Nandor)
    Re: Ever Wonder Why Not Everyone Uses Modules? <tchrist@mox.perl.com>
        From Linux/perl to MS SQL <arturcz@kerigma.cyf.gov.pl>
    Re: From Linux/perl to MS SQL <beske@worldnet.att.net>
        Help with comma seperated file with "'s inside fields <tomc@kendeco.com>
    Re: HELP: line continuation character appears to fail <webmaster@fccjmail.fccj.org>
    Re: How to upload file <shurik@iron.Te.NeT.UA>
    Re: HTML Strip Tags (Tad McClellan)
    Re: HTML::Parser to remove all tags pverdret@sonovision-itep.fr
    Re: is it possible to parameterize a class name? (Ed.Q.Bridges)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 06 May 1998 08:28:03 -0500
From: Derek Balling <dballing@speedchoice.com>
Subject: Another Odd Regexp Question - Buggy Behaviour?
Message-Id: <8A508F448C3892E7.0803A827DB279281.D90E7868BEFE2EFB@library-proxy.airnews.net>

OK, I am using a regexp to parse an automated request for
provisioning of a cable modem.

I'm using the regexp:

$foo = $1 if $request =~ /modem (\d{5,6})/gs;

Which should find the either five or six digit modem UUID
following the word "modem" in the request string. (Where the
message has been parsed to just be line1\nline2\nline3)

This WORKS in the following example:

--- DEBUG OUTPUT 1 ---
Looking for regex /modem (\d{5,6})/sg in :
'
A request has been made to provision modem 99999, a CCM201
modem, with 10 usable IP addresses for Cablemaster ID
123456-01.
REQUESTOR: derek


Downstream:     PHOENIX DOWN4
Upstream Modem: 602-555-1212
Call Waiting? : NO
Customer Name : Test USer
Address1:       77777 Do Not Create
Address2:       Phoenix AZ 88888
Address3:
Phone Number:   550-555-5555

'
Found '99999'  
--- END DEBUG OUTPUT ---

So I would say "OK, that works!"  ***EXCEPT*** if a string
elsewhere in the text is changed, as in THIS example

--- DEBUG OUTPUT 2 ---
Looking for regex /modem (\d{5,6})/sg in :
'
A request has been made to provision modem 99999, a CCM201
modem, with 10 usable IP addresses for Cablemaster ID PCTV.
REQUESTOR: derek
RESPONSIBLE: foobar

Downstream:     PHOENIX DOWN4
Upstream Modem: 602-555-1212
Call Waiting? : NO
Customer Name : Test USer
Address1:       77777 Do Not Create
Address2:       Phoenix AZ 88888
Address3:
Phone Number:   550-555-5555

'
Found ''            
--- END DEBUG OUTPUT ---

Any thoughts as to why this would be like this? I know I
need to key off of "modem" because 5-6 digit numeric strings
appear elsewhere in the request (zip code, long street
numbers, etc.), but adding the modem portion seems to break
it when the data on subsequent lines, which seem to be
irrelevant, are different.

I've tried a number of variations (keying on the ,
afterward, changing the ' ' in the regex to \s, etc. It
seems to be unaffected.

Derek


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

Date: Wed, 06 May 1998 13:45:17 GMT
From: hawk@algonet.se (Hakan Hjelmstrom)
Subject: Re: CGI call: open or save as file???
Message-Id: <35505fc9.81505999@news.algonet.se>

On Wed, 06 May 1998 08:29:56 +0200, Thomas Hack wrote:
> From a HTML-page, I submit a form:
> <FORM METHOD=POST ACTION="c:/inetpub/wwwroot/cgi-bin/test.pl">
<snip>
> Basically, it is the same as if typing test.pl at the DOS-prompt.  
> My system: NT4.0, Peer Web Server, Perl5 port for Windows32,
> all paths set, .pl associated with perl.exe, execute permissions

You might consider running the script through your web server.
Your "ACTION"-parameter should point at
"http://yourhost/cgi-bin/test.pl" or something similar.

Hekan Hjelmstrvm
hawk@algonet.se


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

Date: Wed, 06 May 1998 13:45:21 GMT
From: hawk@algonet.se (Hakan Hjelmstrom)
Subject: Re: cgi-lib
Message-Id: <35516076.81678667@news.algonet.se>

On Wed, 06 May 1998 00:11:10 -0600, trieu8@hotmail.com wrote:
> I'm learning CGI & Perl, and I have to use CGI-lib.pl for my project. 
> I put it in cgi-bin and it works alright in Unix, but when I call my script form HTML,
> I always have an alert box "Document contains no data". 

You mean it works OK from the shell prompt but not from your browser?
Be sure you're actually returning a valid Content-type of text/html
followed by *two* newlines at the beginning of your script.

> I don't know why I have that although I fill in all the text box of the form?

This is not the same "form" containing no data. You're browser is
telling you that the script returned nothing useful to display
(probably due to aforementioned Content-type header).

Hekan Hjelmstrvm
hawk@algonet.se


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

Date: 6 May 1998 11:52:11 GMT
From: scott@softbase.com
Subject: Re: chdir in Win NT
Message-Id: <6ipitb$tka$1@mainsrv.main.nc.us>

Oren  Levine (olevine@clalit.co.il) wrote:
> I adapted a search engine script to work with NT.
> I have a problem with the following:
> sub get_files {

>    chdir ($basedir);
> However, chdir won't work.

It works for me.  I use it all the time. The thing to
look for is path problems. Try not using \ as the
path separator.

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: Wed, 06 May 1998 09:23:00 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: COUNTING DAYS UNTIL 2000
Message-Id: <fl_aggie-0605980923000001@aggie.coaps.fsu.edu>

In article <01bd7860$50183840$a44a6dc2@earl.esense.nl>, "Mathijs Oosterom"
<thijs@esense.nl> wrote:

+ Hi there,
+ 
+ Does anyone has a Perl-script that counts the days until the year 2000? 

Yep. It uses some modules, and if you don't have them, it won't work.

James

#!/usr/bin/perl -w
#-- -*-perl-*-
#use Date::Manip;

use Time::JulianDay;

$dday=31;
$dmon=12;
$dyear=1999;
$jd1=julian_day($dyear,$dmon,$dday);

(undef,undef,undef,$mday,$mon,$year,undef,undef,undef)=localtime();
$year=1900+$year;
$mon++;
$jd2=julian_day($year,$mon,$mday);

$days_left=$jd1-$jd2;

print "Only $days_left days till the Year 2000 bug hits!\n";

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>


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

Date: Wed, 06 May 1998 12:36:19 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: CPAN & Module gripes (was Re: Ever Wonder...?)
Message-Id: <pudge-0605980834270001@192.168.0.3>

In article <354FE0C3.5D93653E@coos.dartmouth.edu>, rjk@coos.dartmouth.edu wrote:

# Chris Nandor wrote:
# > 
# > In article <6ila3p$53b$2@marina.cinenet.net>, cberry@cinenet.net (Craig
# > Berry) wrote:
# > 
# > # CPAN consists entirely of a search/retrieval interface plus the contained
# > # modules.  Of these, the modules are by far the more important part.  If
# > # the module descriptions suck, then CPAN sucks.
# > 
# > Can you blame Blockbuster because most movies made today suck?  Or a
# > library for certain books that suck?  That makes no sense to me.
# 
# Irrelevant.  Craig wasn't *blaming* CPAN for the poor quality of module
# descriptions.  He simply said that if the module descriptions suck, then CPAN 
# sucks.
# 
# Similarly, if all of the movies that you can rent from Blockbuster suck, then
# Blockbuster sucks.

He did not make the case that all the module descriptions suck.  Or if he
made that case, he made it poorly.  He only made the case that some of
them suck.

Not that I care to continue to argue the points in this thread.  I just
want to show that you are wrong and going to hell and that only the Boston
Perl Mongers can save you, you damned heathen!

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
MacPerl: Power and Ease (ISBN 1881957322), http://www.ptf.com/macperl/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: 6 May 1998 09:47:20 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: deleting lines from file help
Message-Id: <6ippl8$pc7$1@monet.op.net>
Keywords: buckwheat cinema suffice themselves


In article <6io27c$jji$1@gte1.gte.net>,
Douglas Wilson <dgwilson@gte.net> wrote:
>perl -pi -e '($. <= 20000) and $_="";' logfile

The result of that program is a file tat begins with 20,000 blank lines.

The correct program is simpler anyway:

	perl -ni -e 'print if $. > 20_000';



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

Date: Wed, 06 May 1998 12:45:19 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Ever Wonder Why Not Everyone Uses Modules?
Message-Id: <pudge-0605980843260001@192.168.0.3>

In article <m3u373iwpb.fsf@furu.g.aas.no>, Gisle Aas <aas@sn.no> wrote:

# phdss@writeme.comm (Brett Tabke) writes:
# 
# > And yes using it has proven to be the slowest thing I've
# > ever run under Perl.
# 
# The loading time for large modules is a problem.

Right, and this is an important distinction: LWP is not slow (in my
experience), but loading it is.  That distinction is very important.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
MacPerl: Power and Ease (ISBN 1881957322), http://www.ptf.com/macperl/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: Wed, 06 May 1998 12:45:34 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Ever Wonder Why Not Everyone Uses Modules?
Message-Id: <pudge-0605980843410001@192.168.0.3>

In article <o84T1IIelAHS092yn@netins.net>, phdss@netins.net wrote:

# sidebar:I bet in the great war, you would have sided with the
# Shadows? eg:  you come out, kick over a few posts
# every-once-in-awhile and see what survives. which leads to your new
# nick:  Mr. Morden!

No, you're not a geek ...

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
MacPerl: Power and Ease (ISBN 1881957322), http://www.ptf.com/macperl/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: 6 May 1998 13:05:03 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Ever Wonder Why Not Everyone Uses Modules?
Message-Id: <6ipn5v$pj3$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, pudge@pobox.com (Chris Nandor) writes:
:Right, and this is an important distinction: LWP is not slow (in my
:experience), but loading it is.  That distinction is very important.

I can't imagine why. :-)

% wc -l `perl -MLWP  -le 'map { print } values %INC'`
    160 /usr/lib/perl5/site_perl/HTTP/Request.pm
    467 /usr/lib/perl5/Exporter.pm
     96 /usr/lib/perl5/strict.pm
    603 /usr/lib/perl5/i686-linux/5.00403/overload.pm
     66 /usr/lib/perl5/vars.pm
    396 /usr/lib/perl5/site_perl/HTTP/Response.pm
     46 /usr/lib/perl5/site_perl/LWP/MemberMixin.pm
    264 /usr/lib/perl5/site_perl/HTML/HeadParser.pm
    176 /usr/lib/perl5/Carp.pm
    138 /usr/lib/perl5/Time/Local.pm
    129 /usr/lib/perl5/site_perl/LWP/Debug.pm
    249 /usr/lib/perl5/site_perl/HTML/Entities.pm
    540 /usr/lib/perl5/site_perl/HTTP/Headers.pm
    330 /usr/lib/perl5/site_perl/HTTP/Date.pm
    249 /usr/lib/perl5/AutoLoader.pm
    724 /usr/lib/perl5/site_perl/LWP/UserAgent.pm
    433 /usr/lib/perl5/site_perl/HTML/Parser.pm
    936 /usr/lib/perl5/site_perl/URI/URL.pm
    233 /usr/lib/perl5/site_perl/HTTP/Status.pm
    592 /usr/lib/perl5/site_perl/LWP.pm
    208 /usr/lib/perl5/site_perl/HTTP/Message.pm
    303 /usr/lib/perl5/site_perl/LWP/Protocol.pm
   7338 total

Here are some other, um, interesting examples:

% wc -l `perl -MCGI -le 'map { print } values %INC'`
   5863 /usr/lib/perl5/CGI.pm
    603 /usr/lib/perl5/i686-linux/5.00403/overload.pm
   6466 total

Hey, at least it's not many files, and a lot of doc!

% wc -l `perl -MCurses -le 'map { print } values %INC'`
    569 /usr/lib/perl5/site_perl/Curses.pm
    734 /usr/lib/perl5/i686-linux/5.00403/Config.pm
    176 /usr/lib/perl5/Carp.pm
    249 /usr/lib/perl5/AutoLoader.pm
    467 /usr/lib/perl5/Exporter.pm
    693 /usr/lib/perl5/i686-linux/5.00403/DynaLoader.pm
     66 /usr/lib/perl5/vars.pm
   2954 total

And we used to think curses large.

% wc -l `perl -MIO -le 'map { print } values %INC'`
    158 /usr/lib/perl5/Tie/Hash.pm
    253 /usr/lib/perl5/IO/Pipe.pm
    104 /usr/lib/perl5/Symbol.pm
    734 /usr/lib/perl5/i686-linux/5.00403/Config.pm
     99 /usr/lib/perl5/i686-linux/5.00403/Fcntl.pm
     51 /usr/lib/perl5/IO.pm
     96 /usr/lib/perl5/strict.pm
    467 /usr/lib/perl5/Exporter.pm
     66 /usr/lib/perl5/vars.pm
     52 /usr/lib/perl5/SelectSaver.pm
    144 /usr/lib/perl5/IO/Socket/UNIX.pm
    693 /usr/lib/perl5/i686-linux/5.00403/DynaLoader.pm
     68 /usr/lib/perl5/IO/Seekable.pm
    240 /usr/lib/perl5/IO/Dir.pm
    176 /usr/lib/perl5/Carp.pm
    166 /usr/lib/perl5/IO/File.pm
    281 /usr/lib/perl5/i686-linux/5.00403/Socket.pm
    479 /usr/lib/perl5/Class/Struct.pm
    113 /usr/lib/perl5/File/stat.pm
    370 /usr/lib/perl5/IO/Socket/INET.pm
    249 /usr/lib/perl5/AutoLoader.pm
    409 /usr/lib/perl5/IO/Socket.pm
    577 /usr/lib/perl5/IO/Handle.pm
   6045 total

Which is a remarkably expensive thing just to get ->autoflush() methods
for kids afraid of $| and *FH.

% wc -l `perl -MTk  -le 'map { print } values %INC'`
     92 /usr/lib/perl5/site_perl/Tk/Pretty.pm
      3 /usr/lib/perl5/site_perl/auto/Tk/MainWindow/autosplit.ix
    104 /usr/lib/perl5/Symbol.pm
    734 /usr/lib/perl5/i686-linux/5.00403/Config.pm
    365 /usr/lib/perl5/site_perl/Tk/Frame.pm
     72 /usr/lib/perl5/site_perl/Tk/Toplevel.pm
     96 /usr/lib/perl5/strict.pm
    467 /usr/lib/perl5/Exporter.pm
     66 /usr/lib/perl5/vars.pm
      8 /usr/lib/perl5/site_perl/auto/Tk/Wm/autosplit.ix
     49 /usr/lib/perl5/site_perl/auto/Tk/Widget/autosplit.ix
    573 /usr/lib/perl5/site_perl/Tk.pm
    693 /usr/lib/perl5/i686-linux/5.00403/DynaLoader.pm
     13 /usr/lib/perl5/site_perl/auto/Tk/Frame/autosplit.ix
      4 /usr/lib/perl5/site_perl/auto/Tk/Toplevel/autosplit.ix
    176 /usr/lib/perl5/Carp.pm
     29 /usr/lib/perl5/site_perl/auto/Tk/autosplit.ix
    303 /usr/lib/perl5/site_perl/Tk/CmdLine.pm
    215 /usr/lib/perl5/site_perl/Tk/MainWindow.pm
     68 /usr/lib/perl5/site_perl/Tk/Submethods.pm
     61 /usr/lib/perl5/site_perl/Tk/Configure.pm
    249 /usr/lib/perl5/AutoLoader.pm
    523 /usr/lib/perl5/site_perl/Tk/Derived.pm
     70 /usr/lib/perl5/site_perl/Tk/Image.pm
    117 /usr/lib/perl5/site_perl/Tk/Wm.pm
    994 /usr/lib/perl5/site_perl/Tk/Widget.pm
   6144 total

Barely beats IO.  Amazing.

% wc -l `perl -MDate::Manip -le 'map { print } values %INC'`
    734 /usr/lib/perl5/i686-linux/5.00403/Config.pm
    104 /usr/lib/perl5/Symbol.pm
     99 /usr/lib/perl5/i686-linux/5.00403/Fcntl.pm
     51 /usr/lib/perl5/IO.pm
    467 /usr/lib/perl5/Exporter.pm
     96 /usr/lib/perl5/strict.pm
     66 /usr/lib/perl5/vars.pm
    404 /usr/lib/perl5/Cwd.pm
     52 /usr/lib/perl5/SelectSaver.pm
   5325 /usr/lib/perl5/site_perl/Date/Manip.pm
    693 /usr/lib/perl5/i686-linux/5.00403/DynaLoader.pm
     68 /usr/lib/perl5/IO/Seekable.pm
    176 /usr/lib/perl5/Carp.pm
    166 /usr/lib/perl5/IO/File.pm
     32 /usr/lib/perl5/integer.pm
    249 /usr/lib/perl5/AutoLoader.pm
    577 /usr/lib/perl5/IO/Handle.pm
   9359 total

Dates for a mere ten thousand lines.  Have a nice day.  Ok, much of
that is pod, but still, it often needs to be pawed through anyway.
And opening files isn't for free.

For even more fun

% strace perl -MTk -e 0 |& sed -ne '/^open/s/,.*//p' | cat -n 
     1	open("/etc/ld.so.cache"
     2	open("/usr/local/lib/libgdbm.so.2"
     3	open("/usr/lib/libgdbm.so.2"
     4	open("/usr/local/lib/libdb.so.2"
     5	open("/usr/lib/libdb.so.2"
     6	open("/usr/local/lib/libdl.so.1"
     7	open("/usr/lib/libdl.so.1"
     8	open("/usr/lib/X11/libdl.so.1"
     9	open("/usr/openwin/lib/libdl.so.1"
    10	open("/mnt/usr/local/lib/libdl.so.1"
    11	open("/mnt/usr/lib/libdl.so.1"
    12	open("/mnt/usr/lib/X11/libdl.so.1"
    13	open("/mnt/usr/openwin/lib/libdl.so.1"
    14	open("/lib/libdl.so.1.7.14"
    15	open("/usr/local/lib/libm.so.5"
    16	open("/usr/lib/libm.so.5"
    17	open("/usr/lib/X11/libm.so.5"
    18	open("/usr/openwin/lib/libm.so.5"
    19	open("/mnt/usr/local/lib/libm.so.5"
    20	open("/mnt/usr/lib/libm.so.5"
    21	open("/mnt/usr/lib/X11/libm.so.5"
    22	open("/mnt/usr/openwin/lib/libm.so.5"
    23	open("/usr/i486-linux-libc5/lib/libm.so.5.0.6"
    24	open("/usr/local/lib/libc.so.5"
    25	open("/usr/lib/libc.so.5"
    26	open("/usr/lib/X11/libc.so.5"
    27	open("/usr/openwin/lib/libc.so.5"
    28	open("/mnt/usr/local/lib/libc.so.5"
    29	open("/mnt/usr/lib/libc.so.5"
    30	open("/mnt/usr/lib/X11/libc.so.5"
    31	open("/mnt/usr/openwin/lib/libc.so.5"
    32	open("/usr/i486-linux-libc5/lib/libc.so.5.3.12"
    33	open("/usr/share/locale/C/LC_MESSAGES"
    34	open("/usr/share/locale/C/LC_MONETARY"
    35	open("/usr/share/locale/C/LC_COLLATE"
    36	open("/usr/share/locale/C/LC_TIME"
    37	open("/usr/share/locale/C/LC_NUMERIC"
    38	open("/usr/share/locale/C/LC_CTYPE"
    39	open("/tmp/perl-ea11459"
    40	open("/tmp/perl-ea11459"
    41	open("/home/tchrist/perllib/i686-linux/Tk.pm"
    42	open("/home/tchrist/perllib/Tk.pm"
    43	open("/usr/lib/perl5/i686-linux/5.00403/Tk.pm"
    44	open("/usr/lib/perl5/Tk.pm"
    45	open("/usr/lib/perl5/site_perl/i686-linux/Tk.pm"
    46	open("/usr/lib/perl5/site_perl/Tk.pm"
    47	open("/home/tchrist/perllib/i686-linux/AutoLoader.pm"
    48	open("/home/tchrist/perllib/AutoLoader.pm"
    49	open("/usr/lib/perl5/i686-linux/5.00403/AutoLoader.pm"
    50	open("/usr/lib/perl5/AutoLoader.pm"
    51	open("/home/tchrist/perllib/i686-linux/vars.pm"
    52	open("/home/tchrist/perllib/vars.pm"
    53	open("/usr/lib/perl5/i686-linux/5.00403/vars.pm"
    54	open("/usr/lib/perl5/vars.pm"
    55	open("/home/tchrist/perllib/i686-linux/Carp.pm"
    56	open("/home/tchrist/perllib/Carp.pm"
    57	open("/usr/lib/perl5/i686-linux/5.00403/Carp.pm"
    58	open("/usr/lib/perl5/Carp.pm"
    59	open("/home/tchrist/perllib/i686-linux/Exporter.pm"
    60	open("/home/tchrist/perllib/Exporter.pm"
    61	open("/usr/lib/perl5/i686-linux/5.00403/Exporter.pm"
    62	open("/usr/lib/perl5/Exporter.pm"
    63	open("/usr/lib/perl5/site_perl/auto/Tk/autosplit.ix"
    64	open("/home/tchrist/perllib/i686-linux/DynaLoader.pm"
    65	open("/home/tchrist/perllib/DynaLoader.pm"
    66	open("/usr/lib/perl5/i686-linux/5.00403/DynaLoader.pm"
    67	open("/home/tchrist/perllib/i686-linux/Config.pm"
    68	open("/home/tchrist/perllib/Config.pm"
    69	open("/usr/lib/perl5/i686-linux/5.00403/Config.pm"
    70	open("/home/tchrist/perllib/i686-linux/strict.pm"
    71	open("/home/tchrist/perllib/strict.pm"
    72	open("/usr/lib/perl5/i686-linux/5.00403/strict.pm"
    73	open("/usr/lib/perl5/strict.pm"
    74	open("/home/tchrist/perllib/i686-linux/Symbol.pm"
    75	open("/home/tchrist/perllib/Symbol.pm"
    76	open("/usr/lib/perl5/i686-linux/5.00403/Symbol.pm"
    77	open("/usr/lib/perl5/Symbol.pm"
    78	open("/home/tchrist/perllib/i686-linux/Tk/Submethods.pm"
    79	open("/home/tchrist/perllib/Tk/Submethods.pm"
    80	open("/usr/lib/perl5/i686-linux/5.00403/Tk/Submethods.pm"
    81	open("/usr/lib/perl5/Tk/Submethods.pm"
    82	open("/usr/lib/perl5/site_perl/i686-linux/Tk/Submethods.pm"
    83	open("/usr/lib/perl5/site_perl/Tk/Submethods.pm"
    84	open("/etc/ld.so.cache"
    85	open("/usr/lib/perl5/site_perl/i686-linux/auto/Tk/Tk.so"
    86	open("/usr/X11R6/lib/libX11.so.6"
    87	open("/home/tchrist/perllib/i686-linux/Tk/Widget.pm"
    88	open("/home/tchrist/perllib/Tk/Widget.pm"
    89	open("/usr/lib/perl5/i686-linux/5.00403/Tk/Widget.pm"
    90	open("/usr/lib/perl5/Tk/Widget.pm"
    91	open("/usr/lib/perl5/site_perl/i686-linux/Tk/Widget.pm"
    92	open("/usr/lib/perl5/site_perl/Tk/Widget.pm"
    93	open("/usr/lib/perl5/site_perl/auto/Tk/Widget/autosplit.ix"
    94	open("/home/tchrist/perllib/i686-linux/Tk/Image.pm"
    95	open("/home/tchrist/perllib/Tk/Image.pm"
    96	open("/usr/lib/perl5/i686-linux/5.00403/Tk/Image.pm"
    97	open("/usr/lib/perl5/Tk/Image.pm"
    98	open("/usr/lib/perl5/site_perl/i686-linux/Tk/Image.pm"
    99	open("/usr/lib/perl5/site_perl/Tk/Image.pm"
   100	open("/home/tchrist/perllib/i686-linux/Tk/MainWindow.pm"
   101	open("/home/tchrist/perllib/Tk/MainWindow.pm"
   102	open("/usr/lib/perl5/i686-linux/5.00403/Tk/MainWindow.pm"
   103	open("/usr/lib/perl5/Tk/MainWindow.pm"
   104	open("/usr/lib/perl5/site_perl/i686-linux/Tk/MainWindow.pm"
   105	open("/usr/lib/perl5/site_perl/Tk/MainWindow.pm"
   106	open("/usr/lib/perl5/site_perl/auto/Tk/MainWindow/autosplit.ix"
   107	open("/home/tchrist/perllib/i686-linux/Tk/CmdLine.pm"
   108	open("/home/tchrist/perllib/Tk/CmdLine.pm"
   109	open("/usr/lib/perl5/i686-linux/5.00403/Tk/CmdLine.pm"
   110	open("/usr/lib/perl5/Tk/CmdLine.pm"
   111	open("/usr/lib/perl5/site_perl/i686-linux/Tk/CmdLine.pm"
   112	open("/usr/lib/perl5/site_perl/Tk/CmdLine.pm"
   113	open("/home/tchrist/perllib/i686-linux/Tk/Toplevel.pm"
   114	open("/home/tchrist/perllib/Tk/Toplevel.pm"
   115	open("/usr/lib/perl5/i686-linux/5.00403/Tk/Toplevel.pm"
   116	open("/usr/lib/perl5/Tk/Toplevel.pm"
   117	open("/usr/lib/perl5/site_perl/i686-linux/Tk/Toplevel.pm"
   118	open("/usr/lib/perl5/site_perl/Tk/Toplevel.pm"
   119	open("/usr/lib/perl5/site_perl/auto/Tk/Toplevel/autosplit.ix"
   120	open("/home/tchrist/perllib/i686-linux/Tk/Frame.pm"
   121	open("/home/tchrist/perllib/Tk/Frame.pm"
   122	open("/usr/lib/perl5/i686-linux/5.00403/Tk/Frame.pm"
   123	open("/usr/lib/perl5/Tk/Frame.pm"
   124	open("/usr/lib/perl5/site_perl/i686-linux/Tk/Frame.pm"
   125	open("/usr/lib/perl5/site_perl/Tk/Frame.pm"
   126	open("/usr/lib/perl5/site_perl/auto/Tk/Frame/autosplit.ix"
   127	open("/home/tchrist/perllib/i686-linux/Tk/Derived.pm"
   128	open("/home/tchrist/perllib/Tk/Derived.pm"
   129	open("/usr/lib/perl5/i686-linux/5.00403/Tk/Derived.pm"
   130	open("/usr/lib/perl5/Tk/Derived.pm"
   131	open("/usr/lib/perl5/site_perl/i686-linux/Tk/Derived.pm"
   132	open("/usr/lib/perl5/site_perl/Tk/Derived.pm"
   133	open("/home/tchrist/perllib/i686-linux/Tk/Configure.pm"
   134	open("/home/tchrist/perllib/Tk/Configure.pm"
   135	open("/usr/lib/perl5/i686-linux/5.00403/Tk/Configure.pm"
   136	open("/usr/lib/perl5/Tk/Configure.pm"
   137	open("/usr/lib/perl5/site_perl/i686-linux/Tk/Configure.pm"
   138	open("/usr/lib/perl5/site_perl/Tk/Configure.pm"
   139	open("/home/tchrist/perllib/i686-linux/Tk/Pretty.pm"
   140	open("/home/tchrist/perllib/Tk/Pretty.pm"
   141	open("/usr/lib/perl5/i686-linux/5.00403/Tk/Pretty.pm"
   142	open("/usr/lib/perl5/Tk/Pretty.pm"
   143	open("/usr/lib/perl5/site_perl/i686-linux/Tk/Pretty.pm"
   144	open("/usr/lib/perl5/site_perl/Tk/Pretty.pm"
   145	open("/home/tchrist/perllib/i686-linux/Tk/Wm.pm"
   146	open("/home/tchrist/perllib/Tk/Wm.pm"
   147	open("/usr/lib/perl5/i686-linux/5.00403/Tk/Wm.pm"
   148	open("/usr/lib/perl5/Tk/Wm.pm"
   149	open("/usr/lib/perl5/site_perl/i686-linux/Tk/Wm.pm"
   150	open("/usr/lib/perl5/site_perl/Tk/Wm.pm"
   151	open("/usr/lib/perl5/site_perl/auto/Tk/Wm/autosplit.ix"

Boggling, isn't it?  One hundred and fifty-one opens.  Let's
check open file resources:

% perl -MTk -e 'system "lsof -p $$"'

COMMAND   PID    USER   FD   TYPE DEVICE SIZE/OFF  INODE NAME
perl    11503 tchrist  cwd    DIR    8,5    29696 115137 /home (/dev/sda5)
perl    11503 tchrist  rtd    DIR    8,3     1024      2 /
perl    11503 tchrist  mem    REG    8,3   535251 105410 /usr/bin/perl
perl    11503 tchrist  mem    REG    8,3    21367  67586 /lib/ld-linux.so.1
perl    11503 tchrist  mem    REG    8,3    24732  51261 / (/dev/sda3)
perl    11503 tchrist  mem    REG    8,3    62112  51348 /usr/lib/libdb.so.2.0.0
perl    11503 tchrist  mem    REG    8,3     6983  67606 /lib/libdl.so.1.7.14
perl    11503 tchrist  mem    REG    8,3    36309  64029 / -- lib/libm.so.5.0.6
perl    11503 tchrist  mem    REG    8,3   706960  64023 / -- lib/libc.so.5.3.12
perl    11503 tchrist  mem    REG    8,3   510022  29137 /usr/lib/perl/site_perl/i686-linux/auto/Tk/Tk.so
perl    11503 tchrist  mem    REG    8,3   591020  18812 /usr/X11R6/lib/libX11.so.6.0
perl    11503 tchrist    0u   CHR  4,199      0t0  10543 /dev/ttyp7
perl    11503 tchrist    1u   CHR  4,199      0t0  10543 /dev/ttyp7
perl    11503 tchrist    2u   CHR  4,199      0t0  10543 /dev/ttyp7

Well, that's not so bad.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    Let's say the docs present a simplified view of reality...    :-)
            --Larry Wall in  <6940@jpl-devvax.JPL.NASA.GOV>


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

Date: 6 May 1998 11:46:57 GMT
From: "Artur R. Czechowski" <arturcz@kerigma.cyf.gov.pl>
Subject: From Linux/perl to MS SQL
Message-Id: <6ipijh$2n8$1@kerigma.cyf.gov.pl>

Hello
I have a NT box with MS SQL server. There are some databases which I cannot
move to other platform. I have a 2nd box with Linux and perl 5.004. I need
to have to access from perl scripts to data collected on MS-SQL. What I need
to do it? Please, give me descriptions as for idiot - step by step.
HELP!

PS. Commercial sollution also will be satisfied for me.
PS2. Sorry about my terrible english.

Regards
	Artur
-- 
Artur R. Czechowski <arturcz@kerigma.cyf.gov.pl>
See http://pgp.icm.edu.pl/pks/ for PGP public key


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

Date: Wed, 06 May 1998 09:17:15 -0400
From: Bryan Beske <beske@worldnet.att.net>
To: "Artur R. Czechowski" <arturcz@kerigma.cyf.gov.pl>
Subject: Re: From Linux/perl to MS SQL
Message-Id: <6ipnub$fcu@bgtnsc03.worldnet.att.net>

> I have a NT box with MS SQL server. There are some databases which I cannot
> move to other platform. I have a 2nd box with Linux and perl 5.004. I need
> to have to access from perl scripts to data collected on MS-SQL. What I need
> to do it? Please, give me descriptions as for idiot - step by step.
> HELP!
>

    See:

http://www.perl.com/CPAN-local//modules/by-module/DBD/DBD-ODBC-0.14.readme



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

Date: Tue, 5 May 1998 21:46:15 -0500
From: Tom Cross <tomc@kendeco.com>
Subject: Help with comma seperated file with "'s inside fields
Message-Id: <Pine.LNX.3.95.980505213932.20945B-100000@meridian.kendeco.com>


I need to read in a comma seperated file with text fields that have "'s
around it.  I found the neat code in the perl FAQ regarding how to split
it up, however, if a text field has a " character in it, the code splits
it on that character.  I have some part descriptions which contain the
inch sign (") and this is not going to work.  I have no clue how to do
these regular expressions and would appreciate any help!!


Example:

This record contains two text fields, part number and description.  Notice
the description contains the " character.  The code below (found in the
perl FAQ) splits it on the " character after the 3.  If there is a way to
write the regular expression in such a way that it only splits on a " when
its next to a comma or end-of-line/end-of-file?

  $text = '"PARTNUM","DESC PENCIL 3" YELLOW #2",1,2,3,4';

  @new = ();
  push(@new, $+) while $text =~ m{
        "([^\"\\]*(?:\\.[^\"\\]*)*)",?  # groups the phrase inside the
quotes
        | ([^,]+),?
        | ,
        }gx;
  push(@new,undef) if substr($text,-1,-1) eq ',';

  print "$new[0] - $new[1] - $new[2] - $new[3] - $new[4] - $new[5] -
$new[6]\n";


Thanks for any and all help!! 

sign me,

perl newbie

--
Tom Cross                     Voice: 320-253-1020    FAX: 320-253-6956
System Administrator                          E-mail: tomc@kendeco.com
Kendeco Industrial Supply                       http://www.kendeco.com
        St Cloud Area Linux Users Group: http://www.scalug.org



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

Date: Wed, 06 May 1998 10:05:19 GMT
From: Bill 'Sneex' Jones <webmaster@fccjmail.fccj.org>
Subject: Re: HELP: line continuation character appears to fail
Message-Id: <3550341E.1C5883B2@fccjmail.fccj.org>

Calle Dybedahl wrote:

> The danger comes when $file contains "foo;/bin/rm -rf /".

Hmmm, I could actually use a self-contained bomb like this!  Thx! ;-)

On the other hand, I tried it out and it doesn't appear to work!?
What am I doing wrong???

:-)
-Sneex- 
____________________________________________________________________________
Bill Jones | FCCJ Webmaster | Voice 1-904-632-3089 | Fax 1-904-632-3007
Florida Community College at Jacksonville | 501 W. State St. | Jax, FL 32202
mailto:webmaster@fccjmail.fccj.org | http://webmaster.fccj.org/Webmaster


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

Date: 6 May 1998 12:46:39 GMT
From: Alexandr Dubovikov <shurik@iron.Te.NeT.UA>
Subject: Re: How to upload file
Message-Id: <6ipm3f$gso$1@toster.Te.NeT.UA>

Leonid A. Arcadiev ( arcadiev@usa.net ) RANEE PISAL:
> Can anyone advice me a script which will upload files?

> I know there is such a thing like <INPUT TYPE="FILE" NAME="MYFILE> but when
> I try to use it, the only thing I get after submitting a form is the path
> to the file I selected (e.g. C:\PROGRAMS\NETSCAPE\SOMETHING.TXT)

> How can I upload that file itself?

it's HTML form for upload files to your server

<FORM ENCTYPE="multipart/form-data" ACTION="/cgi-bin/upload.cgi" METHOD="POST">\n", 
<INPUT TYPE="FILE" NAME="upload-file" SIZE=35><BR>
<INPUT TYPE="SUBMIT" VALUE="OK">
</FORM>                     

into script you may use module 
use CGI qw(:standard);
$CGI::OS = 'WINDOWS' if ($Windows);
(perldoc CGI)

some samples it's scripts locate on
http://www.cgi-resources.com

> Looking for your help. Please post a reply or send it to arcadiev@usa.net

> Thank you in advance,

> Leonid A. Arcadiev.




 Alexandr Dubovikov * +380 (0482) 260704  
  baron@iRC RusNet  *  shurik@te.net.ua 


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

Date: Wed, 6 May 1998 05:10:34 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: HTML Strip Tags
Message-Id: <qucpi6.hk7.ln@localhost>

Feargal Hogan (feargalh@shipping-guides.co.uk) wrote:

: I have some SGML "snippets" that I would like to convert to straight
: text.


: I need to strip everything from < to the next > inclusive. Is there a
: simple s/// pattern I can use.


   s/<.*?>//g;  

   or

   s/<[^>]*>//g; 


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


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

Date: Wed, 06 May 1998 06:59:16 -0600
From: pverdret@sonovision-itep.fr
Subject: Re: HTML::Parser to remove all tags
Message-Id: <6ipjak$dkr$1@nnrp1.dejanews.com>

In article <6ioqee$o88$1@node17.cwnet.frontiernet.net>#1/1,
  jared@frontiernet.net (Jared Evans) wrote:
>
> I tried this:
>
> use LWP::Simple;
> use HTML::Parse;
> print parse_html(get 'http://www.sn.no/libwww-perl/')->format;
>
> No cigar, as the HTML::Parser v2.17 (latest version?) doesn't have
parse_html.
>
> Is there anything out there that will make it simple for me to remove all
> HTML tags to convert into a simple n' sweet TEXT-only output?
>
> -Jared
>
My own try:

use LWP::Simple;
use HTML::TreeBuilder;
require HTML::FormatText;
my $htmltree = HTML::TreeBuilder->new->parse(get
"http://www.sn.no/libwww-perl/");
my $formatter = HTML::FormatText->new(leftmargin => 0, rightmargin => 50);
print $formatter->format($htmltree);

Hotp this helps,
Philippe

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Wed, 06 May 1998 13:28:14 GMT
From: edb@interport.net (Ed.Q.Bridges)
Subject: Re: is it possible to parameterize a class name?
Message-Id: <35505f1f.35432579@news.spry.com>


when i do this:

	#!/usr/bin/perl
	use Carp;
	use strict;
	use diagnostics;

	my($foo) = shift;
	require "$foo";

	$foo =~ s#/#::#;
	$foo =~ s#\.pm$##;

	my( $Input );

	$Input =  $foo->new;

it works.  when i do this:

	#!/usr/bin/perl
	use Carp;
	use strict;
	use diagnostics;

	my($foo) = shift;
	require "$foo";

	my( $Input );

	$Input =  $foo->new;

i get this:
        Can't call method "new" in empty package "TestInput/Test.pm"
at ./Poll.cgi line 20.


The first isr klugey.  Is there a better way? 

TIA
--ed--



On Tue, 05 May 1998 22:02:09 -0700, Jan Krynicky
<jkry3025@comenius.ms.mff.cuni.cz> wrote:

>Ed.Q.Bridges wrote:
>> 
>> >This has been asked a bunch of times recently.  Maybe it ought to be
>> >added to the FAQ list...  Search DejaNews for the subject line
>> >"*Really* dynamic function loaing?"  There's a thorough answer in that
>> >thread.  You should also
>> 
>> a search on dejanews using this subject line (both with and without
>> typo) returned no results.  do you remember any of the author's names?
>> 
>> >
>> >   C:\> perldoc -f use
>> >
>> >which will explain to you that use Foo; is a synonym for
>> >
>> >   BEGIN { require Foo;  import Foo }
>> >
>> 
>> thanks, i knew that (and tried it) already.  the problem is that
>> a BEGIN forces the require at compile time, not run time.
>> i'm trying to insert a value to be required at runtime.
>> 
>> when i code this:
>>         my($foo) = shift;
>>         BEGIN { require $foo; import $foo; }
>> i get this:
>>         Null filename used at ./main.pl line 9.
>>         BEGIN failed--compilation aborted at ./main.pl line 9.
>> 
>> TIA
>> --e--
>
>If you want the module to be "used" in compile time, you have to do all
>the necessary
>tests to find out what module to use also in compile time, that is in a
>BEGIN{}
>block, textualy before the BEGIN{ require $foo; import $foo; }.
>
>If you do not insist in using it in compile time, omit the BEGIN{} at
>all.
>
>Read man perlfunc to find out what BEGIN{} means.
>
>HTH, Jenda



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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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". 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 2513
**************************************

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