[19731] in Perl-Users-Digest
Perl-Users Digest, Issue: 1926 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 14 14:05:32 2001
Date: Sun, 14 Oct 2001 11:05:09 -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: <1003082709-v10-i1926@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 14 Oct 2001 Volume: 10 Number: 1926
Today's topics:
Re: $query->param not working. <bart.lateur@skynet.be>
Re: Access a hash key by hash value ? <bootsy52@gmx.net>
Re: Access a hash key by hash value ? (Garry Williams)
Re: Access a hash key by hash value ? <bootsy52@gmx.net>
Re: Access a hash key by hash value ? (Garry Williams)
Re: Access a hash key by hash value ? <bootsy52@gmx.net>
Re: Access a hash key by hash value ? (Garry Williams)
Creating a cgi generated form (Drew)
Re: Creating a cgi generated form <jurgenex@hotmail.com>
Re: Creating a cgi generated form <bart.lateur@skynet.be>
Re: Creating a cgi generated form (Garry Williams)
Re: Creating a cgi generated form <echang@netstorm.net>
Help requested - trying to understand the commify regex (Bob Dubery)
Re: Help requested - trying to understand the commify r (Garry Williams)
Re: How do you get paid for Perl work over the Internet <tsee@gmx.net>
Re: How do you get paid for Perl work over the Internet <matthew.garrish@sympatico.ca>
Re: How to stop File Upload (CGI) <bart.lateur@skynet.be>
Re: newbie for perl <tintin@snowy.calculus>
Re: newbie for perl <bart.lateur@skynet.be>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 14 Oct 2001 14:47:43 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: $query->param not working.
Message-Id: <sa9jst8umu4hkg5q95tp367vp88egp399b@4ax.com>
Scott Bell wrote:
>> > Can anyone tell me why this isn't working,
>>
>> No, no one can.
>very helpful
As Mr Spock (or is it Data) would say: "insufficient data".
--
Bart.
------------------------------
Date: Sun, 14 Oct 2001 14:27:47 +0200
From: "Carsten Menke" <bootsy52@gmx.net>
Subject: Re: Access a hash key by hash value ?
Message-Id: <pan.2001.10.14.14.27.46.366.2432@gmx.net>
On Fri, 12 Oct 2001 01:28:58 +0200, Garry Williams wrote:
Hi Gary,
I read your mail, yes was helping a lot, also a look into the Camel Book
and the Cook Book helped out.
But again I'm at a state of point where I do not know why this is not
working. OK, I'll tell you what I actually want, this makes it maybe
easier. I have a generated Logfile from proxy server program, so I
have made different filter options to filter out what I want, so far so
good. Now, my colleague wants the final Summary sorted by IP's. Sorting
simply with the cmp operator gives a sorting like this of course
(.1,.10,.2). I could not sort it with <=> because of the dots within the
IP Adress so I wrote a subroutine. This output is sorted correctly as
long as you have the same adress range (lets say all is 192.168.0.1 -
192.168.0.254)
But as soon as this changes the sort is not working correctly anymore,
and this is what I don't understand
############################### IP SORT #################################
open (FILE, ">>$path"."$summary") or die "Could not open";
foreach (sort {IP_Sort($result{$a},$result{$b})}
keys %result)
{
print FILE $result{$_},$_,"\n";
}
close(FILE);
##### Subroutine
sub IP_Sort
{
my ($c,$d,$e,$f,$g,$i,$h,$j,$compare,$compare2);
$compare=$_[0];
$compare2=$_[1];
$compare=~m/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\s*$/;
$c=$1;
$d=$2;
$e=$3;
$f=$4;
$compare2=~m/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\s*$/;
$g=$1;
$i=$2;
$h=$3;
$j=$4;
print $c.$d.$e.$f,"\n";
if ($c > $g)
{
return 1;
}
elsif ($d > $i)
{
return 1;
}
elsif ($e > $h)
{
return 1;
}
elsif ($f > $j)
{
return 1;
}
elsif ($g > $c)
{
return -1;
}
elsif ($i > $d)
{
return -1;
}
elsif ($h > $e)
{
return -1;
}
elsif ($j > $f)
{
return -1;
}
else
{
return 0;
}
}
########################## END CODE #################################
All this generates a sorting like this on different Adress Ranges
############### OUTPUT ##############################################
192.168.200.1
192.168.100.10
192.168.0.52
192.168.0.52
192.168.0.52
192.168.0.52
192.168.0.52
192.168.0.52
192.168.0.52
192.168.0.52
192.168.0.52
192.168.0.52
192.168.0.52
192.168.100.2
192.168.1.52
192.168.1.100
192.168.100.1
Still any suggestion ? I would be very glad :-))
Thanx at all
Carsten
------------------------------
Date: Sun, 14 Oct 2001 14:05:40 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Access a hash key by hash value ?
Message-Id: <slrn9sj6tj.hvm.garry@zfw.zvolve.net>
On Sun, 14 Oct 2001 14:27:47 +0200, Carsten Menke <bootsy52@gmx.net>
wrote:
> But again I'm at a state of point where I do not know why this is not
> working. OK, I'll tell you what I actually want, this makes it maybe
> easier. I have a generated Logfile from proxy server program, so I
> have made different filter options to filter out what I want, so far so
> good. Now, my colleague wants the final Summary sorted by IP's.
Ahh, sorting a hash by its values, where the values are IP addresses...
use Socket;
for ( map { $_->[1] }
sort { $a->[0] cmp $b->[0] }
map { [ inet_aton($result{$_}), $_ ] }
keys %result )
{
print "$_ => $result{$_}\n";
}
--
Garry Williams
------------------------------
Date: Sun, 14 Oct 2001 16:29:41 +0200
From: "Carsten Menke" <bootsy52@gmx.net>
Subject: Re: Access a hash key by hash value ?
Message-Id: <pan.2001.10.14.16.29.41.275.2432@gmx.net>
On Sun, 14 Oct 2001 16:05:40 +0200, Garry Williams wrote:
>
> Ahh, sorting a hash by its values, where the values are IP addresses...
>
> use Socket;
> for ( map { $_->[1] }
> sort { $a->[0] cmp $b->[0] }
> map { [ inet_aton($result{$_}), $_ ] } keys %result )
> {
> print "$_ => $result{$_}\n";
> }
>
Not exactly, I have a logfile where several informations are stored. So
I/he can carry the logfiles at home, and then filter out what he/I wants.
Or do you meant by use Socket; only that I should use the routine
inet_aton, that will make my life easier? I will look in my Cook Book, to
see what is possible by inet_aton.
Anyway, shouldn't my code work as well? I really don't understand why
it's get sorted that way when I use my code snippet.
Thanx
Carsten
------------------------------
Date: Sun, 14 Oct 2001 15:25:21 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Access a hash key by hash value ?
Message-Id: <slrn9sjbj0.i0d.garry@zfw.zvolve.net>
On Sun, 14 Oct 2001 16:29:41 +0200, Carsten Menke <bootsy52@gmx.net> wrote:
> On Sun, 14 Oct 2001 16:05:40 +0200, Garry Williams wrote:
>>
>> Ahh, sorting a hash by its values, where the values are IP addresses...
>>
>> use Socket;
>> for ( map { $_->[1] }
>> sort { $a->[0] cmp $b->[0] }
>> map { [ inet_aton($result{$_}), $_ ] } keys %result )
>> {
>> print "$_ => $result{$_}\n";
>> }
>>
> Not exactly, I have a logfile where several informations are stored. So
> I/he can carry the logfiles at home, and then filter out what he/I wants.
I can't read minds. I just used what you posted as a basis for my
solution. The code above assumes that you already have a hash
(%result) whose values are IP addresses as character strings in
dotted-quad format. Your code seemed to want that sorted by the
values and then displayed in key-value format. The code above does
that.
> Or do you meant by use Socket; only that I should use the routine
> inet_aton, that will make my life easier? I will look in my Cook Book, to
> see what is possible by inet_aton.
Yes, the inet_aton() function is described in the Socket manual page.
It converts a character string dotted-quad representation of an IP
address to the internal representation of an IP address (in_addr_t)
which, for ipv4, is an unsigned 32-bit integer. Perl "sees" that as a
string. This can be compared as a string to order IP addresses.
> Anyway, shouldn't my code work as well? I really don't understand why
> it's get sorted that way when I use my code snippet.
I don't know. Your code is obscure. Regular expression matches are
performed without a check that they actually matched before using the
$1, $2, etc. variables. Your post purports to include the output of
that code, but it does not match the code's print statements. Who
knows? It's clearly *not* what you say it is.
But why bother when a simple compare of a converted string will solve
the problem?
--
Garry Williams
------------------------------
Date: Sun, 14 Oct 2001 17:46:24 +0200
From: "Carsten Menke" <bootsy52@gmx.net>
Subject: Re: Access a hash key by hash value ?
Message-Id: <pan.2001.10.14.17.46.24.145.2432@gmx.net>
On Sun, 14 Oct 2001 17:25:21 +0200, Garry Williams wrote:
>> Not exactly, I have a logfile where several informations are stored. So
>> I/he can carry the logfiles at home, and then filter out what he/I
>> wants.
>
> I can't read minds.
Hmmmh, yes was late and I was overtired, so guess one could have
expressed it more clearly.
>> Anyway, shouldn't my code work as well? I really don't understand why
>> it's get sorted that way when I use my code snippet.
>
> I don't know. Your code is obscure. Regular expression matches are
> performed without a check that they actually matched before using the
> $1, $2, etc. variables. Your post purports to include the output of
> that code, but it does not match the code's print statements. Who
> knows? It's clearly *not* what you say it is.
I guess you meant this:
.....
> $compare2=~m/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\s*$/;
> $g=$1;
> $i=$2;
> $h=$3;
> $j=$4;
> print $c.$d.$e.$f,"\n";
.....
Yes I forgot to remove the print statement here, this was just a test for
me to see if $1,$2,$3,$4 are matched correctly and the output of course
is different.
The output I posted was the part of the output which gets written to file
within the foreach loop. (The final output).
I have not made any test here if $1,$2,$3 gets matched because I have
another subroutine which is part of the filter which makes tests on this.
I just didn't want to post the whole code, so that you have to read pages
to see the relevant snippet. But when you are interested I could. :-)
But I tested $1, and they get machted correctly.
> But why bother when a simple compare of a converted string will solve
> the problem?
>
Hmmmmh?? Actually you're right. It's only that I want mostly learn and
implement my own ways, and I assure you if I don't find the error in my
code I will use your snippet. Normally that is when I'm on the edge of
throwing my computer out of the window. :-)
Many many thanx
Carsten
Hope that I could help here sometimes, too.
------------------------------
Date: Sun, 14 Oct 2001 16:55:40 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Access a hash key by hash value ?
Message-Id: <slrn9sjgsc.i21.garry@zfw.zvolve.net>
On Sun, 14 Oct 2001 17:46:24 +0200, Carsten Menke <bootsy52@gmx.net> wrote:
> On Sun, 14 Oct 2001 17:25:21 +0200, Garry Williams wrote:
>
> The output I posted was the part of the output which gets written to file
> within the foreach loop. (The final output).
No, it's not. That print statement printed a list including
$result{$_} *and* $_. The output seems to be only one value -- the IP
addresses.
As soon as I saw that the code didn't match the purported output, I
quit reading. It happens all the time that people here debug typos
instead of the real problem. I didn't want to waste my time on that.
>> But why bother when a simple compare of a converted string will solve
>> the problem?
>>
> Hmmmmh?? Actually you're right. It's only that I want mostly learn and
> implement my own ways, and I assure you if I don't find the error in my
> code I will use your snippet. Normally that is when I'm on the edge of
> throwing my computer out of the window. :-)
Okay, in the interest of saving an innocent passerby from serious
injury, you should look at what your comparison code does when
comparing 192.168.0.52 and 192.168.100.2 . Your code calls the former
greater than the latter because 52 is greater than 2.
If you insist on comparing the four parts of an IP address one part at
a time, you must check each part *completely* before going on to check
the next part. 0 isn't greater than 100, but it *is* less than 100.
--
Garry Williams
------------------------------
Date: 14 Oct 2001 03:30:26 -0700
From: web_forums@yahoo.com (Drew)
Subject: Creating a cgi generated form
Message-Id: <59c77510.0110140230.6d0edb12@posting.google.com>
Hello everyone,
I need to create a CGI generated form that sends out email. The users
input is saved to a text file and also sent out as email. I have been
able to successfully create a CGI program that processes the user's
information using an HTML form. However, I am actually supposed to use
a CGI generated form rather than HTML. I hope I'm making sense..
What I need to do is have a general HTML page with link to the form.
i.e when a user clicks the link - the form is triggered and the user's
information is appropriately handled.
Due to certain restrictions, I am not permitted to use any modules.
I'm only allowed to have a single stand-alone CGI file(plus the
general html page ofcourse).
Does anyone have any hints on how I am supposed to achieve this? I'm a
bit confused about where to place the FORM and ACTION tags. Any
help/examples would be greatly appreciated. Thanks for your time.
Drew
------------------------------
Date: Sun, 14 Oct 2001 06:56:53 -0700
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Creating a cgi generated form
Message-Id: <3bc999a5$1@news.microsoft.com>
"Drew" <web_forums@yahoo.com> wrote in message
news:59c77510.0110140230.6d0edb12@posting.google.com...
> Hello everyone,
> I need to create a CGI generated form that sends out email. The users
> input is saved to a text file and also sent out as email. I have been
> able to successfully create a CGI program that processes the user's
> information using an HTML form.
So far, so good. That makes a lot of sense.
> However, I am actually supposed to use
> a CGI generated form rather than HTML. I hope I'm making sense..
This on the other hand doesn't make any sense at all.
The Common Gateway Interface doesn't know anything about forms or what a
form is or how to display a 'form'. Typically a CGI program or CGI script
would generate an HTML form which in turn would be displayed by the client
browser. As stated your problem is impossible to solve.
> What I need to do is have a general HTML page with link to the form.
> i.e when a user clicks the link - the form is triggered and the user's
> information is appropriately handled.
> Due to certain restrictions, I am not permitted to use any modules.
> I'm only allowed to have a single stand-alone CGI file(plus the
> general html page ofcourse).
> Does anyone have any hints on how I am supposed to achieve this? I'm a
> bit confused about where to place the FORM and ACTION tags. Any
As neither Perl nor CGI know anything about FORM or ACTION or tags the only
place left is an HTML page (which is probably generated by the CGI script).
I wonder if your problem could be rephrased as:
when the user comes to the site at first he should see a welcome page. Only
when he clicks on a link
- the second HTML page containing the form should be displayed (this is
easy to achive with an <A> tag in the first page) or
- the form (which was hidden so far) will be displayed on the same page
(this is easy to achive using DHTML/JS)
None of this has anything to do with Perl, however.
jue
------------------------------
Date: Sun, 14 Oct 2001 15:17:59 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Creating a cgi generated form
Message-Id: <8vajst0lo0kg967eiq94mshnkhujl5sd1g@4ax.com>
Drew wrote:
>However, I am actually supposed to use
>a CGI generated form rather than HTML. I hope I'm making sense..
Not really. But
print <<'-END-OF-HTML-';
<HTML><HEAD>
...
</BODY></HTML>
-END-OF-HTML-
(be sure to align this script to the far left), will allow you to simply
produce the HTML in a script. This is known as a "here doc". By
embedding $var variables into your text, you can produce slightly
different texts every time. And don't forget the "content-type" header.
HTH,
Bart.
------------------------------
Date: Sun, 14 Oct 2001 15:29:52 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Creating a cgi generated form
Message-Id: <slrn9sjbrg.i0d.garry@zfw.zvolve.net>
On Sun, 14 Oct 2001 15:17:59 GMT, Bart Lateur <bart.lateur@skynet.be> wrote:
> Drew wrote:
>
>>However, I am actually supposed to use
>>a CGI generated form rather than HTML. I hope I'm making sense..
>
> Not really. But
>
> print <<'-END-OF-HTML-';
> <HTML><HEAD>
> ...
> </BODY></HTML>
> -END-OF-HTML-
>
> (be sure to align this script to the far left), will allow you to simply
> produce the HTML in a script. This is known as a "here doc". By
> embedding $var variables into your text, you can produce slightly
> different texts every time.
Not if you use single quotes around '-END-OF-HTML-'.
--
Garry Williams
------------------------------
Date: Sun, 14 Oct 2001 16:45:36 GMT
From: "E.Chang" <echang@netstorm.net>
Subject: Re: Creating a cgi generated form
Message-Id: <Xns913A82BAEF864echangnetstormnet@207.106.93.86>
web_forums@yahoo.com (Drew) wrote in
news:59c77510.0110140230.6d0edb12@posting.google.com:
> Hello everyone,
> I need to create a CGI generated form that sends out email. The
> users input is saved to a text file and also sent out as email. I
> have been able to successfully create a CGI program that processes
> the user's information using an HTML form. However, I am actually
> supposed to use a CGI generated form rather than HTML. I hope I'm
> making sense.. What I need to do is have a general HTML page with
> link to the form. i.e when a user clicks the link - the form is
> triggered and the user's information is appropriately handled.
> Due to certain restrictions, I am not permitted to use any modules.
> I'm only allowed to have a single stand-alone CGI file(plus the
> general html page ofcourse).
> Does anyone have any hints on how I am supposed to achieve this?
> I'm a bit confused about where to place the FORM and ACTION tags.
> Any help/examples would be greatly appreciated. Thanks for your
> time.
Sounds like homework to me, with all those restrictions on what you are
permitted to use. Are you allowed to ask for help?
Anyway, even if that's the case, I think the following should be review
of what you should have learned - If you want to use a script generated
HTML form rather than a static one, the original page just needs a link
whose href is the script rather than another static HTML page. The
script needs to detect if it is being called from that page or if it is
being called from the form. If called from the form, process it (which
you say you already know how to do). If called from the starting page,
print out the form page. How to tell the diffference? Well, in one
case you receive form data and in the other... . (And have you learned
about request methods?)
If you know enough to process the form, you should be able to handle
this.
--
EBC
------------------------------
Date: 14 Oct 2001 10:03:35 -0700
From: megapode@hotmail.com (Bob Dubery)
Subject: Help requested - trying to understand the commify regex
Message-Id: <e8f67309.0110140903.d9ced36@posting.google.com>
I'm trying to come to grips with regexes - very powerful but a little
cryptic as well (to me at any rate).
In the Perl Cookbook I came across the commify regex. It works, but
I'm hoping somebody can tell me HOW.
$revno = reverse $number;
$revno =~ s/(\d{3})(?=\d)(?!\d*\.)/$1,/g;
$number = reverse $revno;
Ok... I understand the reverse fine :-) The regex baffles me though...
1) I understand the first part of the regex... that's matching 3
digits. The others aren't so clear to me.
2) The $1 - if I understand correctly - says change every occurence of
the first "sub-expression" with in the regex (IE \d{3}) to itself AND
a comma. Clearly the other two components prevent commifying of the
digits to the left of the point in the reversed number, and adding a
comment to the right of the reversed number if the portion to the
right is 6 digits long. But how? Can $2 and $3 have some effect on $1?
Thanks
Bob
------------------------------
Date: Sun, 14 Oct 2001 17:24:58 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Help requested - trying to understand the commify regex
Message-Id: <slrn9sjija.i2j.garry@zfw.zvolve.net>
On 14 Oct 2001 10:03:35 -0700, Bob Dubery <megapode@hotmail.com> wrote:
> I'm trying to come to grips with regexes - very powerful but a little
> cryptic as well (to me at any rate).
>
> In the Perl Cookbook I came across the commify regex. It works, but
> I'm hoping somebody can tell me HOW.
>
> $revno = reverse $number;
> $revno =~ s/(\d{3})(?=\d)(?!\d*\.)/$1,/g;
> $number = reverse $revno;
>
> Ok... I understand the reverse fine :-) The regex baffles me though...
>
> 1) I understand the first part of the regex... that's matching 3
> digits. The others aren't so clear to me.
Review the perlre manual page.
The (?=\d) is a positive look-ahead assertion that requires a digit
after the first three. The (?!\d*\.) is a negative look-ahead
assertion that requires that *no* periods appear after the first three
and possibly more digits. These look-ahead assertions do *not*
consume any part of the string being matched, so they both can be true
about the same part of the string at the same time.
Look-ahead is pretty cool, eh?
--
Garry Williams
------------------------------
Date: Sat, 13 Oct 2001 23:00:12 +0200
From: "Steffen Müller" <tsee@gmx.net>
Subject: Re: How do you get paid for Perl work over the Internet??
Message-Id: <9qc0tg$ccq$01$3@news.t-online.com>
"Carlos C. Gonzalez" <aperlprogrammer@yahoo.com> schrieb im Newsbeitrag
news:MPG.16324c32d15dc0369897b0@news.edmonton.telusplanet.net...
| Alan Wrigley at spamhater@keepyourfilthyspamtoyourself.co.uk said...
|
| > And why on earth would anyone pay to commision work that's going to be
| > sub-contracted to novices?
|
| Hi Alan. Though I cannot yet speak from much experience in this I
| believe if one considers programming services as a product being sold to
| customers the principals that make joint-ventures successful will work in
| getting Perl programmers work.
|
| I do the marketing. I sell the product. New programmers get to do the
| work. I would hand off the client to a new programmer lock, stock, and
| barrel. Getting a small commission only on work that I could not handle
| myself. Timewise. I will undoubtedly get more work than I can
| handle eventually and I don't want to just drop potential clients without
| making something in return for my efforts in getting them.
|
| I believe new programmers could do a lot of the work at lower rates than
| very experienced ones and clients want to save money. If the work is not
| done according to the clients specs the programmer would simply not get
| paid (and I would not get my commission).
|
| The programmer undertaking the work will handle it all. I will be out of
| it once a project is handed over. I will only be paid (10-15%) if the
| client decides to commission the work from the programmer I handed things
| over to. And only on a first contract. Subsequent contracts would be
| totally between the programmer and the client. As such it would be in the
| interests of the programmer to earn a lower than ideal rate per hour on
| the first contract (given my commission cut) in order to secure a
| potentially long term client. Of their own.
|
| From a clients perspective they are getting the work at no more than I or
| another beginning programmer might charge. I am banking on most of them
| not caring that a beginner programmer is doing the work as long as the
| work is done and as long as they are dealing directly with the programmer
| doing the work.
|
| Most of my clients will not be corporations but rather individuals
| wanting to establish a web presence for themselves at the lowest
| realistic price. They will not have the time to do it themselves and
| will readily jump I believe on the chance to get beginning programmers to
| do some or all of the work for them at a lower rate.
|
| The bottom line for most of my clients will be getting the job done in a
| resonable period of time, getting the code written so that it works, and
| done as cheaply as possible. Many individuals simply cannot afford the
| $100.00 per hour rates a lot of programmers charge and that corporations
| are willing to pay. My focus is to market some kind of solution to
| individuals. Mom and pop operations. Not corporate America.
|
| I believe it will work.
I don't.
You might find novice programmers - okay. Customers, too, because that's
what you say is your business. But do you really think experienced
programmers charge a lot just because they have some expensive habit?
You wrote that what your customers want is "getting the code written so that
it works." The problem is: Novices often cannot guarantee that! It is easy
to write code that works if the users behave. Newbies can usually do that.
But there can be gazillions of bugs waiting to be discovered days, weeks,
months, or even years *after* the testing phase. One can never be completely
certain that some piece of software is bug-free (if any software really is
at all). If you hire an experienced programmer, however, you actually buy
some confidence. These guys have seen a lot of problems and don't waste
their time making beginners' mistakes (something that can save a lot of
money. A lot of programmers spend most of their time debugging).
Once a customer finds out that his software doesn't work well, he/she isn't
going to hire a novice programmer again. Certainly not the same.
Now, please don't think this is one of the expensive pro's trying to keep
his customers in line. I can say that because I've been struggling with such
problems in the past year or so. Whenever I look at code I sold to somebody
more than half a year ago, I feel like I sold that poor guy to the devil
himself. (Stuff like CGI scripts that actually encourage DoS.)
Steffen
--
$_=q;Just\another\Perl\hacker;;@r=split/\\/;$r[$_]=
[split'',$r[$_]]for(0..3);$i=24;for(reverse 0..3){
print' 'x$i--.$_."\n"for(reverse@{$r[$_]});print"\n"}
------------------------------
Date: Sun, 14 Oct 2001 11:17:05 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: How do you get paid for Perl work over the Internet??
Message-Id: <a0iy7.1864$uJ3.126134@news20.bellglobal.com>
"Carlos C. Gonzalez" <aperlprogrammer@yahoo.com> wrote in message
news:MPG.1632dbdf16a8a5d49897b2@news.edmonton.telusplanet.net...
> Hi Matt. I noticed what you are talking about Matt but it doesn't faze
> me. As long as there are people wanting to get on the Internet to make
> extra money there will be a need for Perl programmers and web page
> developers.
>
Perhaps, but on the flip-side, I also know a tonne of people like yourself
who believed that they would get rich on the web, and who are currently
seeking employment. I'm not trying to put a damper on your dreams, but I
hate seeing people falling into the same naive trap. You talk about people
who would 'like' to have a presence or 'wish' they could. Ask them to put
down some money and see if their dreams don't disappear, even if you think
undercutting the market will prompt them to hire you. The lesson a number of
my friends have learned the hard way is that those who require a web
presence have a tech department to handle it, those who would like one
either do it themselves or get family to do it, thus leaving very few people
who will actually hire someone they don't know over the internet to create a
page for them. Good for you if you can pull it off, but I wouldn't quit your
day job.
And as a final point, it's really quite rude to publicly solicit help for
such an ill-conceived venture in this newsgroup. You have announced to the
Perl community that you are not adverse to providing clients with shoddy
work, but I suppose the only consolation is that you cannot delete these
messages from the newsgroup archives, so hopefully any potential clients who
do a background check of you on the internet will come across these posts
and think twice.
Matt
------------------------------
Date: Sun, 14 Oct 2001 16:16:36 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: How to stop File Upload (CGI)
Message-Id: <c7ejstktssi54nvq61qe4h72r51rlrtna8@4ax.com>
Petar Markovic wrote:
>I an making CGI scripts for uploading files.
>It is designed for business clients and some of them need to upload
>large files.
>
>If a client pushes the Stop button on the browser I want the upload to
>stop and delete the part of file already copied to Server.
What the user sends, is not the final file. You still have to extract
the file, anyway.
So using the module File::Temp you can create a file which, as soon as
the file is closed, or when the script ends, is deleted. On Unix, you
can commonly achieve that effect by unlinking the file as soon as it's
opened; on Windows, you need to add it to a "to delete" list, so you can
unlink all of them in an END block. That's how File::Temp does it,
anyway.
So, when the upload is done: don't close the file. Open it in mode "+>",
then seek back to the start of the file, and extract away.
CGI::Minimal takes a simpler approach. It simply tries to hold all of
the upload in memory. If your files aren't terribly big (the internal
limit in CGI::Minimal is set to 1MB), that would work too, plus,
extracting the parameters from the upload will be easier, too.
--
Bart.
------------------------------
Date: Sun, 14 Oct 2001 20:22:01 +1000
From: "Tintin" <tintin@snowy.calculus>
Subject: Re: newbie for perl
Message-Id: <oIdy7.20$%U6.374839@news.interact.net.au>
"newbie" <newbie_member@newsguy.com> wrote in message
news:9qb8re02sof@drn.newsguy.com...
> Hi all:
>
> I downloaded perl 5.6.1 source code from perl.org on my solaris 7 (x86)
and
> tried to compile it. From the doc "INSTALL", it is quite simple:
>
> The basic steps to build and install perl5 on a Unix system
> with all the defaults are:
>
> rm -f config.sh Policy.sh
> sh Configure -de
> make
> make test
> make install
>
> # You may also wish to add these:
> (cd /usr/include && h2ph *.h sys/*.h)
> (installhtml --help)
> (cd pod && make tex && <process the latex files>)
>
> Each of these is explained in further detail below.
>
>
> but I encountered strange error messages after I followed the steps
>
> hostname:~/src/p561$ sh Configure -de
> Configure: ^M: not found
> Configure: ^M: not found
> Configure: ^M: not found
> Configure: ^M: not found
> : No such file or directory
> Configure: ^M: not found
> Configure: ^M: not found
> Configure: ^M: not found
> Configure: ^M: not found
> : No such file or directory
> Configure: ^M: not found
> Configure: ^M: not found
> Configure: ^M: not found
> Configure: ^M: not found
> : No such file or directory
> Configure: ^M: not found
> Configure: ^M: not found
> Configure: ^M: not found
> Configure: ^M: not found
>
>
> Could anyone help me on this?
Why did you start a new thread for this? Didn't you like the answers for
your original posting?
------------------------------
Date: Sun, 14 Oct 2001 15:06:03 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: newbie for perl
Message-Id: <1dajstk0s311ron5jfagpf4mo88drb3tn6@4ax.com>
newbie wrote:
>I downloaded perl 5.6.1 source code from perl.org on my solaris 7 (x86) and
>tried to compile it. From the doc "INSTALL", it is quite simple:
>but I encountered strange error messages after I followed the steps
>
>hostname:~/src/p561$ sh Configure -de
>Configure: ^M: not found
>Configure: ^M: not found
...
Those "^M" are CR's. How did you put your files onto that machine? It
looks like these are Windows/DOS text files.
--
Bart.
------------------------------
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 1926
***************************************