[10698] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4290 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 24 20:07:22 1998

Date: Tue, 24 Nov 98 17:00:32 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 24 Nov 1998     Volume: 8 Number: 4290

Today's topics:
    Re: a regexp question ptimmins@netserv.unmc.edu
    Re: Attempt to free unreferenced scalar  - ERROR - what <rootbeer@teleport.com>
    Re: bsp lib for perl <rootbeer@teleport.com>
        Carriage Return Problem <amaring@jps.net>
    Re: Carriage Return Problem <meowen@btinternet.com>
    Re: chop newline... (Larry Rosler)
    Re: crypt (Ben Coleman)
    Re: Dangerous Commands (Ilya Zakharevich)
    Re: Debugging <rootbeer@teleport.com>
    Re: File descriptor/flock problem <rootbeer@teleport.com>
    Re: Finding Win32 NTFS File Owner <rootbeer@teleport.com>
    Re: Getting what a refernce meta-refers to <rootbeer@teleport.com>
    Re: Grabbing an image from a cgi on another site <rootbeer@teleport.com>
    Re: How get IP address logged & sent with html form? <rootbeer@teleport.com>
        How to sort an array of strings case insensitive ? thst@my-dejanews.com
    Re: in need of some help (Tad McClellan)
        Is s/(?)ABC/xyz/; ok? (was Re: Bind won't take variable <rick.delaney@shaw.wave.ca>
    Re: Link Exchange script... <rootbeer@teleport.com>
    Re: Log Munging (Tad McClellan)
        meassuring time in milli seconds thst@my-dejanews.com
    Re: More Problems with "Rename()" (Matthew Bafford)
    Re: More Problems with "Rename()" (brian d foy)
    Re: My <!--#exec cgi="\scripts\script.pl"-->command wil <rootbeer@teleport.com>
    Re: Newbie 'sys/socket.ph' question (was Re: Raw Socket <rootbeer@teleport.com>
    Re: Parse File Upload.. (BenJamin Prater)
    Re: Perl performance on VMS <rootbeer@teleport.com>
    Re: Please help me locate Perl Style Guide <ebohlman@netcom.com>
    Re: Question on dbmopen( ) and dbmclose( ). <rootbeer@teleport.com>
    Re: question on inode number to file name (Alan Barclay)
        QUICK QUESTION! <eric@egdc.net>
    Re: QUICK QUESTION! <gbc1@axe.humboldt.edu>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Wed, 25 Nov 1998 00:44:51 GMT
From: ptimmins@netserv.unmc.edu
Subject: Re: a regexp question
Message-Id: <73fjtu$ive$1@nnrp1.dejanews.com>

In article <73ef7t$dso$1@pilot.njin.net>,
  dblack@pilot.njin.net (David Alan Black) wrote:

> aajii@raaseri.ton.tut.fi (Antti-Jussi Korjonen) writes:
[snip]
>
> >The question is, how do I tell perl to use only the FIRST match in
> >splitting and leave it that way?
>
> >I don't want any answers telling me to read the perldoc...
>
> OK - in that case, read _Anna Karenina_.  My favorite part is when Anna
> throws herself into Vronsky's arms, crying, "The LIMIT parameter can be
> used to split a line partially: ($login, $passwd, $remainder) =
> split(/:/, $_, 3); When assigning to a list, if LIMIT is omitted, Perl
> supplies a LIMIT one larger than the number of variables in the list, to
> avoid unnecessary work.  For the list above LIMIT would have been 4 by
> default.  In time critical applications it behooves you not to split
> into more fields than you really need."

Sex, sex, sex ... that's all you boys talk about these days ...

Patrick Timmins
$monger{Omaha}[0]

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 24 Nov 1998 23:28:21 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Attempt to free unreferenced scalar  - ERROR - what does it mean ?
Message-Id: <Pine.GSO.4.02A.9811241524520.4375-100000@user2.teleport.com>

On Fri, 20 Nov 1998, Neelam Saini wrote:

> Subject: Attempt to free unreferenced scalar  - ERROR - what does it mean ?

It means that there's a bug in perl or (more likely) in the compiled code
of some module you're using. Try to make a small self-contained program
which fails reliably (What an oxymoron!) when running on 5.004_04 or
later. Ideally, your example should be no more than half a dozen lines. If
you have to use any compiled module to replicate the bug, contact the
module's author. If not, use perlbug to file the bug report with the Perl
development team. Thanks!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 25 Nov 1998 00:30:25 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: bsp lib for perl
Message-Id: <Pine.GSO.4.02A.9811241629550.4375-100000@user2.teleport.com>

On Sat, 21 Nov 1998 yawny@email.com wrote:

> Anybody have any good Perl code to implement basic BSP algorithms
> (searching & sorting, file i/o)?

If there's a module which does what you want, it should be listed in
the module list on CPAN. If you don't find one to your liking, you're
welcome and encouraged to submit one! :-)  Hope this helps!

    http://www.perl.org/CPAN/
    http://www.perl.com/CPAN/

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 24 Nov 1998 15:31:31 -0800
From: "amaring" <amaring@jps.net>
Subject: Carriage Return Problem
Message-Id: <365b41d8.0@blushng.jps.net>

illegal character \015 (carriage return) at admin.cgi line 2
(Maybe you didn't strip carriage returns after a network transfer?)

Can someone please tell me what is causing this and how to fix it?   Line 2
has nothing in it... And IM not using a return anywhere!




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

Date: Tue, 24 Nov 1998 23:34:13 +0000
From: "Mark E. Owen" <meowen@btinternet.com>
Subject: Re: Carriage Return Problem
Message-Id: <365B4275.E9C538D4@btinternet.com>

I had this, I unzipped/gunzipped a perl module on Win32 platform
and tried to use it on Linux (I had a win32 partition mapped)
Whoops, had to use gunzip on Linux, cured the problem.

Mark E. Owen

amaring wrote:
> 
> illegal character \015 (carriage return) at admin.cgi line 2
> (Maybe you didn't strip carriage returns after a network transfer?)
> 
> Can someone please tell me what is causing this and how to fix it?   Line 2
> has nothing in it... And IM not using a return anywhere!


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

Date: Tue, 24 Nov 1998 15:30:12 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: chop newline...
Message-Id: <MPG.10c4e162956ca5c989894@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <365AFBEF.27B01D09@PSS.boeing.com> on Tue, 24 Nov 1998 
18:33:19 GMT, Dave Barden <david.r.barden@PSS.boeing.com> says...
> I'm using chop to join two lines if a line contains less than the 11
> fields I know it should contain.  I can't allow more than one space to
> separate each field.  Not knowing if my current line ends with a space
> or not and not knowing whether the next line which I've now joined by
> removing the newline, starts with a space or not leaves me puzzled about 
> ensuring there is one and only one space between the fields where I
> removed the newline character with chop.

How about forgetting the chop, joining the lines, and using:

    tr/ \n/ /s;

which means "replace every sequence of spaces or new-lines by a single 
space".

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Tue, 24 Nov 1998 23:08:27 GMT
From: tnguru@termnetinc.com (Ben Coleman)
Subject: Re: crypt
Message-Id: <365b3c38.333983432@news.mindspring.com>

On Tue, 24 Nov 1998 00:29:01 -0600, Todd Smith <tbsmith@viper.net> wrote:

>i've seen the encryption algorithim for crypt written in C, but since
>perl is my strong point, has anyone seen a version of the algorithim in
>Perl?

Here we go again.  You can find Crypt.pm at
http://www.pdv-systeme.de/users/martinv/Crypt.pm

Ben
-- 
Ben Coleman
Senior Systems Analyst
TermNet Merchant Services, Inc.
Atlanta, GA


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

Date: 25 Nov 1998 00:35:31 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Dangerous Commands
Message-Id: <73fjcj$9gc$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Martien Verbruggen
<mgjv@comdyn.com.au>],
who wrote in article <cQF62.50$Zw2.208@nsw.nnrp.telstra.net>:
> I'm confused... 
> 
> # perldoc -f sysopen
> 
> Or do you mean that you cannot use it in the same way as you use open?
> I can understand that one.

Doing perldoc -f sysopen clearly states that the arguments are not
portable.

> Wouldn't an inclusion of the relevant .ph files provide you with those?

But this would not be portable either.

Ilya


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

Date: Wed, 25 Nov 1998 00:49:19 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Debugging
Message-Id: <Pine.GSO.4.02A.9811241648190.4375-100000@user2.teleport.com>

On Mon, 23 Nov 1998 joe@webolution.com wrote:

> I'm looking for a way to execute cgi Perl scripts and have each
> executed line of code written to a text file. Any suggestions?

Hack in the debugger to make this happen. Or, better, try doing what you
really want, and use the debugger to step through your code from the
command line. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 24 Nov 1998 23:05:30 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: File descriptor/flock problem
Message-Id: <Pine.GSO.4.02A.9811241503150.4375-100000@user2.teleport.com>

On 20 Nov 1998 phukit@enteract.com wrote:

> sub closedb {
> 	flock(DB_FH, LOCK_UN);
> 	untie %db;
> 	undef $db_obj;
> }

I can't say for sure that this is the only problem, but it looks like _a_
problem. Unless you know all about the buffering issues involved, you
shouldn't explicitly release the lock on a file within Perl. Instead, in
this case, simply untie()ing the hash should cause the underlying file to
be closed, and the lock is released automatically at that time. You
probably shouldn't make $db_obj a global variable, anyway, so you could
eliminate that line as well. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/




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

Date: Tue, 24 Nov 1998 23:21:16 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Finding Win32 NTFS File Owner
Message-Id: <Pine.GSO.4.02A.9811241520150.4375-100000@user2.teleport.com>

On Fri, 20 Nov 1998, Randy O'Meara wrote:

> Is there a way to find the owner of a file on a Win32 NTFS file system?

If there is, the docs, FAQs, and newsgroups about that system should have
the answer. But if it's anything like it is in Unix, Perl's stat()
function should do the trick. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 25 Nov 1998 00:25:19 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Getting what a refernce meta-refers to
Message-Id: <Pine.GSO.4.02A.9811241618300.4375-100000@user2.teleport.com>

On 20 Nov 1998, Yary H. wrote:

> Can a sub examine a reference, and determine if it's a reference to
> something anonymous, or a reference to something the caller has a name
> for- and get the name?

This is like the question asking whether you can make a two-story
outhouse. The answer is the same: You don't want to do it, you shouldn't
do it, and it's too messy to be practical.

If the caller wants your sub to know their names for variables, they can
pass the variable names (as strings) separately. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 25 Nov 1998 00:54:06 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Grabbing an image from a cgi on another site
Message-Id: <Pine.GSO.4.02A.9811241653150.4375-100000@user2.teleport.com>

On Tue, 24 Nov 1998, J. Kirk wrote:

> I also tried one that used LWP but my Host does not have those modules
> installed

So, get them installed!

> ( I have also failed in attempting to install those modules in my home
> directory).

The FAQ talks about how to do this. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 25 Nov 1998 00:34:14 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: How get IP address logged & sent with html form?
Message-Id: <Pine.GSO.4.02A.9811241633290.4375-100000@user2.teleport.com>

On Sun, 22 Nov 1998, Andr=E9 Bell-remove the x to reply wrote:

> Subject: How get IP address logged & sent with html form?

Sounds like you want to get a browser or server to do something. Check the
docs, FAQs, and newsgroups about browsers or servers. Good luck!

--=20
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 25 Nov 1998 00:43:59 GMT
From: thst@my-dejanews.com
Subject: How to sort an array of strings case insensitive ?
Message-Id: <73fjsa$iv2$1@nnrp1.dejanews.com>

As the subject says: How to do that in perl ?
If I sort the normal way then capital letters are coming before lower letters.

Bye Thomas

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 24 Nov 1998 17:37:49 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: in need of some help
Message-Id: <d0gf37.6il.ln@flash.net>


[ 
   Please don't send stealth Cc's anymore. 

   I don't like them.
]


Tk Soh (r28629@email.sps.mot.com) wrote:
: Tad McClellan wrote:
: > 
: > Jimmy Yeung (jiyeung@pacbell.net) wrote:


: > : how would i go about printing only the files that do not begin with a
: > : dot?  


: > opendir(ENGOPS, '/directory/directory/directory/directoryineedtopost') ||
: >    die "could not open directory $!";    # no need to chdir() first...
: > foreach (grep /^[^.]/, readdir(ENGOPS)) {

: this is going to ignore also all the filenames begin with a dot. 


   Which is what was asked for!


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Tue, 24 Nov 1998 23:43:45 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Is s/(?)ABC/xyz/; ok? (was Re: Bind won't take variables)
Message-Id: <365B4645.A48A5588@shaw.wave.ca>

Larry Rosler wrote:
> 
> Your attempt to use $case after 's' is totally wrong.  It can go 
> either at the end, where you are trying to put 'g' optionally, or 
> within the $find string as '(?i)' (without the quotes, of course).

Strangely enough, you can use '(?g)' as well, though this is
undocumented.  Consider this:

    my $find    = 'ABC';
    my $replace = 'xyz';

    for my $case ('i', "") {
        for my $global ('g', "") {
            $_ = 'abcabcABCabcABC';
            s/(?$case$global)$find/$replace/;
            print "$_\n";
        }
    }

which gives:
xyzxyzxyzxyzxyz
xyzabcABCabcABC
abcabcxyzabcxyz
abcabcxyzabcABC

I find this behaviour useful, though puzzling.  The last case comes out
to be 

    s/(?)ABC/xyz/;

which doesn't seem quite right.  Is (?) simply ignored?  Shouldn't perl
complain about a regex like this?

I believe the last time this came up Ilya said it was a bug but I can't
remember if he meant the behaviour or the documentation.  Personally I
like this behaviour, but I would like it better if it was documented.

Should I expect the above code snippet to work or not?

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: Wed, 25 Nov 1998 00:32:46 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Link Exchange script...
Message-Id: <Pine.GSO.4.02A.9811241632250.4375-100000@user2.teleport.com>

On Sun, 22 Nov 1998, Jado wrote:

>     Anyone know of a good ratio-based link exchange script? 

If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 24 Nov 1998 17:31:47 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Log Munging
Message-Id: <3lff37.6il.ln@flash.net>

Ci-Ci Mills (cici@erols.com) wrote:
: I built a
: hash that contains the date, keyword and the count for that keyword.  To get
: the top 20 keywords, I need to sort by the count....this is where I am
: running into problems.


   This is where you should be running to the Perl FAQ, part 4:

      "How do I sort a hash (optionally by value instead of key)?"


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 25 Nov 1998 00:37:01 GMT
From: thst@my-dejanews.com
Subject: meassuring time in milli seconds
Message-Id: <73fjfb$iho$1@nnrp1.dejanews.com>

Is there a way to find out the number of milli seconds between two independent
event (two keypresses, two subroutine calls,...)

Bye

Thomas

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 24 Nov 1998 16:15:40 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: More Problems with "Rename()"
Message-Id: <MPG.10c4ec0b40aadb55989736@news.scescape.net>

In article <365B0C90.35873DCB@mediaone.net>, wcase@mediaone.net says...
=> Thank you Uri for your suggestions, especially the formatting ones. I
=> have cleaned up the code a bit (snippet attached below).

It looks much nicer. :)

=> I am still, however having problems with the "rename()" function (I
=> added a 'die' clause to the rename() as suggested by another helpful
=> person).

:)

=> When I send "rename ( $cgi_sfn{'upfile'}, $tempvar1)" it does not rename
=> the file, nor does it return an error, nor does it continue running
=> anything below that statement.

'Curiouser and Curiouser'

=> The 'print' shows that $tempvar1 = "logo_TEST_TEST_TEST.gif"
=>
=> HOWEVER... If I add the one line that sets "$tempvar1 =
=> "logo_TEST_TEST_TEST.gif";" and then the rename() it works fine!!
=> 
=> I can't think of any reason this would be. Any help would be wonderful,
=> as this is driving me quite insane!

Ok, I _ass_u_me_ that you know it is stopping at the rename through the 
use of some prints or something after the unlink.

Are you, by any chance, running the program through a CGI session?  That 
would explain a whole lot.  The servers I've had experience with ignore 
[1] STDERR once the headers have been sent.

Since die prints it's message on STDERR, that might by your problem.

How about:

rename ( $cgi_sfn{'upfile'}, $tempvar1) or do {
      print
         "Unable to rename [$cgi_sfn{'upfile'}] to [$tempvar1].\n",
         "Reason: $!\n";
      exit;
}

if my above assumption is valid.  This might help narrow it down a little 
bit...

=> -----------CODE------------
=>   my ($tempvar1, $read_len, $extension, $result);
=> 
=>   $extension = substr( $cgi_cfn{'upfile'}, -4, 3);
=>   $tempvar1 = $cgi_data{'name'} . ( $extension eq 'jpg' ? '.jpg' :
=> '.gif' );
=> 
=>   print "$cgi_sfn{'upfile'}\n";
=>   print "$tempvar1\n";
=> 
=>   $tempvar1 = "logo_TEST_TEST_TEST.gif";
=> 
=>   rename ( $cgi_sfn{'upfile'}, $tempvar1) or die
=>         "Unable to rename [$cgi_sfn{'upfile'}] to [$tempvar1].\n",
=>         "Reason: $!\n";
=> --------END CODE----------

=> Thanks again,

Hope This Help(s|ed)!

=> William Case

--Matthew


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

Date: Tue, 24 Nov 1998 15:39:30 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: More Problems with "Rename()"
Message-Id: <comdog-ya02408000R2411981539300001@news.panix.com>

In article <365B0C90.35873DCB@mediaone.net>, William Case <wcase@mediaone.net> posted:

> The 'print' shows that $tempvar1 = "logo_TEST_TEST_TEST.gif"
> 
> HOWEVER... If I add the one line that sets "$tempvar1 =
> "logo_TEST_TEST_TEST.gif";" and then the rename() it works fine!!

are you sure that $tempvar1 had anything in it in the other case?

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Wed, 25 Nov 1998 00:47:44 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: My <!--#exec cgi="\scripts\script.pl"-->command will not work
Message-Id: <Pine.GSO.4.02A.9811241646540.4375-100000@user2.teleport.com>

On Mon, 23 Nov 1998, Rick Luhman wrote:

> I have been trying to get #exec cgi to work with Microsoft-IIS/4.0

Perhaps the docs, FAQs, and newsgroups about your software or system would
be helpful. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/




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

Date: Tue, 24 Nov 1998 23:17:17 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Newbie 'sys/socket.ph' question (was Re: Raw Sockets)
Message-Id: <Pine.GSO.4.02A.9811241515300.4375-100000@user2.teleport.com>

On 20 Nov 1998, P8r Versteegen wrote:

>     I'm trying to learn perl and its socket API's, but my
> "require 'sys/socket.ph';" call give this error:
> 
> Illegal expression (COND_EXPR) as lvalue in file /usr/lib/perl/sys/socket.ph at line 98, next 2 tokens ") )"

Probably h2ph doesn't work right on your system. Maybe you should fix
sys/socket.ph, or perhaps you really want to install SysV::IPC from CPAN.
Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 24 Nov 1998 18:32:02 -0600
From: ben@sofnet.com (BenJamin Prater)
Subject: Re: Parse File Upload..
Message-Id: <365b4ec1.1293354@news.sofnet.com>

Mick,

Simply look for the name of the file in the appropriate form field
once it's uploaded and prior to saving it.

Ben

On Wed, 25 Nov 1998 08:39:41 +1100, Mick <bellears@deakin.edu.au>
wrote:

>When uploading files via a web page, how can I ensure that only a
>specifically named file is allowed to be uploaded. I know this is a
>fairly broad question, but I'm fairly new to Perl and do not know where
>to start.
>So eg. file to be uploaded must be called file.txt and if the user tries
>to upload anything else they get an appropriate message?
>
>Thanks for any replies,
>Mick
>



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

Date: Wed, 25 Nov 1998 00:52:28 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Perl performance on VMS
Message-Id: <Pine.GSO.4.02A.9811241650410.4375-100000@user2.teleport.com>

On 24 Nov 1998, Ed Young wrote:

> From the table, it is clear that under VMS every action takes a lot
> more resources that on the other platforms. The VMS Perl
> implementation was compiled with DEC/C.

You may be able to get better results with different optimization settings
for your compiler, or with a different compiler. Maybe you can use some
tool on your system to find out where the performance bottleneck is. Or
maybe you can start porting Linux to your hardware. :-)  Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 24 Nov 1998 23:03:20 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Please help me locate Perl Style Guide
Message-Id: <ebohlmanF2y81L.A4r@netcom.com>

Martien Verbruggen <mgjv@comdyn.com.au> wrote:
: For win32 systems: I just heard that ActiveState doesn't ship the
: documentation with their distribution. Complain to them.

They do ship the documentation, but not in .pod form.  It's all in plain 
HTML files, with duplicates in MS HTML-Help (.chm) form.  Still annoying, 
but not disastrous.



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

Date: Wed, 25 Nov 1998 00:38:16 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Question on dbmopen( ) and dbmclose( ).
Message-Id: <Pine.GSO.4.02A.9811241635320.4375-100000@user2.teleport.com>

On Mon, 23 Nov 1998, Jun Sam Choi wrote:

> I have a problem in Perl CGI programming using dbmOpen() & dbmClose();

If the problem happens only in the CGI environment, the docs, FAQs, and
newsgroups about CGI programming should be able to help you.

> But, After some records is inserted dbm file denied to allow records
> any more.

Who denied what? The first step is to find out who or what is doing the
denying, then you can find out why, and what to do about it. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 24 Nov 1998 23:34:10 GMT
From: gorilla@elaine.drink.com (Alan Barclay)
Subject: Re: question on inode number to file name
Message-Id: <911950448.972918@elaine.drink.com>

In article <5uve37.0hk.ln@flash.net>, Tad McClellan <tadmc@flash.net> wrote:
>Kin Yee Lee (leeky@ucalgary.ca) wrote:
>
>:  Given an inode number, is it possible to find the file name from it?   
>                                                 ^^^
>                                                 ^^^  ??
>
>   An inode may have more than one filename.

Also, an inode may have less than one filename.

open(FILE,">file") or die "etc $!";
unlink(file);
sleep(5000);

there is now a file with an inode, but without a filename.



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

Date: Tue, 24 Nov 1998 19:14:20 +0000
From: Eric Gessner <eric@egdc.net>
Subject: QUICK QUESTION!
Message-Id: <365B04E2.6F89D2A4@egdc.net>

This is a multi-part message in MIME format.
--------------5A683367604932F7EBBBB915
Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="4D4F5353"
Content-Transfer-Encoding: 7bit

i am importing a key/value array from an HTML form.  the values are
numbers, and my question is, how do i add them together to come up with
a total?  they are all in the same string, right?  so how do i do this?


this prints out all the values, of course:

foreach $number(keys(%input)) {
print "$input{$numbers}";

}

what is the code to make the all the values add each other and give me a
total?

thanks!
eric

--------------5A683367604932F7EBBBB915
Content-Type: text/x-vcard; charset=us-ascii;
 name="eric.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Eric Gessner
Content-Disposition: attachment;
 filename="eric.vcf"

begin:vcard 
n:Gessner;Eric
tel;fax:717-522-9202
tel;home:717-523-1705
tel;work:717-522-9200
x-mozilla-html:FALSE
url:http://www.egdc.net/eric/
org:Eric Gessner's Digital Center;http://www.egdc.net/
adr:;;P.O. Box 5;Lewisburg;PA;17837;USA
version:2.1
email;internet:eric@egdc.net
title:Owner
note:ICQ#: 6331962
x-mozilla-cpt:;3
fn:Eric Gessner
end:vcard

--------------5A683367604932F7EBBBB915--



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

Date: Tue, 24 Nov 1998 16:37:14 -0800
From: Greg Coit <gbc1@axe.humboldt.edu>
Subject: Re: QUICK QUESTION!
Message-Id: <365B513A.FEDB9B73@axe.humboldt.edu>

Eric Gessner wrote:

> i am importing a key/value array from an HTML form.  the values are
> numbers, and my question is, how do i add them together to come up with
> a total?  they are all in the same string, right?  so how do i do this?
>
> this prints out all the values, of course:
>
> foreach $number(keys(%input)) {
> print "$input{$numbers}";
>
> }
>
> what is the code to make the all the values add each other and give me a
> total?
>
> thanks!
> eric

Using the code you supplied, I think this will work:

foreach $number(keys(%input)) {
$total += $input{$numbers};
}


Hope this helps,

Greg Coit
gbc1@axe.humboldt.edu



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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 4290
**************************************

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