[8749] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2366 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Apr 20 19:07:18 1998

Date: Mon, 20 Apr 98 16:00:30 -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           Mon, 20 Apr 1998     Volume: 8 Number: 2366

Today's topics:
        (Motif and Qt) Re: Mozilla 5.0 (Jason Gloudon)
    Re: ---- Need Help to force a Page to Reload (Jason Gloudon)
    Re: array elements -- how to exclude when reading in? (Craig Berry)
    Re: array elements -- how to exclude when reading in? <jasond@processing.net>
    Re: Carriage return/line feed in text files <philipm@nospam.nafohq.hp.com>
    Re: CGI help for a newbie, easy question <jasond@processing.net>
    Re: DATA filehandle <pholser@nortel.com>
        Dynamic Linking probs on SVR4 (perl 5.004.04) <msg@waste.org>
    Re: Help with regular expression (robert)
    Re: Help with regular expression (Tad McClellan)
    Re: how can I get commands to display? <barnett@houston.Geco-Prakla.slb.com>
    Re: How do I get the name of each file in a dir? (Mark-Jason Dominus)
    Re: How do I get the name of each file in a dir? (Jason Gloudon)
    Re: How do I get the name of each file in a dir? (Jason Gloudon)
        HTML Tables -> Preformatted Text ? (Kevin Smith)
    Re: Image can view but cannot download? (Craig Berry)
    Re: IS THERE SUCH A THING AS MULTI TASKING? <perlguy@inlink.com>
    Re: keys in hashs (Andrew M. Langmead)
    Re: making a window system modal in tk (Jason Gloudon)
    Re: max length of data in sdbm record (Andrew M. Langmead)
    Re: max length of data in sdbm record (Jason Gloudon)
        Newbie question... <umichfan@hotmail.com>
    Re: Newbie question... <beske@worldnet.att.net>
    Re: ODBC and Perl <perlguy@inlink.com>
    Re: Parser works sometimes <aas@sn.no>
    Re: perl and spaces in strings <bmb@ginger.libs.uga.edu>
        PERL en francais SVP eaudet@solution123.com
    Re: Perl module to retrieve a document and send it to a <beske@worldnet.att.net>
    Re: Project question and gripe about (Re: Snobby news g <jdporter@min.net>
    Re: Proplem with perl script (I'm new to perl) <barnett@houston.Geco-Prakla.slb.com>
    Re: Regexp question (Craig Berry)
        Regular Expression to match a valid IP address <robsmith@writeme.com>
    Re: Regular Expression to match a valid IP address <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: RMS should be invited to O'Reilly's "Free Software  <zkessin@lhr-sys.dhl.com>
        sendmail <loo@algonet.se>
    Re: Snobby news group (Abigail)
    Re: Text box alignmnet <barnett@houston.Geco-Prakla.slb.com>
        Win32 OLE Help with function (Jim Hutchins)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 20 Apr 1998 14:09:44 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: (Motif and Qt) Re: Mozilla 5.0
Message-Id: <slrn6jmlju.ne3.jgloudon@manitoba.bbn.com>

robert <robert@il.fontys.nl> wrote:
 .
>If you don't want to use Motif (since, like, it costs money), you could
>check out http://www.troll.no/ for a Qt (a graphical library for X)
>version of Mozilla 5. It compiles and runs on my (quite moderate) machine
>(although rather buggy, but thats seems to be a Mozilla problem rather
>than a Qt problem :).

Qt is only free for non-commercial use, read their license. It may cost money
depending on what you are doing with it. Not that that's a bad thing but it's
misrepresented in many circles as being free of cost.

Like many others I'd wait for a GNU Toolkit port, or use the somewhat buggy
LessTif libraries.

-- 
Jason Gloudon


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

Date: Mon, 20 Apr 1998 13:57:41 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: ---- Need Help to force a Page to Reload
Message-Id: <slrn6jmktc.ne3.jgloudon@manitoba.bbn.com>

Arup Kanjilal <codestorm@mailcity.com> wrote:
>Bulk E-Mail ISP wrote:
 .
 .
>> How do I make the page counter increment each time the search.cgi script
>> is run?
>> 
>> Address replies to mailto:kamenar@webmall.net

A Bulk Email ISP ? Sure.
>
>
>Before you
>
>print "Content-type: whatever/whichever\n\n";
>
>do a 
>
>print "Pragma: no-cache\n";
>
>Be warned, msie blatantly ignores this, ns works great tho

Which is why this, being a non-perl question, should be asked on
comp.infosystems.www.authoring.cgi.

-- 
Jason Gloudon


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

Date: 20 Apr 1998 21:09:55 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: array elements -- how to exclude when reading in?
Message-Id: <6hgdj3$629$3@marina.cinenet.net>

Jonathan Feinberg (jdf@pobox.com) wrote:
: > I need to check BEFORE the record is read into the array for octal
: > character 026 and if this character is present in the record, I do NOT
: > want the record read into the array. 
: 
:    while(<>) {
:       next if /\026/;
:       push @records, $_;
:    }

Or

  while (<>) {
    push @records, $_ unless /\026/;
  }

Or even (for small files)

  @records = grep { !/\026/ } <>;

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Mon, 20 Apr 1998 12:48:19 -0700
From: Jason Daniel <jasond@processing.net>
To: Michael Shavel <mshavel@erols.com>
Subject: Re: array elements -- how to exclude when reading in?
Message-Id: <353BA683.6F8613E9@processing.net>

Perhaps a

while (<>){
    unless ($_ =~ /\026/){
        $records[$index++]=$_;
    }
}

might work?

Just a thought.

Jason Daniel
"My 1st attempt to solve anything!"



Michael Shavel wrote:

> Hi
>
>  I'm using this to read in records from a file on the command line into
> elements of an array :
>
> while(<>)
> {
> $records[$index++] = $_;
> }
>
> I need to check BEFORE the record is read into the array for octal
> character 026 and if this character is present in the record, I do NOT
> want the record read into the array.
>
> I have used several methods AFTER the array has been created, including:
>
> for (@records)
> {
> s/\026//g;
> }
>
> but I always seem to still have an entry for the record that contained
> that 026 character. I am able to remove the character but when I cycle
> through each element for processing later on in the script I still get an
> entry for the array element that contained the 026 character.
>
> So the only solution I can see is to not include the record in the array
> created during the "read in"  ie, while(<>){ $records[$index++] = $_   }
>
> I have found a solution but it is less then ideal. I take out each record
> that does NOT have \026, then open and write to a temp file I create.
> There must be an easier way though.
>
> If anyone has any ideas it would be very helpful.
>
> Thanks very much!
>
> Sincerely
> Mike Shavel
> mshavel@erols.com





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

Date: Mon, 20 Apr 1998 13:35:32 -0700
From: Philip <philipm@nospam.nafohq.hp.com>
Subject: Re: Carriage return/line feed in text files
Message-Id: <353BB193.BA357383@nospam.nafohq.hp.com>

Hello:

This might help:

 ...here is a code snippet from my module, Text::ConvertPlatform, which
is not yet available on CPAN, but can be downloaded from
http://nervepinch.com/perl/
-----
        while (<FILE>) {
                $old .= $_;
                # convert everything to unix first
                s/\015\012/\012/g;
                s/\015/\012/g;
                # if they want dos format
                s/\012/\015\012/g if ($mode eq "dos");
                # if they want mac format
                s/\012/\015/g if ($mode eq "mac");
                $results .= $_;
                }
-----
Regards,


Philip Mikal
 ...to reply, remove "nospam" from my domain.
-----


Larry Rosler wrote:

> Chris King wrote in message <3539a56e.90525006@news.cyberg8t.com>...
> >On Thu, 16 Apr 1998 14:30:00 -0600, Dan Baker <dtbaker_@flash.net>
> >wrote:
> >
> >
> >>I would guess you are forgetting to add the \n at the end of each
> line
> >>you are printing... unless you TELL perl to add a newline, it
> won't...
> >>By the same token, when reading IN text, you almost always have to
> use
> >>the chomp($string) function to remove the newline from the end.
> >
> >You do mean chop($sting) and not chomp($sting), right?
> >
> >Sheila King
>
> No, though chop will usually do what you want.  See the Blue Camel
> (page
> 149).  chomp "removes only any line ending corresponding to the
> current
> value of $/, and not just any last character."  (By default, the value
> of $/
> is "\n".
>
> --
> Larry Rosler
> Hewlett-Packard Laboratories
> lr@hpl.hp.com





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

Date: Mon, 20 Apr 1998 12:56:11 -0700
From: Jason Daniel <jasond@processing.net>
To: Andrew Connell <jconnell@lords.com.nospam>
Subject: Re: CGI help for a newbie, easy question
Message-Id: <353BA85B.D320BB3C@processing.net>

Andrew,

A couple of things come to mind.

1.  Can you run it on the command line?  If not, this might give you a clue.
2.  Have you taken a look at the server logs?  They will tell you why the script
did not execute correctly.

My guess is if the program runs on the command line, you probally do not have
cgi execute permision in
the directory you have put the script in.

What type of Web server (software) do you have?

Jason




Andrew Connell wrote:

> I did both the changes that I were suggested (removing the ; and fixing the
> #!usr/... header), but I am still getting the error.  Any suggestions?
> ------
> Andrew Connell <jconnell@lords.com>
> ICQ#: 4210346   AOL IM: jaconell
> http://jconnell.host4u.com
>
> "No one is too old or too young to do something."
>         -Bobby Sands-
>
> Andrew Connell wrote in message <6hek8e$8hs@bgtnsc02.worldnet.att.net>...
> >
> >I am new to cgi scripting, but i am familiar with perl.  However, I have
> yet
> >to make it work.  I have put a script which I know works in that directory
> >(I know it works because it is straight off a tutorial site).  I have tried
> >the chmod 0755 to the file, but I continue to get the "Internal Server
> >Error: The server encountered an internal error or misconfiguration and was
> >unable to complete your request." error.  Anyone see anything that I am
> >doing wrong or things I should check on?  Please email responses.
> >
> >A copy of the script as well as the URL is located below:
> >http://jconnell.host4u.com/CGI-bin/howdy.pl
> >
> >#!/user/bin/perl -w
> ># howdy--the easiest of CGI programs
> >print <<END_of_Multiline_Text;
> >Content-type: text/html
> >
> ><HTML>
> ><HEAD>
> ><TITLE>Hello World</TITLE>
> ></HEAD>
> ><BODY>
> ><H1>Greetings, Terrans!</H1>
> ></BODY>
> ></HTML>
> >
> >END_of_Multiline_Text;
> >
> >
> >------
> >Andrew Connell <jconnell@lords.com>
> >ICQ#: 4210346   AOL IM: jaconell
> >http://jconnell.host4u.com
> >
> >"No one is too old or too young to do something."
> >        -Bobby Sands-
> >
> >
> >
> >





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

Date: Mon, 20 Apr 1998 08:39:17 -0500
From: Paul Holser <pholser@nortel.com>
Subject: Re: DATA filehandle
Message-Id: <353B5005.1F6D@nortel.com>

Jonathan Stowe wrote:
> 
> On Fri, 17 Apr 1998 17:39:30 -0500, Paul Holser <pholser@nortel.com>
> wrote:
> 
> >
> >-----------------------------
> >#!/usr/bin/perl
> >
> >use Pod::Text;
> >use strict;
> >
> >pod2text( '<&=' . fileno \*DATA );
> >#pod2text( '<&DATA' );
> >
> 
> So whats wrong with :
> 
> pod2text($0);

Nothin'.  Just curious to try something else.

Thanks for your time.

-- 
// Paul Holser ~ Northern Telecom, Inc. ~ pholser@nortel.com
// Wireless Automation Tool Development
// $time ||= time; $time = time unless $time; # is cap-tuuured!...
// "A good craftsman never blames his tools." --Keith Olbermann


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

Date: Mon, 20 Apr 1998 08:40:10 -0700
From: Michael Grigoni <msg@waste.org>
Subject: Dynamic Linking probs on SVR4 (perl 5.004.04)
Message-Id: <353B6C5A.4EBC@waste.org>

Greetings,

Seeking insight on dynamic linking problems for Perl 5.004.04 extensions
NDBM, SDBM and POSIX; system is AT&T SystemV/ix86 R4 V2.1 under Standard
C Development Environment (SCDE).

All tests pass except 'anydbm.t' and 'posix.t'.

Results for 'anydbm.t':

		1..12
		dynamic linker: perl: symbol not found: dbm_open
		Killed

	Checking for symbols containing 'dbm' in 'NDBM_File.so:

[30]	|         0|       0|FILE |LOCL |0    |ABS    |ndbm.c
[37]	|     12804|     148|FUNC |LOCL |0    |9      |dbm_access
[43]	|     11332|      56|FUNC |LOCL |0    |9      |dbm_hashinc
[46]	|     11772|     300|FUNC |LOCL |0    |9      |dbm_slow_nextkey
[59]	|     10216|     176|FUNC |GLOB |0    |9      |dbm_fetch
[60]	|     10088|      32|FUNC |GLOB |0    |9      |dbm_close
[65]	|     12072|     732|FUNC |GLOB |0    |9      |dbm_do_nextkey
[69]	|     11388|     248|FUNC |GLOB |0    |9      |dbm_firsthash
[79]	|      9792|     296|FUNC |GLOB |0    |9      |dbm_open
[88]	|     10120|      96|FUNC |GLOB |0    |9      |dbm_forder
[92]	|     11636|      68|FUNC |GLOB |0    |9      |dbm_firstkey
[95]	|     10612|     720|FUNC |GLOB |0    |9      |dbm_store
[101]	|     10392|     220|FUNC |GLOB |0    |9      |dbm_delete
[106]	|     11704|      68|FUNC |GLOB |0    |9      |dbm_nextkey

	Checking for symbols containing 'dbm' in '/usr/ucblib/libucb.a':

Symbols from libucb.a[ndbm.o]:
[1]	|         0|       0|FILE |LOCL |0    |ABS    |ndbm.c
[11]	|      3096|     148|FUNC |LOCL |0    |2      |dbm_access
[17]	|      1624|      56|FUNC |LOCL |0    |2      |dbm_hashinc
[21]	|      2064|     300|FUNC |LOCL |0    |2      |dbm_slow_nextkey
[28]	|        84|     296|FUNC |GLOB |0    |2      |dbm_open
[36]	|       380|      32|FUNC |GLOB |0    |2      |dbm_close
[37]	|       412|      96|FUNC |GLOB |0    |2      |dbm_forder
[38]	|       508|     176|FUNC |GLOB |0    |2      |dbm_fetch
[39]	|       684|     220|FUNC |GLOB |0    |2      |dbm_delete
[42]	|       904|     720|FUNC |GLOB |0    |2      |dbm_store
[44]	|      1680|     248|FUNC |GLOB |0    |2      |dbm_firsthash
[45]	|      1928|      68|FUNC |GLOB |0    |2      |dbm_firstkey
[46]	|      1996|      68|FUNC |GLOB |0    |2      |dbm_nextkey
[47]	|      2364|     732|FUNC |GLOB |0    |2      |dbm_do_nextkey


	NOTE: 'anydbm.t' using only ODBM passes all tests, but our
		ODBM is based on NDBM...

	      'anydbm.t' fails using only SDBM, but it comes with
	        the perl distribution and so shouldn't depend on
	        local vagueries...

Results for 'posix.t':

		1..17
		ok 1
		ok 2
		ok 3	
		ok 4
		ok 5
		ok 6
		ok 7
		ok 8
		ok 9
		ok 10
		ok 11
		ok 12
		ok 13
		ok 14
		ok 15
		ok 16
		dynamic linker: perl: symbol not found: acos
		Killed

	Checking for symbols containing 'cos' in 'POSIX.so':

[34]	|     72260|     532|FUNC |LOCL |0    |9      |asin_acos
[43]	|     74432|       0|NOTY |LOCL |0    |9      |_cos
[124]	|     74296|       0|NOTY |GLOB |0    |9      |cos
[128]	|     45704|     260|FUNC |GLOB |0    |9      |XS_POSIX_cosh
[184]	|     44664|     260|FUNC |GLOB |0    |9      |XS_POSIX_acos
[210]	|     75628|     132|FUNC |GLOB |0    |9      |cosh
[282]	|     72792|      20|FUNC |GLOB |0    |9      |acos

	Checking for symbols containing 'cos' in '/usr/ccs/lib/libm.a':

Symbols from /usr/ccs/lib/libm.a[acosh.o]:
[1]	|         0|       0|FILE |LOCL |0    |ABS    |acosh.c
[8]	|         0|     308|FUNC |GLOB |0    |2      |acosh
[4]	|        20|     532|FUNC |LOCL |0    |2      |asin_acos
[14]	|       552|      20|FUNC |GLOB |0    |2      |acos
[4]	|        16|     476|FUNC |LOCL |0    |2      |asin_acos
[14]	|       492|      16|FUNC |GLOB |0    |2      |acosf
[33]	|         0|       0|NOTY |GLOB |0    |UNDEF  |cos
[29]	|         0|       0|NOTY |GLOB |0    |UNDEF  |cos
[28]	|         0|       0|NOTY |GLOB |0    |UNDEF  |cos
[7]	|       508|       0|NOTY |LOCL |0    |2      |_cos
[12]	|       372|       0|NOTY |GLOB |0    |2      |cos
[7]	|       468|       0|NOTY |LOCL |0    |2      |_cosf
[12]	|       356|       0|NOTY |GLOB |0    |2      |cosf
[10]	|       308|     132|FUNC |GLOB |0    |2      |cosh
[13]	|       260|     120|FUNC |GLOB |0    |2      |coshf


Output of 'myconfig' program:


Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
  Platform:
    osname=svr4, osvers=, archname=i386-svr4
    uname='sysv bigsys 4.0 2.1 i386 386at '
    hint=recommended, useposix=true, d_sigaction=define
    bincompat3=n useperlio=undef d_sfio=undef
  Compiler:
    cc='/bin/cc', optimize='-O', gccversion=
    cppflags='-g -I/usr/include -I/usr/ucbinclude -DDEBUGGING'
    ccflags ='-g -I/usr/include -I/usr/ucbinclude -DDEBUGGING'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=undef, d_castneg=define
    intsize=4, alignbytes=4, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='/bin/cc', ldflags ='-L/usr/ccs/lib -L/usr/ucblib
-L/usr/local/lib'
    libpth=/usr/ccs/lib /usr/local/lib /shlib /lib /usr/lib /usr/ucblib
    libs=-lnet -lsocket -lnsl -ldbm -ldl -lld -lm -lc -lcrypt -lucb -lx
    libc=/usr/ccs/lib/libc.so, so=so
    useshrplib=true, libperl=libperl.so
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-KPIC -G', lddlflags='-G -L/usr/ccs/lib -L/usr/ucblib
-L/usr/local/lib'


Searching various archives reveals similar problems on flavors of
Unixware
and Solaris, no confirmed solutions were posted.

All help much appreciated.

Michael Grigoni
Cybertheque Museum


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

Date: 20 Apr 1998 15:26:43 +0200
From: robert@il.fontys.nl (robert)
Subject: Re: Help with regular expression
Message-Id: <6hfiej$977@bsd1.ilse.net>

Mark Fergusson <mferg@hal.ddntl.didata.co.za>:
 >$DATE="03/30/98"
 >$TIME="14:49:43"
 >How do I get:
 >$NEWDATE="1998-03-30 14:49:43"

- snip start -
#!/usr/local/bin/perl5 -w

use strict;

my $DATE = "03/30/98";
my $TIME = "14:49:43";

$DATE =~ m#(\d{2})/(\d{2})/(\d{2})#;
my $mon = $1;
my $day = $2;
my $year = 1900 + $3;

my $NEWDATA = "$year-$mon-$day $TIME";

print "NEWDATA: $NEWDATA\n";
- snip end -

No error-checks, you should implement those yourself :)

                                                                    robert


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

Date: Mon, 20 Apr 1998 06:42:58 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Help with regular expression
Message-Id: <2ccfh6.uk.ln@localhost>

Mark Fergusson (mferg@hal.ddntl.didata.co.za) wrote:
: Please can someone help me with the following:

: $DATE="03/30/98"
: $TIME="14:49:43"

: How do I get:
: $NEWDATE="1998-03-30 14:49:43"


There modules for getting/manipulating dates. 

That is the Best Way to deal with dates, but here is how you can do
it the Simple (ie. non-Best) Way:


---------------------------
#!/usr/bin/perl -w

$date = '03/30/98';
$time = '14:49:43';

($newdate = $date) =~ s#^(\d\d)/(\d\d)/(\d\d)#
                         sprintf "%s-%s-%s %s", $3+1900, $1, $2, $time
                       #e;

print "$newdate\n";
---------------------------


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


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

Date: Mon, 20 Apr 1998 08:07:45 -0500
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: how can I get commands to display?
Message-Id: <353B48A1.4CE7AFC5@houston.Geco-Prakla.slb.com>

joes garage wrote:
> 
> I looked at the FAQ and programming perl book and cannot find
> what I am looking for.  I would like to display lines as they execute.
> 
> I am looking for the equiv of set -x in shell.
> Does such a beast exist?
> 
> thanks
> Ken
Well, not as such (not that I am aware).

perl -d script.pl is a good way.  It allows you to step through your
code, and debug it (that's what the -d is for).  You can interact with
the script as it runs.  It is a very good way to determine what is going
on, when nothing else makes any sense.

HTH.

Dave

-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

----------------------------------------------------------------------
Dave Barnett                 U.S.: barnett@houston.Geco-Prakla.slb.com
DAPD Software Support Eng    U.K.: barnett@gatwick.Geco-Prakla.slb.com
----------------------------------------------------------------------


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

Date: 20 Apr 1998 10:04:41 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: How do I get the name of each file in a dir?
Message-Id: <6hfklp$een$1@monet.op.net>
Keywords: algorithm effluvia machine shoestring


In article <353AFA30.7187@sunset.net>, Aaron  <aaronl@sunset.net> wrote:
>Hell we can chmod, chdir, mkdir
>and the like, but I can't find a "perl" command to list the files.

readdir.



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

Date: Mon, 20 Apr 1998 14:35:13 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: How do I get the name of each file in a dir?
Message-Id: <slrn6jmn3o.ne3.jgloudon@manitoba.bbn.com>

Fain <mindmore@mindless.com> wrote:
># Tried and True...
>print `ls`;
># works
>
>Why use a whole function for something that you can do as simply as
>that?

Because if it fails or you change operating systems then what ?

-- 
Jason Gloudon


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

Date: Mon, 20 Apr 1998 14:32:21 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: How do I get the name of each file in a dir?
Message-Id: <slrn6jmmud.ne3.jgloudon@manitoba.bbn.com>

Aaron <aaronl@sunset.net> wrote:
>I too have wondered about this.  I have had to resort to the above or
>also I have used $foo=`echo /some_dir/*`;
>But what if I'm on a different platform, win32?  Do we always have to
>resort to the shell to get a file list?  Hell we can chmod, chdir, mkdir
>and the like, but I can't find a "perl" command to list the files.

Huh ? I think you have missed a large chunk of the documentation and/or any 
books that you've hopefully read about perl.

That echo 'solution' will fail you if your directory becomes too large for
globbing to work and if you don't have permissions to read that directory
then what ?

Use readdir.

-- 
Jason Gloudon


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

Date: Mon, 20 Apr 1998 20:39:17 GMT
From: kesmit@unx.sas.com (Kevin Smith)
Subject: HTML Tables -> Preformatted Text ?
Message-Id: <ErqC22.3Dx@unx.sas.com>

Does anyone know of a script that will convert an HTML table to 
preformatted text?  Essentially, I need a way to generate tables 
that will be viewed on mainframes.  It must be robust enough to 
handle line wrapping of multiple columns to 80 characters.  It is 
possible to open the HTML file in Netscape and save as text, but 
there may be quite a few tables involved.

Kevin Smith
kesmit@sas.com


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

Date: 20 Apr 1998 20:57:36 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Image can view but cannot download?
Message-Id: <6hgcs0$629$2@marina.cinenet.net>

brian d foy (comdog@computerdog.com) wrote:
: In article <353b89a0.1412664@news.hknet.com>, stevenchan69@hotmail.com (LM386) posted:
: >Image can view but cannot download?
: >how is the technique to make it possible?
: 
: if you can see it you can download it.  the LWP module makes this
: an even easier thing to do.

To put it even more strongly, if you can see it you have obviously 
*already* downloaded it!  The image bits are there inside your machine, 
or you couldn't see them on your screen.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Mon, 20 Apr 1998 11:36:01 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: IS THERE SUCH A THING AS MULTI TASKING?
Message-Id: <353B3321.A1D974D0@inlink.com>

You may be able to accomplish this by having your script be a No Parse
Header (NPH) script.

With an NPH script, data can be sent back to the browser as it happens,
instead of all at once.

On UNIX boxes, the usual way (I think) to do this is to name your
script.pl file, nph-script.pl.  On NT, you can simply do a $|=1, and it
seems to work for me.

HTH,

Brent


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

Date: Mon, 20 Apr 1998 13:48:37 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: keys in hashs
Message-Id: <Erpt11.8CI@world.std.com>

mpslon01@msuacad.morehead-st.edu (MICHAEL PATRICK SLONE) writes:

>Andrew M. Langmead (aml@world.std.com) wrote:
>> mpslon01@msuacad.morehead-st.edu (MICHAEL PATRICK SLONE) writes:
>> Since the version of perl you used seems to have a copyright
>> notification from four years ago, isn't it much more likely that this
>I'll petition the sysadmin to upgrade the interpreter.  I knew it was old,
>but I hadn't been aware of this bug...

>> is a bug that has been fixed?

Yes, the perl development team has fixed many bugs, added a few
features, and fixed many security holes in the past four years.

Unfortunatly, the bug database at
<URL:http://language.perl.com/bugs/index.html> has not been kept up to
date, but at last you can see about first two years changes.

If you download the current perl distribution, you can also take a
look at the Changes* files to view more about what what has gone on
since then.
-- 
Andrew Langmead


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

Date: Mon, 20 Apr 1998 14:19:01 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: making a window system modal in tk
Message-Id: <slrn6jmm5b.ne3.jgloudon@manitoba.bbn.com>

David Grove <pete@dave-world.net> wrote:
>I want to create a dialog box that is system modal under Win32. In
>other words, I want execution of the main program to wait until the
>child windows is closed, to act upon the result of that window. I
>don't want to put a lot of functionality into the child windows. How
>is this accomplished?

This is a TK specific question, Have you looked around at the TK documentation
on the Net ?

Most people on this newsgroup have never seen TK or used it, so this isn't
really the best place to ask. Please Try a tk specific newsgroup.

(All persons looking to complain i didn't help the poster, I am aware he may
be using Tk interfaces in Perl)

-- 
Jason Gloudon


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

Date: Mon, 20 Apr 1998 14:00:34 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: max length of data in sdbm record
Message-Id: <ErptKz.FHo@world.std.com>

pete@dave-world.net (David Grove) writes:

>What is the maximum length of data in an sdbm record, key, and value?

There is a table of the features of the various supported DBM
implementations in the "AnyDBM_File" module. Use the command

   perldoc AnyDBM_File

to view it.

-- 
Andrew Langmead


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

Date: Mon, 20 Apr 1998 21:01:48 GMT
From: jgloudon@hyssop.bbn.com.bbn.com (Jason Gloudon)
Subject: Re: max length of data in sdbm record
Message-Id: <slrn6jndtq.6ft.jgloudon@hyssop.bbn.com>

David Grove <pete@dave-world.net> wrote:
>>>What is the maximum length of data in an sdbm record, key, and value?
>>
>>There is a table of the features of the various supported DBM
>>implementations in the "AnyDBM_File" module. Use the command
>>
>>   perldoc AnyDBM_File
>>
>>to view it.
>
>Yes, I know. It does not contain the information I'm looking for. If
>it did I would not have asked here.

It doesn't answer your question directly but told you where to look.

>From perdoc AnyDBM_File

       manpage), GDBM, SDBM (which is always there--it comes with
       Perl), and finally ODBM.   This way old programs that used
 .
 .
                               odbm    ndbm    sdbm    gdbm    bsd-db
                                ----    ----    ----    ----    ------
        Size limits             1k      4k      1k[3]   none    none
                                                ^^^^^

-> [3] By default, but can be redefined. 

ie. in the perl source distribution, which contains the file:

sdbm.3

so if you have perl and the manpages installed, man sdbm.

 .
 .
BUGS
       The sum of key and value data sizes must not exceed  PAIR-
       MAX (1008 bytes).

Jason Gloudon


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

Date: Mon, 20 Apr 1998 10:06:47 -0400
From: Tim Logan <umichfan@hotmail.com>
Subject: Newbie question...
Message-Id: <353B5677.3700BAFF@hotmail.com>

I am new to Perl and am working on a script to process forms on my
company's intranet.  I would like it to get the poster's IP address then
use part of that to identify which facility the user is in.

I have used $ipaddress = $ENV{'REMOTE_ADDR'} to get the IP address, but
how do I use just x number of characters in if/elsif/else?  I have only
been learning Perl for about 1 week and have been reading "Programming
Perl" by O'Reilly.  I'm not asking for someone to write the code for
me...just tell me which command(s) I should read about to learn how to
do this.

Thanks,

Tim Logan
umichfan@hotmail.com





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

Date: Mon, 20 Apr 1998 10:18:52 -0400
From: Bryan Beske <beske@worldnet.att.net>
Subject: Re: Newbie question...
Message-Id: <6hflhn$2k@bgtnsc03.worldnet.att.net>

Tim;

Try the "split" command with "/\./" as the string
to split on. This will break the address into its pieces.

b^2



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

Date: Mon, 20 Apr 1998 11:47:37 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: ODBC and Perl
Message-Id: <353B35D9.1C2F65E2@inlink.com>

Just a thought...

Since you CAN run it from the command-line, but not from the web, what
user is the web running as and does it have the proper rights?

HTH,

Brent


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

Date: 20 Apr 1998 23:10:53 +0200
From: Gisle Aas <aas@sn.no>
Subject: Re: Parser works sometimes
Message-Id: <m3bttw8ahu.fsf@furu.g.aas.no>

abigail@fnx.com (Abigail) writes:

> ++     use HTML::Parse;
> 
> HTML::Parse won't do all of the above correctly :(

HTML::Parse (aka HTML::TreeBuilder) has trouble with lot of things.
The basic HTML::Parser only have problems with:

   <![INCLUDE [CDATA [ >>>>>>>>>>>> ]]>

from Tom's examples.  It is parsed as:

   DECL: [INCLUDE [CDATA [ 
   TEXT: '>>>>>>>>>>> ]]>

should we fix that?

-- 
Gisle Aas


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

Date: Mon, 20 Apr 1998 16:55:27 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: perl and spaces in strings
Message-Id: <Pine.A41.3.96.980420164455.29882G-100000@ginger.libs.uga.edu>

Yes, perl does this with the split function.  The following code is a
small example:
-----------------------------------------------------------
#!/usr/local/bin/perl -w
use strict;

my( @a, $y );

### split the string into an array
@a = split( " ", "xxx yyy zzz" );
print ">@a<\n";

### put it in parens and you can subscript it into a scalar
$y = (split( " ", "xxx    yyy    zzz" ))[1];
print ">$y<\n";
-----------------------------------------------------------
It prints:

>xxx yyy zzz<
>yyy<

Note that when the first parameter is a space in double quotes (" "), it's
a special case.  It will split on any number of adjacent white space
characters.  Look up 'split' in any perl book or man page for a much more
complete explanation.

----------------
Brad Baxter, UGA

On 20 Apr 1998, shmoo wrote:

> Does Perl have a way of separating a string by spaces?  In the example



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

Date: Mon, 20 Apr 1998 08:05:03 -0600
From: eaudet@solution123.com
Subject: PERL en francais SVP
Message-Id: <6hfh6a$tks$1@nnrp1.dejanews.com>

Bonjour,

Vous voulez de l'information sur le language perl ... mais en francais?

J'ai cree une liste de diffusion seulement pour cela :)
http://www.solution123.com/perlqc/

Eric Audet

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


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

Date: Mon, 20 Apr 1998 10:15:02 -0400
From: Bryan Beske <beske@worldnet.att.net>
Subject: Re: Perl module to retrieve a document and send it to a browser(Netscape)
Message-Id: <6hflai$2k@bgtnsc03.worldnet.att.net>

I would suggest something like a server side include to a
program that fetches the page you want.

b^2



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

Date: Mon, 20 Apr 1998 13:17:13 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Project question and gripe about (Re: Snobby news group)
Message-Id: <353B4C28.766E@min.net>

Randal Schwartz wrote:
> 
> I read nearly every article in comp.lang.perl.misc and
> comp.lang.perl.modules....
> [1,2,3,A,B]...

Yah. But then there's the long-running tangential threads, such as
"Who would win if  Richard Stallman went up against Bill Gates on
American Gladiators?"

John Porter


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

Date: Mon, 20 Apr 1998 08:05:26 -0500
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
To: Toby Heywood <toby@he-net.demon.co.uk>
Subject: Re: Proplem with perl script (I'm new to perl)
Message-Id: <353B4816.2C1915C0@houston.Geco-Prakla.slb.com>

[courtesy cc to cited author]

Toby Heywood wrote:
> Anyway, I used the the -w flag for trying to debug the script, and all I
> keep getting is this message.  I'm now stuck, and would be grateful if
> you can help.
> 
> Argument "yes" isn't numeric in eq at perl_exercise_5 line 16, <STDIN>
> chunk2.
What this is telling you is that you are trying to do a numeric
comparison (==) between values that are not numeric (strings).  Have a
look at the "eq", and "ne" operators (complimentary to == & !=).

I might advise that, even if you are not ready (programmatically or
otherwise) for Programming Perl, it is a GREAT reference manual.  It has
an entire section devoted to the above error message.

On that note, try using:
use diagnostics;

This will spit out the above message, but with text out of the perldiag
(I think) manual that may be of great assistance to you.

> Argument "maybe" isn't numeric in eq at perl_exercise_5 line 16, <STDIN>
> chunk2.
>
See above.
 
> Thanks in advance!
> --
> Toby Heywood <toby@he-net.demon.co.uk>
> Proprietor, Heywood Enterprises
> ----------------------------------------
> Website - http://www.he-net.demon.co.uk/
> ----------------------------------------
<sig card snipped>

<$0.02>
Many people who read this newsgroup cannot view Netscape address cards. 
To them, it ends up as a hodge-podge of HTML gibberish.  I would advise
removing it when posting to the newsgroups, since many of said readers
are the more/most experienced people here, and they tend to killfile
those things that are not plain text postings.
</$0.02>

HTH.

Dave

-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

----------------------------------------------------------------------
Dave Barnett                 U.S.: barnett@houston.Geco-Prakla.slb.com
DAPD Software Support Eng    U.K.: barnett@gatwick.Geco-Prakla.slb.com
----------------------------------------------------------------------


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

Date: 20 Apr 1998 20:55:23 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Regexp question
Message-Id: <6hgcnr$629$1@marina.cinenet.net>

A.P. (road@apdo.com) wrote:
: I'm learning Perl reading the Llama book. There's an exercise proposing
: to find a regexp to match the same word written two or more times in a
: row (with possibly varying intervening whitespace). The book proposes
: the following answer:
: 
: /(^|\s)(\S+)(\s+\2)+(\s|$)/
: 
: Why do (^|\s) and (\s|$) match any number of leading/trailing
: whitespaces and not just one or none?

You're asking the wrong question, since those regexes don't match what 
you say.  Rather, they're being used to identify word boundaries.  The 
implicit definition of a 'word' being used is 'one or more consecutive 
non-whitespace characters bounded on the front by whitespace or the start 
of the string, and on the end by whitespace or the end of the string.

The idea is to reject a string like "foobar barquux", or even "foobar bar
barquux", where the repetition is internal to 'words'.

: It's a really messy one this regexp business!!

Sure is...but it's worth the effort.  Eventually. :-)

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Mon, 20 Apr 1998 08:46:42 -0400
From: "Rob Smith" <robsmith@writeme.com>
Subject: Regular Expression to match a valid IP address
Message-Id: <6hfcmo$6e8$1@snoopy.uscsumter.edu>

I'm definitely new to Perl, and have been working on a project for work.
I'm at a point where I want to validate an IP entered.  Is there a regular
expression that would help me?  I want to validate that the first and last
octet s between 1 and 254.  Of course the 2nd and 3rd from 0-255.  I want it
to also check that there is a dot between the numbers since the input is
used later on for several routines.

Thanks for any help.

Greatly appreciated.  I've looked up several areas for Regular Expressions,
but they don't explain much about the numeric expressions...

Thanks....

Rob

resmith@uscsu.sc.edu




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

Date: 20 Apr 1998 15:48:55 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
To: robsmith@writeme.com
Subject: Re: Regular Expression to match a valid IP address
Message-Id: <7xg1j81u48.fsf@beavis.vcpc.univie.ac.at>

Re: Regular Expression to match a valid IP address, Rob
<robsmith@writeme.com> said:

Rob> validate an IP entered.  Is there a regular expression
Rob> that would help me?  I want to validate that the first
Rob> and last octet s between 1 and 254.  Of course the 2nd
Rob> and 3rd from 0-255.  I want it to also check that there
Rob> is a dot between the numbers since the input is used
Rob> later on for several routines.

An IP address expressed in dotted-quad form consists of 4
sequences of decimal digits, separated by `.'

So to start with we could use split() to get the individual
sequences.

e.g.
    $ip_address = "192.68.102.44";

    @octet = split(/\./, $ip_address);

Then you can range-check the members of the octet array,
which of course perl will automagically number-ify for you
in arithmetic contexts.  Or you could explicitly use () to
split the octets into separate variables.

Sanity checks on @octet can include how big it is (e.g. to
make sure all 4 octets were present).

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,      | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | http://www.vcpc.univie.ac.at/

"You see? You see? Your stupid minds! Stupid! Stupid!" ~ Eros, Plan9 fOS.


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

Date: 20 Apr 1998 14:04:00 +0100
From: Zachary Kessin <zkessin@lhr-sys.dhl.com>
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <uyax0ablr.fsf@lhr-sys.dhl.com>


pudge@pobox.com (Chris Nandor) writes:
<SNIP>
> # 
> # None of the other licenses guarantee this, therefore all the other
> # licenses are inferior.
> 
> Maybe that is exactly what makes GPL inferior.
> 
<SNIP>

I would point out that saying one is inferior to another is rather
pointless as we do not all agree on the same goals. The GPL is great
if you agree with the ideal behind it. On the other hand the Apache
people have a slightly different Ideal, I have no problem with eather.

--Zach Kessin
(Sick of commercial software)



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

Date: Mon, 20 Apr 1998 16:35:32 +0200
From: "Lukas Lundgren" <loo@algonet.se>
Subject: sendmail
Message-Id: <6hfm90$frp$1@cubacola.tninet.se>

I am writing a script which sends a mail to me... But how do I change the
"From" in the e-mail?

/Lukas Lundgren




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

Date: 20 Apr 1998 14:48:43 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Snobby news group
Message-Id: <6hfn8b$dm0$1@client2.news.psi.net>

Mark Constable (markc@renta.net) wrote on MDCXCII September MCMXCIII in
<URL: news:3539BAA1.71028B90@renta.net>:
++ 
++ 
++ Simply because it is not possible for any _NEW_ user to perl
++ et al to read every fucking piece of documentation and literature
++ all on the first day... that is why.

If you start with a new language, the first 2 weeks should be
spend reading. You are right, you expect to know it all after
the first day. But you can be expected to read the manual.



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: Mon, 20 Apr 1998 08:41:11 -0500
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Text box alignmnet
Message-Id: <353B5077.E1045542@houston.Geco-Prakla.slb.com>

William Shaffer wrote:
> 
> Hi
> 
>     Does any one know how to get text boxes to line up vertically?
<snip>
Use a yardstick?  Maybe a level?  Send them through military boot camp
to improve their posture?

>     Thanks in advance, William Shaffer
I must assume that you are speaking of html code, since Perl doesn't do
text boxes.

How about setting them up in tables, with each text box being a table
row?

If that doesn't do it for you, maybe 
comp.infosystems.www.authoring.cgi
comp.infosystems.www.authoring.html

might be a better place to ask this specific question.  ???

Dave

-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

----------------------------------------------------------------------
Dave Barnett                 U.S.: barnett@houston.Geco-Prakla.slb.com
DAPD Software Support Eng    U.K.: barnett@gatwick.Geco-Prakla.slb.com
----------------------------------------------------------------------


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

Date: Fri, 17 Apr 1998 09:06:29 -0500
From: jimh@sssi.com (Jim Hutchins)
Subject: Win32 OLE Help with function
Message-Id: <3.0.3.32.19980417090629.00dac024@199.29.166.7>

I've been trying to develop an OLE module to interface with
MS Excel using Perl 5.00402 bindist and libwin32-0.10. Most
of the VB macros have converted without trouble to Perl code
except for the following that I can't resolve. I have included
an example macro that uses the "Borders" function that I can't
get to work:

##  Visual Basic code for setting Cell Borders
##     Selection.Borders(xlDiagonalDown).LineStyle = xlNone
##     Selection.Borders(xlDiagonalUp).LineStyle = xlNone
##     With Selection.Borders(xlEdgeLeft)
##         .LineStyle = xlContinuous
##         .Weight = xlThin
##         .ColorIndex = xlAutomatic
##     End With
##     With Selection.Borders(xlEdgeTop)
##         .LineStyle = xlContinuous
##         .Weight = xlThin
##         .ColorIndex = xlAutomatic
##     End With


I'm geting the following error on line 208::

With($ex->Selection->Borders->{'xlDiagonalDown'}, LineStyle => $xlNone);

OLE error 0x80020005: "Type mismatch"
in methodcall/getproperty "xlDiagonalDown" at excel_ole.pl line 208

And I have also tried:

$ex->Selection->Borders->xlDiagonalDown->{'LineStyle'} = $xlNone;

OLE error 0x80020005: "Type mismatch"
in methodcall/getproperty "xlDiagonalDown" argument 2 at 
excel_ole.pl line 208

My program starts off with:

#!/perl/bin/perl -w
use strict;
use Win32::OLE;
use Win32::OLE::Const 'Microsoft Excel';
use Win32::OLE qw(With);
use Win32::OLE::Enum;

my $ex = Win32::OLE->new('Excel.Application', 'Quit')
  or die "Couldn't start Excel: !$\n";

With($ex, Visible => 1, DisplayAlerts => 0);

$ex->Workbooks->Add;


Can anyone provide a solution? This is my first post so
please be kind.... (actually I sent this yesterday and
it never showed up so I'm resending).

Jim H.



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

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

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