[8194] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1812 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 4 21:08:47 1998

Date: Wed, 4 Feb 98 18:00:27 -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           Wed, 4 Feb 1998     Volume: 8 Number: 1812

Today's topics:
    Re: 'require' dir same as app's? (Craig Berry)
    Re: [utility] submit "unix_command" (Michael Wang)
    Re: AIX, perl and syscall.h ? (Jens-Uwe Mager)
        converting href and src tag values to lowercase? <wallsr@jcave.com>
        Date Comparison <akan@atlas.ca>
        DBD:ODBC Makfile.PL problem query?????
    Re: Destroying any and all elments of an array.. how? <ajohnson@gpu.srv.ualberta.ca>
    Re: Filtering Problem (Jonathan Feinberg)
    Re: Generic Config-file maintenance (Martien Verbruggen)
    Re: Help! 255-char URL limit passing form values to cgi (Abigail)
        hexadecimal to binary conversion? eric_gutt@mentorg.com
        IO::Socket::INET newbie question <kellysm@ix.netcom.com>
    Re: Is there a WILDCARD variable in PERL??? <zenin@best.com>
    Re: Is this correct? File Locking <jsd@hudsucker.gamespot.com>
        memory eating progs on win32 perl! <darklord@inrete.it>
    Re: Perl - Oracle Interface (Martien Verbruggen)
    Re: perl and file system (Martien Verbruggen)
    Re: Perl dies with segmentation fault and leaves a core <rjk@coos.dartmouth.edu>
    Re: Perl in a datawarehouse environment (Martien Verbruggen)
    Re: Perl in a datawarehouse environment (Martien Verbruggen)
        Permission Help!! (Alex Oliva)
    Re: Please, help - rsh problem. (Martien Verbruggen)
        posix::strftime (core dumped) <volker@microdata.de>
    Re: Quickie: regexp for valid e-mail addresses <jsd@hudsucker.gamespot.com>
    Re: Quickie: regexp for valid e-mail addresses (Craig Berry)
        Security implications of perl scripts... <johne@secserver.com>
    Re: solution for multiline comments??? (Martien Verbruggen)
    Re: solution for multiline comments??? <rjk@coos.dartmouth.edu>
    Re: Text Problems With Explorer 4.0 (Johnny Fingers)
    Re: Tie-Dee-Perl (Cleanliness is next to Goodliness, or (I R A Aggie)
    Re: Tie-Dee-Perl (Cleanliness is next to Goodliness, or <jason@primal.ucdavis.edu>
    Re: Tie-Dee-Perl (Cleanliness is next to Goodliness, or (Craig Berry)
    Re: Unpack float (Will Morse)
    Re: Who knows about Base64 oder Uudecoder in Perl? (Jim Esten)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 5 Feb 1998 00:41:48 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: 'require' dir same as app's?
Message-Id: <6bb1sc$cif$1@marina.cinenet.net>

Martin Vorlaender (martin@RADIOGAGA.HARZ.DE) wrote:
: Craig Berry (cberry@cinenet.net) wrote:
: : However, I'd love to convey to Perl the idea 'look in the same dir you 
: : got the current file from' without having to fall back on 'require 
: : /path/to/bar.pl', which I'm doing now as a stopgap.
: 
: use FindBin;
: use $FindBin::Bin;
: 
: See the modules POD for gotchas.

Perfect!  Thanks very much for the info.  Now, for my future edification,
how could I have found this in the FAQ?  Even knowing what I'm looking for
(as I do now), I see no trace of this.  Perhaps I'm just being blind. 

---------------------------------------------------------------------
   |   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: 5 Feb 1998 00:01:36 GMT
From: mwang@alhena.ibk.ml.com (Michael Wang)
Subject: Re: [utility] submit "unix_command"
Message-Id: <6bavh0$gqj$1@news.ml.com>

OK, I am convinced that it is useful :-)

But let me point out facts:
1. about command sequence, man nohup: 
     nohup does not recognize command sequences.  In the case  of
     the following command
          example$ nohup command1; command2
     nohup applies only to command1.  The command
          example$ nohup (command1; command2)
2. I am talking anout rsh in the sense of:
     rsh connects to the  specified  hostname  and  executes  the
     specified  command.
 ...

Please do NOT get the script from
ftp://ftp.mindspring.com/users/mwang/submit


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

Date: Wed, 4 Feb 1998 23:11:39 GMT
From: jum@anubis.han.de (Jens-Uwe Mager)
Subject: Re: AIX, perl and syscall.h ?
Message-Id: <jum-0502980011400001@anubis.han.de>

In article <6b9o05$ru4$1@horus.mch.sni.de>, Andreas.Kutschera@bln.sni.de wrote:

> Hi,
> I've gotten a precompiled version of Perl 5.4.4.0 from frec.bull.com,
installed
> it on AIX 4.2 and now I cannot call "SYS_statfs", because there is no
> syscall.h on AIX (and thus no syscall.ph).
> 
> I've searched the FAQ (both Perl and AIX) and everywhere else I could
think of,
> but I've only found solutions for specific syscalls, but no generic solution.
> 
> All I've found out is that on AIX syscalls seem to be assigned dynamically and
> so they don't have a specific number that would work with h2ph.
> 
> My question is this:
> Is there a generic solution that allows me to use syscalls on AIX or do I have
> to rewrite all modules and programs that (seem to) work everywhere else?


The is no way to call system calls by number on AIX. The use of the
indirect system call was an escape hatch of older perl versions as these
where not extensible. The perl module mechanism is the proper way to
interface perl with arbitrary C routines. There is also a tool named
"SWIG" out there that might help you, this is supposed to make interfacing
C and Perl (or other script languages) easier. Look at reference.perl.com
for a link in the programming section.
--
Jens-Uwe Mager <pgp-mailto:62CFDB25>


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

Date: 4 Feb 1998 23:45:46 GMT
From: "Rob W. Walls" <wallsr@jcave.com>
Subject: converting href and src tag values to lowercase?
Message-Id: <01bd31c6$e1f72cc0$594347ce@robwalls>

I am setting up an apache web server and transfering pages originally
designed on MS FrontPage.  The horrors of filename case sensitivity have
caused maximum irritation!  I wrote a little perl script to convert all
file names in a dir to lowercase, but I now need to look inside EVERY html
file and change all path/file references to lowercase also.  I am pretty
new to perl (and Unix) , but I know this can be done.  I just can't seem to
get there from here.  A wildcard file search and a look inside all matched
files for href= and src= values would be just the ticket.  Anyone care to
share a tip on how to do this or where to find a script already written to
do this?
thanks,
wallsr@jcave.com
   


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

Date: Wed, 4 Feb 1998 15:39:49 -0700
From: "Anthony Kan" <akan@atlas.ca>
Subject: Date Comparison
Message-Id: <6baqk5$c1o1@crash.videotron.ab.ca>

Ok I realize I might get flamed for this...but.

I would like to compare dates.  From the DB I get 01-Jan-1998 and I would
like to compare it to the current date to see if the first date is less than
a year ago.  Since the server is running Perl 4 I don't really have the
option to just blast in a pm and be done with it.

Any help greatly appreciated,
Wade Hovind




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

Date: 5 Feb 1998 00:59:29 GMT
From: query?????
Subject: DBD:ODBC Makfile.PL problem
Message-Id: <6bb2th$452@triton.np.ac.sg>

Hi,

     Tried to compile DBD::ODBC by executing  perl Makefile.PL but got the
following error, would appreciate if anyone can tell me what it means:-

????????????????????

#  perl ./Makefile.PL
Can't locate loadable object for module DBI in @INC (@INC contains:
/disk1/perl5/lib/PA-RISC1.1/5.00404 /disk1/perl5/lib
/disk1/perl5/lib/site_perl/PA-RISC1.1 /disk1/perl5/lib/site_perl .) at
 ./Makefile.PL line 11
BEGIN failed--compilation aborted at ./Makefile.PL line 11.

?????????????????????

Perl (v 5.004_4)
DBI  (v 0.90)
DBD  (v 0.16)

Thanks



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

Date: Wed, 04 Feb 1998 18:59:43 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Destroying any and all elments of an array.. how?
Message-Id: <34D90EFF.364A2D07@gpu.srv.ualberta.ca>

Craig Berry wrote:
[snip]
> 
> OK, then, let me turn this into a question:  Is there any detectable
> difference, after the fact, between "undef @a" and "@a = ()"?

yes, whether @a is defined or not is a detectable difference:

@a=qw(one two three);
print "try 1: is defined\n" if defined(@a);

@a=qw(one two three);
@a=();
print "try 2: is defined\n" if defined(@a);

@a=qw(one two three);
undef(@a);
print "try 3: is defined\n" if defined(@a);

regards
andrew


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

Date: Wed, 4 Feb 1998 19:23:36 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Filtering Problem
Message-Id: <MPG.f42d0957b0140989896b5@news.concentric.net>

chip@mail.atlantic.net said...
> According to Joergen.Lang@schwaben.de:
> >"date";"town";"venue";"time";"artist"\n
[snip]

> Step 2: Sort it.
> 
>   @dates = sort { ($a->[4] <=> $b[4]) || ($a->[0] cmp $b->[0]) } @dates;

Chip: please don't bite my head off if I'm delusional, but I think you've
reversed your use of "cmp" and "<=>" (assuming that the artist is alphabetic
and that the date is numeric).

-- 
Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

Date: 5 Feb 1998 01:00:55 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Generic Config-file maintenance
Message-Id: <6bb307$ase$3@comdyn.comdyn.com.au>

In article <34d88660.7441302@newsfeed1.cybertours.com>,
	phil@freed.com (Philip Freed) writes:
> I'd like to maintain a number of config files to be used by various
> Perl utilities.  Before I start writing code, I thought I'd find out
> 
> 1)  If someone has done this already.

To find out if someone has done something already, you normally visit
CPAN: http://www.perl.com/CPAN/modules/00modlist.long.html, and search
that page for 'config'. That will immediatly show you section 12:
"Option, Argument, Parameter and Configuration File Processing", which
has about three modules to do this sort of thing.

Martien
-- 
Martien Verbruggen                  | My friend has a baby. I'm writing down
Webmaster www.tradingpost.com.au    | all the noises the baby makes so later
Commercial Dynamics Pty. Ltd.       | I can ask him what he meant - Steven
NSW, Australia                      | Wright


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

Date: 4 Feb 1998 23:58:00 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Help! 255-char URL limit passing form values to cgi
Message-Id: <6bava8$304$1@client2.news.psi.net>

Steve Palincsar (palincss@nicom.com) wrote on 1619 September 1993 in
<URL: news:34D91797.374E@nicom.com>:
++ Abigail wrote:
++ > 
++ > James Munroe and Tricia O'Neill (eccles@astral.magic.ca) wrote on 1618
++ > September 1993 in <URL: news:34D8562F.4F59@astral.magic.ca>:
++ 
++ Was this stuck in a time warp? 

No.

++ > ++ When sending the contents of an HTML form's textarea to a Perl cgi, or a
++ > ++ large number of form fields with their associated values to a Perl cgi,
++ > ++ anything after the first 255 characters gets truncated, because Netscape's
++ > ++ URL line is limited to that size. Is there any other way to communicate
++ 
++ Perhaps in 1993 POST method hadn't been invented yet.  But then, neither

I would be surprised if it wasn't.

++ was Netscape.  The problem here is that he's using the GET method
++ when he should be using POST.

No, Netscape is the problem.

++ > ++ form field values from the browser to a cgi, in such a way that the
++ > ++ _complete_ string of form names and values is preserved?
++ > 
++ 
++ > That would be Netscape's bug department where you need to be.
++ 
++ More likely he needs to be in a CGI group.

It's still a bug. RTFRFC.


Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


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

Date: Wed, 04 Feb 1998 18:12:56 -0600
From: eric_gutt@mentorg.com
Subject: hexadecimal to binary conversion?
Message-Id: <886636915.819396613@dejanews.com>

What's a clever way to convert a hexadecimal string of
any (reasonable) length to binary?  Or am I just not
seeing the %b format for sprintf?  Examples:
"1ab3" -> 0001101010110011
"1" -> 0001
"cc" -> 11001100

I've done it in about 50 lines of Perl, but that seems like way
too much code.
Thanks
eric_gutt(at-sign)mentorg(dot)com

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Wed, 04 Feb 1998 19:38:58 -0500
From: "Shawn M. Kelly" <kellysm@ix.netcom.com>
Subject: IO::Socket::INET newbie question
Message-Id: <34D90A22.BFBC96BB@ix.netcom.com>

I have the follow code:

use IO::Socket;
$pop = IO::Socket::INET->new(
 Proto => "tcp",
 PeerAddr => "hostname",
 PeerPort => "110");
$reply = <$pop>;
print $reply;
print ($pop "USER username \n");
$reply = <$pop>;
print $reply;
close ($pop);
exit

When the first "print $reply" executes I get the correct response which
is the +OK line from the POP3 server. My next line "print ($pop "USER
username \n");" doesn't seem to run. I never get the next OK prompt from
the server. It appears that I am not writting correctly to the socket.
Could someone please give me a hand with this?

Regards,

Shawn M. Kelly



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

Date: 4 Feb 1998 23:07:51 GMT
From: Zenin <zenin@best.com>
Subject: Re: Is there a WILDCARD variable in PERL???
Message-Id: <886633952.969392@thrush.omix.com>

David Cline <webmaster@pclightning.com> wrote:
: I have over a hundred variables within the same CGI file called
: $xxxxxxxx_r --- with the xxxxxxxxx being over a hundred different words,
: but the "_r" is constent with them all.  I want to add the values
: contained within these variables together.  As a DOS man, I could best
: explain this like so:
: $sum = $*_r;
: If you get my drift.  Is there a PERL wildcard or equivalent???

	Yes, but you _really_ don't want to go that route for this kind of
	thing.  A "hash" (associative array) is normally a better call if
	you must do it by the var name:

	$hash{foo_r} = 42;
	$hash{bar_r} = 12;
	$hash{cat_b} = 50;

	$total = 0;

	foreach $key (keys %hash) {
		if ($key =~ /_r$/) {
			$total += $hash{$key};
		}
	}

	print "$total\n";

	There are faster/less code ways, but this is probably the easiest to
	understand.

-- 
-Zenin
 zenin@best.com


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

Date: 4 Feb 1998 22:55:40 GMT
From: Jon Drukman <jsd@hudsucker.gamespot.com>
Subject: Re: Is this correct? File Locking
Message-Id: <6barlc$795$1@its.hooked.net>

Bill Genzer <bill@fathead.net> wrote:
: I'm still new at CGI and I've looked at several different FAQs trying to
: figure out file locking and I think I finally got it, this is a broken down
: version of what I'm doing, I just wanted to make sure it looks correct.

: open (FILE,">$filepath");

check the result of your open!!!

open(FILE,">$filepath") || die "open failed: $!";

: flock(FILE,2);

yep, this will wait for an exclusive lock.

: seek(FILE, 0, 2);

i guess you want to append.  might as well use >> in the open and save
yourself the seek here.

:  flock(FILE,8);

don't ever do this.  i don't know why it's in the faq, but randal
yelled at a friend of mine when said friend posted something including
this.  so don't do it.  close takes care of it for you.

: CLOSE(FILE);

close(FILE);  case is important for perl keywords.

: Does it matter where you lock and unlock the file?  (either before or after
: you open or close the file?) This is how it was in the FAQ I found and as
: far as I can tell it works fine.

you have to open before you flock, because flock takes a filehandle,
not a pathname.  so you need the open to get the filehandle.  close
automatically unlocks, so leave out the second flock.

-j-


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

Date: Thu, 05 Feb 1998 00:47:58 +0100
From: Guglielmo Alfieri <darklord@inrete.it>
Subject: memory eating progs on win32 perl!
Message-Id: <34D8FE2E.3C419836@inrete.it>

I have a little, nice daemon that grows (mem space) from 700k to 17
Mb.....:<<<
on  a NT system....Ideas ?
Second I have another little, nice daemon that doesn't release the
handles it gets...
I HATE NT.



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

Date: 5 Feb 1998 01:03:36 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl - Oracle Interface
Message-Id: <6bb358$ase$4@comdyn.comdyn.com.au>

[comp.lang.perl is long dead. Please inform your news admin that it should
be removed]

In article <34d8bf7e.0@blushng.jps.net>,
	"Murali Kazhipurath" <murali@jps.net> writes:
> Where can I get some information about using PERL against an Oracle
> database.

http://www.perl.com/CPAN/modules/00modlist.long.html

Look for Oraperl, and DBI. You can also find more information on 
DBI at http://www.hermetica.com/technologia/DBI/.

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


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

Date: 5 Feb 1998 01:25:39 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: perl and file system
Message-Id: <6bb4ej$ase$6@comdyn.comdyn.com.au>

In article <90rrputt.fsf@aigf.sncf.fr>,
	Fabrice Gonton <fabrice.gonton@aigf.sncf.fr> writes:

> Well, I should have said how determine the TYPE of fs 
> (i.e ufs jfs tmpfs nfs ...) with a PERL command, that works on nearly
> all Un*x systems

Nope. Even though perl has a lot of it's roots (but certainly not all)
in unix, it tries to be portable. The only chance you have is to use
an OS specific way of finding out. Try checking /etc/vfstab or so. On
Solaris the following works quite nicely:

> df -g .

This just prints out the entire statvfs structure. Maybe you can check
to see what that would be on other unices. You could try to write a C
interface that does the statvfs() call.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If at first you don't succeed, try
Commercial Dynamics Pty. Ltd.       | again. Then quit; there's no use being
NSW, Australia                      | a damn fool about it.


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

Date: Wed, 04 Feb 1998 20:08:14 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: Perl dies with segmentation fault and leaves a core
Message-Id: <34D910FE.71B046FA@coos.dartmouth.edu>

Jacqui Caren wrote:
> 
> In article <Pine.GSO.3.96.980116151307.669S-100000@user2.teleport.com>,
> Tom Phoenix  <rootbeer@teleport.com> wrote:
> >On Fri, 16 Jan 1998, Bob wrote:
> >
> >> Is there anything that a user script can do to cause a Segmentation
> >> fault and core dump, or is it a perl bug?
> >
> >Yes, and yes. :-)  You should probably file a bug report. Hope this helps!
> 
> Only *after* reading the relevant documentation and making sure the program
> is not *supposed* to dump, or that it is not an FAQ, etc...
> 
> jacqui@oink: perldoc -f dump
> =item dump LABEL

Except, in this case, the script is getting a *segmentation fault* and creating
an undesired core dump.  The dump function is completely irrelevant in this case.

Chipmunk


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

Date: 5 Feb 1998 00:48:28 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl in a datawarehouse environment
Message-Id: <6bb28s$ase$1@comdyn.comdyn.com.au>

[comp.lang.perl is dead. If your news server still carries it, please
ask your news admin to remove it.]

In article <MPG.f415b1b63836bcc9896a1@news.dgsys.com>,
	eweiss@winchendon.com (Eric Weiss) writes:
> [This followup was posted to comp.lang.perl and a copy was sent to the cited author.]

See above. comp.lang.perl is dead.

Martien

-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Inside every anarchy lurks an old boy
Commercial Dynamics Pty. Ltd.       | network - Mitchell Kapor
NSW, Australia                      | 


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

Date: 5 Feb 1998 00:53:26 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl in a datawarehouse environment
Message-Id: <6bb2i6$ase$2@comdyn.comdyn.com.au>

[comp.lang.perl is dead. If your news server still carries it, please
ask your news admin to remove it.]
[This post has nothing to do with perl modules]
[Newsgroups line adapted]
[Cc to author]

In article <34d6ffff.0@blushng.jps.net>,
	"Murali Kazhipurath" <murali@jps.net> writes:
> I am evaluating different tools to do  ETT (Extract, Transform and Transfer)
> for a Oracle 7.3 datawarehouse application running under HP/UX 10.20.
> Currently, we are using a combination of Unix Shell script, PowerHouse (from
> Cognos) and SQL*Loader to do this process. I am in the process of evaluating
> other options.
> 
> Is PERL a good tool for this?

Yes.

> What are the advantages of using PERL over regular shell scripts?

Many. mainly that perl can do a lot of things internally, and in shell
scripts you'd be starting other processes all the time. perl also
allows you to contact your database directly.

> How good are the string manipulation capabilities of PERL? Is it fast?

The best out there. Yes.

> Does PERL have a database interface?

Yes, many of them. The most general one is DBI. DBI has an Oracle
driver, as well as many other drivers. Using DBI has one big
advantage: Your scripts will work with any database, using the same
interface. if your company decides to move to a different database
backend, you will not need to spend much time changing scripts around.
 
> Is it portable (Unix to Windows NT and vice  versa)?

It should be. In most cases: it is. perl 5.005 will be even more
portable.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd.       | clothes.
NSW, Australia                      | 


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

Date: Thu, 05 Feb 1998 01:33:24 GMT
From: aoliva@uspe.com (Alex Oliva)
Subject: Permission Help!!
Message-Id: <34d916cb.98247197@news.supernews.com>

OK... I am at wits end! :)
 
I am creating an .shtml file via a perl based cgi script. 
The directory the file is being written to has permissions of 777.
Since I have a server side include, I use a `chmod 755` inside my
perl script to change the permission of the subdir the .shtml file is
being accessed from. The problem is I STILL get the

"404 - document not found or INSECURE" error message.
 
It's obvious that even though I changed my permission to 755, it still
won't let me run the SSI file (it runs NON SSI html files fine).
 
Is there something I'm missing here? Also, I can't seem to DELETE the
subdir via FTP if I have set the permissions from within the perl
script.
 
Your help would be GREATLY appreciated... thanks!!
 
Please respond to aoliva@uspe.com


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

Date: 5 Feb 1998 01:30:16 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Please, help - rsh problem.
Message-Id: <6bb4n8$ase$7@comdyn.comdyn.com.au>

In article <34d6954c.1116822@news.mindspring.com>,
	ekogan@mindspring.com (Eugene Kogan) writes:

> I am having a problem with rsh. I execute rsh from my Solaris worksta.
> by a perl script using system() call that executes a C-program on the
> remote machine that setuid() to root, executing a start shell script
> (also by a system() call) for a proxy server installed on the remote
> machine that is also Solaris 2.5. The problem is that while the whole

Ugh. Just for fun, you should tell this to the people on one of the
security groups.

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


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

Date: Thu, 05 Feb 1998 01:20:55 +0100
From: Volker Klau <volker@microdata.de>
Subject: posix::strftime (core dumped)
Message-Id: <34D905E7.9F4325F1@microdata.de>

Hi,

my Problem:

POSIX::strftime( "%H:%M, on %D", localtime());
gives a nice Segmentation fault under 
- RedHat Linux/Intel 5.0 (glibc)
- Perl 5.004

Anybody seen/solved this problem ?

Thanx in advance

Volker


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

Date: 4 Feb 1998 23:07:07 GMT
From: Jon Drukman <jsd@hudsucker.gamespot.com>
Subject: Re: Quickie: regexp for valid e-mail addresses
Message-Id: <6basar$795$2@its.hooked.net>

Abigail <abigail@fnx.com> wrote:
: /[\x00-\x7f]+@[\x00-\x7f]+/;

that will allow loser@.aol.com as well as bonehead@ao...l...co..m

: There isn't any symbol from ASCII set that is *not* allowed in an
: email address. Read RFC822 for details.

there are clearly some forms which are more likely to be undeliverable
than others.  i believe in catching the most egregiously
incorrect-looking cases.

-j-


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

Date: 4 Feb 1998 23:50:37 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Quickie: regexp for valid e-mail addresses
Message-Id: <6bausd$8pc$1@marina.cinenet.net>

Jon Drukman (jsd@hudsucker.gamespot.com) wrote:
[with regard to email address validation]
: there are clearly some forms which are more likely to be undeliverable
: than others.  i believe in catching the most egregiously
: incorrect-looking cases.

I agree, if by 'catching' you mean 'warning about' or 'confirming with 
the user', rather than 'rejecting'.

---------------------------------------------------------------------
   |   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: Wed, 04 Feb 1998 18:12:42 -0500
From: John Endersol <johne@secserver.com>
Subject: Security implications of perl scripts...
Message-Id: <34D8F5EA.6C8A86FB@secserver.com>

I used to think that my data had privacy and security.  It didn't.
Perlscripts online are the least of the problems.

I just received the first copy of the free newsletter from
http://www.securedata.org
It tells in plain English how to guard my privacy and security online
and offline.

It is excellent.

John




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

Date: 5 Feb 1998 01:15:30 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: solution for multiline comments???
Message-Id: <6bb3ri$ase$5@comdyn.comdyn.com.au>

In article <s93bni-ya02408000R0302982131270001@snews.zippo.com>,
	s93bni@csd.uu.se (Bjvrn Nilsson) writes:

> /******
> * This is a comment about what is to follow.
> * This class is a nonsense class that really does nothing but
> * serving as an example.
> *******/
> i.e. a notation like the /* C, C++, Java etc */ commenting be a nice
> feature in Perl as well?

#######
# This is a comment about what is to follow.
# This class is a nonsense class that really does nothing but
# serving as an example.
#######

if you really want c-style comments, just run your source through a C
preprocessor (hint: look at the -P option). But remember: You have
just possibly made your code non-portable. Just use the pod style
comments, or hash marks.

BTW. Would you ask on comp.lang.c if it maybe was possible to have
shell style comments in c source?

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | The gene pool could use a little
Commercial Dynamics Pty. Ltd.       | chlorine.
NSW, Australia                      | 


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

Date: Wed, 04 Feb 1998 20:31:04 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: solution for multiline comments???
Message-Id: <34D91657.D45B886D@coos.dartmouth.edu>

Chip Salzenberg wrote:
> 
> According to rjk@coos.dartmouth.edu:
> >In my opinion, the POD method is extremely ugly for block comments.
> 
> There's no accounting for taste.
> 
> >It distorts the intended use of POD, and it's not part of the Perl language.
> 
> Pod (or rather =... =cut) *is* very definitely part of the Perl language.
> That _is_ Perl's multiline comment syntax.  It just so happens that there
> are tools that can read those comments and use them as documentation, but
> Perl doesn't know that.

Alright then.  Consider these code samples:

# commented with POD
$a = $b;
=head1
;
$c = $d
=cut
;
print "$a\n$b\n$c\n$d\n";

# NOT commented with POD
$a = $b
=head1
;
$c = $d
=cut
;
print "$a\n$b\n$c\n$d\n";

# NOT commented with POD: compilation error
$a = $b
=head1
$c = $d
=cut
;
print "$a\n$b\n$c\n$d\n";

# commented with #
$a = $b
#
# ;
# $c = $d
#
;
print "$a\n$b\n$c\n$d\n";

Note that in the third and fourth pieces of code, only the first line is a comment.
=head1 and =cut are interpreted as part of the code.  Not entirely unreasonable.
But definitely inconsistent with the other code samples.
A good multiline commenting syntax shouldn't be so ambiguous.

> >I should be able to comment out large blocks of code without making them
> >part of the documentation.
> 
> That's possible if you real perlpod.

Okay, cool.

Chipmunk


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

Date: Thu, 05 Feb 1998 01:03:31 GMT
From: wyldkard@total.net (Johnny Fingers)
Subject: Re: Text Problems With Explorer 4.0
Message-Id: <MPG.f42da24f998a094989680@news.videotron.ca>

[This followup was posted to comp.lang.perl.misc and a copy was sent to 
the cited author.]

In article <6ap4vo$lv$1@news.greatbasin.net>, webmaster@builderpress.com 
says...
> Hi all,
> 
> I may be jumping in late on a previous discussion, but this problem
> only recently came to light. I recently learned that a few folks
> submitting to my cgi forms were having problems with their data being
> posted, and the bug traces back to only those people using Explorer
> 4.0 or 4.01. I checked into this on my own and it seems that IE4 is
> not passing values on type="text" fields on my cgi forms. I have
> absolutely no clue why IE4 isn't passing along these field values, and
> I can't find a way to make it work (not that I enjoy the idea of going
> back through 3+ years of forms to make changes to accomodate an
> apparent bug in IE4). Has anyone else encountered this? Your help may
> help save my sanity.
> 
> Greg Campbell,
> Washoe Media
> 
> 
Hi

As weird as this is going to sound we had the same problem when running 
forms at work. We were able to fix the "text" problem with 'text'. Don't 
ask me WHY but it didn't like the double quotes around the text option. 
We figured this out as all forms create with Perl/CGI (which uses single 
quotes) worked fine.

Hope this helps.


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

Date: Wed, 04 Feb 1998 19:24:44 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Tie-Dee-Perl (Cleanliness is next to Goodliness, or Perl-White Code)
Message-Id: <fl_aggie-0402981924440001@aggie.coaps.fsu.edu>

In article <Pine.OSF.3.95.980204141710.29487F-100000@primal.ucdavis.edu>,
Jason Christian <jason@primal.ucdavis.edu> wrote:

[humorous note about 'Tie': I do not think that word means what you think
 it means :]

+ On 4 Feb 1998, Craig Berry wrote:
+ 
+ >   open NUMBERS, "< numbers.txt" or die "Can't open numbers.txt: $!";
+ >   $numbers = <NUMBERS>;
+ >   close NUMBERS;

+ which reads "never say 'open'
+ without saying 'die'," or something like that.  That rule is more about
+ practicality than simply cleanliness:  it is nice to know what broke.

Darn right. That one bit me often enough early on -- now its second
nature. Even when I do a one-off proof-of-concept script from the command
line, I always do a 'or die'.

+ But how about closing files? ...
+ If following Craig's slurp (but before his proper
+ 'close') I were to 

+    open NUMBERS, "irrationals.txt" or die "Damn irrationals.txt is big: $!";

Danger! Danger, Will Robinson! If memory serves (and the perlop manpage
indicates this is true), the way this is going to be evaluated is like:

(open NUMBERS), ("irrationals.txt" or die...)

The evaluation will attempt to do the "or" first, then the open. Not
necessarily what is wanted!!

+ Or is there
+ some other reason to obsessively close things we have opened?

To be certain that things are closed and properly buffered-out?

James - I'm at best hap-hazard about such things...

-- 
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/perl/faq/idiots-guide.html>


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

Date: Wed, 4 Feb 1998 16:54:11 -0800
From: Jason Christian <jason@primal.ucdavis.edu>
Subject: Re: Tie-Dee-Perl (Cleanliness is next to Goodliness, or Perl-White Code)
Message-Id: <Pine.OSF.3.95.980204164052.2473C-100000@primal.ucdavis.edu>

On Wed, 4 Feb 1998, I R A Aggie wrote:

> In article <Pine.OSF.3.95.980204141710.29487F-100000@primal.ucdavis.edu>,
> Jason Christian <jason@primal.ucdavis.edu> wrote:
> 
> [humorous note about 'Tie': I do not think that word means what you think
>  it means :]

It was a pun, dammit.

Now if only I could work "tie" and "die" into the same command.

use GDBM;
unless (def($pun{'tie'})){die "Help$!"}


> + On 4 Feb 1998, Craig Berry wrote:
> + 
> + >   open NUMBERS, "< numbers.txt" or die "Can't open numbers.txt: $!";
> + >   $numbers = <NUMBERS>;
> + >   close NUMBERS;
> 
> + which reads "never say 'open'
> + without saying 'die'," or something like that.  That rule is more about
> + practicality than simply cleanliness:  it is nice to know what broke.
> 
> Darn right. That one bit me often enough early on -- now its second
> nature. Even when I do a one-off proof-of-concept script from the command
> line, I always do a 'or die'.
> 
> + But how about closing files? ...
> + If following Craig's slurp (but before his proper
> + 'close') I were to 
> 
> +    open NUMBERS, "irrationals.txt" or die "Damn irrationals.txt is big: $!";
> 
> Danger! Danger, Will Robinson! If memory serves (and the perlop manpage
> indicates this is true), the way this is going to be evaluated is like:
> 
> (open NUMBERS), ("irrationals.txt" or die...)

Right.  If I hadn't been plagiarizing from Craig I would have written
  open(NUMBERS,"irrationals.txt")||die "d in the wool, wash in cold water $!";

> 
> + Or is there
> + some other reason to obsessively close things we have opened?
> 
> To be certain that things are closed and properly buffered-out?

For input, don't we know we have everything after our last <>?

"Tie"ing to a different thread, close() undoes flock().  Does the close
that is performed (implied?) when one reuses a filehandle also un-flock?
Or is this a reason for formally close() -ing the filehandle, to make
sure $filename gets un-flocked?


---------------------------------------------------------------------------
Jason Christian                          University of California, Davis 
jason@primal.ucdavis.edu                  Agricultural and Resource Economics
Office:(530)752-1357 FAX:(530)752-5614   Davis, CA 95616



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

Date: 5 Feb 1998 01:00:12 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Tie-Dee-Perl (Cleanliness is next to Goodliness, or Perl-White Code)
Message-Id: <6bb2us$cif$2@marina.cinenet.net>

Jason Christian (jason@primal.ucdavis.edu) wrote:
[snip]
: But how about closing files?  Being sloppy, I confess that in the
: privacy of my own home I occasionally leave doors open; it may be the
: case that I do this occasionally in a Perl script.  What is the cost of
: this sloppiness?
[snip]

In general, there's no cost involved (beyond the trivial amount of memory 
associated with the now-unused file handle, of course).  I obsessively 
close files for three reasons:

* It keeps me honest about when I'm done with a file.  If I think
  I'm done, do a close, then really end up using the same handle
  later, I find out quickly rather than after arduous debugging.
  In the same vein, when someone reads my code, they can tell for
  sure when a filehandle can be considered irrelevant, rather
  than wondering if maybe three pages down it'll pop up again.

* Some OS's only allow a process to have a rather small total
  number of open filehandles.  Though this is seldom a real
  concern for the sort of apps I write, why tempt fate?

* I'm just obsessive-compulsive enough to worry that someday,
  somehow, on some perhaps as-yet-nonexistent OS, Bad Things
  will occur if I leave filehandles lying around open.  It's
  easier just to close everything than to lose sleep. :-)

---------------------------------------------------------------------
   |   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: 4 Feb 1998 18:24:53 -0600
From: will@Starbase.NeoSoft.COM (Will Morse)
Subject: Re: Unpack float
Message-Id: <6bb0sl$plg$1@Starbase.NeoSoft.COM>


I read (and write) float data with perl all the time, although not particularly
in a struct.

Perhaps a little information like what platform, are your floats IEEE
or some other format, which version of perl, a code sample of what doesn't
work, or some other clue might help here.

I don't suppose the float is not word aligned or something silly like that?

Will

In article <34D54413.8126EF48@ix.netcom.com>,
Paul Banks  <pbanks@ix.netcom.com> wrote:
>I need to unpack a struct which contains float data.
>
>I can unpack the int, long & short, but float gives me some really weird
>results.  I have read the section that says it can't be done, but that
>was last week.
>
>Does anyone have a solution other than writing a small c program to
>convert the entire struct to character data via fprintf?
>
>Thanks
>Paul Banks
>pbanks@ix.netcom.com
>


-- 
# Copyright 1997 Will Morse.  Internet repost/archive freely permitted.
# Hardcopy newspaper, magazine, etc. quoting requires permission.
# 
#      Gravity,                    #    Will Morse
#      not just a good idea,       #    Houston, Texas
#              it's the law.       #    will@starbase.neosoft.com
#
#   These are my views and do not necessarly reflect anyone else/
 =========================================================================
      By US Code Title 47, Sec.227(a)(2)(B), a computer/modem/printer
      meets the definition of a telephone fax machine. By Sec.227(b)
      (1)(C), it is unlawful to send any unsolicited advertisement to
      such equipment, punishable by action to recover actual monetary
      loss, or $500, whichever is greater, for EACH violation.
 =========================================================================



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

Date: 4 Feb 1998 17:33:07 -0600
From: jesten@earth.execpc.com (Jim Esten)
Subject: Re: Who knows about Base64 oder Uudecoder in Perl?
Message-Id: <6batrk$m03@newsops.execpc.com>

Tobias Bugala (TobiasBugala@swol.de) wrote:
: I think I've already seen s.th. like that in the Camel-Book, but I can't
: find it. Does anybody know of it?

: TOBI


Can't find the routine or the camel book?  ;)

page 198 of the chartreuse camel....

#!/usr/bin/perl
$_=<> until ($mode,$file) = /^begin\s*(\d*)\s*(\S*)/;
open(OUT,">$file") if $file ne "";
while (<>) {
	last if /^end/;
	next if /[a-z]/;
	next unless int(((ord() - 32) & 077) + 2 / 3) ==
		int(length() / 4);
	print OUT unpack("u", $_);
}
chmod oct($mode), $file;


cheers,

Jim

-- 
Jim Esten
WebDynamic
jesten@wdynamic.com  http://wdynamic.com


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

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

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