[17830] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5250 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 4 23:38:38 2001

Date: Thu, 4 Jan 2001 20:38:18 -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: <978669497-v9-i5250@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 4 Jan 2001     Volume: 9 Number: 5250

Today's topics:
    Re: Testing if something exists deep within a structure <brannon@lnc.usc.edu>
    Re: Testing if something exists deep within a structure <joe+usenet@sunstarsys.com>
    Re: Testing if something exists deep within a structure <brannon@lnc.usc.edu>
        Troubleshooting flock failure <kj0@mailcity.com>
    Re: Unable to assign a value to an array element. <waltman@netaxs.com>
        Uninstalling CPAN modules <chris@saddlebags.upnix.com>
    Re: Uninstalling CPAN modules <johngros@Spam.bigpond.net.au>
    Re: Uninstalling CPAN modules (El Nadie)
    Re: Uninstalling CPAN modules <johngros@Spam.bigpond.net.au>
    Re: Uninstalling CPAN modules <randy@theory.uwinnipeg.ca>
        Unitialised value error. <johngros@Spam.bigpond.net.au>
    Re: Unitialised value error. <W.Hielscher@mssys.com>
    Re: Unitialised value error. (Anno Siegel)
    Re: Unitialised value error. <johngros@Spam.bigpond.net.au>
    Re: Unitialised value error. (Anno Siegel)
        unlink function <nbeaumont@atosorigin.com>
    Re: unlink function <guenther.degenfelder@datev.de>
    Re: unlink function <bart.lateur@skynet.be>
    Re: Upload multi files with same source <nospam@nospam.com>
    Re: Upload multi files with same source megalomaniacs4u@my-deja.com
    Re: Upload multi files with same source martinnitram@my-deja.com
    Re: Upload multi files with same source <nospam@nospam.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 01 Jan 2001 04:52:19 GMT
From: Terrence Brannon <brannon@lnc.usc.edu>
Subject: Re: Testing if something exists deep within a structure
Message-Id: <lbpui7q3gc.fsf@lnc.usc.edu>

see author BPOWERS on CPAN

actually, I believe his modules were written for hashrefs,but they may
work for array refs

> Hi all.  I could use some help.
> Say I have a structure that looks like this:
> 
> my @array = ({name => "Eric", job => {title =>"Programmer", language =>
> "Perl"}},
>              {name => "John", job => {title => "Graphic Designer"}});
> 
> 
> Now, I want to test if $array[3]->{job}->{language} exists.
> BUT I do not want to create $array[3]->{job} in the process like this
> would:
> 
> if (exists ($array[3]->{job}->{language})
> 
> 
> I know I can do
> 
> if (defined ($array[3]) && exists ($array[3]->{job}) && exists
> ($array[3]->{job}->{language})
> 
> 
> But this gets very ugly with deep structures.
> 
> The perldoc mentions this surprise autovivification and says it may be
> fixed in a later release, but that doesnt help me now.
> Any ideas?  Thank you.
> -E
> 
> 
> Sent via Deja.com
> http://www.deja.com/

-- 
Terrence Brannon
Carter's Compass...
    I know I'm on the right track when by deleting code I'm adding
    functionality.


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

Date: 01 Jan 2001 04:39:56 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Testing if something exists deep within a structure
Message-Id: <m3g0j3626r.fsf@mumonkan.sunstarsys.com>

Terrence Brannon <brannon@lnc.usc.edu> writes:

> see author BPOWERS on CPAN
> 
> actually, I believe his modules were written for hashrefs,but they may
> work for array refs
> 
> > Hi all.  I could use some help.
> > Say I have a structure that looks like this:
> > 
> > my @array = ({name => "Eric", job => {title =>"Programmer", language =>
> > "Perl"}},
> >              {name => "John", job => {title => "Graphic Designer"}});
> > 
> > 
> > Now, I want to test if $array[3]->{job}->{language} exists.
> > BUT I do not want to create $array[3]->{job} in the process like this
> > would:
> > 
> > if (exists ($array[3]->{job}->{language})

You might consider reworking your data structure into an object, and
then creating a method that carries this out for you.  Something like 
this might work:

% cat /tmp/try.pl
#!/usr/bin/perl -wl
use strict;
my $obj =

  [
      { 
          name => "Eric", 
          job  => { 
                    title      => "Programmer",
	            language   => "Perl",
                    supervisor => undef, # key exists, value undefined
                  }
      },

      {   
          name => "John", 
          job  => { title => "Graphic Designer"} 
      },

       undef # see comment above
  ] ;

bless $obj, "OBJ";
$obj->test(\&OBJ::existence);
$obj->test(\&OBJ::definedness);
##################################################
package OBJ;

sub look_for; # aliased to &existence or &definedness

sub test {
  my $self = shift;
  *look_for = shift; # existence or definedness

  print "OK"     if ( $self->look_for( 0, "job", "language") );
  print "OK?"    if ( $self->look_for( 0, "job", "supervisor") );

  print "NOT OK" if ( $self->look_for(1, "job", "language") );
  print "NOT OK" if ( $self->look_for(2, "job", "language") );

  print "OK??"   if ($self->look_for(2));
}

sub existence {
    my $ref = shift;

    foreach (@_) {
      ref $ref or return 0;
      return 0 unless # passes test for existence
          exists $$ref{$_} || eval { $_ <= $#$ref and $_ >= 0 };
      $ref = exists $$ref{$_} ? $$ref{$_} : $$ref[$_] ;
    }

    return 1;
}

sub definedness {
    my $ref = shift;

    foreach (@_) {
      ref $ref or return undef; # a Miami Dolfan :)
      $ref = exists $$ref{$_} ? $$ref{$_} : eval { $$ref[$_] } ;

    }

    return $ref;

}


1;

__END__

% /tmp/try.pl
OK
OK?
OK??
Subroutine look_for redefined at /tmp/try.pl line 33.
OK
%

HTH.
-- 
Joe Schaefer


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

Date: Tue, 02 Jan 2001 17:56:48 GMT
From: Terrence Brannon <brannon@lnc.usc.edu>
Subject: Re: Testing if something exists deep within a structure
Message-Id: <lb7l4d3kin.fsf@lnc.usc.edu>

Data::Iterator just came out. The docs are written by a native German,
so its a bit tough to follow, but it looks worthwhile to investigate.

-- 
Terrence Brannon
Carter's Compass...
    I know I'm on the right track when by deleting code I'm adding
    functionality.


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

Date: 4 Jan 2001 10:51:00 -0500
From: kj0 <kj0@mailcity.com>
Subject: Troubleshooting flock failure
Message-Id: <932654$7va$1@panix3.panix.com>






I'm having problems with a hanging flock call requesting an exclusive
lock on a certain file.  I can't see any obvious reason for this lock
request to hang, since to my knowledge, there's no other process
locking the file.  How can I find out what is causing this flock call
to hang?

Thanks,

KJ




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

Date: 29 Dec 2000 12:34:26 -0500
From: Walt Mankowski <waltman@netaxs.com>
Subject: Re: Unable to assign a value to an array element.
Message-Id: <87snn7m8rh.fsf@netaxs.com>

"John Boy Walton" <johngros@Spam.bigpond.net.au> writes:

> "John Boy Walton" <johngros@Spam.bigpond.net.au> wrote in message
> news:weW26.36934$xW4.291783@news-server.bigpond.net.au...
> 
> Can you believe it?
> I worked it out as soon as I sent it.
> A missing colon on the 'do while'

That fixes the syntax error, but there's still a logic error in your
for loop.  As Barton mentioned, the code inside the for loop will
never be executed.

Walt


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

Date: Sun, 31 Dec 2000 13:15:34 -0700
From: Chris Cameron <chris@saddlebags.upnix.com>
Subject: Uninstalling CPAN modules
Message-Id: <Pine.BSO.4.21.0012311313550.2176-100000@saddlebags.upnix.com>

Is it possible to uninstall CPAN modules? I've looked through all the
FAQ's I could find, but most of them just cover installing the modules.

Thanks,
Chris



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

Date: Tue, 02 Jan 2001 05:47:23 GMT
From: "John Boy Walton" <johngros@Spam.bigpond.net.au>
Subject: Re: Uninstalling CPAN modules
Message-Id: <LXd46.41350$xW4.332145@news-server.bigpond.net.au>


"Chris Cameron" <chris@saddlebags.upnix.com> wrote in message
news:Pine.BSO.4.21.0012311313550.2176-100000@saddlebags.upnix.com...
> Is it possible to uninstall CPAN modules? I've looked through all the
> FAQ's I could find, but most of them just cover installing the modules.
The CPAN module has built in help.
Type help and it will list all commands including uninstall.




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

Date: Tue, 02 Jan 2001 06:13:29 GMT
From: nadie@latino-2000.com (El Nadie)
Subject: Re: Uninstalling CPAN modules
Message-Id: <nadie3a516cee396e@news.latino-2000.com>

On Tue, 02 Jan 2001 05:47:23 GMT,
	John Boy Walton <johngros@Spam.bigpond.net.au> wrote:
> 
> "Chris Cameron" <chris@saddlebags.upnix.com> wrote in message
> news:Pine.BSO.4.21.0012311313550.2176-100000@saddlebags.upnix.com...
> > Is it possible to uninstall CPAN modules? I've looked through all the
> > FAQ's I could find, but most of them just cover installing the modules.
> The CPAN module has built in help.
> Type help and it will list all commands including uninstall.

Are you sure?  The latest version of CPAN (v1.59) does not list any
`uninstall' command when you type `help'.

I pasted a listing below which illustrates this point.  I don't
recall seeing an `uninstall' in any earlier versions of CPAN,
either.

Also, the word `uninstall' appears nowhere within the output of
`perldoc CPAN'.  Neither does `deinstall'.

There never used to be a command within the CPAN shell nor a method
within the CPAN class which uninstalls a module, and I believe that
such a thing still doesn't exist.

The `u' command within the CPAN shell lists what are called
"uninstalled" modules, but I'm pretty sure that this is actually a
list of all the CPAN modules which exist, but which are not
currently installed.  Therefore, a better word might be
"non-installed".

Here's the listing of the interactive CPAN run, showing the
output of the `help' command:

 localhost:~ 1> perl -MCPAN -e shell

 cpan shell -- CPAN exploration and modules installation (v1.59)
 ReadLine support enabled

 cpan> help

 Display Information
  a                                    authors
  b         string           display   bundles
  d         or               info      distributions
  m         /regex/          about     modules
  i         or                         anything of above
  r         none             reinstall recommendations
  u                          uninstalled distributions

 Download, Test, Make, Install...
  get                        download
  make                       make (implies get)
  test      modules,         make test (implies make)
  install   dists, bundles   make install (implies test)
  clean                      make clean
  look                       open subshell in these dists' directories
  readme                     display these dists' README files

 Other
  h,?           display this menu       ! perl-code   eval a perl command
  o conf [opt]  set and query options   q             quit the cpan shell
  reload cpan   load CPAN.pm again      reload index  load newer indices
  autobundle    Snapshot                force cmd     unconditionally do cmd
 cpan>


-- 
El Nadie
nadie@latino-2000.com


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

Date: Tue, 02 Jan 2001 06:46:27 GMT
From: "John Boy Walton" <johngros@Spam.bigpond.net.au>
Subject: Re: Uninstalling CPAN modules
Message-Id: <7Pe46.41442$xW4.332210@news-server.bigpond.net.au>


"El Nadie" <nadie@latino-2000.com> wrote in message
news:nadie3a516cee396e@news.latino-2000.com...
> Are you sure?  The latest version of CPAN (v1.59)
I am running the same version and yes you are right I am wronger than a fish
on top of a sand dune.
I was sure I had seen it but it does not exist. I checked PPM too, but PPM
uses remove. Hopefully Chris will find that helpfull.




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

Date: Tue, 2 Jan 2001 06:33:34 -0600
From: "Randy Kobes" <randy@theory.uwinnipeg.ca>
Subject: Re: Uninstalling CPAN modules
Message-Id: <92si5k$gka$1@canopus.cc.umanitoba.ca>

"El Nadie" <nadie@latino-2000.com> wrote in message
news:nadie3a516cee396e@news.latino-2000.com...
> On Tue, 02 Jan 2001 05:47:23 GMT,
> John Boy Walton <johngros@Spam.bigpond.net.au> wrote:
> >
> > "Chris Cameron" <chris@saddlebags.upnix.com> wrote in message
> > news:Pine.BSO.4.21.0012311313550.2176-100000@saddlebags.upnix.com...
> > > Is it possible to uninstall CPAN modules? I've looked through all the
> > > FAQ's I could find, but most of them just cover installing the
modules.
> > The CPAN module has built in help.
> > Type help and it will list all commands including uninstall.
>
> Are you sure?  The latest version of CPAN (v1.59) does not list any
> `uninstall' command when you type `help'.

There isn't an "uninstall" command within CPAN.pm, but there is
support for uninstalling modules within the generated
Makefile in instances when the name of the module you're
building clashes with that of an already installed module not
located in the targetted install directory. Installing things as
    make install UNINST=1
will install the current module and remove the old one.

best regards,
randy kobes





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

Date: Wed, 03 Jan 2001 11:19:06 GMT
From: "John Boy Walton" <johngros@Spam.bigpond.net.au>
Subject: Unitialised value error.
Message-Id: <KUD46.43100$xW4.346504@news-server.bigpond.net.au>

I have a script that is a mine field game similar to that found in windows.
 My sub that expands the neighbours of  cells that contain a zero give a
use of unitialised value for all the ifs that check if a cell has a zero.

I took care to initialise all my arrays and printed them out so they do
hold values.
The data consists of [0-9 B] in the array scattered at random.
This is an example of the ifs
     if ($cells[$data[$i]-1][$data[$i+1]-1] eq '0'){
      push(@data, $data[$i]-1, $data[$i+1]-1);
    }

Is this being caused because I am using a string test?
If it is I get hammered with Argument "B" isn't numeric in numeric eq (==)
at working.pl line 157
If I use a numeric test.
Does anyone know how I can solve this?
The data consists of [0-9 B] in the array scattered at random.




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

Date: Wed, 03 Jan 2001 13:36:45 +0100
From: Wolfgang Hielscher <W.Hielscher@mssys.com>
Subject: Re: Unitialised value error.
Message-Id: <3A531CDD.8C5B3CBB@mssys.com>

John Boy Walton wrote:
> give a
> use of unitialised value for all the ifs that check if a cell has a zero.
> 
> This is an example of the ifs
>      if ($cells[$data[$i]-1][$data[$i+1]-1] eq '0'){
>       push(@data, $data[$i]-1, $data[$i+1]-1);
>     }

(This is not much of information you supply nor a running piece of code
and data that displays your problem.)

Are you sure that
  $i < @data
  $data[$i]-1 < @cells
  $i+1 < @data
  $data[$i+1]-1 < @cells[$data[$i]-1]

Otherwise your arrays gets extended up to the given index and all newly
created elements are set to undef.


> Is this being caused because I am using a string test?
> If it is I get hammered with Argument "B" isn't numeric in numeric eq (==)
> at working.pl line 157
> If I use a numeric test.
Think about it yourself!


> Does anyone know how I can solve this?
Learn to help yourself.
Learn to help others helping you.
(You're 'round here long enough for knowing that!)

> The data consists of [0-9 B] in the array scattered at random.
Btw: For what you Do need the 9 for?!


Cheers
   Wolfgang


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

Date: 3 Jan 2001 13:03:21 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Unitialised value error.
Message-Id: <92v7up$eru$1@mamenchi.zrz.TU-Berlin.DE>

John Boy Walton <johngros@Spam.bigpond.net.au> wrote in comp.lang.perl.misc:
>I have a script that is a mine field game similar to that found in windows.
> My sub that expands the neighbours of  cells that contain a zero give a
>use of unitialised value for all the ifs that check if a cell has a zero.
>
>I took care to initialise all my arrays and printed them out so they do
>hold values.
>The data consists of [0-9 B] in the array scattered at random.
>This is an example of the ifs
>     if ($cells[$data[$i]-1][$data[$i+1]-1] eq '0'){
>      push(@data, $data[$i]-1, $data[$i+1]-1);
>    }
>
>Is this being caused because I am using a string test?
>If it is I get hammered with Argument "B" isn't numeric in numeric eq (==)
>at working.pl line 157
>If I use a numeric test.
>Does anyone know how I can solve this?

Using "eq" or "==" doesn't change the defined-ness of the operands,
the problem has nothing to do with that.  My guess is that one of
the expressions like $data[$i+1] or $cells[$data[$i]-1] tries to
access an array element that has never been defined.

How to work around that is another question.  If it is okay to treat
cells outside the defined area like cells containing 0, you can
replace the if statement with


  unless ( $cells[$data[$i]-1][$data[$i+1]-1] ) { ...

This is equivalent to yours if the corresponding element of @cells
is defined but won't complain if it isn't.  On the other hand, if
$data[$i] (or similar) is undefined in the first place, it will
still complain.

If that isn't an option, you'll have to find exactly which expressions
are undefined in the indicated line.  Something like

  print "undef: ", join( ", ", grep ! defined eval, qw( $data[ $i] ...), "\n";

can be helpful in that case.

Anno

PS: It would have been helpful if you had shown a little more of
your code.  Note how I had to guess things and offer alternatives
to cover the possibilities.  It is frustrating to you have to
consider and explain various solutions of which only one will be
useful.


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

Date: Wed, 03 Jan 2001 14:47:10 GMT
From: "John Boy Walton" <johngros@Spam.bigpond.net.au>
Subject: Re: Unitialised value error.
Message-Id: <OXG46.43530$xW4.346326@news-server.bigpond.net.au>


"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
news:92v7up$eru$1@mamenchi.zrz.TU-Berlin.DE...
> PS: It would have been helpful if you had shown a little more of
> your code.  Note how I had to guess things and offer alternatives
> to cover the possibilities.  It is frustrating to you have to
> consider and explain various solutions of which only one will be
> useful.
Sorry Anno but my code is 7k, plus I know I need to work on the logic
because those if statements should not be finding a case of 'B'. But when I
do a numeric test it finds 'B' when I do a text comparison it finds Use of
uninitialized value in string eq at working.pl line 157
 . When I checked perldiag it made me wonder whether it was finding a '0' and
then reporting it undefined. I will 'use' all your suggestions anyway as I
am on a steep learning curve and all of it will be usefull now or in the
future.




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

Date: 3 Jan 2001 14:54:47 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Unitialised value error.
Message-Id: <92vefn$eru$3@mamenchi.zrz.TU-Berlin.DE>

John Boy Walton <johngros@Spam.bigpond.net.au> wrote in comp.lang.perl.misc:
>
>"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
>news:92v7up$eru$1@mamenchi.zrz.TU-Berlin.DE...
>> PS: It would have been helpful if you had shown a little more of
>> your code.  Note how I had to guess things and offer alternatives
>> to cover the possibilities.  It is frustrating to you have to
>> consider and explain various solutions of which only one will be
>> useful.
>
>Sorry Anno but my code is 7k, plus I know I need to work on the logic
>because those if statements should not be finding a case of 'B'. But when I
>do a numeric test it finds 'B' when I do a text comparison it finds Use of
>uninitialized value in string eq at working.pl line 157

I strongly doubt that.  The loop may run differently, visiting different
indexes depending on the type of comparison, so it may avoid the
undefined parts in some variant.  But a single array element will
be defined or undefined, no matter which comparison.

>. When I checked perldiag it made me wonder whether it was finding a '0' and
>then reporting it undefined.

No.

Anno


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

Date: Tue, 02 Jan 2001 08:25:55 GMT
From: "Nicolas BEAUMONT" <nbeaumont@atosorigin.com>
Subject: unlink function
Message-Id: <ngg46.532$eI5.883801@nnrp5.proxad.net>

Hello (and happy new year)

    I try to unlink a file under windows NT but the file can't be unlink due
to a permission denied message, it seems that the file is "locked" because
it's open.
So I try to make that :

 print "$logFilename \n";
 $rc = open(HANDLE, $logFilename) or die "Can't open :$!";
 print "$rc \n";
 $rc = close(HANDLE) or die "Unable to close : $!";
 print "$rc \n";
 print "essai 1 :";
 unlink($logFilename) or warn "Can't unlink $logFilename :$!";

and the result is always :

 ../logs/resultat_650650651_99655_xxx_20010102091917.txt
1
1
essai 1 :Can't unlink
 ../logs/resultat_650650651_99655_xxx_20010102091917.txt :Permission denied
at pilote.pl line 533, <FLOG> chunk 21.

but if I start again the script and I wrote :
unlink("../logs/resultat_650650651_99655_xxx_20010102091917.txt"); it works
perfectly...

I need help !! How can I be sure that a file is closed, and how can I be
sure that I can delete it.

Thanks in advance,
--
Nicolas Beaumont.

Computer engineer
Atos Origin
www.atosorigin.com




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

Date: Wed, 3 Jan 2001 14:14:03 +0100
From: "Guenther Degenfelder" <guenther.degenfelder@datev.de>
Subject: Re: unlink function
Message-Id: <3a53270c$1@news.datev.de>

I noticed a '\n' in your filename (there is a new line in the error output
after "Can't unlink"):

>  unlink($logFilename) or warn "Can't unlink $logFilename :$!";
 ...
> essai 1 :Can't unlink
> ../logs/resultat_650650651_99655_xxx_20010102091917.txt :Permission denied

which may result in a trying to delete the file named ""

Am i right?!

    Guenther




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

Date: Wed, 03 Jan 2001 14:51:07 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: unlink function
Message-Id: <a2f65t8jvhotk75dq32ksus5hlgfem589u@4ax.com>

Nicolas BEAUMONT wrote:

>    I try to unlink a file under windows NT but the file can't be unlink due
>to a permission denied message, it seems that the file is "locked" because
>it's open.

Yes. And if it's not your script that has the file open, there's nothing
you can do about it: you can't close other people's files. All you could
do, is stop (restart?) the other program.

Is it worth it?

-- 
	Bart.


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

Date: 30 Dec 2000 03:30:10 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: Upload multi files with same source
Message-Id: <92jks2$ft8$6@216.155.32.187>

In article <P5%26.37218$xW4.295052@news-server.bigpond.net.au>, "John 
Boy Walton" <johngros@Spam.bigpond.net.au> wrote:

 | >    And how to find the CGI.pm version?
 | PPM query CGI.pm
 | or if CPAN is your favourite,
 | perl -MCPAN -e shell
 | m CGI.pm

actually that last would be 

    m CGI
not 
    m CGI.pm

cpan> m CGI.pm
CPAN: Storable loaded ok
Going to read Primus 8.5GB:Applications:MacPerl Ÿ:.cpan:Metadata
No objects of type Module found for argument CGI.pm

cpan> m CGI
Module id = CGI
    CPAN_USERID  LDS (Lincoln D. Stein <lstein@genome.wi.mit.edu>)
    CPAN_VERSION 2.74
    CPAN_FILE    L/LD/LDS/CGI.pm-2.74.tar.gz
    MANPAGE      CGI - Simple Common Gateway Interface Class
    INST_FILE    Primus 8.5GB:Applications:MacPerl Ÿ:site_perl:CGI.pm
    INST_VERSION 2.74

-- 
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: Sat, 30 Dec 2000 19:12:34 GMT
From: megalomaniacs4u@my-deja.com
Subject: Re: Upload multi files with same source
Message-Id: <92lc2u$n0p$1@nnrp1.deja.com>

In article <m3n1dg8fsl.fsf@mumonkan.sunstarsys.com>,
  Joe Schaefer <joe+usenet@sunstarsys.com> wrote:
> efflandt@xnet.com (David Efflandt) writes:
>
> > On Thu, 28 Dec 2000, martinnitram@my-deja.com wrote:
> > >
> > >   I used CGI.pm to handle upload file. Everything work fine at
first,
> > >even upload two files in a single form; but if user input same
image
> > >src in both fields (say, both input c:\image.gif), i found that
only
> > >the first one can upload successfully, while another one is zero in
> > >file size.
>
> What code did you use to arrive at your findings?  There is no way
> to know how you managed this without posting the offending perl,
> HTML, and CGI.pm version.  IIRC, there is an old, broken browser
> that is capable of "compressing" duplicate file uploads, but modern
> browsers should work fine.

Um, I hit this problem 6months ago with CGI.pm

Ignore the OLD BROKEN BROWSER flame bait.

I was using brand new browsers and  CGI.pm (2.5x) with perl 5.005 and
perl 5.6 and using copied html that worked fine with servlets...


--
Ben Baylis (megalomaniacs4u@hotmail.com)


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


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

Date: Tue, 02 Jan 2001 02:14:49 GMT
From: martinnitram@my-deja.com
Subject: Re: Upload multi files with same source
Message-Id: <92rdil$u6o$1@nnrp1.deja.com>

In article <92jks2$ft8$6@216.155.32.187>,
  The WebDragon <nospam@nospam.com> wrote:
> In article <P5%26.37218$xW4.295052@news-server.bigpond.net.au>, "John
> Boy Walton" <johngros@Spam.bigpond.net.au> wrote:
>
>  | >    And how to find the CGI.pm version?
>  | PPM query CGI.pm
>  | or if CPAN is your favourite,
>  | perl -MCPAN -e shell
>  | m CGI.pm
>
> actually that last would be
>
>     m CGI
> not
>     m CGI.pm
>
> cpan> m CGI.pm
> CPAN: Storable loaded ok
> Going to read Primus 8.5GB:Applications:MacPerl ?.cpan:Metadata
> No objects of type Module found for argument CGI.pm
>
> cpan> m CGI
> Module id = CGI
>     CPAN_USERID  LDS (Lincoln D. Stein <lstein@genome.wi.mit.edu>)
>     CPAN_VERSION 2.74
>     CPAN_FILE    L/LD/LDS/CGI.pm-2.74.tar.gz
>     MANPAGE      CGI - Simple Common Gateway Interface Class
>     INST_FILE    Primus 8.5GB:Applications:MacPerl ?site_perl:CGI.pm
>     INST_VERSION 2.74
>
    Thx a lot, so the version of CGI.pm is "INST_VERSION"? As i found
that INST_VERSION of our CGI.pm is 2.42 and CPAN_VERSION is 2.74.


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


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

Date: 2 Jan 2001 08:14:48 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: Upload multi files with same source
Message-Id: <92s2lo$8ol$2@216.155.33.34>

In article <92rdil$u6o$1@nnrp1.deja.com>, martinnitram@my-deja.com 
wrote:

 | >  | >    And how to find the CGI.pm version?

[snip]

 | >  | perl -MCPAN -e shell

[snip] 

 | > cpan> m CGI
 | > Module id = CGI
 | >     CPAN_USERID  LDS (Lincoln D. Stein <lstein@genome.wi.mit.edu>)
 | >     CPAN_VERSION 2.74
 | >     CPAN_FILE    L/LD/LDS/CGI.pm-2.74.tar.gz
 | >     MANPAGE      CGI - Simple Common Gateway Interface Class
 | >     INST_FILE    Primus 8.5GB:Applications:MacPerl ?site_perl:CGI.pm
 | >     INST_VERSION 2.74

 |     Thx a lot, so the version of CGI.pm is "INST_VERSION"? As i found

yes, that shows the 'installed version' that you currently have 
available.

 | that INST_VERSION of our CGI.pm is 2.42 and CPAN_VERSION is 2.74.

you can update this to 2.74 using 

    perl -MCPAN -e shell
    install CGI

however there are some caveats. 

you need to have the environment variable PERL5LIB set to your lib 
directory (something along the lines of 
    setenv PERL5LIB "/home1/users/username/perl/"
) in your shell startup (.login, .cshrc, or whatever)

you also need to set the CPAN config variable makepl_arg using the 'o 
conf' command, to the PREFIX='/home1/users/username/perl/'

I've posted some additional things in another thread regarding the CPAN 
module and some weirdness I've encountered so if it doesn't work, you 
can always do this manually, like so: 

    download the latest CGI.pm from Lincoln Stein's website.
    <http://stein.cshl.org/WWW/software/CGI/>

then ungzip it to your local dir. 

then follow the simple instructions in perlfaq 8, under

How do I install a CPAN module?
How do I keep my own module/library directory?

Hope this helps! :)

-- 
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: 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 5250
**************************************


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