[17728] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5148 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 19 09:05:33 2000

Date: Tue, 19 Dec 2000 06:05:12 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <977234712-v9-i5148@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 19 Dec 2000     Volume: 9 Number: 5148

Today's topics:
        backslah as a normal char (Lalot Dominique)
        CGI, Perl and IBPerl dates <tick.toff@spam.com>
        crypt <Per-fredrik.Pollnow@epk.ericsson.se>
    Re: crypt <uackermann@orga.com>
        DBD:mysql <jenshoja@t-online.de>
        execute a Perl Programm with DBD:DBI - SQL-Statements i gerhard.hann@generali.at
        Executing perl on linux <jmcnamara@iel.ie>
        Help with Multi-dimensional array <rwan@cs.mu.OZ.AU>
    Re: Home Directory <tick.toff@spam.com>
        How to generate executables from perl scripts <richly@mpiz-koeln.mpg.de>
        just mucking about with splits <igor_aptekar@programmer.net>
    Re: just mucking about with splits (Rafael Garcia-Suarez)
        local $| (Was: Getting around named pipe blocking?)  <joe+usenet@sunstarsys.com>
        Mail::Send and MINE (J. K.)
    Re: One-Liner to Sum a Stack of Numbers? <bart.lateur@skynet.be>
    Re: One-Liner to Sum a Stack of Numbers? <bart.lateur@skynet.be>
    Re: One-Liner to Sum a Stack of Numbers? <pdcawley@bofh.org.uk>
    Re: One-Liner to Sum a Stack of Numbers? <nospam@nospam.com>
        perl -i cuts large files. <eli.oshrovich@intel.com>
    Re: perl -i cuts large files. <eli.oshrovich@intel.com>
    Re: Perl to TCP/IP Connection & Overall Direction Neede <nospam@nospam.com>
    Re: Perl to TCP/IP Connection & Overall Direction Neede (Monte Phillips)
    Re: perl, iis, form/java mail, form width <email@address.com>
    Re: possibly st00pid question regarding 'require' <nospam@nospam.com>
    Re: PPM question <snefsite@hotmail.com>
        s it possible to have these menu boxes populated by the (Phil Latio)
    Re: Splitting record string into fields appsman1368@my-deja.com
        String Parsing? spcman@my-deja.com
    Re: Trying to extract only names with letters in regex  <c.manley@chello.nl>
    Re: Use PERL or Java? Which is faster? <tt@cryogen.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 19 Dec 2000 09:19:55 GMT
From: lalot@univ-aix.fr (Lalot Dominique)
Subject: backslah as a normal char
Message-Id: <91n97r$3vm$1@news.univ-aix.fr>

Hello,

I am tring to substitute a string by another.
if I try:
s/\\/|/g
if I have 4 backslah, then I get 2 | instead of |

second problem, about the same..
Is there a way to change the quote \ caracter.

I am trying to substitute NT registries with double \\ in the path
and even \\\\ It's quite awfull to use 8 backslash..
I try $string='\\\\server\\share';
s/$string/$another/g
but it has some strange behavior!.

Thanks in advance

Dom



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

Date: Tue, 19 Dec 2000 13:24:37 GMT
From: "SuperGumby" <tick.toff@spam.com>
Subject: CGI, Perl and IBPerl dates
Message-Id: <pkJ%5.25095$xW4.194060@news-server.bigpond.net.au>

I've found a work around but am interested why I am having the problem.

-------------
this works
-------------

my $stmt = new IBPerl::Statement( Transaction => $tr,
    SQL => "select staff_number, fname, lname, nick from staffname order by
lname");

<snip>

while (($status = $stmt->fetch(\$record)) == 0){

# THIS LINE HERE
print "$record";

 @fields=split(/;/,$record);
 print "<TR ALIGN=\"CENTER\">\n".
  "<TD><a
href=\"staffedit.pl?staff_number=$fields[0]\">$fields[0]</a></td>\n".
  "<TD>$fields[1]</td>\n".
  "<TD>$fields[2]</td>\n".
  "<TD>$fields[3]</td>\n".
  "</tr>\n";
 }
 die "$stmt->{Error}\n" if ($status < 0);

-----------------end code

----------
this doesn't work when the table has a field type DATE, but does when the
field type is DATESTAMP
----------

my $stmt = new IBPerl::Statement( Transaction => $tr,
    SQL => "select * from staffname order by lname");

<snip>

while (($status = $stmt->fetch(\$record)) == 0){

# THIS LINE HERE
print "$record";

 @fields=split(/;/,$record);
 print "<TR ALIGN=\"CENTER\">\n".
  "<TD><a
href=\"staffedit.pl?staff_number=$fields[0]\">$fields[0]</a></td>\n".
  "<TD>$fields[1]</td>\n".
  "<TD>$fields[2]</td>\n".
  "<TD>$fields[3]</td>\n".
  "</tr>\n";
 }
 die "$stmt->{Error}\n" if ($status < 0);

-----------------end code


the only reason I have :

# THIS LINE HERE
print "$record";

is to inspect what comes back from Perl/IBPerl/InterBase,,, when it works
$record gives "1;Frederick;Dagg;Fred" (specifying fields) or
"1;Frederick;Dagg;20/12/00;Fred" (field type TIMESTAMP using "select * etc")
but if I use "select * etc" and the column is type DATE (rather than
TIMESTAMP) I get no output on this line, and no table.

TIA




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

Date: Tue, 19 Dec 2000 13:47:15 +0100
From: "Per- Fredrik Pollnow" <Per-fredrik.Pollnow@epk.ericsson.se>
Subject: crypt
Message-Id: <91nkq2$271$1@newstoo.ericsson.se>

Hello,

Can someone please help me, I don't know how to crypt. Can someone give me
an example? I have tried this:

print "Enter password: "chomp($passwd = <STDIN>);
$x = crypt::DES $passwd




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

Date: Tue, 19 Dec 2000 15:12:13 +0000
From: Ulrich Ackermann <uackermann@orga.com>
Subject: Re: crypt
Message-Id: <3A3F7ACD.E5805342@orga.com>

Per- Fredrik Pollnow wrote:
> 
> Hello,
> 
> Can someone please help me, I don't know how to crypt. Can someone give me
> an example? I have tried this:
> 
> print "Enter password: "chomp($passwd = <STDIN>);
> $x = crypt::DES $passwd

man Crypt::DES should be the right place to start, when looking for DES
encryption. Of course, you need Crypt::DES installed on your machine.

HTH, Ulrich 
-- 
Ulrich Ackermann
ORGA Kartensysteme GmbH (SY-PEAT-STA)
Tel.:+49.5254.991-925 
mailto:uackermann@orga.com


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

Date: Tue, 19 Dec 2000 14:01:18 +0100
From: "hotschi" <jenshoja@t-online.de>
Subject: DBD:mysql
Message-Id: <91nmbi$oj2$04$1@news.t-online.com>

Hello,
can anyone tell me where I can download the DBD driver for mysql.
Thanx




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

Date: Tue, 19 Dec 2000 10:50:06 GMT
From: gerhard.hann@generali.at
Subject: execute a Perl Programm with DBD:DBI - SQL-Statements in a file
Message-Id: <y3H%5.45$dg5.2325@nreader1.kpnqwest.net>

This is a multipart message in MIME format.
--=_alternative 003B859C412569BA_=
Content-Type: text/plain; charset="us-ascii"

Hi,
I have the following problem - I execute a perl programm with DBD:DBI - 
there I want to call 
a file with sql-statements - example is down enclosed with ******* - is it 
possible to call
a file with sql-statements from a perl-programm ?

thanks a lot for your help in advance
Gerhard Hann


@DB=("TEST1NT","OEM"); 
$DBCOUNT=@DB; 
$user="system"; 
$pw="manager"; 
$ENV{NLS_LANG}="GERMAN_GERMANY.WE8ISO8859P1"; 
$ENV{ORACLE_HOME}="c:\\oracle\\ora816ee"; 

use DBI;

for ($i=0;$i<$DBCOUNT;$i++) {

   $ENV{ORACLE_SID}=$DB[$i];
   $utlbstatdir="c:\\home\\oracle\\export\\$ENV{ORACLE_SID}";
   chdir $utlbstatdir;
   utl_start();
}

# Funktionendefinition
sub utl_start {
   # Connect to database
   $dbh = DBI->connect( "dbi:Oracle:$ENV{ORACLE_SID}", $user, $pw,
       { AutoCommit => 0, RaiseError => 0, PrintError => 1 } )
       or die $DBI::errstr;

$dbh->do( <<END_EINGABE1 );
alter system set timed_statistics=true 
END_EINGABE1

**************************************************************************************************************************
HERE is my PROBLEM - I WANT TO CALL A FILE, WHERE THE SQL-STATEMENTS ARE 
INSIDE
HOW DOES THIS WORK ???????????????????
$dbh->do( <<END_EINGABE2 );
@c:\\home\\oracle\\script\\utlbstat.cmd    <=== this is the file with 
sql-statements
END_EINGABE2
**************************************************************************************************************************

   $dbh->disconnect;

}

--=_alternative 003B859C412569BA_=
Content-Type: text/html; charset="us-ascii"




<br><font size=2 face="sans-serif">Hi,</font>
<br><font size=2 face="sans-serif">I have the following problem - I execute a perl programm with DBD:DBI - there I want to call </font>
<br><font size=2 face="sans-serif">a file with sql-statements - example is down enclosed with ******* - is it possible to call</font>
<br><font size=2 face="sans-serif">a file with sql-statements from a perl-programm ?</font>
<br>
<br><font size=2 face="sans-serif">thanks a lot for your help in advance</font>
<br><font size=2 face="sans-serif">Gerhard Hann</font>
<br>
<br>
<br><font size=2 face="sans-serif">@DB=(&quot;TEST1NT&quot;,&quot;OEM&quot;); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font>
<br><font size=2 face="sans-serif">$DBCOUNT=@DB; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</font>
<br><font size=2 face="sans-serif">$user=&quot;system&quot;; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</font>
<br><font size=2 face="sans-serif">$pw=&quot;manager&quot;; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</font>
<br><font size=2 face="sans-serif">$ENV{NLS_LANG}=&quot;GERMAN_GERMANY.WE8ISO8859P1&quot;; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font>
<br><font size=2 face="sans-serif">$ENV{ORACLE_HOME}=&quot;c:\\oracle\\ora816ee&quot;; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</font>
<br>
<br><font size=2 face="sans-serif">use DBI;</font>
<br>
<br><font size=2 face="sans-serif">for ($i=0;$i&lt;$DBCOUNT;$i++) {</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp;$ENV{ORACLE_SID}=$DB[$i];</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp;$utlbstatdir=&quot;c:\\home\\oracle\\export\\$ENV{ORACLE_SID}&quot;;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp;chdir $utlbstatdir;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp;utl_start();</font>
<br><font size=2 face="sans-serif">}</font>
<br>
<br><font size=2 face="sans-serif"># Funktionendefinition</font>
<br><font size=2 face="sans-serif">sub utl_start {</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp;# Connect to database</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp;$dbh = DBI-&gt;connect( &quot;dbi:Oracle:$ENV{ORACLE_SID}&quot;, $user, $pw,</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp;{ AutoCommit =&gt; 0, RaiseError =&gt; 0, PrintError =&gt; 1 } )</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp;or die $DBI::errstr;</font>
<br>
<br><font size=2 face="sans-serif">$dbh-&gt;do( &lt;&lt;END_EINGABE1 );</font>
<br><font size=2 face="sans-serif">alter system set timed_statistics=true </font>
<br><font size=2 face="sans-serif">END_EINGABE1</font>
<br>
<br><font size=2 face="sans-serif">**************************************************************************************************************************</font>
<br><font size=2 face="sans-serif">HERE is my PROBLEM - I WANT TO CALL A FILE, WHERE THE SQL-STATEMENTS ARE INSIDE</font>
<br><font size=2 face="sans-serif">HOW DOES THIS WORK ???????????????????</font>
<br><font size=2 face="sans-serif">$dbh-&gt;do( &lt;&lt;END_EINGABE2 );</font>
<br><font size=2 face="sans-serif">@c:\\home\\oracle\\script\\utlbstat.cmd &nbsp; &nbsp;&lt;=== this is the file with sql-statements</font>
<br><font size=2 face="sans-serif">END_EINGABE2</font>
<br><font size=2 face="sans-serif">**************************************************************************************************************************</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp;$dbh-&gt;disconnect;</font>
<br>
<br><font size=2 face="sans-serif">}</font>
<br>
--=_alternative 003B859C412569BA_=--


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

Date: Tue, 19 Dec 2000 09:42:22 +0000
From: Jimmy Mc Namara <jmcnamara@iel.ie>
Subject: Executing perl on linux
Message-Id: <3A3F2D7D.8077B0D0@iel.ie>

Hi folks,

Not sure if this is the correct newsgroup for this but here goes. I am
writing perl scripts that are transported from a test environment to a
production environment on site after every build. I found that perl
lived in /usr/bin in one of the machines and in /usr/local/bin in the
other so I used the usual script to search the path as follows:

#!/bin/sh -- # -*- perl -*-
eval 'exec perl -wS $0 ${1+"$@"}'
  if 0;

Now one of the servers has been switched to an intel box using
linux(output of uname -a is "Linux rufus 2.2.16-SMP #1 SMP Wed Aug 2
20:01:21 GMT 2000 i686 unknown" and the script above doesn't work it
throws an error as follows:


sh: -- # -*- perl -*-: unrecognized option


Usage:  sh [GNU long option] [option] ...
        sh [GNU long option] [option] script-file ...
GNU long options:
        --debug
        --dump-po-strings
        --dump-strings
        --help
        --login
        --noediting
        --noprofile
        --norc
        --posix
        --rcfile
        --restricted
        --verbose
        --version
        --wordexp
Shell options:
        -irsD or -c command             (invocation only)
        -abefhkmnptuvxBCHP or -o option

Just wondering has anybody come across this before.

Regards

Jimmy




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

Date: Tue, 19 Dec 2000 23:00:53 +1100
From: Raymond WAN <rwan@cs.mu.OZ.AU>
Subject: Help with Multi-dimensional array
Message-Id: <Pine.LNX.3.96.1001219223347.28328A-100000@vike.cs.mu.OZ.AU>


Hi all,

	There's something I would like to do, but I don't know how to do
it.  Basically, I'm creating a two dimensional array and would like to put
it into a one dimensional array (therefore creating a three dimensional
array).  In pseudocode, what I'm doing looks like this:

for ( ... ) {
  for ( ... ) {
    $_ = <INPUT_FILE>;
    @tmp = split;
    push @grid, [ @tmp ];
  }

  $biggrid[$i] = \@grid;
  $i++;
}

	My problem is that grid is always the same thing so biggrid ends
up being an array of grid's...all of which have the same rows in them.  In
C-speak (sorry, but I'm a C programmer ;) ), I need to re-malloc the grid
array so that biggrid stores a new memory address each time -- how do I do
it? 

	Alternatively, if I could, on line 5 "push" directly into
$biggrid[$i], that would be great...I could remove the grid variable.

	Also, as you can tell, I'm still new to Perl.  I know pattern
matching, but don't know things like this or Packages, Objects, etc.  I
have the "Camel book" by O'Reilly, but truthfully, I find it hard to
understand.  Is there an O'Reilly book that one would suggest as a good
beginner book that's well written, well organized, and contains good
examples?  [BTW:  I said "O'Reilly" because I've read enough of them to
believe they're pretty good overall.]

	Thank you in advance!

Ray






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

Date: Tue, 19 Dec 2000 12:13:26 GMT
From: "SuperGumby" <tick.toff@spam.com>
Subject: Re: Home Directory
Message-Id: <GhI%5.24878$xW4.192703@news-server.bigpond.net.au>

I have to comment on the obviousness of this, just where I'd expect it to
be.

Tad McClellan wrote in message ...
>mgrime@my-deja.com <mgrime@my-deja.com> wrote:
>
>>Can anyone tell me if there is there any way to reference your home
>>directory
>
>
>There is code for that in the "C-style Logical Or" section
>of perlop.pod.




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

Date: Tue, 19 Dec 2000 13:00:35 +0100
From: Erik Richly <richly@mpiz-koeln.mpg.de>
Subject: How to generate executables from perl scripts
Message-Id: <3A3F4DE3.7060607@mpiz-koeln.mpg.de>

Hi!

I need to generate an executable from a perl script I wrote cause it 
needs to be run on a machine that doesn't have Perl installed.
How do I do it?
I tried the perlcc:

perlcc prog.pl -o executable

but running the executable I would end up getting an error:

Can't locate object method "new" via package "LWP::UserAgent".

What did I do wrong?

Thanx alot

Erik



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

Date: Tue, 19 Dec 2000 13:09:37 -0000
From: "Igor Aptekar" <igor_aptekar@programmer.net>
Subject: just mucking about with splits
Message-Id: <Z5J%5.73304$eT4.5370213@nnrp3.clara.net>

anyone know how i can do something like print split(",",$a)[1]

thats is get whatever item of the split array i want without using an
intermediate variable

just curious




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

Date: Tue, 19 Dec 2000 13:37:50 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: just mucking about with splits
Message-Id: <slrn93up4o.h6j.rgarciasuarez@rafael.kazibao.net>

Igor Aptekar wrote in comp.lang.perl.misc:
> anyone know how i can do something like print split(",",$a)[1]

Insert the appropriate parenthesis according to the precedence of
operators (that may not always be what you expect) :

print ( (split(/,/,$ARGV[0])) [1] )

-- 
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: 19 Dec 2000 07:51:07 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: local $| (Was: Getting around named pipe blocking?) 
Message-Id: <m3puiod16s.fsf@mumonkan.sunstarsys.com>


On a recent thread, Uri remarked that local on $| 
was meaningless as the value is file handle specific.  
I'm not sure I understand exactly what he meant, 
since localization of $| seems to work for me:

#!/usr/bin/perl -w

{
  local $| = 1;
  print "fflush called?";
}

#normal behavior
print "...waiting 2 sec...";
sleep 2;
print "fflush called?\n";
print "Waiting 2 sec...";
sleep 2;

{ 
   $| = 1;
   print "all done. Please stand by...";

}

#autoflush enabled
print "fflush called?";
sleep 2;
print "\n";

__END__

Is there something subtle I'm missing?

-- 
Joe Schaefer



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

Date: 19 Dec 2000 09:47:01 GMT
From: cljlk@hotmail.com (J. K.)
Subject: Mail::Send and MINE
Message-Id: <91naql$bhp$1@autumn.news.rcn.net>

Hi,

I am looking for Mail::Send and MINE package.
Would anyone point out the direction?
Thanks 



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

Date: Tue, 19 Dec 2000 09:44:30 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: One-Liner to Sum a Stack of Numbers?
Message-Id: <3cbu3tckfcgjq2g41qgq2j1p5eu55j667b@4ax.com>

Jon Bell wrote:

> I merely offer this as one explanation for why OE users tend
>to prefer full-quoting, which leads naturally to top-posting as a way of
>minimizing scrolling if the reader needs to read only the response.

But if you read parts of a thread over several days, and especially if
you follow many threads at once, then not reading part of the previous
post, is not practical. It may have been days since you read the
previous post. By contrast, follow-ups tend to be written minutes after
reading the original post. So, to you, the follow-upper, it might seem
to make sense, but to any reader that follows a thread over multiple
days, only reading a few posts at a time, it is extremely annoying.

-- 
	Bart.


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

Date: Tue, 19 Dec 2000 09:49:15 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: One-Liner to Sum a Stack of Numbers?
Message-Id: <uhbu3t8tpe2gu9i38d3k9sq4fp282t4110@4ax.com>

SuperGumby wrote:

>The great majority of groups I am involved in are not *nix specific,
>therefore the majority of readers are using Outlook Express (or another win
>reader with preview). By using "top posting" a thread can be walked simply.

Are you even trying to suggest that OE can do something that other
newsreader programs can't, i.e. showing threads as an outline? Hah! How
naive you are. Where do you think did MS get the idea from? Have they
EVER had an original idea? Not that I know of.

Welking threads might seem convenient on people who only visit
newsgroups once in a few weeks. But if you tend to look at the evolution
of a thread several times a day, it is VERY annoying, because you force
US, the reader, to do YOUR work: looking back at what we read hours,
oreven days ago, and filter out what the hell you're talking about now.
That makes the task of following the evolution of a thread twice as
hard. At least.

Stop being so fucking lazy. Make life at least a little bit easier for
everyone else.

-- 
	Bart.


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

Date: 19 Dec 2000 10:23:33 +0000
From: Piers Cawley <pdcawley@bofh.org.uk>
Subject: Re: One-Liner to Sum a Stack of Numbers?
Message-Id: <m2lmtcvhei.fsf@rt158.private.realtime.co.uk>

"SuperGumby" <tick.toff@spam.com> writes:

> <snip>
> >
> >: how can it be evil?
> >
> >It isn't - he's trolling. :)
> 
> no, I am not.
> 
> The great majority of groups I am involved in are not *nix specific,
> therefore the majority of readers are using Outlook Express (or another win
> reader with preview). 

The windows newsreader that I use occasionally has a preview facility
that does the right thing. It discounts all the quoted lines at the
beginning of the message and previews the first unquoted section of
text. One wonders why OE doesn't do this.

-- 
Piers


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

Date: 19 Dec 2000 10:59:12 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: One-Liner to Sum a Stack of Numbers?
Message-Id: <91nf20$cpe$0@216.155.32.16>

In article <mTx%5.23992$xW4.185326@news-server.bigpond.net.au>, 
"SuperGumby" <tick.toff@spam.com> wrote:

 | Randal L. Schwartz wrote in message ... <snip>
 | >Proper quoting is not *nix-specific.  Wherever did you get THAT 
 | >idea?
 | 
 | I agree, it is not *nix specific, but the proponents who insist on 
 | it tend, in my experience, to be *nix users. I believe ex-diehard 

bzzzzzzzzt. guess what. I'm a Mac user. So much for that idea. Game 
over, man. 

 | 'bottom posters' who use programs similar in function to OE, tend to 
 | give up whinging about it and accept the convenience of being able 
 | to 'browse' threads.

I don't find it convenient to 'browse threads' when I have to read the 
bottom of the post before I can follow the reply at the top. I really 
want to shoot the brain-damaged Microsoft Engineer who thought that 
allowing top posting much less making it the damnable DEFAULT would be a 
'good idea'. 

How much does anyone want to bet that everyone at Microsoft top-posts in 
internal company mail? :D

 | Worst part is, I hate polluting the group with discussion of what I 
 | see as a trivial difference in posting style. I just cannot see why 
 | people get so upset about it.

 ...which is probably why it annoys people. you just don't get it. :)

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: Tue, 19 Dec 2000 14:43:06 +0200
From: "Eli Osherovich" <eli.oshrovich@intel.com>
Subject: perl -i cuts large files.
Message-Id: <91nl4t$bvc@news.or.intel.com>

Hi All.
I have a problem using perl with -i switch

Trying to execute this simple code : perl -i -p -e 'print "KUKU\n" unless
$a; $a=1;' very_big_file

I get a new file about 10M less than the original one (~77M).

If I give an extension to -i switch :
perl -i.bak -p -e 'print "KUKU\n" unless $a; $a=1;' very_big_file

Everything looks OK.

how can you explain it ?

Thanks in advance.

P.S.
>uname -a
HP-UX ihp169 B.10.20 A 9000/785 2008124755 two-user license
>perl -v
This is perl, version 5.004

This system uses AFS . (it may be an AFS bug ).







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

Date: Tue, 19 Dec 2000 14:52:00 +0200
From: "Eli Osherovich" <eli.oshrovich@intel.com>
Subject: Re: perl -i cuts large files.
Message-Id: <91nlli$c5n@news.or.intel.com>

It seems to be an AFS problem
I've tryed to do the same thin on the same machine bun within a local
directory
(not mounted via AFS) and it gave good results

Eli Osherovich <eli.oshrovich@intel.com> wrote in message
news:91nl4t$bvc@news.or.intel.com...
> Hi All.
> I have a problem using perl with -i switch
>
> Trying to execute this simple code : perl -i -p -e 'print "KUKU\n" unless
> $a; $a=1;' very_big_file
>
> I get a new file about 10M less than the original one (~77M).
>
> If I give an extension to -i switch :
> perl -i.bak -p -e 'print "KUKU\n" unless $a; $a=1;' very_big_file
>
> Everything looks OK.
>
> how can you explain it ?
>
> Thanks in advance.
>
> P.S.
> >uname -a
> HP-UX ihp169 B.10.20 A 9000/785 2008124755 two-user license
> >perl -v
> This is perl, version 5.004
>
> This system uses AFS . (it may be an AFS bug ).
>
>
>
>
>




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

Date: 19 Dec 2000 12:05:50 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: Perl to TCP/IP Connection & Overall Direction Needed
Message-Id: <91niuu$mfb$0@216.155.32.16>

In article <x7zohtdjo5.fsf@home.sysarch.com>, Uri Guttman 
<uri@sysarch.com> wrote:

[massive snip] 

 | hire a perl programmer.
 | 
 |   EH> 5. E-mail a copy of the "New Info" data & also save it to an ASCII 
 |   .csv 
 |   EH>    flat file. I CAN DO THIS.  
 | 
 | are you sure? that is about the same difficulty as the first #5.
 | 
 |   EH> 6. Perform the next "search" while still logged in to the remote
 |   EH> system.  
 |   EH>    Hmmm... I THINK I CAN DO THIS.
 | 
 | think harder.
 | 
 |   EH> 7. Log Off the remote database when all searches are done.  I CAN 
 |   DO
 |   EH> THIS !!!
 | 
 | exit() ;
 | 
 | uri

Ahh Uri, you are so free from the ravages of sarcasm. (-:

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: Tue, 19 Dec 2000 11:49:48 GMT
From: montep@hal-pc.org (Monte Phillips)
Subject: Re: Perl to TCP/IP Connection & Overall Direction Needed
Message-Id: <3a3f4af0.1156422@news.hal-pc.org>

On Mon, 18 Dec 2000 20:37:52 -0800, Eric Hilding <eric@hilding.com>
wrote:

>My Perl studies took a dive over the past few years, but now a project 
>is before me that I'd like to ask for a little direction about.  I just
>ordered the "Perl CD Bookshelf" on CD so this should help :-)
>
>What I need to do is use Perl on my ISP's Unix, to do (at timed
>intervals),
>what I laboriously have to do manually now using HyperTerminal to 
>access a remote database on another system via a TCP/IP connection.
>
>At "timed" intervals (this may be a problem since the perl script must
>be
>in my USR subdirectory and don't think I can use CRON):
>
>1. Connect via Perl with TCP/IP to a remote database.  Is there already
>some 
>   kind of module? I AM CLUELESS ON HOW TO APPROACH THIS.  


What is your platform?  What is the remote servers platform?  What
access security level do you have on each?  Do you have port 80 access
to the remote?




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

Date: Tue, 19 Dec 2000 13:52:24 GMT
From: "Rob" <email@address.com>
Subject: Re: perl, iis, form/java mail, form width
Message-Id: <sKJ%5.25182$xW4.194578@news-server.bigpond.net.au>

> 1) How can I make my form full size ?  Is there a width attribute ?
> I'm having trouble getting a <hr> tag within a form to stretch
> the whole width of the page.

Ideally post this aspect of HTML formatting to a group that deals with such
or alternatively check the specs on current X/HTML recommendations from
www.w3.org

Hint:    <hr width="100%">


> 2) How can I call a perl script to handle form processing on a NT / IIS
> environment ?
> I'm using ActiveState perl v5.6.0
> How do I have to have my machine configured ?
> What needs to be in my path ?
> I'm assuming I will need the perl script to be in the same
> directory of the form.
> ex:  /inetpubs/wwwroot/page.html     will be processed
> by  /inetpubs/wwwroot/page.pl

This is an IIS configuration question, again not specifically dealt with in
this group.

Hint:    Executable directives


> 3) I'm looking for good examples of form based email scripts.
> Is javamail good to use for this ?    other suggestions ???

Javamail?  'Tis not Perl though ... http://www.google.com and enter 'Perl
email form script' - See what you get.


> 4) I've seen some pages, when saved as a favorite in IE have unique
> icons with them.
> See the pages from the  CBOT in particular.
> How is this done ?

Javascript usually ... again, not Perl.


Rob


--
The email address should read rob at cowsnet dot com


<invinfo@my-deja.com> wrote in message news:91m815$koa$1@nnrp1.deja.com...




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

Date: 19 Dec 2000 11:12:48 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: possibly st00pid question regarding 'require'
Message-Id: <91nfrg$cpe$1@216.155.32.16>

In article <slrn93thop.87t.tadmc@magna.metronet.com>, 
tadmc@metronet.com (Tad McClellan) wrote:

 | The WebDragon <nospam@nospam.com> wrote:
 | >
 | >I have a number of scripts that I use to process a file in different 
 | >ways.. yet they all have a similar set of variables to import the data. 
 | >
 | >can I dump all that 'similar' stuff 
 
 | Is the "similar stuff" by chance global variables?
 | 
 | Let's hope not...

*chuckle* well.. basically there is one rather large HOHOL (that gets 
populated from a datafile, and a few associated data items along with it 
in other hashes or scalars. they technically ARE global to all 5 of the 
scripts involved, but I just have the data reading in separately in each 
one.. if I change the data structure any, I'll need to re-do this in 
each script.

Separating out the import process would greatly simplify things, 
particularly in light of the fact that I want to move away from the 
flat-file DB format and into something DBI oriented as I learn the Perl 
DBI... 

 | >into a file 'setup.pl' and have it 
 | >all executed via a 
 | >
 | >    require 'setup.pl'; 
 | >
 | >which would then let me share all those common variables and their data?
 
 | Yes.

ok.

 | >or should require only be used to import various subroutines and 
 | >whatnot?

 | Above you asked "can I", now you switch to "should I" :-)

heh :)
 
 | Having lots of global variables is bad. If that is what you
 | are talking about, then you should not use require to import
 | them. You should not have them in your main program either.

well how many is 'lots' ? Typically these scripts use around 10-20 max. 
the 'suite' of 5 or so scripts, performs diferent iterations over the 
datafile to print out various reports such as 

 o duplicate entries
 o orphaned files (missing from either the DB or the FTP)
 o file-size errors (where the DB has an incorrect entry for the file on 
the FTP)
 o rating errors (generated by a fscking faulty .asp file that results 
in a rating of 0) (which IS legitimate in some cases which makes 
tracking things more difficult) 
 o entries for reviews that HAVE been and have NOT been converted to the 
DB
 o and an overall report file indicating how many of each 'error' were 
found. 

 | You should group them together in some other data structure
 | (a hash is often used for this). That is, one global hash
 | with 20 pairs rather than 20 global variables.

hm. these are pretty simple scripts.. that could seriously obfuscate the 
intent here, but I can see the usefulness of this in some situations, I 
suppose. 

 | The "best" (most scalable) way would be to use packages and
 | modules to provide the common variables (with "use" instead
 | of "require").

I'll have to ponder this .. 

Can I have the 'used' file do all the importing of the data into the 
hash for me and supply this into a variable readable by the various 
scripts?

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: Tue, 19 Dec 2000 10:57:31 +0100
From: "Sven Franke" <snefsite@hotmail.com>
Subject: Re: PPM question
Message-Id: <91nb8b$9lm$1@enterprise.cistron.net>

Hi,

"John Boy Walton" <johngros@Spam.bigpond.net.au> schreef in bericht
news:o_J_5.20827$xW4.162470@news-server.bigpond.net.au...
> I have added five repositories to PPM and now searching takes forever. Way
> more than five times my initial search time. Is it wrong to search all the
> repositories?
>
>
And which repositories do you use?

Sven Franke




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

Date: Tue, 19 Dec 2000 12:05:03 GMT
From: pubic.hairsphil.latio@f-in-stupid.co.uk (Phil Latio)
Subject: s it possible to have these menu boxes populated by the contents of a flat file database?
Message-Id: <P9I%5.23044$I5.251152@stones>

I have a form with 13 menu (not list) boxes. Is it possible to have these 
menu boxes populated by the contents of a flat file database?

If so, is it then possible that to ensure each box is unique so if Green 
was selected in box 1, it cannot be entered in any of the other boxes? On 
reflection this part could be done client-side in Javascript but a need a 
way to fill those boxes.

Has anyone seen or done this? I have access to quite a few Perl books so if 
this process is any, please let me know which one.

Cheers

Phil 







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

Date: Tue, 19 Dec 2000 12:15:57 GMT
From: appsman1368@my-deja.com
Subject: Re: Splitting record string into fields
Message-Id: <91njhs$l5b$1@nnrp1.deja.com>

I am reassured to know that these forums are not entirely populated with
narrow-minded pompous morons like you. If you have nothing useful to
contribute, other that to advertise your own 'talents' then do us all a
favour and take up knitting.

In article <slrn93sreb.6sn.tadmc@magna.metronet.com>,
  tadmc@metronet.com (Tad McClellan) wrote:
> appsman1368@my-deja.com <appsman1368@my-deja.com> wrote:
>
> >I really don't have the time to learn perl at the
> >moment but I am assured that it is the best tool available.
>
> Then hire someone who _has_ taken the time to learn Perl.
>
> --
>     Tad McClellan                          SGML consulting
>     tadmc@metronet.com                     Perl programming
>     Fort Worth, Texas
>


Sent via Deja.com
http://www.deja.com/


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

Date: Tue, 19 Dec 2000 13:25:30 GMT
From: spcman@my-deja.com
Subject: String Parsing?
Message-Id: <91nnk6$o80$1@nnrp1.deja.com>

Anyone have a one-liner to check to make sure a string consists of only
az-AZ-0-9 (Letters, Numbers) NO CHARACTERS!

Thanks - Al


Sent via Deja.com
http://www.deja.com/


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

Date: Tue, 19 Dec 2000 08:44:41 GMT
From: Craig <c.manley@chello.nl>
Subject: Re: Trying to extract only names with letters in regex exp?
Message-Id: <3A3F2031.7DEF56C@chello.nl>

Hi Robert,

This will do it:

$name='-!Billy Bob3245Joe%';
while ($name =~ /([A-Za-z]+)/g) { # + == one or more characters, g ==
global
 print "$1\n"; # print next match in parenthesis
}


and this will do it too:
@_ = split /[^A-Za-z]+/,$name; # split on one or more characters not in
list A-Za-z
print join("\n",@_);

-Craig Manley.


Robert Chalmers wrote:
> 
> Hi,
> trying to extract from a list, only those names that contain letters. No numbers, no dashes or stops etc. Just A-Z
> 
> I though this would do it. The name is at most 4 letters long, so should'n this do it? Match only letters in the A-Z range, and in
> the position, 0 to 4 in the string $name.?
> 
> but it doesn't do it...  I admitto getting real confused with regex, but this seems so easy ! and I'm stumped.
> 
>                 if ($name =~ /[A-Z]{0,4}/) {
>                 print "$name\n";
>                 }
> 
> If any kind soul can pointout the error of my ways, I'd really appreciate it.
> thanks
> robert
> 
> --
> ---
> Robert Chalmers
> http://www.quantum-radio.net.au         Quantum Radio                    robert@quantum-radio.net.au
> http://www.inexpensivewebsites.com   Domain Name Registrations  info@inexpensivewebsites.com


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

Date: Tue, 19 Dec 2000 13:04:21 GMT
From: Tim Tyler <tt@cryogen.com>
Subject: Re: Use PERL or Java? Which is faster?
Message-Id: <G5tGB9.34D@bath.ac.uk>

In comp.lang.java.programmer Rand <me@me.com> wrote:

: You know, if we are talking server side (such as CGI vs. servlets), it
: doesn't really matter if Java executes faster than Perl because Java
: servlets don't have the startup costs that CGI scripts do.

Perl != CGI scripts.  See Apache's mod_perl.

Comparing CGI with modern Servlet engines is one of those apples and pears
jobs - servlets should be compared with mod_perl.

For a performance comparison, see:

http://www.caucho.com/articles/benchmark.xtp

The performance appears to be really rather similar.
-- 
__________                  http://alife.co.uk/  http://mandala.co.uk/
 |im |yler  tt@cryogen.com  http://hex.org.uk/   http://atoms.org.uk/


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

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

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V9 Issue 5148
**************************************


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