[19723] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1918 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 12 11:05:37 2001

Date: Fri, 12 Oct 2001 08:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1002899110-v10-i1918@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 12 Oct 2001     Volume: 10 Number: 1918

Today's topics:
    Re: [Q]: Mail::Box manager hangs before anything intere <Tassilo.Parseval@post.rwth-aachen.de>
        changing a submit button to a link <noname@nowhere.com>
    Re: changing a submit button to a link <Thomas@Baetzler.de>
    Re: DBD::DB2 help (Jacqui caren)
    Re: DBI:DBD <uwe@richard-schneider.de>
        easy question - win32 filepath <bjelkea@online.no>
    Re: easy question - win32 filepath <Thomas@Baetzler.de>
    Re: easy question - win32 filepath <jurgenex@hotmail.com>
    Re: Getting a list of running programs under Windows200 <tim@vegeta.ath.cx>
    Re: Getting a list of running programs under Windows200 <pilsl_@goldfisch.at>
    Re: Hashe keys and references? (Anno Siegel)
        Mailing list subscription script (Jeremy Reynolds)
    Re: OT: This is a useless thread. (was: YOU ARE ALL GAY <tmoero@yahoo.invalid>
        Parsing complex data structure (Drew Myers)
    Re: Parsing complex data structure <Thomas@Baetzler.de>
    Re: Parsing complex data structure <nospam@newsranger.com>
    Re: Parsing complex data structure <Thomas@Baetzler.de>
    Re: Perl and DBI (Jacqui caren)
    Re: Perl Power Limits? <ilya@martynov.org>
    Re: Reformat Chain (Houda Araj)
    Re: Reformat Chain (John J. Trammell)
    Re: Signal SEGV with overload (Anno Siegel)
        The inner working of the debug module ? (Ernst Ube)
    Re: Uploading <pilsl_@goldfisch.at>
    Re: Uploading (M.A. Oxby)
    Re: Uploading <pilsl_@goldfisch.at>
    Re: Uploading <bart.lateur@skynet.be>
        website examples <wgrigg@draper.com>
    Re: Why is $i so popular? (Jacqui caren)
    Re: YOU ARE ALL GAY! <spamfreenation@nigenet.org.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 12 Oct 2001 12:21:08 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: [Q]: Mail::Box manager hangs before anything interesting happens
Message-Id: <3BC6C414.9030505@post.rwth-aachen.de>

Anatoly Karp wrote:

> use Mail::Box::Manager;
> 
> my $mgr    = Mail::Box::Manager->new;
> my $folder = $mgr->open(folder => $ENV{MAIL}) or die "Could not open\
>                                                       mailbox!\n";
> # <------------- code ends here ------------------->
> 
> 
> 
> This is almost straight from the perldoc page
> (I just added the die bit), and when I run it 
> it hangs, hangs miserably. (it does get past the new call)
> 
> Any thoughts on what might be wrong here?..


Mail::Box locks the mailboxes you specified for opening by creating a 
mailboxname.lock file in the respective directory. That's for preventing 
opening (and possibly manipulating) a mailbox twice at the same time.
First thing you have to do is deleting the .lock files. Secondly, add 
something like this to your script:

END { $mgr->closeAllFolders };

This will explicitely close (and therefore remove lock-files of) all 
opened mailboxes.


Tassilo


-- 
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};



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

Date: Fri, 12 Oct 2001 09:41:52 -0400
From: "wildphir" <noname@nowhere.com>
Subject: changing a submit button to a link
Message-Id: <9q6rot$5v9$1@bob.news.rcn.net>

This is a cgi poll file which has a "View Results" button and I want to
change that to a link. What do I change the input type to?  and how do I
make that a link?  thanks



   print "<input type=submit value=\"View Results\"></form></center><p>\n";
  }
  print "<center>\n";
  print "</font></td></tr></table>\n";
  exit;





--
Get a pet, articles, photos, chat
http://luvpetz.com




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

Date: Fri, 12 Oct 2001 15:46:47 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: changing a submit button to a link
Message-Id: <pusdst8ht6qrui61i101bda70j4r04hksm@4ax.com>

On Fri, 12 Oct 2001, "wildphir" <noname@nowhere.com> wrote:
>This is a cgi poll file which has a "View Results" button and I want to
>change that to a link. What do I change the input type to?  and how do I
>make that a link?  thanks

This is not a Perl question. Try comp.infosystems.www.authoring for your
HTML problem. Actually learning HTML might make quite a lot of
difference, too.

Tsk,
-- 
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl


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

Date: Fri, 12 Oct 2001 11:31:29 GMT
From: Jacqui.Caren@ig.co.uk (Jacqui caren)
Subject: Re: DBD::DB2 help
Message-Id: <9138786C2JacquiCarenigcouk@195.8.69.73>

[posted and mailed]

goldbb2@earthlink.net (Benjamin Goldberg) wrote in 
<3B85F529.65AD193C@earthlink.net>:

>Us perl folks can generally help you if the the problem is with perl
>itself, but when it's with a module, you probably need to whomever is
>maintaining it.
>

contact the dbi-users mailing list
and remember to look in the mailing list archives before sending email.


Jacqui


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

Date: Fri, 12 Oct 2001 13:42:01 +0200
From: Uwe Schneider <uwe@richard-schneider.de>
Subject: Re: DBI:DBD
Message-Id: <3BC6D709.35A1A173@richard-schneider.de>

icon wrote:
> 
> Hello ,
> 
> Please if you know the answer let me know what is wrong. I am losing my mind
> over this.
> 
> I've had major hard time trying to compile DBI into my perl 5. Finally got
> it and not it's time to get DBD for oracle working so I can run queries from
> perl scripts.

this is strange. DBI normally compiles out of the box... What was wrong?


> 
> I tried to compile DBD but it bitched about whole bunch of libraries which i
> fixed by instaling them off of oracle CD. Now it comes up wiht the followinf
> error. I'll paste the whole thing so you can see what has happened. The
> error is on the bottom.
> 


oci8.c
> oci8.c: In function `oci_hdtype_name':
> oci8.c:100: `OCI_HTYPE_SUBSCRIPTION' undeclared (first use in this function)
> oci8.c:100: (Each undeclared identifier is reported only once
> oci8.c:100: for each function it appears in.)
> oci8.c:109: `OCI_DTYPE_LOCATOR' undeclared (first use in this function)
> make: *** [oci8.o] Error 1

Hmmh... There is no handle type "OCI_HTYPE_SUBSCRIPTION" in Oracle 8.0,
but there is one in 8.1. The same applies to "OCI_DTYPE_LOCATOR".

Maybe the configure script thinks, you have 8.1 instead of 8.0. 

Perhaps you ask the maintainer of DBD::Oracle?

Uwe


-- 
Uwe Schneider       | Telefon +49 7244 / 609504
Karlsdorfer Str. 31 | Mail    uwe@richard-schneider.de
DE-76356 Weingarten | http://www.richard-schneider.de/uwe
Linux - OS al dente!


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

Date: Fri, 12 Oct 2001 14:41:10 GMT
From: "Alexander Bjelke" <bjelkea@online.no>
Subject: easy question - win32 filepath
Message-Id: <aiDx7.272$Ryf.179578368@news.telia.no>

How do I specify a win32 filepath in Perl?

Is this correct?:

$file = "c:\winnt\test.txt";

Please help!
Alexander




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

Date: Fri, 12 Oct 2001 16:47:54 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: easy question - win32 filepath
Message-Id: <6i0estgst4jhvghesgq1iglig2j9ku9uv8@4ax.com>

On Fri, 12 Oct 2001, "Alexander Bjelke" <bjelkea@online.no> wrote:

>How do I specify a win32 filepath in Perl?

The way you like. TIMTOWTDI.

>Is this correct?:

>$file = "c:\winnt\test.txt";

No.

$file = "c:\\winnt\\test.txt"; or $file = "c:/winnt/test.txt";

HTH,
-- 
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl


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

Date: Fri, 12 Oct 2001 07:51:47 -0700
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: easy question - win32 filepath
Message-Id: <3bc7037f$1@news.microsoft.com>

"Alexander Bjelke" <bjelkea@online.no> wrote in message
news:aiDx7.272$Ryf.179578368@news.telia.no...
> How do I specify a win32 filepath in Perl?
> Is this correct?:
> $file = "c:\winnt\test.txt";

This would be the file named "c:winnt<TAB>test.txt" (where <TAB> indicates
the TAB character). I doubt this is what you want.

Just use normal forward slashes:
    $file = "c:/winnt/test.txt";
If you insist on using backslashes (possible, but discouraged) then you will
have to escape them.

jue




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

Date: Fri, 12 Oct 2001 10:20:45 GMT
From: Tim Hammerquist <tim@vegeta.ath.cx>
Subject: Re: Getting a list of running programs under Windows2000
Message-Id: <slrn9sdhqv.151.tim@vegeta.ath.cx>

Me parece que Greg Webster <gwebster@ahbl.ca> dijo:
[ snip ]
>  In Unix, I'd just grep 'ps ax' for what I needed and if a program
>  wasn't running I'd start it, but I wonder if there is a way for me to
>  do this under Win2k.

There are various bash environments for Win32 that come with dozens of
standard *nix utils, but I'm not sure how well/if they implement a good
ps.

>  I've got a program that does some funky terminal emulation for an
>  external program to print to a local printer, and that program keeps
>  crashing. So what I'd like to do is have a perl script running on this
>  Win2k box that runs (via some freeware scheduler) once a minute,
>  checks to see if the terminal emulation program is running and if not,
>  starts it.

Doesn't Win2k have an innate scheduling program?  I know WinNT 4 had
one.  That would be a serious oversight on Microsoft's part; hell (or,
for Kyra's benefit, "Hell"), even Win98 had a Task Scheduler. =)

>  Any ideas on how I'd find out if that terminal emulation program is
>  running or not?

I believe ActiveState Perl (which, for lack of your stating otherwise, I
assume you use) comes standard with the Win32::Process; this might be
what you want.  Also, try a search.cpan.org query:

    http://search.cpan.org/search?mode=module&query=Proc

This returns many modules, some of which also apply to Win32.
Proc::Background looks somewhat promising, based on what (little) you've
told us.

>  Greg Webster

HTH
Tim Hammerquist
-- 
Last year in Oregon, Summer fell on a *tuesday*. That was it. One
day. Big shiny thing in the sky. Some people thought it was a UFO.
    -- Randal L. Schwartz, comp.lang.perl.misc


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

Date: Fri, 12 Oct 2001 15:06:36 +0200
From: peter pilsl <pilsl_@goldfisch.at>
Subject: Re: Getting a list of running programs under Windows2000
Message-Id: <3bc6eade@e-post.inode.at>

Greg Webster wrote:

> Heya all,
> 
> I'm a unix guy so doing perl under Win2k is a bit weird for me.
> 
> In Unix, I'd just grep 'ps ax' for what I needed and if a program
> wasn't running I'd start it, but I wonder if there is a way for me to
> do this under Win2k.
> 
> I've got a program that does some funky terminal emulation for an
> external program to print to a local printer, and that program keeps
> crashing. So what I'd like to do is have a perl script running on this
> Win2k box that runs (via some freeware scheduler) once a minute,
> checks to see if the terminal emulation program is running and if not,
> starts it.
> 

poor guy. Standard unix-shells for win have ps-ports included, but do not 
list all running tasks. There is no tool coming with win by default, but 
there is a addon called 'ms-resourcekit' (sold my microsoft) that holds lot 
of useful commandline-tools including a tool called 'pulist' that does 
exactely what you want. Combining with 'grep' from the cygwin-shell you get 
the same as under linux.
 For scheduling I recommend using one of the win-schedulers (name of the 
service depends on your winversion) that can always be startet with 'at' or 
with 'soon' (soon comes with the reskit too).

Parts of the reskit can be downloaded by free on microsofts website - I 
dont know if 'pulist' is part of them.

If you cant avoid doing more than using ms-office on windows I strictly 
recommend the following tools:

* resource-kit by microsoft
* cygwin by cygnus
* lot of tools from www.sysinternals.com
* if you need to deal with registry and filepermissions there is another 
tool for purchase that provides commandlinetools for this - dont know the 
name - if you need mail me.

I additionally have a telnetdaemon installed on all win-machines under my 
control to remote-control this machines with rsh from the unix-servers.
So I just use cron on the linux-workgroupserver to run scripts on the 
win-clients.

The task you want to perform can easily be performed with nt-shell-commands 
also (its somehow posix-style) :

something like:
pulist | grep terminal || start terminal

very useful command in NT is the for-command that includes patternmatching 
and such things. 

hope this helps.

peter

-- 
peter pilsl
pilsl_@goldfisch.at
http://www.goldfisch.at



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

Date: 12 Oct 2001 10:57:00 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Hashe keys and references?
Message-Id: <9q6i9s$ggl$2@mamenchi.zrz.TU-Berlin.DE>

According to Dimitri <mauroid@csi.forth.gr>:
> Can the key of a hash table element be a reference? Would the
> following work?
> 
> $key = [1, 2, 3];	## reference to anonymous array (1, 2, 3)
> $val = "bla";
> 
> $hash{$key} = $val;
> 
> It doesn't seem to work for me. It seems like the $key is stringified,
> i.e. the above command behaves as if I had done this :
> 
> $hash{"$key"} = $val;
> 
> Which of course messes everything up (can't use $key any more to
> dereference the original array).

As you have observerd, hash keys are always strings, so indeed a
reference cannot directly be recovered once it has been made a hash
key.

Of course, there are ways around this.  You can either keep a "master
hash" where you hold the original references with the keys:

    $key = [ 1, 2, 3];
    $val = "bla";

    $master{ $key} = $key;
    $hash{ $key} = $val;

 ...or keep the reference with the data:

    $hash{ $key} = [ $val, $key];

 ...or any of MWTDI.

All such methods have in common that they establish another reference
to the original data, so when this would go out of scope it can't
be garbage-collected.  If the resulting memory leak is a problem,
there are usually ways to clear the master-entry (or whatever) when
appropriate, but this may be painful to do.

There is also a converse problem:  The stringified version of a
reference is guaranteed to be unique among all references existing
at the moment.  However, if you keep that string around after the
original has gone out of scope, there is a minute, but non-zero chance
that a newly allocated reference will stringify in the same way as the
old one, which is bad.  Keeping the original around with the string
prevents that from happening.

Anno



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

Date: 12 Oct 2001 08:03:54 -0700
From: jeremyreynolds@yahoo.com (Jeremy Reynolds)
Subject: Mailing list subscription script
Message-Id: <207f49a1.0110120703.70130789@posting.google.com>

Hoping that someone can point me in the right direction for a script
that will allow someone to choose a number of mailing lists from a
list on a web page, enter their e-mail address, and the script will
send an appropriate e-mail to the list server with the correct
commands. As a beginner to scripting I'm hoping there might be
something simple out there that I can amend and use.

Any suggestions appreciated.

Thanks,

Jeremy.

jeremyreynolds_NOSPAM@yahoo.com (Remove '_NOSPAM' when replying)


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

Date: Fri, 12 Oct 2001 19:19:04 +0900
From: tm <tmoero@yahoo.invalid>
Subject: Re: OT: This is a useless thread. (was: YOU ARE ALL GAY!)
Message-Id: <tmoero-D353CB.19190412102001@newsflood.tokyo.att.ne.jp>

Geoffrey Pointer wrote:
> Michael Lee Yohe 
 
> > Please quit cross-posting this big piece of excrement.
> 
> Excuse me!! Whether or not you agree with what tm and I are saying and
> whether or not we agree with each other, this often happens in threads.
> Sometimes the issue of _how_ to use the usenet comes up. How do you expect
> these ideas to disseminate other wise? I'm glad tm was bothered to comment
> whatever I might think about his approach. You on the other hand are just
> totally blinkered.
> 
> The cross-posting thing happened in the original message. I'm sorry if that
> was contributed to by me but as in this case also, you yourself have replied
> by cross-posting so who knows where from and not only that, you've changed
> the thread subject. You've personally contributed to the multiplication of
> the excrement you apparently detest. Need I say more? This is certainly my
> last message in this/that thread.

heh. I like your style, geof, even if you are a quitter.
Say, what ng are you posting from? I'm in alt.config. Maybe we could 
snip the ngs to spare the whiners and then i could continue verbally 
kicking your ass?


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

Date: 12 Oct 2001 05:47:42 -0700
From: bh_ent@hotmail.com (Drew Myers)
Subject: Parsing complex data structure
Message-Id: <d1b6a249.0110120447.4ca478e3@posting.google.com>

Hi.

I have two data structures, one is a simple hash, the other is a bit
more complex (actually, there are several more, but I'm only
interested in these two for the time being).

My goal, is to print out the information from the complex data
structure, if the key exists in the second (simple) hash.

The print statement at the end is not iterating through the record the
way I think it should.  I do get the proper quantity of lines printed,
but the information is always the first element (I assume) of the
record.


#!/c/perl/bin/perl -w
use strict;
use Net::FTP;

# Fetch list of servers
# Build record for each server

my @cons=qw(/etc/passwd /etc/shadow /etc/security/passwd);
my $record;
my $server;
my $dir=qw(c:/perl/scripts/data);
my $serverlist=qw(data/serverlist.ext);
my %servertype=();
my %server=();
open (SERVERLIST,"$serverlist") || die "Can't fork $serverlist open:
$!\n";
while (<SERVERLIST>) {
  chomp;
  my ($server,$flavor)=split(',',);
  my $shadow;
  if ($flavor =~ /hp/) { $shadow = $cons[1]; } else { $shadow =
$cons[2]; }
  $record = {
        SERVER          => $server,
        REMOTE_PASSWD   => $cons[0],
        REMOTE_SHADOW   => $shadow,
        LOCAL_PASSWD    => "$dir/$server.pass",
        LOCAL_SHADOW    => "$dir/$server.shad",
  };
  $server{ $record->{SERVER} } = $record;
  if ($flavor =~ /aix/) { $servertype{$server}=$record; }
}
close (SERVERLIST) || die "Can't fork $serverlist close: $!\n";

# Consolidate shadow and password files
my $passfile;
for my $report (keys %server) {
    print "$record->{LOCAL_PASSWD}\n" if (exists
$servertype{$report});
}

Thanks in advance, 
Drew Myers


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

Date: Fri, 12 Oct 2001 15:34:37 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: Parsing complex data structure
Message-Id: <lerdstgke3cpv3q0r761jgvkm30gmvratm@4ax.com>

On 12 Oct 2001 05:47:42 -0700, bh_ent@hotmail.com (Drew Myers) wrote:

>#!/c/perl/bin/perl -w
>use strict;
>use Net::FTP;
>
># Fetch list of servers
># Build record for each server
>
>my @cons=qw(/etc/passwd /etc/shadow /etc/security/passwd);

This is overly cryptic. I'd suggest:

my %srvtype = (
  hp => { passwd => '/etc/passwd', shadow => '/etc/shadow' },
  sun => { passwd => '/etc/passwd', shadow => '/etc/security/shadow' },
[...]
);

You could then say $srvtype{'hp'}->passwd etc. The advantage is also
that you have all the details in an accessible data structure instead of
the "business logic" of your code.

>my $dir=qw(c:/perl/scripts/data);
>my $serverlist=qw(data/serverlist.ext);

qw doesn't make sense here - you don't want to build a list.

>while (<SERVERLIST>) {
>  chomp;
>  my ($server,$flavor)=split(',',);

my ($server,$flavor) = split /,/;

You split(',',) should raise a warning since you try to split undef.
This may be where your code breaks.

>  $record = {
>        SERVER          => $server,

Having %server and $server is confusing.

HTH,
-- 
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl


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

Date: Fri, 12 Oct 2001 14:17:28 GMT
From: Drew Myers <nospam@newsranger.com>
Subject: Re: Parsing complex data structure
Message-Id: <YXCx7.26092$ev2.34615@www.newsranger.com>

Thomas_B=E4tzler?= says...
>
>>my @cons=qw(/etc/passwd /etc/shadow /etc/security/passwd);
>
>This is overly cryptic. I'd suggest:
>
>my %srvtype = (
>  hp => { passwd => '/etc/passwd', shadow => '/etc/shadow' },
>  sun => { passwd => '/etc/passwd', shadow => '/etc/security/shadow' },
>[...]
>);

I hadn't thought of that.  Thanks.

>>while (<SERVERLIST>) {
>>  chomp;
>>  my ($server,$flavor)=split(',',);
>
>my ($server,$flavor) = split /,/;
>
>You split(',',) should raise a warning since you try to split undef.
>This may be where your code breaks.

Correct me if I'm wrong, but I thought an expression
like "split(',',)" implied the use of $_.  Is that wrong?


Thanks for the help!

now if I can just figure out my silly data structure...




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

Date: Fri, 12 Oct 2001 16:43:58 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: Parsing complex data structure
Message-Id: <130estc3j4corel2gb5riksjrrpc76t89q@4ax.com>

On Fri, 12 Oct 2001, Drew Myers <nospam@newsranger.com> wrote:

>>>  my ($server,$flavor)=split(',',);
>>
>>my ($server,$flavor) = split /,/;
>>
>>You split(',',) should raise a warning since you try to split undef.
>>This may be where your code breaks.
>
>Correct me if I'm wrong, but I thought an expression
>like "split(',',)" implied the use of $_.  Is that wrong?

Yes.

split(','); will split $_.

split /,/; will split $_.

split(',',); will split <undef>. Hint: one comma too many.

Is it just me, or is split rapidly becoming a hot topic this week? :-)

HTH,
-- 
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl


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

Date: Fri, 12 Oct 2001 12:00:36 GMT
From: Jacqui.Caren@ig.co.uk (Jacqui caren)
Subject: Re: Perl and DBI
Message-Id: <9138814C8JacquiCarenigcouk@195.8.69.73>

cpryce@pryce.net (cp) wrote in <f88l7.18346$x84.4619254@ruti.visi.com>:

>
>"Chris Fedde" <cfedde@fedde.littleton.co.us> wrote in message
>news:lJWk7.92$Owe.171086848@news.frii.net...
>> In article <IoVk7.67396$f01.18381188@news3.rdc1.on.home.com>,
>> christian <carrazola@home.com> wrote:
>> >Hello,
>> >
>> >I'm looking for either a good Book or Documentation on all the mysql
>> >functions that perl can use.
>> >
>>
>> If the documentation that is part of the DBI and DBD:: interfaces is
>> not enough then there are a couple other sources. There might be good
>> pointers for you at http://dbi.symbolstone.org/.
>>
>
>I'm not sure why that's an either/or question. I highly recommend that
>you use both the book and the POD documentation. The book that is
>available at the above Web address (through Amazon.com) is written by
>the author of the DBI module and is the best on the market, IMHO.

Co authored by Alligator who is not exactly an unknown...

Tim also was perl5.004_04 maintking and wrote/mainatns a large
number of perl modules. I cannot see how anyone else could
come up with a better book.

Note that the POD and the DBI web site hold a lot of information.

The dbi-users mailing list (archives) are also vital if you
aree starting out...

Jacqui


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

Date: 12 Oct 2001 17:42:18 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: Perl Power Limits?
Message-Id: <87bsjdynyd.fsf@abra.ru>

>>>>> On Thu, 11 Oct 2001 22:14:02 -0400, Sean O'Dwyer <notspam@spamfree.dud> said:

SO> Hello,
SO> I'm working on a site at the moment that gets approximately 900k hits 
SO> and 32k unique visits per month.

SO> There are some aspects of the site that should be databased and I'm 
SO> wondering what the real world outside limit for Perl might be: 1,000 SSI 
SO> calls per hour, 10,000?

SO> In other words, is this a job for C++ or can Perl handle it with room to 
SO> spare? Does my question even make sense?

If you writting CGIs C++ could be faster than Perl because CGI load
time should be faster. But you probably should use techologies like
mod_perl, fast_cgi or speedy_cgi - techologies that doesn't start new
process on each request but instead reuse existing processes for
serving requests. In this case load time is no longer relevant. Since
you application is database driven I would expect backend database to
be bottleneck in such configuration but not implementation
language. And since Perl is much more easier to write web application
I would use Perl. Probably the only gain you could get by using C++ is
lowering memory requirements. But you should know that RAM is cheap
but developer's time is not.

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)                                    |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)                          |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


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

Date: 12 Oct 2001 06:13:57 -0700
From: Houda.Araj@cogmedia.com (Houda Araj)
Subject: Re: Reformat Chain
Message-Id: <21916d9f.0110120513.7616776e@posting.google.com>

I am sorry I did not include the data as Thomas mentionned.  What I
need is to take a file that contains strings (Input chain) and direct
it to an output file (the result of reformat) instead of viewing it
only on the screen.

I am somewhat not familar with PERL and I just have no idea how to go
about doing this.

Thanks

Houda Araj


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

Date: Fri, 12 Oct 2001 09:11:48 -0500
From: trammell@haqq.hypersloth.invalid (John J. Trammell)
Subject: Re: Reformat Chain
Message-Id: <slrn9sduh4.ubt.trammell@haqq.hypersloth.net>

On 12 Oct 2001 06:13:57 -0700, Houda Araj <Houda.Araj@cogmedia.com> wrote:
> I am sorry I did not include the data as Thomas mentionned.  What I
> need is to take a file that contains strings (Input chain) and direct
> it to an output file (the result of reformat) instead of viewing it
> only on the screen.
> 
> I am somewhat not familar with PERL and I just have no idea how to go
> about doing this.
> 

program.pl <input.txt >output.txt

-- 
According to the Genesis account, the tower of Babel was man's second
major engineering undertaking, after Noah's ark.  Babel was the first
engineering fiasco.
                                - F. Brooks, _The Mythical Man-Month_


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

Date: 12 Oct 2001 11:37:23 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Signal SEGV with overload
Message-Id: <9q6klj$jtf$1@mamenchi.zrz.TU-Berlin.DE>

According to Ari Jolma <ajolma@water.hut.fi>:
> Why do I get a Signal SEGV with this code:
> 
> $a = init();
> domore($a);
> 
> sub init {
>     my $a = new Object;
>     return $a;
> }
> 
> sub domore {
>     my $a = shift;
>     $a += 1;
> }
> 
> package Object;
> 
> use overload ('fallback' => 1,
> 	      '+=' => 'add');
> 
> sub new {
>     my $class = shift;
>     my $self = {};
>     bless($self, $class);
>     return $self;
> }
> 
> sub add {
>     my $self = shift;
>     my $add = shift;
>     print "$self\n";
> }
> 
> The code works OK if I use the add method directly or if I do not
> use my $a in domore.

There shouldn't be a segfault (I guess Ilya will know what to do about
it), but you didn't provide a copy constructor ('=' handler).  When
a mutator like += is overloaded (instead of autogenerating it from +),
a copy constructor is needed.  The copy constructor itself can only
be autogenerated for plain scalars, so you must provide one.

Set "$Object::overload{ '='} = \ &clone" and define another method:

    sub clone {
        my $self = shift;
        bless { %{ $self} }, ref $self;
    }

Anno


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

Date: 12 Oct 2001 06:59:07 -0700
From: ernst_ube@yahoo.com (Ernst Ube)
Subject: The inner working of the debug module ?
Message-Id: <a9b6720e.0110120559.59d76422@posting.google.com>

Hi,
do you know a description of the 
functioning of the DB module somewhere...?

(The two GUI debuggers that I loaded down
didn't work. It can't be so difficult to
write a simple one myself  :-)

Thanks
Ernst


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

Date: Fri, 12 Oct 2001 12:47:38 +0200
From: peter pilsl <pilsl_@goldfisch.at>
Subject: Re: Uploading
Message-Id: <3bc6ca4b$1@e-post.inode.at>

Amer Neely wrote:

<skip>
> 
> I've witnessed some of these failures for a client of mine for which I
> provided an upload feature for client resumes. Out of every few hundred
> successful uploads we still get the odd failure, and I haven't been able
> to isolate or duplicate it. But it sure beats copy-paste your resume
> into a text box :) If you haven't had any failures, consider yourself
> lucky I guess.

Thats interesting and I didnt know of that. Maybe I had such failures 
already but didnt realize the problem and thought of network- or 
clientproblems.

anyway : there are companies out there that would consider themselves very 
lucky if they had such a good functioniality (only one failure out of 
hundred operations ;)

thnx for your comment.

best,
peter

-- 
peter pilsl
pilsl_@goldfisch.at
http://www.goldfisch.at



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

Date: Fri, 12 Oct 2001 11:11:00 GMT
From: JHM1MAO@leeds.ac.uk (M.A. Oxby)
Subject: Re: Uploading
Message-Id: <GL3Ayy.FnH@leeds.ac.uk>

Could one of you just run the function by me quickly, as I'm not presently in 
a position to just "nip" out and gra a copy of a book! :)
I do do programming with CGI.pm where necessary, but of course until I need  a 
function I don't learn it!
Thanks:)

In article <3BC69C77.B25B1F56@softouch.on.ca>, Amer Neely 
<aneely@softouch.on.ca> wrote:
>peter pilsl wrote:
>> 
>> Amer Neely wrote:
>> 
>> >
>> > I would also suggest getting if possible the "Official Guide to
>> > Programming with CGI.pm" by Lincoln Stein. It contains good examples of
>> > code for uploading files. However, he does state that in some situations
>> > it fails, so be aware if this happens and you start pulling your hair
>> > out as I did :)
>> 
>> File-upload-fields are part of my daily bread (so you can imagine what
>> low-qualitiy-food I eat every day ;), but I never had any problems with em.
>> The code I use (mainly from cgi.pm) is fairly simple and robust.
>> 
>> What problems are you talking about ?
>> 
>> peter
>> 
>> --
>> peter pilsl
>> pilsl_@goldfisch.at
>> http://www.goldfisch.at
>
>In his CGI FAQ at
>http://stein.cshl.org/WWW/software/CGI/cgi_docs.html#upload_caveats the
>very first paragraph in the Upload section reads: "The file upload
>feature doesn't work with every combination of browser and server. The
>various versions of Netscape and Internet Explorer on the Macintosh,
>Unix and Windows platforms don't all seem to implement file uploading in
>exactly the same way. I've tried to make CGI.pm work with all versions
>on all platforms, but I keep getting reports from people of instances
>that break the file upload feature."
>
>I've witnessed some of these failures for a client of mine for which I
>provided an upload feature for client resumes. Out of every few hundred
>successful uploads we still get the odd failure, and I haven't been able
>to isolate or duplicate it. But it sure beats copy-paste your resume
>into a text box :) If you haven't had any failures, consider yourself
>lucky I guess.

- Martin Oxby
Founder and Administrator
[http://www.resource-centre.net]
Web Resources, Free Email, Messaging and Programming Tutorials all under one roof!


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

Date: Fri, 12 Oct 2001 14:51:52 +0200
From: peter pilsl <pilsl_@goldfisch.at>
Subject: Re: Uploading
Message-Id: <3bc6e778$1@e-post.inode.at>

M.A. Oxby wrote:

> Could one of you just run the function by me quickly, as I'm not presently
> in a position to just "nip" out and gra a copy of a book! :)
> I do do programming with CGI.pm where necessary, but of course until I
> need  a function I don't learn it!

Which function of you ? You didnt post a source we could run.
If you mean : write the source for you and give it to you for no money: no
if you mean : you have a source and want me to test it : yes

best,
peter

-- 
peter pilsl
pilsl_@goldfisch.at
http://www.goldfisch.at



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

Date: Fri, 12 Oct 2001 13:38:11 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Uploading
Message-Id: <8rrdstc6hnqi01u9i3jmsq58263p1kbkaq@4ax.com>

peter pilsl wrote:

>> I do do programming with CGI.pm where necessary, but of course until I
>> need  a function I don't learn it!
>
>Which function of you ? You didnt post a source we could run.

Of course he's talking about "upload", in this particular case.

There was a tutorial online by Brent Michalski. Let's see if I can find
it... Here it is.


<http://www.webreview.com/1998/08_14/developers/08_14_98_3.shtml>

Look around in that directory for some related files. It doesn't look
like there are links to them on the page itself. And the online example
script looks like it's disabled. Yup: click on it, and Netscape shows
the source.

-- 
	Bart.


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

Date: Fri, 12 Oct 2001 10:19:11 -0400
From: "William Grigg" <wgrigg@draper.com>
Subject: website examples
Message-Id: <9q6u4v$mtu$1@news.draper.com>

We have a project that is trying to use 4 webservers (IIS4, IIS5, Apache and
Mandrake) on 4 platforms (NT4, W2000, Solaris and Linux) in order to do some
analysis. We need some sort of representative website that does some
standard stuff that includes database updating, such as a shopping cart type
application. I have gotten stuck trying to take the IIS5 sample website and
rehosting it to Apache using chili!soft. I would like to try an all Perl
type website that works on all 4 of the above mentioned platforms. Any help
would be greatly appreciated.

TIA

Bill Grigg




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

Date: Fri, 12 Oct 2001 11:28:37 GMT
From: Jacqui.Caren@ig.co.uk (Jacqui caren)
Subject: Re: Why is $i so popular?
Message-Id: <91387E28CJacquiCarenigcouk@195.8.69.73>

johndporter@yahoo.com (John Porter) wrote in
<3B8A5378.E6BD6C12@yahoo.com>: 

>"Randal L. Schwartz" wrote:
>> Fortran77 may have introduced the type declaration to override the
>> mandatory "convention". 

I missed the early part of this thread but I assumed that
the discussion moved around the convention of using I as the
first integer variable in untyped namespace languages such as
AutoCode, early FORTRANs etc.

This also explains the use of i,j,k,l in nested loops.

Anyway this is the way *I* used to do it in AutoCode and the
early FORTRANs (on Hollerith cards no less).

Jacqui

p.s.
Having to puch cards and wait 2 days to see if your code compiled
and then worked as expected made you very carefull about your design.

The folks I know who have experience in such limited resource
situations (such as having to share terminals etc) are IMHO much
better programmers - they actuall think about a deisgn rather than
ract to stimulii generate by the compile and execute phases...



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

Date: Fri, 12 Oct 2001 12:20:05 +0100
From: "nice.guy.nige" <spamfreenation@nigenet.org.uk>
Subject: Re: YOU ARE ALL GAY!
Message-Id: <9q6jkt$lrvqm$1@ID-112325.news.dfncis.de>

"Geoffrey Pointer" <geoffrey@bigpond.net.au> wrote in message
news:B7ECB739.83A4%geoffrey@bigpond.net.au...
[...]
> Thanks Nigel, I realise my error and you have clearly demonstrated that
> education doesn't have to be a humiliating experience. Heck, I know I'm
not
> perfect.

Hi Geoff,

Hmmm... well.... now you have posted the original message... and it still
makes absolutely no sense whatsoever!

Cheers ;-)
Nige

--
Nigel Moss

Visit me on the webby thing! http://www.nigenet.org.uk
Boycott E$$O!! http://www.stopesso.com





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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 1918
***************************************


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