[18488] in Perl-Users-Digest
Perl-Users Digest, Issue: 656 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Apr 9 00:05:40 2001
Date: Sun, 8 Apr 2001 21:05:11 -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: <986789110-v10-i656@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 8 Apr 2001 Volume: 10 Number: 656
Today's topics:
#!/usr/bin/perl -w vs. use diagnostics <kbass1@nc-rr.com>
Re: #!/usr/bin/perl -w vs. use diagnostics <rick.delaney@home.com>
Re: ? The best Perl book ? (Tad McClellan)
CGI - Uploaded file needs a specific name. (Bill Nussbaumer)
Re: CGI - Uploaded file needs a specific name. <dan@nospam_dtbakerprojects.com>
Re: complaint about moderation of this group (---Pete---)
Re: complaint about moderation of this group (Tad McClellan)
Re: dir problem <wayne.keenan@ntlworld.com>
Re: explain this please <kstep@pepsdesign.com>
Re: explain this please (The Mosquito ScriptKiddiot)
Re: HTML::Parser - no compiler to compile Win32 object <bart.lateur@skynet.be>
Re: HTML::Parser - no compiler to compile Win32 object <kstep@pepsdesign.com>
Re: Perl job, $ ? (Tad McClellan)
Re: Radius detail File to csv <matt@webexplorers.com.au>
Return code for % operator <huem@MailAndNews.com>
Re: Return code for % operator <VincentMurphy@mediaone.net>
Re: Return code for % operator <wayne.keenan@ntlworld.com>
Re: Return code for % operator (Tad McClellan)
Re: So what do YOU use Perl for? (Tad McClellan)
Re: So what do YOU use Perl for? <wyzelli@yahoo.com>
Re: So what do YOU use Perl for? (Tad McClellan)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 08 Apr 2001 23:54:55 GMT
From: "Kevin B" <kbass1@nc-rr.com>
Subject: #!/usr/bin/perl -w vs. use diagnostics
Message-Id: <jT6A6.38165$Ho5.9540596@typhoon.southeast.rr.com>
Is there a difference in using
#!/usr/bin/perl -w
as opposed to using
use diagnostics
in a perl program? When I used them individually within my perl programs, I
really do not see a difference. What are the advantages, disadvantages and
differences in these process when it comes to reporting problems.
Kevin
------------------------------
Date: Mon, 09 Apr 2001 03:29:48 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: #!/usr/bin/perl -w vs. use diagnostics
Message-Id: <3AD12FE8.1D3CCDE9@home.com>
[posted & mailed]
Kevin B wrote:
>
> Is there a difference in using
>
> #!/usr/bin/perl -w
>
> as opposed to using
>
> use diagnostics
>
> in a perl program? When I used them individually within my perl programs, I
> really do not see a difference.
Wow, you must only write error-free programs. ;-)
'use diagnostics' is the same as -w in that it enables warnings in your
program. If you happen to get any warnings, it also looks them up in
perldiag.pod and spits out the full description of the warning. It does
the same for fatal errors.
perldoc diagnostics
> What are the advantages, disadvantages and
> differences in these process when it comes to reporting problems.
The advantage of 'diagnostics' is that it looks up warnings and errors
in perldiag for you. The disadvantage is that it slows down your
program to do so. More importantly, it quickly becomes tiresome to see
the full description once you know what the terse message means.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Sun, 8 Apr 2001 18:12:38 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: ? The best Perl book ?
Message-Id: <slrn9d1oim.vb1.tadmc@tadmc26.august.net>
Ciaran McCreesh <keesh@users.pleaseremovethisbit.sourceforge.net> wrote:
>Basically, stick to O'Reilly and you'll be OK. Just don't get the Wrox
^^^
^^^
>Press book, it's awful.
Wrox has only a single Perl title?
Please say the title of the book if you are going to talk about the book.
Which book are you referring to there?
>And no, I won't justify that statement, someone
>else can do it.
Or, we can just ignore your unsubstantiated opinion.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 09 Apr 2001 00:48:28 GMT
From: wnussbau@hotmail.com (Bill Nussbaumer)
Subject: CGI - Uploaded file needs a specific name.
Message-Id: <3ad104be.4736462@news-east.speakeasy.org>
Hi,
I'm new to this and despite reading through the docs I'm having a bit
of trouble discerning what filefield and upload are really doing.
I need to upload a file so that I can pass it as an argument to an
excecutable residing on a Windows system (the program is Win32 only).
The file specifically must be named "database.dat". There are no
other options, the program (i.e. raw_dump.exe) will only look for that
file name.
The code below uploads the file and will even correctly rename it but
it seems I have a CGItempXXXX file showing at 0kb in the root
directory of my web server, the CGI script hangs and the program never
gets run.
Could someone give me a point in the right direction. What am I doing
wrong here? (BTW $plate_number is just a numerical parameter passed
to the program).
Thanks,
Bill
$upload_fh = param("upload_file");
binmode($upload_fh);
my $file = $upload_fh;
close $upload_fh;
`copy $file $database_file`;
`raw_dump.exe $plate_number > rd_out.txt`;
------------------------------
Date: Mon, 09 Apr 2001 01:16:25 GMT
From: Dan Baker <dan@nospam_dtbakerprojects.com>
Subject: Re: CGI - Uploaded file needs a specific name.
Message-Id: <3AD10C26.37009E2A@nospam_dtbakerprojects.com>
Bill Nussbaumer wrote:
>
> Hi,
>
> I'm new to this and despite reading through the docs I'm having a bit
> of trouble discerning what filefield and upload are really doing.
--------------------------
too bad dejanews is gone, but if you try google search with a keyword
"upload"" in this group, you'll get a bunch of old posts... including
one I posted a long time ago, I'll repost here.... just read thru and
pick out what you need:
A webpage with source like this:
<form ENCTYPE="multipart/form-data" ACTION="UploadImage.pl"
METHOD="POST">
<P>Type the full path of file to upload, or use the browse
button:
<input TYPE="file" ACCEPT="image/jpeg,image/gif"
NAME="UploadFile" SIZE="32" VALUE="C:\">
<i><font color="#CC0000">When browsing, you will need to
set file type to *.* every time in the dialog box
to list .gif and .jpg image files! The default file type is
.htm, and that
is NOT what you are looking for...</font>
<BR>When browsing for the first time, note that you may need to
change
the current folder displayed to your local image directory to
see the
available images.</i>
<div align=right><input TYPE=submit VALUE="Upload to Server Now"
></div>
</form>
will send a multipart request to the server. Note that the
param('UploadFile') will be BOTH a filename and an open FILEHANDLE.
example perl script to handle it might look like this:
#! /usr/bin/perl -w
use CGI qw( param uploadInfo );
$CGI::POST_MAX=1024 * 100 ; # set maximum
size of post to 100k
$TempFile::TMPDIRECTORY = './tmp_images' ; # force temp
file location
#
------------------------------------------------------------------------------
# check input
unless ( $OverwriteFlag ) { $OverwriteFlag = 'no-overwrite' }
unless ( $UploadedImage ) {
&ExitToBrowser( 'warn' , "You did not enter a path for a
file to ".
"upload. Use your browser \"Back\" button and enter a
filepath." )
}
# check to make sure it is the right type
# -----
$tempString = ${uploadInfo($UploadedImage)}{'Content-Type'} ; #
deref the hash of info
#
unless ( $tempString ) {
print "Content-type: text/plain\n\n";
print "WARNING - \n".
"Path entered for file was invalid...\n".
"Try using the browse button to select a
file.\n".
"\nUse the Browser \"Back\" button to return to
the ".
"upload management page.\n" ;
exit ;
}
#
if (( $temp ne 'image/jpeg' )and( $temp ne 'image/gif' )) {
print "Content-type: text/plain\n\n";
print "WARNING - \n".
"Cannot upload file with Content-Type = $temp, ".
"it MUST be either .jpg or .gif file!".
"\nPlease use the browser \"Back\" button, and
select an image
file.\n";
exit ;
}
# save the original local file name/handle to use later
my $UploadFH = $UploadedImage ;
# figure out filename to save it as, and make sure it is "legal"
# -----
$UploadedImage =~ s/.*[\\|\/](.+)$/$1/ ; # grab end of path
passed in
$UploadedImage =~ s/\s/_/g ; # convert spaces to _
# build relative path to new image target
# -----
my $ImagePath = $cAdminCgi2Gallery ;
if ( $TargetFolder ) { $ImagePath = "$ImagePath\/$TargetFolder"
}
$ImagePath = "$ImagePath\/$UploadedImage" ;
# check to see if we will overwrite an existing file on the
server
# -----
if ( -f $ImagePath and ( $OverwriteFlag eq 'no-overwrite' ))
{
# build warning page
print "Content-type: text/plain\n\n";
print "WARNING - \n".
"File $ImagePath already exists on server, ".
"you currently have set preferences not to overwrite
existing
files. \n".
"\nUse the browser \"Back\" button to return to the
upload
page.\n";
exit ;
}
#
------------------------------------------------------------------------------
#
# write the file from open filehandle
&WriteUploadFile( $UploadFH , "$ImagePath" ) ;
1;
#
##############################################################################
# local subs
#
##############################################################################
sub WriteUploadFile { my ( $FromFH , $ToPath ) = @_ ;
# we are using this sub because we dont trust CGI:: to check
size
# local vars
my $bytesread ;
my $buffer = "";
my $flen = 0 ;
open ( TARGETFILE , ">$ToPath" ) ;
binmode( TARGETFILE );
binmode( $FromFH );
$flen = 0 ;
while ( $bytesread = read( $FromFH , $buffer , 1024 ) ) {
print TARGETFILE $buffer ;
$flen += 1024 ;
if ( $flen > $CGI::POST_MAX ) { # check size here since
# we cant count on CGI
to do it
print "Content-type: text/plain \n\n".
"FATAL ERROR - \n\n".
"The file $FromFH \nthat you attempted to upload
".
"is too big. \nOnly $CGI::POST_MAX kbytes are ".
"allowed. \n\n".
"Please use your browser \"Back\" button and ".
"resample, crop, or select a smaller file...\n";
close $FromFH ;
close TARGETFILE ;
unlink $ToPath or die "could not delete working
file because $!" ;
exit;
}
}
close $FromFH ;
close TARGETFILE ;
chmod 0666, "$ToPath" ;
unless (-f $ToPath ) { # something might have gone wrong during
the
save
die "FATAL ERROR - could not upload >$FromFH< to
>$ToPath< because $!
\n";
}
1;}
#
##############################################################################
------------------------------
Date: Sun, 08 Apr 2001 23:35:53 GMT
From: bogus@erol.com (---Pete---)
Subject: Re: complaint about moderation of this group
Message-Id: <3ad0f42c.488809434@news.earthlink.net>
On Sun, 8 Apr 2001 09:40:07 -0400, tadmc@augustmail.com (Tad
McClellan) wrote:
>It is not up to the Perl docs to show the division. It is up to
>the CGI "docs" (such as they are).
-----
Tad, you seem to have misinterpreted the points I was
making in my post. My intent was not to complain about
the policies here, but rather to explain why and how this
CGI issue is occuring as an ongoing problem and to
pose some possible solutions (see bottom of msg).
As for me, I'm a visual basic programmer for many years
and needed to do some things using Perl & CGI. I read the
Perl Docs and bought 2 Perl Books and 1 CGI/Perl book.
I did a file search on my Perl directory looking for "CGI"
and found 113 files containing "CGI", giving me the
impression that CGI is part of Perl. The O'Reilly book
titled "CGI Programming with Perl" listed only 3 newsgroups
for CGI support and of those 3... comp.lang.perl.misc
was the most logical choice.
Bottom line... The Perl Docs and published books are
directly & indirectly funneling CGI people to this NG.
This is the root of CGI off-topic problem.
OK, that's my point, stated more clearly this time.
So, If the majority of folks here decided to separate the
CGI issues and deem them as off-topic, I would certainly
respect that concept, and.. I actually did follow the rules of
good net-etiquette by posing my CGI questions in NG...
comp.infosystems.www.authoring.cgi
where most all my CGI issues were addressed.
So, I'm not bitter or complaining <smile>.
OK, getting past all the above, what are the options
and the possible solutions?
1.) Continue arguing as to what's a legal CGI topic?
Ans: No! - Waste of time. Has not seemed to work to date.
2.) Create a new "perl.cgi" sub-group?
Ans: Not likely! Would only make sense when if number
of CGI posts were extremely high.
3.) Keep addressing each person who posts CGI off-topic?
Ans: Possible but this becomes annoying & time consuming!
4.) Ignore the CGI off-topic posts, maybe they will go away.
Ans: No! - Wishfull thinking.
5.) Use an automated Email'd FAQ for new users?
Ans: Not effective due to too many anti-spam email addresses.
6.) Do a regular scheduled posting titled "RULES OF THIS NG"
that would help to direct people to the correct NG and such that
people could refer an offending poster to it if he/she posted OT.
Ans: Possible?
7.) Create "standard CGI-OT reply" for offending CGI posts,
politely explaining the various reasions why their topic is
off-topic and directing them to the corrrect NG?
Ans: Possible?
8.) If no acceptable solution can be agreed upon, simply
allow CGI topics to be posted?
Ans: Possible if it would only add a small number of post/day.
9.) Leave is like it is.
Ans:???
----pete---
------------------------------
Date: Sun, 8 Apr 2001 22:46:51 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: complaint about moderation of this group
Message-Id: <slrn9d28kr.vlq.tadmc@tadmc26.august.net>
---Pete--- <bogus@erol.com> wrote:
>On Sun, 8 Apr 2001 09:40:07 -0400, tadmc@augustmail.com (Tad
>McClellan) wrote:
>
>>It is not up to the Perl docs to show the division. It is up to
>>the CGI "docs" (such as they are).
>-----
>Tad, you seem to have misinterpreted the points I was
^
^ plural
>making in my post.
I saw two points. That is why I made two different followups
to the same post, one for each point.
_My_ point in the followup you quote above was in response to
your "challenge".
You challenged the _Perl_ docs to address an application area
where Perl might be used. That isn't their job.
>My intent was not to complain about
>the policies here, but rather to explain why and how this
>CGI issue is occuring as an ongoing problem and to
>pose some possible solutions (see bottom of msg).
That was the point I addressed (agreed with) in my second followup.
>As for me, I'm a visual basic programmer for many years
>and needed to do some things using Perl & CGI. I read the
>Perl Docs and bought 2 Perl Books and 1 CGI/Perl book.
>I did a file search on my Perl directory looking for "CGI"
>and found 113 files containing "CGI", giving me the
>impression that CGI is part of Perl.
That is an understandable and common occurence.
(but that doesn't mean we have to like it :-)
>Bottom line... The Perl Docs and published books are
>directly & indirectly funneling CGI people to this NG.
No, it isn't that. It is just the extremely large number of folks
who happen to choose to use Perl for their CGI programs.
There are 10's of thousands of them out there. It only takes a few
dozen to begin putting stress on the Perl newsgroup.
>This is the root of CGI off-topic problem.
That (too many people with not enough training to even sort out
"what is what") is the root of the CGI problem.
:-)
I don't see "this problem" ever going away.
"Fame and Fortune" sure do _sound_ good. Looks like that "fame"
part has some drawbacks associated with it though. Our language
will now be regularly used by incompetents. That's just how it is.
>OK, that's my point, stated more clearly this time.
I am quite sure I got it the first time though.
>So, If the majority of folks here decided to separate the
>CGI issues and deem them as off-topic, I would certainly
>respect that concept,
I think you can count that one as pretty much already "on the books".
(we're talking "CGI questions" here not "CGI programs")
>So, I'm not bitter or complaining <smile>.
^^^^^^ ^^^^^^^^^^^
Thank you for leaving that to me <smile**2>
>OK, getting past all the above, what are the options
>and the possible solutions?
>
>1.) Continue arguing as to what's a legal CGI topic?
>Ans: No! - Waste of time. Has not seemed to work to date.
Yet here we are doing just that.
This has been discussed here dozens of times before. I don't see
any "new" points being made in this thread...
>3.) Keep addressing each person who posts CGI off-topic?
>Ans: Possible but this becomes annoying & time consuming!
Yes, but it also actually _helps_ the poor misfortunate who
has "wandered into the wrong room".
(except that the annoyance often colors the response, which
reduces the effectiveness of getting the message across...
)
>4.) Ignore the CGI off-topic posts, maybe they will go away.
>Ans: No! - Wishfull thinking.
Many do this already I'm sure.
I employ some automated help with that.
[ Here is the scorefile entry that I'm referring to:
% probably off-topic
Score:: -1000
Subject: browser
Subject: 500 error
Subject: server error
Subject: redirect
Subject: banner
Subject: htaccess
Subject: cgi-lib
Subject: download
Subject: upload
Subject: guest *book
Subject: referr?er
Subject: apache
Subject: cookie
Subject: check *box
]
>6.) Do a regular scheduled posting titled "RULES OF THIS NG"
>that would help to direct people to the correct NG and such that
>people could refer an offending poster to it if he/she posted OT.
>Ans: Possible?
Done, but not yet fully implemented.
The thread wherein the group hashed out the contents (URL wrapped):
http://groups.google.com/groups?hl=en&lr=&safe=off&ic=1&th=
30fff84a5d0e83a8&seekd=952918533#952918533
The "on deck" version, waiting for me to get off my butt and
ask dfw.pm to start autoposting it for us:
http://www.augustmail.com/~tadmc/clpmisc_guide/
No comments on its contents accepted at this time!
Wait until the autopost happens (hopefully within a week or two)
then followup to that if you have anything to say.
>7.) Create "standard CGI-OT reply" for offending CGI posts,
>politely explaining the various reasions why their topic is
>off-topic and directing them to the corrrect NG?
>Ans: Possible?
That might be useful.
Somebody writes a web page(s) with discussion of on-topicness
and we can point the miscreants to that.
>8.) If no acceptable solution can be agreed upon, simply
>allow CGI topics to be posted?
>Ans: Possible if it would only add a small number of post/day.
That would for sure push me over the edge. I'd leave (but that isn't
much of a loss, there's plenty of others here. Unless _they_ give
it up too...)
And once folks saw that "CGI questions" get _answers_ here instead of
flames, "small number" will prove an inaccurate characterization of
the volume involved.
>9.) Leave is like it is.
>Ans:???
Unsatisfying, but viable (perhaps).
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 08 Apr 2001 22:51:46 +0100
From: "wayne.keenan" <wayne.keenan@ntlworld.com>
Subject: Re: dir problem
Message-Id: <3AD0DD72.4F226544@ntlworld.com>
"wayne.keenan" wrote:
> Gwyn Judd wrote:
>
> > I was shocked! How could J.A.W <nlp0421@gz.cngb.com>
> > say such a terrible thing:
> >
> > >to ignore the subdirs, but is there an efficient way to do this?
> >
> > You want the '-d' file-test operator.
> >
>
> -f
okay: ! -d
:)
------------------------------
Date: Sun, 8 Apr 2001 18:16:17 -0400
From: "Kurt Stephens" <kstep@pepsdesign.com>
Subject: Re: explain this please
Message-Id: <9aqo0d$hr5$1@slb5.atl.mindspring.net>
"The Mosquito ScriptKiddiot" <anotherway83@aol.com> wrote in message
news:20010407222546.05296.00001818@ng-fc1.aol.com...
> this example is in Programming Perl but i can't understand it...i know
it's got
> sumthing to do with how the scope of the variable changes when it's
declared
> 'local', but i don't see why
>
> $cool='lothlorien';
> $cool=~ m/ (?{$i=0}) (.(?{$i=$i+1;}) )* lori (?{print $i;})/x;
>
>
> gives the value of $i as 10 while
>
>
> $cool='lothlorien';
> $cool=~ m/ (?{$i=0}) (.(?{local $i=$i+1;}) )* lori (?{print $i;})/x;
>
> gives the value of $i as 4
The perlre documentation gives a similar example using the (?{ assertion.
Quoting perlre:
"The code is properly scoped in the following sense: If the assertion is
backtracked (compare Backtracking), all changes introduced after
localization are undone, so that
$_ = 'a' x 8;
m<
(?{ $cnt = 0 }) # Initialize $cnt.
(
a
(?{
local $cnt = $cnt + 1; # Update $cnt, backtracking-safe.
})
)*
aaaa
(?{ $res = $cnt }) # On success copy to non-localized
# location.
>x;
will set $res = 4. Note that after the match, $cnt returns to the globally
introduced value, because the scopes that restrict local operators are
unwound."
In your first example, (.(?{$i=$i+1;}))* exhibits the same greedy behaviour
as .* would without the assertion. This matches all 10 characters in the
string, executing (?{$i=$i+1;}) for each match. The expression then
backtracks to match the second part 'lori'. The value of 10 reflects the
value calculated before backtracking. In your second example, logically
equivalent to the example in perlre, 'all changes introduced after
localization are undone'.
Consider yet another version of your code, using the non-greedy .*?:
$cool='lothlorien';
$cool=~ m/ (?{$i=0}) (.(?{$i=$i+1;}) )*? lori (?{print $i;})/x;
prints the value 4 as well.
HTH
Kurt Stephens
------------------------------
Date: 09 Apr 2001 01:15:04 GMT
From: anotherway83@aol.com (The Mosquito ScriptKiddiot)
Subject: Re: explain this please
Message-Id: <20010408211504.27241.00005418@ng-ch1.aol.com>
thanks d00d...i get it now
peace
The Mosquito ScriptKiddiot
Championing the Cause of Mosquitoes in Technology
------------------------------
Date: Sun, 08 Apr 2001 22:18:02 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: HTML::Parser - no compiler to compile Win32 object required - Help!!
Message-Id: <bbo1dtsp87lpteu7dcuqc0616uvo3e3hp0@4ax.com>
Phil Holland wrote:
>I have downloaded version 3.19 of HTML::Parser from CPAN, but can't
>complete the installation on my Win2000 system as dmake has no C
>compiler it can use.
>
>Can anyone send me a pre-compiled Parser object that I seem to need to
>run this module, or tell me where I can find one, please?
Assuming you're using a pelr 5.6.0 from Activestate: if you have direct
access to internet with that machine, PPM can download and install it
directly.
If not:
<http://www.activestate.com/PPMpackages/5.6/>
Get the PPD file, and .tar.gz file from the MSWin32-x86-multi-thread
subdirectory.
Assuming you use exactly the same relative positions and the original
names for your local copies, then edit the PPD file using a text editor,
and on line 9, in the CODEBASE tag for the "MSWin32" target, modify the
HREF so the string is a relative URL, i.e.
"MSWin32-x86-multi-thread/HTML-Parser.tar.gz".
Now you're ready for action: at the command line prompt, type
PPM install HTML::Parser
and it should do the whole install for you.
If you have direct access to internet with that machine, that last
thing is all you have to do. I think.
--
Bart.
------------------------------
Date: Sun, 8 Apr 2001 18:21:33 -0400
From: "Kurt Stephens" <kstep@pepsdesign.com>
Subject: Re: HTML::Parser - no compiler to compile Win32 object required - Help!!
Message-Id: <9aqo9f$p8g$1@slb2.atl.mindspring.net>
"Phil Holland" <postmaster@hollandnumerics.co.uk> wrote in message
news:wFQr5QAvQN06EwmZ@hollandnumerics.demon.co.uk...
> I have downloaded version 3.19 of HTML::Parser from CPAN, but can't
> complete the installation on my Win2000 system as dmake has no C
> compiler it can use.
>
> Can anyone send me a pre-compiled Parser object that I seem to need to
> run this module, or tell me where I can find one, please?
Are you using ActiveState Perl? If so, a precompiled HTML::Parser is
available via PPM from the ActiveState repository.
C:\>PPM
PPM interactive shell (2.1.2) - type 'help' for available commands.
PPM> install HTML-Parser
HTH,
Kurt Stephens
------------------------------
Date: Sun, 8 Apr 2001 18:15:00 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Perl job, $ ?
Message-Id: <slrn9d1on4.vb1.tadmc@tadmc26.august.net>
Jan <janoleolsen@hotmail.com> wrote:
>Are there any forums or sites where I can find someone who'd like to take on
>some CGI programming?
If you want the CGI program to be written in Perl, then:
http://jobs.perl.org/
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 9 Apr 2001 09:02:27 +1000
From: "hangover" <matt@webexplorers.com.au>
Subject: Re: Radius detail File to csv
Message-Id: <3ad0ef21_4@news01.one.net.au>
Brad,
-snip-
I did the code below as a lark.
> I don't know if there are more fields than those you showed, and
> I'm doing simple quoting: "text","","number","\"text in quotes\"".
>
> Perhaps you'll find it useful, or at least interesting.
>
> Brad
-snip-
Thanks for your help. I now know where to start and hopefully can mould
this into something that will suit me well. I don't quite understand it all
but i will perservere :) It is definately interesting considering it is no
way associated with how i thought it needed to be done!
Thanks to the other guys that offered modifications as well.
I will post it back to the group when i finish it :)
-Matt
------------------------------
Date: Sun, 8 Apr 2001 20:40:14 -0400
From: hue micheal <huem@MailAndNews.com>
Subject: Return code for % operator
Message-Id: <3B0CF845@MailAndNews.com>
My first thought, the following were correct:
if (100%4) { print "100 is dividible by 4" }
if (!(101%4)) { print "101 is not divisible by 4" }
results: Nothing is printed !!!
So the actual return code were:
(100%4) returns faulse
(101%4) returns true
So I have to change my codes to:
if (!(100%4)) { print "100 is dividible by 4" }
if (101%4) { print "101 is not divisible by 4" }
I my opinion, the first case is more acurate ? Any thoughts ?
I think KSH has the same logic as perl. May be I am missing something here
?
------------------------------------------------------------
Get your FREE web-based e-mail and newsgroup access at:
http://MailAndNews.com
Create a new mailbox, or access your existing IMAP4 or
POP3 mailbox from anywhere with just a web browser.
------------------------------------------------------------
------------------------------
Date: Mon, 09 Apr 2001 00:54:08 GMT
From: Vinny Murphy <VincentMurphy@mediaone.net>
Subject: Re: Return code for % operator
Message-Id: <m3itkf2bjv.fsf@vmurphy-hnt1.athome.net>
>>>>> "hue" == hue micheal <huem@MailAndNews.com> writes:
hue> My first thought, the following were correct: if (100%4) { print
hue> "100 is dividible by 4" } if (!(101%4)) { print "101 is not
hue> divisible by 4" }
The % is the modulus operator. 100 % 4 is 0, 101 % 4 is 1, 102 % 4 is 2,
103 %4 is 3, 104 % 4 is 0 ...
Thus if you say
print 'Anything' if 0;
you won't get anything printed.
hue> results: Nothing is printed !!!
hue> So the actual return code were: (100%4) returns faulse (101%4)
hue> returns true
The return code is the modulus, or remainder of the division.
See perldoc perlop for more details on the % operator.
--Vinny
hue> So I have to change my codes to: if (!(100%4)) { print "100 is
hue> dividible by 4" } if (101%4) { print "101 is not divisible by 4" }
hue> I my opinion, the first case is more acurate ? Any thoughts ?
hue> I think KSH has the same logic as perl. May be I am missing
hue> something here ?
hue> ------------------------------------------------------------ Get
hue> your FREE web-based e-mail and newsgroup access at:
hue> http://MailAndNews.com
hue> Create a new mailbox, or access your existing IMAP4 or POP3
hue> mailbox from anywhere with just a web browser.
hue> ------------------------------------------------------------
------------------------------
Date: Mon, 09 Apr 2001 02:09:57 +0100
From: "wayne.keenan" <wayne.keenan@ntlworld.com>
Subject: Re: Return code for % operator
Message-Id: <3AD10BE5.B6C754AC@ntlworld.com>
hue micheal spuriously wrote:
> My first thought, the following were correct:
> if (100%4) { print "100 is dividible by 4" }
> if (!(101%4)) { print "101 is not divisible by 4" }
>
> results: Nothing is printed !!!
why are u so surprised
100%4 tells you that the remainder is 0 (i.e. false)
101%4 tells you that the remainder is 1 (i.e. true)
>
>
> So the actual return code were:
> (100%4) returns faulse
> (101%4) returns true
yes.....
>
>
> So I have to change my codes to:
> if (!(100%4)) { print "100 is dividible by 4" }
> if (101%4) { print "101 is not divisible by 4" }
>
correct.
>
> I my opinion, the first case is more acurate ? Any thoughts ?
'opinion' doesn't really matter here. obviously it's totally not accurate
>
>
> I think KSH has the same logic as perl. May be I am missing something here
> ?
>
what you probably meant to say :
a) if ((100%4) == 0) { print "100 is divisible by 4\n" }
b) if ((101%4) != 0) { print "101 is not divisible by 4\n" }
------------------------------
Date: Sun, 8 Apr 2001 23:00:01 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Return code for % operator
Message-Id: <slrn9d29dh.vlq.tadmc@tadmc26.august.net>
hue micheal <huem@MailAndNews.com> wrote:
>My first thought, the following were correct:
>if (100%4) { print "100 is dividible by 4" }
>if (!(101%4)) { print "101 is not divisible by 4" }
>
>results: Nothing is printed !!!
>I my opinion, the first case is more acurate ?
^^^^^^^
There are no "opinions" in rudimentary mathematics.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 8 Apr 2001 18:08:30 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: So what do YOU use Perl for?
Message-Id: <slrn9d1oau.vb1.tadmc@tadmc26.august.net>
Szilvia Oszko <soszko@gmu.edu> wrote:
>One recurring theme in this newsgroup seems to be that Perl!=CGI and
>that while Perl is often used to write CGI scripts, it can also be used
>to do a lot of other things. I'd be curious to see what non-CGI stuff
>you do with Perl.
I use Perl most often processing angle-brackety text (but not HTML).
1000 10-line programs each year. (often "data analysis")
100 100-line programs each year. (often some form of "reporting")
10 1000-line programs. (components in yet more publishing systems,
often some form of "translation")
1 10,000 line suite implementing a publishing work-flow.
(3 of these actually, but saying that would break the symmetry)
I use Perl for this. I use Perl for that.
I've used Perl to provide for my family for the last several years.
I use it for impressing the boss (though this is pretty much
impossible for one of my bosses, he knows Perl too).
I use it for impressing myself (the 3rd "virtue").
I use it when I find myself saying "I wonder if...". A little
experimenting around using Perl often helps dispell the "wonder"
part.
I use it for orchestrating a collage of _other_ miscellaneous
programs to effect a solution to pressing problems.
I use it for whatever needs to "get done".
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 9 Apr 2001 13:21:31 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: So what do YOU use Perl for?
Message-Id: <A7aA6.11$Z53.2638@vic.nntp.telstra.net>
"Szilvia Oszko" <soszko@gmu.edu> wrote in message
news:3ACFB415.63D2CA91@gmu.edu...
> One recurring theme in this newsgroup seems to be that Perl!=CGI and
> that while Perl is often used to write CGI scripts, it can also be used
> to do a lot of other things. I'd be curious to see what non-CGI stuff
> you do with Perl.
Processing billing records for ISP clients.
Processing ISP logs (RADIUS) into more readable and compact format.
Sending emails to ISP clients.
Client administrations tasks.
Some CGI type work as well (processing forms and writing files or sending
emails).
Extracting data from web pages (I also use Perl to grab those web-pages),
and building databases.
Lots of little data munging things from day to day.
Wyzelli
--
push@x,$_ for(a..z);push@x,' ';
@z='092018192600131419070417261504171126070002100417'=~/(..)/g;
foreach $y(@z){$_.=$x[$y]}y/jp/JP/;print;
------------------------------
Date: Sun, 8 Apr 2001 22:52:46 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: So what do YOU use Perl for?
Message-Id: <slrn9d28vu.vlq.tadmc@tadmc26.august.net>
Randal L. Schwartz <merlyn@stonehenge.com> wrote:
>print "Just another Perl hacker,"
Dude! You forgot to output the Content-type header first.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
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 656
**************************************