[22977] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5197 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 9 21:07:51 2003

Date: Wed, 9 Jul 2003 18:05:50 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 9 Jul 2003     Volume: 10 Number: 5197

Today's topics:
        re:  perl style guide <jdurick@mitre.org>
    Re: Alternative to use vars <bik.mido@tiscalinet.it>
    Re: Alternative to use vars <mgjv@tradingpost.com.au>
    Re: AS repositories - so many, others missing, why?! (Fourth Monkey)
    Re: AS repositories - so many, others missing, why?! (Randy Kobes)
    Re: ASP --> PERL SCRIPT HELP>>PLEASE>> (Sara)
    Re: Cannot build perl 5.8.0 with Berkley DB 4.1.15 <dwilga-MUNGE@mtholyoke.edu>
    Re: Cannot build perl 5.8.0 with Berkley DB 4.1.15 <pkeller@breathe.com>
        CGI Perl Script caching variables (Herbman)
    Re: CGI Perl Script caching variables <noreply@gunnar.cc>
    Re: CGI Perl Script caching variables (Herbman)
        CGI: how to test existence of file to upload? <jill_krugman@yahoo.com>
    Re: CGI: how to test existence of file to upload? <wgu_@_wurquhart.co.uk>
    Re: CGI: how to test existence of file to upload? <flavell@mail.cern.ch>
    Re: Compiling the h2xs way. (kspecial@linuxmail.org)
        Creating macros in VISIO? (Chad Johnson)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 8 Jul 2003 13:36:14 -0400
From: "jdurick" <jdurick@mitre.org>
Subject: re:  perl style guide
Message-Id: <beevei$hke$1@newslocal.mitre.org>

Besides the one on perldoc.com, does anyone else have any other style guides
I can take a look at to get a look at feel for which one I should use? Any
help would be appreciated.

thx in advance....jd




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

Date: Wed, 09 Jul 2003 14:36:31 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Alternative to use vars
Message-Id: <l7tngvsbh8ea279mvobl714o1ainr9fsdp@4ax.com>

On Mon, 7 Jul 2003 20:44:31 +1000, Martien Verbruggen
<mgjv@tradingpost.com.au> wrote:

>[It may be that I'm still misunderstanding what you're trying to say. If
>so, my apologies in advance...]

This is indeed possible, since english is not my native language and
*my* english is far from perfect. However, still being relatively a
newbie, this conversation is in any case useful for me.

BTW: since you're so kind commenting my article, I'd like to hear your
(and other's) opinion about the other post I wrote, namely the one
about how naturally C<our> fits the existing scheme for "local"
variables under the "natural-language-like-features-in-Perl point of
view"...

>I would indeed argue that if you want that scope (and that's of course a
>lexical scope) that it would be better to use implicit curlies. What I
>wanted to emphasise though, is that such a scope, with the curlies, is
>different from package scope. A package can exist in more than one

OK, I see the point *now*. So I might say at most that my
(hypotetical) "solution" is a "first-order approximation" to package
scope (with C<our>), isn't it? ("wouldn't it be?", that is)

>The long and short of it is that package scope and lexical scope are
>orthogonal things. They do often overlap in real code, but behind the
>scenes there is no real overlap.

Perfectly clear. So I guess there's no *simple* way, as I naively
thought, to "link" them together by means of an "esoteric common
vector", at least in Perl5. I wonder if in Perl6 they will actually be
different aspects of the same underlying mechanism (I suppose that for
backward compatibility the same apparent behaviour will be
maintainded).

>From what you write, I wonder whether you mean that you'd like to have a
>"lexical" scope that would automatically spring to life when one is in a
>certain package. If so, then you're really talking about package scope,

This is (more or less) what I meant...

>and you're looking for what C<use vars> does, I think. Allowing a real
>lexical scope[1] to extend like that would be, IMO, contrary to what a
>lexical scope is.

Hmmm, I think I understand now. Thank you for the other detailed
explanations, that I snipped.


Michele
-- 
$\=q.,.,$_=q.print'  ,\g,,( w,a'c'e'h,,map{$_-=qif/g/;chr
}107..q[..117,q)[map+hex,split//,join' ,2B,, w$ECDF078D3'
F9'5F3014$,$,];];$\.=$/,s,q,32,g,s,g,112,g,y,' , q,,eval;


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

Date: Thu, 10 Jul 2003 10:36:29 +1000
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Alternative to use vars
Message-Id: <slrnbgpd8d.rlm.mgjv@martien.heliotrope.home>

On Wed, 09 Jul 2003 14:36:31 +0200,
        Michele Dondi <bik.mido@tiscalinet.it> wrote:
> On Mon, 7 Jul 2003 20:44:31 +1000, Martien Verbruggen
><mgjv@tradingpost.com.au> wrote:

> BTW: since you're so kind commenting my article, I'd like to hear your
> (and other's) opinion about the other post I wrote, namely the one
> about how naturally C<our> fits the existing scheme for "local"
> variables under the "natural-language-like-features-in-Perl point of
> view"...

Is that the one with Message-ID
<aa6egvkv440j3u8baqeugciu6ut6jrcsh4@4ax.com>?

I read that article earlier, but I wasn't sure whether there was anythin
in there that I could comment on :) 

I do think it might show that there is still a bit of a misunderstanding
about what C<my()>, C<local()>, C<our()> and C<use vars> do, and that's
understandable, since they seem to do many similar things.

Maybe a few more explanations, as I see things, could help, in addition
to MJD's "Coping with scoping" article. I'll say much of the same, but
phrased differently.


Perl has two types of variables: There are those that belong to a
package, and those who don't. The ones that don't belong to a package
are _created_ with C<my()>; all others belong to a package. The ones
that don't belong to a package are only available inside of the lexical
scope they are defined in, the others are available globally, which is
why they are also often called global variables.

Perl has two types of scope: lexical scope and "package scope", where
the latter isn't really a scope, more a namespace. Lexical scope is
(mainly) a compile time thing, and is defined by the enclosing block or
file [1]. Package scope is defined by the use of the package keyword.

Variables that don't belong to a package, i.e. the ones created with
c<my()>,  are often called lexical variables. This is fine, but it does
introduce a bit of a confusion factor. The term lexical doesn't really
apply to the variable, but only to its name. The name temporary or local
variable would have been a better name[2], since these variables also
cease to exist at the end of the current scope. However, Perl already
had local (see later). 

Because lexical scope refers to the name of the variable, and not the
variable itself you can have a lexically scoped package variable with
C<our()>. The variable itself always exists and is accessible, it's just
its short name that is only available in the current lexical scope. It's
as if there is a temporary lexical variable that is an alias for the
package variable[3]. 

The C<use vars> pragma simply allows you to refer to the named variables
by their short name while inside of the package name space (scope, if
you want).

All of the above work on variable names. Before the days of lexical
variables the mechanism to localise variables was with C<local()>.
However, C<local()> does not really localise a variable, but it
localises a (package) variable value. The current value of the variable
is saved, and restored at the end of the current scope. C<local()> has
no effect on variable names. Nowadays, C<local()> has its main use in
providing temporary values for the builtin variables, and is probably
not the right solution for most other uses.

So, summarising...

C<my()>     creates a new non-package variable with lexical scope, and
            existence.
C<local()>  saves the current value of a package (global) variable and
            restores it on leaving the current scope.
C<our()>    allows access to a package variable by its short name in the
            current lexical scope
C<use vars> allows a variable to be referred to by its short name inside
            a package name space.

One of these works with non-package variables, the other three with
globals. Three of these work with (lexical) scopes, and one with package
name spaces. Three of these act on variable names, and one on values
only.

>>The long and short of it is that package scope and lexical scope are
>>orthogonal things. They do often overlap in real code, but behind the
>>scenes there is no real overlap.
> 
> Perfectly clear. So I guess there's no *simple* way, as I naively
> thought, to "link" them together by means of an "esoteric common
> vector", at least in Perl5. I wonder if in Perl6 they will actually be
> different aspects of the same underlying mechanism (I suppose that for
> backward compatibility the same apparent behaviour will be
> maintainded).

I haven't kept up with Perl 6 too well, but from what I understand a lot
of this is one of the areas where some work will be done.

Perl 6 will depart in many ways from the way things are done in Perl 5.
There is no backward compatibility, except for a Perl5 to Perl 6
translation, which will probably be automatic [4]. Perl 6 is a new language,
and one of the goals of the project is to finally get rid of all the
accumulated backward compatibility mess. Localisation and scope is
actually not that messy, compared to many other things that are being
cleaned up.

Martien

[1] It actually is defined by the location of the declaration up to the
end of the enclosing block or file.

[2] The term private variables, which is also expressed by C<my()> just
doesn't entirely cut it for me, mainly because that expression is
already in heavy use in OO, with a different sort of meaning.

[3] I don't know whether that is how Perl implements it, which is why I
say "as if".

[4] As I said, I don't know too much about it, since I haven't been
following the mailing lists very closely. I just browse them now and
again.

-- 
                        | 
Martien Verbruggen      | You can't have everything, where would you
                        | put it?
                        | 


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

Date: 8 Jul 2003 14:18:58 -0700
From: stuart@mohawk.net (Fourth Monkey)
Subject: Re: AS repositories - so many, others missing, why?!
Message-Id: <616fce8f.0307081318.197e1785@posting.google.com>

randy@theoryx5.uwinnipeg.ca (Randy Kobes) wrote in message news:<slrnbg981v.3jt.randy@theoryx5.uwinnipeg.ca>...
> On 3 Jul 2003 13:53:53 -0700, Fourth Monkey <stuart@mohawk.net> wrote:
> >I've recently had to reinstall ActiveState Perl on a Win NT 4 PC and
> >am not able to duplicate the set of packages I had before (ver. 561),
> >using PPM, for either version 561 or 580! What I specifically noticed
> >
> >doesn't answer why I can no longer install all the packages I had
> >before (even though I'm not using the latest Perl) or why some
> >packages have degraded in version to ones that don't work as well.
> 
> In general, ActiveState's automated build system will add
> a CPAN ppm package to their repository if the package (and any 
> dependencies outside of the core ActiveState distribution)
> builds OK and all the tests pass. I'm not sure specifically
> about the problem with XBase - there is a ppm package for
> DBD-XBase (ActivePerl 8xx) that reports version 0.232, which 
> seems to correspond to the latest CPAN version.
> 
Interesting. In the past all I ever had to do to install the XBase
package was enter "ppm install XBase" and I got the latest ver.
However, I just tried your suggestion, "ppm install DBD-XBase" and it
installed ver. 5.004 which is the right one. What I don't understand
is, the package name is "XBase" so why do I need to enter "DBD-XBase"
to install it? There is no parent DBD package that I can see (yes, I
tried "ppm install DBD" - I'll try anything once ;o) and nothing in
the source file says "DBD::...". So how, unless someone helpful like
yourself tells me, would I know to prepend "DBD" onto the name to get
ppm to install the latest version of the XBase package? Does this sort
of thing (unspoken "parent" namespace names) hold true for other
packages as well?

> >If anyone can add to the above list I would appreciate that, perhaps
> >that's all I need to make my install work like it did before.
> 
> There's a module on CPAN - PPM::Repositories - which contains
> a list of known repositories outside of ActiveState.

Thanks, I set it up on one of our servers and printed out that list,
very good to know those resources.

-Monkey


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

Date: 9 Jul 2003 14:24:36 GMT
From: randy@theoryx5.uwinnipeg.ca (Randy Kobes)
Subject: Re: AS repositories - so many, others missing, why?!
Message-Id: <slrnbgo8e0.np.randy@theoryx5.uwinnipeg.ca>

On 8 Jul 2003 14:18:58 -0700, Fourth Monkey <stuart@mohawk.net> wrote:
>randy@theoryx5.uwinnipeg.ca (Randy Kobes) wrote in 
   message news:<slrnbg981v.3jt.randy@theoryx5.uwinnipeg.ca>...
[ .. ] 
>> In general, ActiveState's automated build system will add
>> a CPAN ppm package to their repository if the package (and any 
>> dependencies outside of the core ActiveState distribution)
>> builds OK and all the tests pass. I'm not sure specifically
>> about the problem with XBase - there is a ppm package for
>> DBD-XBase (ActivePerl 8xx) that reports version 0.232, which 
>> seems to correspond to the latest CPAN version.
>> 
>Interesting. In the past all I ever had to do to install the XBase
>package was enter "ppm install XBase" and I got the latest ver.
>However, I just tried your suggestion, "ppm install DBD-XBase" and it
>installed ver. 5.004 which is the right one. What I don't understand
>is, the package name is "XBase" so why do I need to enter "DBD-XBase"
>to install it? There is no parent DBD package that I can see (yes, I
>tried "ppm install DBD" - I'll try anything once ;o) and nothing in
>the source file says "DBD::...". So how, unless someone helpful like
>yourself tells me, would I know to prepend "DBD" onto the name to get
>ppm to install the latest version of the XBase package? Does this sort
>of thing (unspoken "parent" namespace names) hold true for other
>packages as well?

I don't think it's a problem with unspoken parent name
spaces. Although I'm not sure of the history, what seems to
have happened was that the original XBase.pm module,
under $CPAN/authors/id/P/PR/PRATP/XBase-x.xx, was
transferred to $CPAN/authors/id/J/JA/JANPAZ/DBD-XBase-x.xx.
This latter package has both the DBD::XBase and XBase
modules. When you use ppm to install something, you specify the
CPAN distribution name, not a module name (in most cases
the distribution name is derived from the name of the
major module in the package by a simple s/::/-/g). Since 
now DBD::XBase is the recommended interface, the package
was named DBD-XBase, but as a byproduct of installing this,
you also get a more up-to-date version of the older XBase
interface.

-- 
best regards,
randy kobes


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

Date: 8 Jul 2003 13:19:46 -0700
From: genericax@hotmail.com (Sara)
Subject: Re: ASP --> PERL SCRIPT HELP>>PLEASE>>
Message-Id: <776e0325.0307081219.46312fb5@posting.google.com>

"kalusalu" <jessanik@rogers.com> wrote in message news:<KrpMa.38291$2ay.28126@news01.bloor.is.net.cable.rogers.com>...
> Hello..I was browsing thru the newsgroups ...and was wondering if anyone
> here can be of assistance to me....as I am very very new to PERL..and have
> this ASP SCRIPT..I have to convert...
> 
> <%
> 'Response.Content.Type = "text/plain"
> vpath = Request("vpath")
> 
> IF vpath = "" then
> vpath = "/"
> END IF
> 
> realPath = server.mappath(vpath)
> 
> Set fs = CreateObject("Scripting.FileSystemObject")
> Set f = fs.GetFolder(realPath)
> 
> response.write f.Size & vbcrlf
> response.write.realPath & vbcrlf
> response.write vpath & vbcrlf
> %>
> 
> it outputs the following:
> 34342323423  D:\www-roots\www.example.com.80/wwwroot/
> 
> the diskusage    the real path     the virtual path
> 
> I have written this..
> 
> #  $d = det_dir_name();
> 
>  $size = 0;
>  DIR = opendir $d
> 
>   While (readdir DIR) {
>    next if /^\.\.?$/ ;
>    next if -d$_;
>    $size == -s $_;
>    }
> 
> print $size
> print $d
> 
> cannot find a function for this det dir name...any ideas..and how I convert
> this ASP SCRIPT ????

Gooday:

First off try to get your organization off of ASP's- become part of
the solution not part of the problem. Bill isn't rich enough yet?

Having said that, a few variations on your idioms you might consider
(code is typed into the response panel - NOT TESTED!) :


#!(pathToPerl)/perl -w 
# get used to using -w switch! And look at -T if you're writing CGI

use strict; # a great switch to use particularly for newbies

use diagnostics; # optional but gives you some nice wordy messages

# let's declare our vars
  my $size = 0;

# let's be helpful to ourselves and signal problems? No?
# assumes $pathToDir was declared somewhere!
  die "huh? what happened\n$!\n" unless opendir DIR, $pathtoDir;

# filtered arrays are much nicer to work with!
  @d = grep !/^\.\.?$/, readdir DIR; 

# close up this connection as soon as possible
  closedir DIR; 

# now I assume your trying to SUM the filesizes, ignoring directories?
# so I'd replace the == in your code with += if that's correct..

for (@d)
  {next if -d $_;
   $size += -s $_;
  }
  my $f = @d; # number of files
  my $a = $size / $f; #average filesize for fun
  print "total file size for $pathToDir is $size\n$f files, avergage
size $a\n";
  print "Yes I love Perl- its everything that MS isn not!\n\n";


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

Date: Tue, 08 Jul 2003 15:18:46 GMT
From: Dan Wilga <dwilga-MUNGE@mtholyoke.edu>
Subject: Re: Cannot build perl 5.8.0 with Berkley DB 4.1.15
Message-Id: <dwilga-MUNGE-4E1828.11184308072003@nap.mtholyoke.edu>

If it helps any, in the past I've had success working around problems 
compiling DB into Perl by setting it to use one of the older methods 
(like DBM), and then using CPAN to install DB_File separately, afterward.

-- 
Dan Wilga          dwilga-MUNGE@mtholyoke.edu
** Remove the -MUNGE in my address to reply **


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

Date: Wed, 09 Jul 2003 11:18:18 +0100
From: Peter Keller <pkeller@breathe.com>
Subject: Re: Cannot build perl 5.8.0 with Berkley DB 4.1.15
Message-Id: <begq5b$i79$1@niobium.hgmp.mrc.ac.uk>

Dan Wilga wrote:
> If it helps any, in the past I've had success working around problems 
> compiling DB into Perl by setting it to use one of the older methods 
> (like DBM), and then using CPAN to install DB_File separately, afterward.
> 
Dear Dan,

Many thanks for this helpful suggestion - it worked fine. The version
of DB_File in the perl5.8.0 distribution is 1.803, whereas the version
from CPAN is now 1.806, which may have made the difference.

The only tweak was that I had to add an -rpath argument to the LDDLFLAGS
in the generated Makefile. This is because I chose to put the DB 
installation into its own tree inside the perl install tree, to insulate
it from any changes in external DB libs that other people might do.

Thanks again,
Peter.



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

Date: 9 Jul 2003 09:26:48 -0700
From: hramos67@yahoo.com (Herbman)
Subject: CGI Perl Script caching variables
Message-Id: <f667042e.0307090826.508dc5c6@posting.google.com>

I have a script which includes a variable found in a .cfg file whose
content was:

#!/usr/bin/perl
$basedir="/html/users/maestro-documentarycom/html/cgi-bin/wwwboard"; 
# Directory to wwwboard scripts
$mesgpath="/html/users/maestro-documentarycom/html/wwwboard";  #
Directory to wwwboard scripts
1;

I sinced modified it due to some path errors to the following:

#!/usr/bin/perl
$basedir="/html/cgi-bin/wwwboard";  # Directory to wwwboard scripts
$mesgpath="/html/wwwboard";  # Directory to wwwboard scripts
1;


When I call the Perl script, it still gives me the following error
D:\html\users\maestro-documentarycom\html\cgi-bin\wwwboard\wwwboard.pl
line 381

I change the file the .cfg file, but I still get the same path error.


Is this page being cached and if so, how do I un-chache it?


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

Date: Wed, 09 Jul 2003 20:37:51 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: CGI Perl Script caching variables
Message-Id: <behnoq$5fhub$1@ID-184292.news.dfncis.de>

Herbman wrote:
> I have a script which includes a variable found in a .cfg file whose
> content was:
> 
> #!/usr/bin/perl
> $basedir="/html/users/maestro-documentarycom/html/cgi-bin/wwwboard"; 
> # Directory to wwwboard scripts
> $mesgpath="/html/users/maestro-documentarycom/html/wwwboard";  #
> Directory to wwwboard scripts
> 1;
> 
> I sinced modified it due to some path errors to the following:
> 
> #!/usr/bin/perl
> $basedir="/html/cgi-bin/wwwboard";  # Directory to wwwboard scripts
> $mesgpath="/html/wwwboard";  # Directory to wwwboard scripts
> 1;
> 
> When I call the Perl script, it still gives me the following error
> D:\html\users\maestro-documentarycom\html\cgi-bin\wwwboard\wwwboard.pl
> line 381
> 
> I change the file the .cfg file, but I still get the same path error.
> 
> Is this page being cached and if so, how do I un-chache it?

Assuming you include the .cfg file using 'require': Are you possibly 
running the script under mod_perl? In that case, the previous values 
may be saved in memory, otherwise it sounds weird to me.

Guess you need to let us know a little more.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



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

Date: 9 Jul 2003 14:41:56 -0700
From: hramos67@yahoo.com (Herbman)
Subject: Re: CGI Perl Script caching variables
Message-Id: <f667042e.0307091341.4fde81a3@posting.google.com>

Gunnar Hjalmarsson <noreply@gunnar.cc> wrote in message news:<behnoq$5fhub$1@ID-184292.news.dfncis.de>...
> Herbman wrote:
> > I have a script which includes a variable found in a .cfg file whose
> > content was:
> > 
> > #!/usr/bin/perl
> > $basedir="/html/users/maestro-documentarycom/html/cgi-bin/wwwboard"; 
> > # Directory to wwwboard scripts
> > $mesgpath="/html/users/maestro-documentarycom/html/wwwboard";  #
> > Directory to wwwboard scripts
> > 1;
> > 
> > I sinced modified it due to some path errors to the following:
> > 
> > #!/usr/bin/perl
> > $basedir="/html/cgi-bin/wwwboard";  # Directory to wwwboard scripts
> > $mesgpath="/html/wwwboard";  # Directory to wwwboard scripts
> > 1;
> > 
> > When I call the Perl script, it still gives me the following error
> > D:\html\users\maestro-documentarycom\html\cgi-bin\wwwboard\wwwboard.pl
> > line 381
> > 
> > I change the file the .cfg file, but I still get the same path error.
> > 
> > Is this page being cached and if so, how do I un-chache it?
> 
> Assuming you include the .cfg file using 'require': Are you possibly 
> running the script under mod_perl? In that case, the previous values 
> may be saved in memory, otherwise it sounds weird to me.
> 
> Guess you need to let us know a little more.

Actually, I'm troubleshooting for a relative and I'm not sure how they
are setup.  I will look into it further and submit and update.

Thank you


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

Date: Tue, 8 Jul 2003 15:24:32 +0000 (UTC)
From: J Krugman <jill_krugman@yahoo.com>
Subject: CGI: how to test existence of file to upload?
Message-Id: <beenng$fn7$1@reader1.panix.com>




I'm using CGI.pm to write a CGI form.  This form includes a filefield.
How can I test if the file entered by the user actually exists?

(I tried using "defined fileno $q->param('filename')", but it
returns true whether or not the file 'filename' exists.)

TIA,

	-Jill



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

Date: Tue, 08 Jul 2003 16:24:36 +0100
From: The Sender <wgu_@_wurquhart.co.uk>
Subject: Re: CGI: how to test existence of file to upload?
Message-Id: <HrBOa.17138$pd.10812@news-binary.blueyonder.co.uk>

At some time in the past J Krugman wrote :

> 
> 
> 
> I'm using CGI.pm to write a CGI form.  This form includes a filefield.
> How can I test if the file entered by the user actually exists?
> 
> (I tried using "defined fileno $q->param('filename')", but it
> returns true whether or not the file 'filename' exists.)
> 
> TIA,
> 
> -Jill

Hi Jill,

You can't since you don't have file access to the Client's Machine. You'll
just have to rely on them I'm afraid not to tell porkies.

-- 
Regards,

William


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

Date: Tue, 8 Jul 2003 18:53:02 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: CGI: how to test existence of file to upload?
Message-Id: <Pine.LNX.4.53.0307081840140.22550@lxplus103.cern.ch>

On Tue, Jul 8, J Krugman inscribed on the eternal scroll:

> I'm using CGI.pm to write a CGI form.  This form includes a filefield.
> How can I test if the file entered by the user actually exists?

What is it that you think you need to know? If they upload some data
by that means, you'll get it.  If they don't, you won't.

> (I tried using "defined fileno $q->param('filename')", but it
> returns true whether or not the file 'filename' exists.)

Are you confused about where this file actually sits?

They specify a file on their computer.  The form submission uploads it
to your server.  You're wasting your time looking for _their_ actual
file on _your_ computer.  You just get the data (and usually an
indication of what the local file had been called on their machine).

This has nothing specific to do with Perl: it would be the same
principle in any server-side CGI script, no matter what language.


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

Date: 9 Jul 2003 08:53:38 -0700
From: kspecial@linuxmail.org (kspecial@linuxmail.org)
Subject: Re: Compiling the h2xs way.
Message-Id: <365f784f.0307090753.21452bf7@posting.google.com>

"James E Keenan" <jkeen@concentric.net> wrote in message news:<becvro$c17@dispatch.concentric.net>...
> <kspecial@linuxmail.org> wrote in message
> news:365f784f.0307071456.6961d899@posting.google.com...
> > My name is Noah. What i'm trying to figure out is how I can
> > compile this module: Win32::Scheduler. Most modules can simply be
> > inserted, be compiled (if you will) with a Makefile, or if there is
> > not one made, h2xs.
> >
> >         Now. H2xs is probably what i'm going to need *not quite sure.
> > Check out how the file directory looks:
> >
> > ~\scheduler\blib\lib\Win32:
> [snip]
> 
> My hunch is that you are referring to this CPAN module.
> http://search.cpan.org/src/DAVEROTH/Win32-Scheduler_v20000702/lib/Win32/Sche
> duler/
> 
> The author does not appear to have provided a README, so we can only guess
> at how it should be installed.  Perhaps you should correspond directly with
> him:  rothd@roth.net


Thank you,
          Auther has been contacted, no response yet. I will keep looking.
Remember if anyone else has ever compiled this module before let me know.

--K-sPecial


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

Date: 9 Jul 2003 06:33:57 -0700
From: cjohnso9@amfam.com (Chad Johnson)
Subject: Creating macros in VISIO?
Message-Id: <a3c05aa8.0307090533.11a9fec2@posting.google.com>

I am trying to write a PERL script to set certain printing attributes
for VISIO documents. Someone gave me the advice that I should create a
macro in VISIO and then translate the source ove to PERL script. The
problem is that I don't know how to create macros in VISIO. I am
trying to set the printing attributes to "download as soft font" and
"set as truetype font".

Any help would be gretaly appreciated.

Thanks,
Chad


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

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


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