[6342] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 964 Volume: 7

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 17 14:17:14 1997

Date: Mon, 17 Feb 97 11:00:29 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 17 Feb 1997     Volume: 7 Number: 964

Today's topics:
     Re: 'Programming perl'? Will it damage my health? (Jeffrey)
     Re: Compiling Perl on UnixWare <alt.test@dispatch.demon.co.uk>
     Re: difference btw s/// & tr/// (Honza Pazdziora)
     File length? (Kovacs Anita)
     Re: File length? (Chris Schleicher)
     Re: finding full path to file name <seay@absyss.fr>
     Re: grep returns no value (Chris Schleicher)
     Re: H: How to associate the .pl extention with perl.exe <hanklem@ibm.net>
     Re: Help ! How to process @ character in a string ? (Bob Wilkinson)
     Re: Help in setting up S/// (Jeffrey)
     Re: Help with chat2.pl (Jagadeesh Venugopal)
     Re: HOW TO SPLIT A SIMPLE STRING <Mazda.Hewitt@bbsrc.ac.uk>
     Re: HOW TO SPLIT A SIMPLE STRING <Mazda.Hewitt@bbsrc.ac.uk>
     Re: Need help for 2 easy PERL questions, please <rob@netcentral.net.no.spam>
     Re: Perl vs Korn Shell (Piers Cawley)
     Perl/CGI into Ingres Databases <pgriffit@hpbrij69.bri.hp.com>
     Re: Perl5 for Windows 95 (Chris Schleicher)
     Re: Perl5 for Windows 95 (Craig S. Riter)
     Problem with '-s' switch.. (sukumar)
     Re: PROGRAM: how to check for nice/valid email address (DUPLANTIER Bastien)
     Q: Automatically move text from one page to another (Varog Kervarec)
     Re: QUES: what is "undump"? (Steven L. Kunz)
     Re: QUES: what is "undump"? (Steven L. Kunz)
     Questions <reb@pobox.com>
     Re: regexp's in XEmacs vs. Perl (Jeffrey)
     Re: Regular Expressions and Assigning to Variable <jander@jander.com>
     Re: Searching for Perl-supported Linux database (Todd R. Eigenschink)
     Re: Sorting Hash of a Hash...help (Jeff Carnahan)
     Re: space stripping (Jeffrey)
     Re: space stripping (Christopher Masto)
     Re: using "$var" considered harmful?! (was Re: Q: openi <tchrist@mox.perl.com>
     Win32::InitiateSystemShutdown <dloud@erols.com>
     Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)

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

Date: 15 Feb 1997 17:28:51 GMT
From: jfriedl@tubby.nff.ncl.omron.co.jp (Jeffrey)
Subject: Re: 'Programming perl'? Will it damage my health?
Message-Id: <JFRIEDL.97Feb16022851@tubby.nff.ncl.omron.co.jp>


Mike Stok <mike@stok.co.uk> wrote:
|> The book assumes perl 5 is the "normal" perl, an doesn';t dwell
|> much on 4, 3, 2 etc.

According to Tom, there is no such thing as ``Perl 4''.
There is ``Perl'' (currently 5.003).
Then there's ``dead flea-bitten camel carcasses''

	Flea-bitten Jeffrey
----------------------------------------------------------------------------
Jeffrey Friedl <jfriedl@omron.co.jp> Omron Corp, Nagaokakyo, Kyoto 617 Japan
O'Reilly & Associates' _Mastering Regular Expressions_
                                   http://enterprise.ic.gc.ca/~jfriedl/regex/


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

Date: Mon, 17 Feb 1997 17:09:14 GMT
From: See Signature For Real Name And Email Address <alt.test@dispatch.demon.co.uk>
Subject: Re: Compiling Perl on UnixWare
Message-Id: <uqfd8tzz7et.fsf@drmail.dr.lucent.com>

david.getchell@paonline.com (David Getchell) writes:

> I am having a hard time getting Perl to compile on UnixWare 2.1. The
> version of Perl is 5.003. It fails several of the tests during the
> self-check. I also was unable to use dynamic loading. Suggestions?

I was able to finally make it to "all tests successful" by following
this hint from the UnixWare Frequently Asked Questions (Developer) (D34)

   File glob tests fail due to broken csh in UnixWare 1.1.4.

   I have two reports that the version of csh included with UnixWare 1.1.4
   is broken (which is the version of csh included in PTF2001 which fixes
   memory leaks in csh).  This will cause some of the "file glob" tests to
   fail.

   If this happens to you, you can get around the problem by going back
   to Step 3 above and changing d_csh='define' to d_csh='undef' in
   config.sh then continuing on with the remaining steps.  You might also
   want to check out my File::Glob module which does file globbing inside
   Perl (http://www.metronet.com/~tye/glob.html).

Using the following I am able to repeatably do a successful build:

#!/bin/sh

# DESTDIR is where perl will be invoked from once all steps
# of the build and install are complete

DESTDIR=/usr/add-on/perl
PATH=/sbin:/usr/sbin:/usr/bin:/etc:/usr/ccs/bin
export PATH
OPTS="-Dprefix=$DESTDIR -Dlibc=\"/usr/ccs/lib/libc.so\""
LD_LIBRARY_PATH=`pwd`; export LD_LIBRARY_PATH
rm -f config.sh
 ./Configure -dsE $OPTS
mv config.sh config.sh.bak
cat config.sh.bak | sed -e "s/d_csh='define'/d_csh='undefine'/g" > config.sh
 ./Configure -S 
make
make test

-- 
Larry Mulcahy                               bofh@lucent.com
Computing and Telecommunications Services   Unix System Administration Team
http://info.dr.lucent.com/~ambient/         303-538-4821
            Linux: It is now safe to turn on your computer.


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

Date: Mon, 17 Feb 1997 17:05:38 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: difference btw s/// & tr///
Message-Id: <adelton.856199138@aisa.fi.muni.cz>

bw@mail2.tripnet.se (Bertil Wennergren) writes:

> : s/// uses regexes and does subsitutions on matches
> : 
> : tr/// does not use regexes and does translations from, say
> : lowercase to uppercase
> : 
> 
> My first reaction to the tr-function was to try something like this, which
> would be ideal for a lot of my text work:
> 
> tr/(ab)(cd)(ef)(gh)/ijkl/;
> 
> The idea was to translate certain character combinations into single
> characters (ab -> i, cd -> j...). I doesn't work however. :-( I had to use
> more cumbersome s-functions.

I hope you can still do

tr/abcdefgh/iijjkkll/;

Hope this helps.

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: 17 Feb 1997 15:36:52 GMT
From: anita@unicorn.sch.bme.hu (Kovacs Anita)
Subject: File length?
Message-Id: <5e9tuk$gpp$1@goliat.eik.bme.hu>


Does anybody happen to know how to get a file's length in bytes
by a perl function?
thanks a lot!

Csaba Tanczos


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

Date: 17 Feb 1997 10:22:37 -0800
From: chrissch@cs.uoregon.edu (Chris Schleicher)
Subject: Re: File length?
Message-Id: <5ea7ld$3uj@psychotix.cs.uoregon.edu>

In article <5e9tuk$gpp$1@goliat.eik.bme.hu>,
Kovacs Anita <anita@unicorn.sch.bme.hu> wrote:
>Does anybody happen to know how to get a file's length in bytes
>by a perl function?
>thanks a lot!

Consider using either the stat() function or the -s file test operator.
Also consider reading some of the fine Perl documentation. ;-)


Yours,

--Chris
-- 
     Chris Schleicher                      Office:  541/346-3998
     Univ of Oregon CIS GTF                email: chrissch@cs.uoregon.edu
                URL: http://www.cs.uoregon.edu/~chrissch/


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

Date: Mon, 17 Feb 1997 17:07:52 +0000
From: Douglas SEAY <seay@absyss.fr>
Subject: Re: finding full path to file name
Message-Id: <33089068.3041@absyss.fr>

Todd Lowpensky wrote:
> 
> I'm being passed a file name to work on, and I need to
> figure out the entire path of the file.  The string passed
> to me may be "../../../motive/file", so it would require
> a fair amount of work to reconstruct it from the current
> directory.
> 
> I'm using PERL 5 in Solaris.  Any ideas?
> thanks
> --
> 
> -TL
> toddl@net.com

here is something I wrote a long time ago.  I don't
remember what I was trying to do, but I think it might
do what you want.

doug seay
seay@absyss.fr

-------------------{ cut here }--------------------

#!/usr/local/bin/perl -w
 
use     strict;
 
my $name = shift || '.';
die "cannot find $name\n" unless ( -e $name );
 
$name .= '/.' if ( -d $name );
 
$name = "./$name" unless ( substr($name,0,1) eq '/' );
$name = &search($name);
 
die "ERROR: $name does not exist\n" unless ( -e $name );

print "$name\n";
 
 
sub     search
{
my $name = shift;
my $base = $name;
$base =~ s|.*/|/|;
substr($name, -length($base)) = '';
$base = '' if ( $base eq '/.' );
return $base unless ( $name );
 
chdir($name);
$name = `pwd`;
chomp($name);
&search($name) . $base;
}


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

Date: 17 Feb 1997 10:07:55 -0800
From: chrissch@cs.uoregon.edu (Chris Schleicher)
Subject: Re: grep returns no value
Message-Id: <5ea6pr$3rs@psychotix.cs.uoregon.edu>

In article <5e8vsi$gio@nr1.toronto.istar.net>,
Lee Johnson <ljohnson@isys.ca> wrote:
>I'm tying to strip the file and replace it with only the lines that contain
>a given word.

Use the -w flag to let Perl help you out with warnings about suspicious
code.  The -w flag is your friend.


>$file='/home/logs/logs.txt';
>@today_log = grep/nancy/, <$file>;

Here <$file> isn't what you think it is.  If you're going to use angle
brakets to do a read on a filehandle, what's between the brackets better
be a filehandle!  Do you see why what you have isn't?


>open (LOG, ">$file") ||print("Hey:$!\n");
>print LOG $today_log;

Oops.  $today_log is _not_ the same as @today_log.  If you've succesfully
managed to get an array of lines containing 'nancy' in @today_log you
need to print @today_log to the file, not $today_log which is an
unitialized variable (-w would have warned you about this :-).

I think something along the following lines might help:

---------------
## Read into @today_log
$file = '/home/logs/logs.txt';
open(LOG, $file) or die "Couldn't open logfile: $!";
chomp(@today_log = <LOG>);
close(LOG) or warn $!;

## I prefer matching all lines w/nancy over removing all lines w/o nancy
@matches = grep { /nancy/ } @today_log;

## Output our findings.
open(LOG, ">$file") or die "Can't open log for writing: $!";
print LOG join("\n", @today_log);
close(LOG) or warn $!;
---------------

Could someone remind me why <$file> doesn't raise a 

    Read on closed filehandle ...

warning?  Seems it must be somehow related to the fact that Perl might
be expecting a glob in there (e.g., <${file}>).


Hope this helps,

--Chris
-- 
     Chris Schleicher                      Office:  541/346-3998
     Univ of Oregon CIS GTF                email: chrissch@cs.uoregon.edu
                URL: http://www.cs.uoregon.edu/~chrissch/


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

Date: Mon, 17 Feb 1997 10:17:35 -0700
From: Hank LeMieux <hanklem@ibm.net>
To: Jvrgen Gustafsson <jorgen.gustafsson@mailbox.swipnet.se>
Subject: Re: H: How to associate the .pl extention with perl.exe in win95??
Message-Id: <330892AF.7BAE@ibm.net>

Sir,

You wrote:
> Hello, have installed Perl5 for Win95 and there is no problem to run
> a  script when i write PERL MYSCRIPT.PL, but when I write only
> MYSCRIPT.PL, I'm getting an errormessage.....
> 
> How do I associate .pl files with perl.exe???
> Doesn't the line #!/perl5/bin/perl do the job??

No, #!/perl5/bin/perl only works on unix.

This question is answered in full in question 4.10 of the perl for Win32
FAQ at
<http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ_4.html#4_10>. 

Some important points: On windows, it's best to
install perl into a directory whose full path contains directory names
of 8 characters or less (ie: NOT in a directory, or nested in a
directory with names like "program files", because DOS will translate
this to "progra~1", which messes up perl's ability to find things). 
There is a way to install perl such that it handles these extended file
names correctly, but it's easier and less frustration-prone to simply
use short directory names.  (NOTE: it won't work to change the directory
names after perl is installed).  Also, bullet 10 of question 4.10 tells
you to type "[full path to perl]\perl.exe %1 %*" when specifying the
pathway to perl.exe.  I couldn't get the "%1 %*" to work.

Maybe someone else can fill us in on that one?

Good luck!

Hank
hanklem@ibm.net

--

Hank LeMieux
Freelance Web Design/JavaScript/CGI
Santa Fe, NM
(505) 986-8166
http://members.aol.com/HankWeb/



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

Date: Mon, 17 Feb 1997 17:16:59 -0500
From: b.wilkinson@pindar.co.uk (Bob Wilkinson)
Subject: Re: Help ! How to process @ character in a string ?
Message-Id: <b.wilkinson-1702971716590001@ip57-york.pindar.co.uk>

In article <32FBCCEF.3D25@student.monash.edu.au>,
default.user@g306.fcit.monash.edu.au wrote:

> Hi everyone ,
>      I had this problem , I need to process this script but I encounter
> server error at the @abc , how do I go about stripping the @ character.
> here is the listing :
> -------------------------------
> #! /usr/local/bin/perl
deletia
>  $txt
> ="http://user:password@abc.ct.monash.edu.au/~cvc/sdc.html?hidval=test";
>  $txt =~ s/$d/$c/g;
> 
 deletia
> ----------------------------------------
> sorry for being so brief - school lab is closing
> Edmund
> klcho5@student.monash.edu.au

I think that you just have to escape the "@" character with the "\" character,
so you'd do password\@abc etc.

Sorry for being so brief - just about to go.

Bob

-- 
All is flux, nothing is still; nothing endures but change
- Heraclitus


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

Date: 15 Feb 1997 17:18:44 GMT
From: jfriedl@tubby.nff.ncl.omron.co.jp (Jeffrey)
To: keith@stage.netsinc.com (Keith Arner)
Subject: Re: Help in setting up S///
Message-Id: <JFRIEDL.97Feb16021844@tubby.nff.ncl.omron.co.jp>


[post and mail]

Keith Arner <keith@stage.netsinc.com> wrote:
|> > Multiple leading spaces (Must Be Kept)
|> > an optional asterisk ( would like to remove it ) change it to a blank.
|> > Multiple spaces (Must be kept)
|> > Text ..............
|> > 
|> > The need is to remove the optional asterisk if it is there
|> > but not to remove any asterisks that may be in the text.
|> 
|> s/(\s+)\*(\s+)/\1 \2/

You probably want to make sure you use a leading /^/.

Oh, and remember, \1 and the like are regex metacharacters (to be used
in the regex). Outside of a regex, after the match, you'll want to use $1
and such (variables representing the text matched).

Small efficiency point: the 2nd (\s+) is just to make sure whitespace
follows -- but one \s is just as good as many, so there's no real benefit
to use \s+. Using the simpler \s alone makes it a bit more efficient.

But come to think of it, there's really no need to bother matching the
spaces -- an asterisk after the leading spaces is enough. I'd just go with:

	s/^(\s+)\*/$1 /;

Jeffrey
----------------------------------------------------------------------------
Jeffrey Friedl <jfriedl@omron.co.jp> Omron Corp, Nagaokakyo, Kyoto 617 Japan
O'Reilly & Associates' _Mastering Regular Expressions_
                                   http://enterprise.ic.gc.ca/~jfriedl/regex/


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

Date: 17 Feb 1997 17:35:50 GMT
From: jvenu@ctp.com (Jagadeesh Venugopal)
Subject: Re: Help with chat2.pl
Message-Id: <5ea4tm$db1@concorde.ctp.com>
Keywords: Opening a TELNET/FTP session in PERL

In article <5e8476$sle@news.uta.edu> vkd0871@omega.uta.edu (Vasudev Dalal) writes:
>Hello all :
>
>	I have been keeping an eye on the posts and till 
>now I have not seen any-one really answer the problem/
>question of opening a Telnet OR FTP session.
>
>	The FAQS says that I need to use the chat2.pl 
>script and just for the kicks I downloaded a copy of the 
>script and tried to open a session, but it is not very 
>obvious and I had no success.
>

Please refer to the book, Perl 5 How-to at your friendly
neighborhood book store. It explains in sufficient detail
how one can use telnet through a Perl script. Alternatively 
see the unsupported code below.

>
>	I so, could you please guide me & many who have 
>posted and got no help here.

People that know Perl pretty well get sick of answering
the same questions time and again. Maybe some prior research
at www.dejanews.com might help?

#!/usr/local/bin/perl 

require "chat2.pl";
use Term::ReadKey;

$DEBUG = 1;

# specify handlers for SIGINT, SIGQUIT, SIGTERM
$SIG{"INT"} = "GotSig";
$SIG{"QUIT"} = "GotSig";
$SIG{"TERM"} = "GotSig";

#set the buffering to character mode
$| = 1;

#now open a command and create a handle to it
$handle = &chat::open_proc("/bin/sh");

&chat::expect($handle,			
	      10,                       
	      '\$\s',                   
	      '&chat::print($handle, "stty -echo\n");', 
	      'EOF', '&Eof',           
	      'TIMEOUT', '&TimeOut'    
	      );

#ask to telnet to firewall
&chat::expect($handle, 10,               
	      '\$\s',     '&chat::print($handle, " exec telnet firewall\n");',
	      'EOF', '&Eof;',           
	      'TIMEOUT', '&TimeOut'     
	      );

#ask to telnet to denali.edu
&chat::expect($handle, 10,               
	      '\>\s',     
	      '&chat::print($handle,"telnet denali.edu\n");',
	      'EOF', '&Eof;',           
	      'TIMEOUT', '&TimeOut'     
	      );

#logged in to denali now; send username
&chat::expect($handle, 30,               
	      'ogin:\s',     
	      '&chat::print($handle,"user\n");',
	      'EOF', '&Eof;',           
	      'TIMEOUT', '&TimeOut'     
	      );

#set the read mode to pass through all characters without
#interpretation at our end

ReadMode("ultra-raw", STDIN);

#make it interactive so we can enter our password here
&Interact($handle);

#close and quit
&chat::close($handle);

sub GotSig {
print "Got Signal Quitting\n";
&chat::close($handle);
exit;
}

sub Interact {
    
    my($Ihandle) = @_;
    my(@Ready, $Count, $InBuffer, $OutBuffer);

    while(1) {
	
	@Ready = &chat::select(undef, STDIN, $Ihandle);
	if(grep($_ eq 'STDIN', @Ready)) {
	    
	    $Count = sysread(STDIN, $InBuffer, 1024);
	    ($Count >=1) || last;
	    ($InBuffer =~ /\004/) && return;  
	    &chat::print($Ihandle, $InBuffer);
	}

	if(grep($_ eq $Ihandle, @Ready)) {

	    ($OutBuffer = &chat::expect($Ihandle, 0, '[\s\S]+', '$&')) || last;
	    print $OutBuffer;

	}

    }
    
}

sub END {

    ReadMode("original", STDIN);

}

sub Eof {

    print ("Unexpected EOF\n");
    &chat::close($handle);
    exit 1;

}

sub TimeOut {

    print ("Unexpected TimeOut\n");
    &chat::close($handle);
    exit 2;

}

-- 
 /\/\ |Jagadeesh K. Venugopal, jvenu@ctp.com |http://w3.ctp.com/~jvenu 
/ /_.\|Cambridge Technology Partners, Inc.   |http://www.ccs.neu.edu/home/jkvg 
\  /./|304 Vassar St.  Cambridge, MA 02139   |
 \/\/ |Phone: 617.374.2028 FAX: 617.374.8300 +


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

Date: Mon, 17 Feb 1997 14:33:38 +0000
From: Mazda Hewitt <Mazda.Hewitt@bbsrc.ac.uk>
To: I R A Aggie <fl_aggie@hotmail.com>
Subject: Re: HOW TO SPLIT A SIMPLE STRING
Message-Id: <33086C42.3F54@bbsrc.ac.uk>

I R A Aggie wrote:
> 
> In article <5e254b$to6$1@news.nyu.edu>, donahue@acf2.nyu.edu (Adam M.
> Donahue) wrote:
> 
> +I have a a six character string,
> + say 012345, that I want to split into three variables, $one, $two, $three
> + that would then have 01, 23, 45.  The original string has no
> + delimiters, though.
<SNIP>
> ?? This presumes that you'll only have a 6 character string...
> 
> James - which may be good, may be bad, may be indifferent


#try 

(@list) = $string =~ /(\w{2})/g;


#then..
#$list[0]= 12
#$list[1]= 34
#$list[2]= 56
#$list[3]= 78

#Mazda


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

Date: Mon, 17 Feb 1997 14:31:01 +0000
From: Mazda Hewitt <Mazda.Hewitt@bbsrc.ac.uk>
To: I R A Aggie <fl_aggie@hotmail.com>
Subject: Re: HOW TO SPLIT A SIMPLE STRING
Message-Id: <33086BA5.59E2@bbsrc.ac.uk>

try 

(@list) = $string =~ /(\w{2})/g;

$list[0]= 12
$list[1]= 34
$list[2]= 56
$list[3]= 78

Mazda


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

Date: Mon, 17 Feb 1997 10:13:03 -0600
From: Rob Huffstedtler <rob@netcentral.net.no.spam>
Subject: Re: Need help for 2 easy PERL questions, please
Message-Id: <3308838F.2DD6FE73@netcentral.net.no.spam>

Instead of using a system call, why don't you open a filehandle and pipe
the output to sendmail
	open (MAIL, "|sendmail -f$FORM{'email'} $recipient) || die
Then anything you print to mail will be sent/
	print MAIL "Subject: Subject goes here";

as you might imagine $FORM{'email'} is the email address they put in the
form and recipient is a variable that specifies who to send it to.

Good Luck
	

> Here's the first question.  Using a CGI-perl script based on the
> "cgi-lib.pl", I want to send an email.  I CAN send the email.  Here's how
> I
> do it :
> 
> ---code starts here---
>     $command="mail     berube\@odyssee.net     <     $name_of_file";
>     system($command);
> ---code ends here---
> 
> [where "name_of_file" is the file that contains the body message for the
> email]
> When I do this, it sends a email to my email address no-problemo.  The
> problem is the following : the email doesn't have a "subject".  So, when
> I
> check my mail, I receive an email with no subject.  This ain't no good 
> Benjamin
> 
> --
> Benjamin Berube
> berube@odyssee.net
> http://www.odyssee.net/~berube


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

Date: 17 Feb 1997 16:32:33 GMT
From: pdcawley@aladdin.net (Piers Cawley)
Subject: Re: Perl vs Korn Shell
Message-Id: <5ea171$anl$1@gunnar.aladdin.net>

In article <5dg3v3$76b$1@mathserv.mps.ohio-state.edu>,
	ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
> [A complimentary Cc of this posting was sent to Dave Stagner 
><david_stagner@ncs.com>],
> who wrote in article <32FB57F5.41C6@ncs.com>:
>> Whether perl or korn shell is better depends largely on what you're
>> doing.  Korn shell is much more effective as an interactive command line
>> than perl.  :}
> 
> Hmm, apparently you did not use 
> 	perl -de 0
> recently ;-). (Of course, this supposes that you installed either
> T;:R::Perl or T::R::GNU.)

Well, it's very lovely indeed, but it doesn't quite do all the things
I like my shell to do. Of course, if someone would just write perlsh,
I for one would be very happy indeed.

-- 
Piers Cawley


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

Date: Mon, 17 Feb 1997 16:03:14 +0000
From: Phil Griffiths <pgriffit@hpbrij69.bri.hp.com>
Subject: Perl/CGI into Ingres Databases
Message-Id: <33088142.895@hpbrij69.bri.hp.com>

Has anyone out there developed a perl CGI module to interact with Ingres
?
We're looking to write a change request system using a web front &
Ingres backend.
Any sources of information would be greatly received.

I would appreciate an emailed response.
Many thanks.

-- 
Phil Griffiths
(pgriffit@hpbrij69.bri.hp.com)


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

Date: 17 Feb 1997 10:16:19 -0800
From: chrissch@cs.uoregon.edu (Chris Schleicher)
Subject: Re: Perl5 for Windows 95
Message-Id: <5ea79j$3t4@psychotix.cs.uoregon.edu>

  [mailed and posted]

In article <01bc1cba$01c03600$e022ea9e@P01223.logica.co.uk>,
Nobody <nobody@logica.com> wrote:
>I'm deperately trying to find a copy of perl5 for  Windows 95 -

http://www.perl.hip.com/


Regards,

--Chris
-- 
     Chris Schleicher                      Office:  541/346-3998
     Univ of Oregon CIS GTF                email: chrissch@cs.uoregon.edu
                URL: http://www.cs.uoregon.edu/~chrissch/


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

Date: Mon, 17 Feb 1997 18:16:50 GMT
From: criter@lucent.com (Craig S. Riter)
Subject: Re: Perl5 for Windows 95
Message-Id: <3309a066.12688514@nntp.cb.lucent.com>

http://www.activeware.com


>I'm deperately trying to find a copy of perl5 for  Windows 95 -
>Can anyone hepl ?
>Many Thanks
>Mat

______________________________________________________________________
Craig S. Riter         criter@riter.com         criter@povpartners.com
www.riter.com                           PGP key available upon request
It infuriates me to be wrong when I know I'm right.           -Moliere


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

Date: 17 Feb 1997 18:35:30 GMT
From: sukku@menudo.uh.edu (sukumar)
Subject: Problem with '-s' switch..
Message-Id: <5ea8di$kcn@Masala.CC.UH.EDU>

Hi there,
	I am trying to parse the command line switches in my script.
My script should  take '-m arg1 -l arg2' as command args.

#!/packages1/gnu/solaris/bin/perl  -s
if($l)
{
    print "l arg: $ARGV[0]\n";
}

if($m)
{
    print "m arg: $ARGV[1]\n";
}

Does not give me both args. It misses -m. If I print @ARGV, 
I get -m as one of its members. Can someone tell me what I am 
doing wrong??

TIA,
Srini.


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

Date: 17 Feb 1997 18:18:01 GMT
From: duplanti@enstb.enst-bretagne.fr (DUPLANTIER Bastien)
Subject: Re: PROGRAM: how to check for nice/valid email address
Message-Id: <5ea7cp$mkr@alfali.enst-bretagne.fr>

thank you

-- 
 --------------------------------------------------
 Bastien DUPLANTIER  	       tel : 02 98 00 18 16 
 add : ENSTB technopole Brest-Iroise 29280 PLOUZANE 
 http://www-eleves.enst-bretagne.fr/~duplanti       





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

Date: Mon, 17 Feb 1997 17:43:50 GMT
From: kervarec@online.no (Varog Kervarec)
Subject: Q: Automatically move text from one page to another
Message-Id: <33089417.36152728@news.eunet.no>

I am indeed new to perl, so any help will be greatly appreciated.

I have written (with a lot of good help and examples) a perl script
for publishing text on a web-page. 

When the user writes text into a form, the input is automatically
written to a predefined web-page, with the newest message at the top
(like an ordinary guestbook-script).

However, this script only accumulates text on this page - what I want
to do is to get the script to automatically limit the amount of text
to, let's say 10 messages, and then move the oldest onto another page
("archive"). When the archive reaches for instance 50 messages, the
oldest should be moved to yet another page ("archive 2"), and so on.

Also, the script should generate a link when the total amount is
reached ("Click here to view message archieve")...

Please reply both to this group and directly using e-mail to
sajaa@sn.no.

TIA - Jarle Aasland, NORWAY




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

Date: 17 Feb 1997 15:41:23 GMT
From: skunz@iastate.edu (Steven L. Kunz)
Subject: Re: QUES: what is "undump"?
Message-Id: <5e9u73$8s8$1@news.iastate.edu>

In <5e3mfd$dhe@fridge-nf0.shore.net> nvp@shore.net (Nathan V. Patwardhan) writes:

>John Nolan (sg94bwh5@dunx1.ocs.drexel.edu) wrote:
>: In Programming Perl (2nd ed, page 336), they mention in passing
>: that you can take the coredump of a compiled perl script, 
>: "undump" it using the undump program, and create an 
>: executable.  Does anyone know what undump is?  

>[...] If you undump the "hello world"
>program, it will be 300K.  Imagine the executable for something signifcant?

>You're better off checking out the Perl compiler, available at a CPAN
>near you!

But don't assume the Perl compiler is going to generate something smaller.
I'm not knocking the Perl5 compiler (I've used undump successfully but I
still abandoned it for the Perl5 compiler). I'm just saying that if you
generate "C" code, compile and link it for a "Hello world!" program, you
don't end up with something smaller than undump would have generated (or
something you even call "small" in general).

As proof, here are some stats on the one-line 'print "Hello, world!\n";'
program compiled with Perl5.003 (with the alpha3-compiler extension) on
Ultrix 4.3a (using staticly-linked extensions): 

         25 Feb 17 09:27 hello.pl
       4775 Feb 17 09:28 hello.c
     806912 Feb 17 09:30 hello

     (that "hello" binary IS stripped, by the way)

So, instead of 300K you get over 800K!  But it works.  Compile the same
thing on Sun-Irix and you get: 

         25 Feb 17 09:27 hello.pl
     758608 Feb 17 09:35 hello
       4775 Feb 17 09:34 hello.c

     (again, "hello" IS stripped)

-- 
Steven L. Kunz
Networked Applications  --  Project Manager, Microcomputer Networked Services
Iowa State University Computation Center, Iowa State University, Ames, Iowa
E-mail: skunz@iastate.edu


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

Date: 17 Feb 1997 15:56:50 GMT
From: skunz@iastate.edu (Steven L. Kunz)
Subject: Re: QUES: what is "undump"?
Message-Id: <5e9v42$879$1@news.iastate.edu>

In <5e9u73$8s8$1@news.iastate.edu> skunz@iastate.edu (Steven L. Kunz) writes:

> [...]
>So, instead of 300K you get over 800K!  But it works.  Compile the same
>thing on Sun-Irix and you get: 
          ========                   <-- Argh.  That is "SGI-Irix"
                                         Sorry for the confusion.
>         25 Feb 17 09:27 hello.pl
>     758608 Feb 17 09:35 hello
>       4775 Feb 17 09:34 hello.c

-- 
Steven L. Kunz
Networked Applications  --  Project Manager, Microcomputer Networked Services
Iowa State University Computation Center, Iowa State University, Ames, Iowa
E-mail: skunz@iastate.edu


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

Date: Mon, 17 Feb 1997 16:49:15 GMT
From: Edward Brown <reb@pobox.com>
Subject: Questions
Message-Id: <ocwws7wf78.fsf@serf.nsc.com>



I'm trying to open a process

open(PROCESS, "sccs get SCCS/s.$file |") || 
	die "Unable to open sccs\n";


Some of the errors (like "does not exist") apparently print to STDERR
and don't show up in the while(<PROCESS>) loop.

I tried:

 open(STDERR, ">&STDOUT") || die "Can't dup stdout";

but that doesn't help.

How can I get the error into my while loop (or a separate loop) so
that I can process based on the error?!


Ed


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

Date: 15 Feb 1997 17:35:50 GMT
From: jfriedl@tubby.nff.ncl.omron.co.jp (Jeffrey)
To: Hrvoje Niksic <hniksic@srce.hr>
Subject: Re: regexp's in XEmacs vs. Perl
Message-Id: <JFRIEDL.97Feb16023550@tubby.nff.ncl.omron.co.jp>


[mail and post]

Hrvoje Niksic <hniksic@srce.hr> wrote:
|> > While presumably one could do simple things like translate '\s' to
|> > '[ \t\n\r]', it would be require significant work to get some of
|> > the more useful Perl regexps.  Even to implement the \s translation
|> > perfectly one would need a regular expression parser so that
|> > [\sxyz] changes to [ \t\n\rxyz].
|> 
|> Whatever are you talking about??  Haven't you ever looked at Emacs
|> syntax tables?  Perl \s is the same as Emacs \s-.  Emacs also has \s_,
|> \sw, \S<something>, etc.  Look up the regexp section of the manual.

Well, perhaps my version is old, but last I checked, Emacs didn't allow the
use of syntax classes within character classes, so even that is still an
issue. /-:|=

	Jeffrey
----------------------------------------------------------------------------
Jeffrey Friedl <jfriedl@omron.co.jp> Omron Corp, Nagaokakyo, Kyoto 617 Japan
See my Jap<->Eng dictionary at http://www.wg.omron.co.jp/cgi-bin/j-e
O'Reilly's Regular Expression book: http://enterprise.ic.gc.ca/~jfriedl/regex/


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

Date: 17 Feb 1997 09:35:32 -0500
From: Jim Anderson <jander@jander.com>
Subject: Re: Regular Expressions and Assigning to Variable
Message-Id: <enef7b63.fsf@jander.com>

nelson@seahunt.imat.com (Michael Nelson) writes:

> 
> Hi...
> 
> I'm writing a small program to parse some data out of a web page
> and then print it out in another form.  My problem is this... I 
> need to find lines of the form:
> 
>     <th align=middle valign=top>1548</th>
>     
> ...and parse the number out of it, in this case, "1548".
> 
> I'm finding the lines ok, but having problems parsing the number
> out and dumping it into a variable.  I've tried several variations
> on the following, but I guess I don't understand how to get it to
> find a ">", followed by one or more digit chars, followed by a "<".
> 
> Some things I've tried:

[...]
 
> ...I have earlier initialized $variable to "0", but I never seem

Why would you do that? That's where the data you're matching against
resides!

Something like this ought to work:

	$nbr = $variable =~ />(\d+)</;

> to get a match, even when a pattern like ">1548<" exists in the
> line. $variable always stays set to "0".
> 
> Sure makes me feel like a dummy... 

-- 
Jim Anderson			jander@jander.com
PGP Public Key Fingerprint:	0A 1C BB 0A 65 E4 0F CD
				4C 40 B1 0A 9A 32 68 44


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

Date: 17 Feb 1997 13:28:09 -0500
From: eigenstr@pluto.mixi.net (Todd R. Eigenschink)
Subject: Re: Searching for Perl-supported Linux database
Message-Id: <87vi7rthhi.fsf@pluto.mixi.net>

Chris Schoenfeld <chris@ixlabs.com> writes:

> I'm in the market for a database with the following features:
> 
> 1. Native Linux and Spac Solaris support (i.e. share binary db's).
> 2. A thoroughly tested Perl 5 module interface.
> 3. Speedy, for CGI work.
> 4. Either commercial or well-supported PD.
> 5. Native file/record locking.
> 
>[stuff deleted]
> 
> Empress
> Empress not only has its own Perl module, but both the module and Linux
> seem to be commercially supported for this product. I don't know the
> price, but have sent email to the company for more info.
> 
> DBD::DBI (sp?) module.
> I am curious about the status of this module, and especially the mSQL, 
> PostgreSQL, and Empress interfaces. What exactly is the status of this
> project, and can anyone reccommend a particular implementation for
> production work? It would certainly be an advantage to have a
> well-supported transparent layer.


We use PostgresQL here.  I like it.  It's pretty stable (versions 1.09
and up).  It has a nice Perl module.  (But alas, no DBD yet, although
I just saw the other day that someone's starting one.))

I tested Empress.  The people are very helpful, and they offer a free
trial.  I got 60 days (it's a 30-day trial, but I requested and was
given an extension).  It's fast (*very* fast), at least as solid as
Postgres, comes with a ridiculous amount of documentation (read that
"a lot, and thorough").  The only reason why we're not using Empress
right now is that the Perl DBD isn't complete (as of 1 Jan 1997).
What's there works well, but there are some features that are missing.
It would have worked for our purposes, but I didn't want to go and
modify all our database-using code to rely on a semi-complete
interface.

(I just checked, and they're still distributing the same version of
the perl DBD that I played with.  I exchanged some email with the
author, and he was working on it in his spare time, but didn't have
any sort of schedule.)


Todd
-- 
Todd R. Eigenschink		Midwest Internet Exchange, Inc.
eigenstr@mixi.net		http://www.mixi.net/
System Administrator		(219) 459-2521


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

Date: Mon, 17 Feb 1997 18:33:42 GMT
From: tails@hooked.net (Jeff Carnahan)
Subject: Re: Sorting Hash of a Hash...help
Message-Id: <330aa3e5.83154810@news.wenet.net>

On Wed, 12 Feb 1997 16:49:51 -0500, "Chris R. Contakes"
<AFconcr@dia.osis.gov> wrote:

> $RECORD{$SSN}{last} = $lastname;
> $RECORD{$SSN}{first} = $first;
>  .

>  foreach $SSN (keys %RECORD) {
>     foreach $last( sort keys %{ $RECORD{$SSN}{$last}} )
>    .......
>     ......

Try:

foreach $item_1 (keys (%record)) {
	foreach $item_2 (sort ( keys( %{  $record{$item_1}  }))) {

	...

	}
}

You don't need to put the $last information in the sorting... =)


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

Date: 15 Feb 1997 17:25:52 GMT
From: jfriedl@tubby.nff.ncl.omron.co.jp (Jeffrey)
To: shields@crosslink.net (Michael Shields)
Subject: Re: space stripping
Message-Id: <JFRIEDL.97Feb16022552@tubby.nff.ncl.omron.co.jp>


[mail and post]

Michael Shields <shields@crosslink.net> wrote:
|> It's too new to be in Books in Print but if you bring the ISBN from
|> ora.com, any bookstore worth shopping at will be able to order it for you.

You'd be surprised. A couple of weeks ago, I went to *the* largest
bookstore in the entire country of Japan (the Kinokuniya near Tokyo's
Sinjuku station) to see if they had it (the ISBN is 1-56592-257-3, BTW). I
couldn't find it, but it's often misshelved, so I thought I'd ask.

Remember, this is the largest bookstore in all of Japan.

Given an ISBN, or a title, or anything, they can't tell you if they have it
other than by looking on the shelf to see if it's there.

(Did I mention that this is the largest bookstore in Japan?)

It boggles the mind.

Actually, this evening I was at the Kinokuniya in Osaka (the largest
bookstore in *this* part of Japan -- perhaps the 2nd largest in the
country). I didn't bother asking -- they didn't even have the English
version of O'Reilly's ``Understanding Japanese Information
Processing'' (by Ken Lunde). They had a bazillion ``for dummies''
books, and tons on web and ``internet'' and stuff. They didn't even
have the Camel. Pittiful.

Ah, but after 8 years of this, I'm moving to San Jose in a month or so.
I hear the Bay Area has a few reasonable bookstores :-)
	Jeffrey
----------------------------------------------------------------------------
Jeffrey Friedl <jfriedl@omron.co.jp> Omron Corp, Nagaokakyo, Kyoto 617 Japan
See my Jap<->Eng dictionary at http://www.wg.omron.co.jp/cgi-bin/j-e
O'Reilly's Regular Expression book: http://enterprise.ic.gc.ca/~jfriedl/regex/


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

Date: 17 Feb 1997 18:03:54 GMT
From: exidor@nimbus.superior.net (Christopher Masto)
Subject: Re: space stripping
Message-Id: <5ea6ia$oe1@news.webspan.net>

In article <JFRIEDL.97Feb16022552@tubby.nff.ncl.omron.co.jp>,
Jeffrey <jfriedl@wg.omron.co.jp> wrote:
>You'd be surprised. A couple of weeks ago, I went to *the* largest
>bookstore in the entire country of Japan (the Kinokuniya near Tokyo's
>Sinjuku station) to see if they had it (the ISBN is 1-56592-257-3, BTW). I
>couldn't find it, but it's often misshelved, so I thought I'd ask.
[horror story]
>Ah, but after 8 years of this, I'm moving to San Jose in a month or so.
>I hear the Bay Area has a few reasonable bookstores :-)

You should be somewhat happier.  The larger chain bookstores (Borders,
Barnes & Noble, Waldenbooks, B. Dalton, etc.) all have their inventory
computerized.  I'll have to ask if they can search using regular
expressions. :-)

Of course, you still have to wade through the "for dummies" books to get
to the shelves.

(Regular Expressions for Dummies, anyone?)


-- 
Christopher Masto  .   .   .   .   NetMonger Communications
chris@masto.com  .   .   .   .   . Masto Consulting:           info@masto.com



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

Date: 17 Feb 1997 14:47:20 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: using "$var" considered harmful?! (was Re: Q: opening a file RW without deleting it.)
Message-Id: <5e9r1o$1an$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    chrissch@cs.uoregon.edu (Chris Schleicher) writes:
:Did you mean?
:
:    sub g {
:       my $stuff = shift;
:       print "@{$stuff}\n";     # or perhaps just $stuff
:    }
:
:As written, g() isn't much use in illustrating you've stringified
:that array reference.

Yes, indeed.  That's what I meant.

thanks,

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


    "Have the appropriate amount of fun." --Larry Wall


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

Date: Mon, 17 Feb 1997 11:11:00 -0500
From: Dan <dloud@erols.com>
Subject: Win32::InitiateSystemShutdown
Message-Id: <33088314.6AAC@erols.com>

I am having problems with this function.  Anyone have any success with
it?


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

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

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 V7 Issue 964
*************************************

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