[10280] in Perl-Users-Digest
Perl-Users Digest, Issue: 3873 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 2 12:07:23 1998
Date: Fri, 2 Oct 98 09:00:21 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 2 Oct 1998 Volume: 8 Number: 3873
Today's topics:
Re: Alternate colors in tables with perl command? <jdporter@min.net>
CGI to mod_perl: language issue <jeffb@mcguckin.com>
Re: connecting to a Mysql via command line ok FAILs wit <jdw@dev.tivoli.com>
Re: DEL in PERL (I R A Aggie)
Re: Delete file command? <jhi@alpha.hut.fi>
Re: eq on if statement causing problems with string <jdf@pobox.com>
Re: Hangs - Netscape Enterprise Server 3.51 / Sybase we <eashton@bbnplanet.com>
Re: Hangs - Netscape Enterprise Server 3.51 / Sybase we <eashton@bbnplanet.com>
Re: Hashes - defined or not? <tchrist@mox.perl.com>
Re: Hashes - defined or not? <r28629@email.sps.mot.com>
Help needed with fcntl in perl <bas@yournews.nl>
Help with perl code nguyen.van@imvi.bls.com
How much would you charge for your programming? (Masa Suzuki)
Re: How much would you charge for your programming? <r28629@email.sps.mot.com>
Re: How much would you charge for your programming? <eashton@bbnplanet.com>
Re: how to pass FORM variable to second cgi? <jdporter@min.net>
Re: I hate it when I do that. (Andrew M. Langmead)
Re: I have installed Linux. Now what? <gjetson@spacely.com>
Re: IDE for Perl <jeffb@mcguckin.com>
Re: Is Net::FTP (libnet-1.0605) threadsafe? <bbense+comp.lang.perl.modules.comp.lang.perl.misc.Oct.02.98@telemark.stanford.edu>
Modem port - Mac (Garrett Paine)
Re: need a regular expressions expert... (Patrick Timmins)
Re: Need IP Address Sort Subroutine droby@copyright.com
Re: Omaha Perl Mongers - First Meeting ! <eashton@bbnplanet.com>
Re: Passing Perl Var To JavaScript - How? (Joachim Zobel)
Re: Passing Perl Var To JavaScript - How? dsaff@tvisions.com
problem after fork and httpd waiting ! help me out ! <dcoorna@dbm.ulb.ac.be>
Re: sendmail.pl <bjohnsto@usa.net>
Re: Trimming Long Scalar Variables <aqumsieh@tigre.matrox.com>
Re: Word wrap for Perl (John Moreno)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 02 Oct 1998 11:11:13 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Alternate colors in tables with perl command?
Message-Id: <3614ED11.D41B8075@min.net>
Ronald J Kimball wrote:
>
> ## Simpler logic that toggles the color
> $toggle = !$toggle;
>
> ## Simplest logic that toggles the color
> $toggle ^= 1;
I guess I'm just in a benchmarking mood these days.
#!/usr/local/bin/perl
use Benchmark;
timethese( 1_000_000, {
'using_bang' => ' $toggle = !$toggle ',
'using_not' => ' $toggle = not $toggle ',
'using_xor' => ' $toggle ^= 1 ',
});
using_bang: 16.98
using_not: 11.42
using_xor: 11.95
Just thought someone might be interested...
--
John "Many Jars" Porter
baby mother hospital scissors creature judgment butcher engineer
------------------------------
Date: Fri, 02 Oct 1998 09:22:38 -0600
From: Jeff Beard <jeffb@mcguckin.com>
Subject: CGI to mod_perl: language issue
Message-Id: <3614EFBE.4ADD2718@mcguckin.com>
Hello,
Thanks for reading this. It's a little bit long so please bear with me
and my newbie-ness.
My situation is that I've got CGI scripts written in Perl that I need to
get running under mod_perl wich basically do the same thing. I get
varying degrees of success but when it does "work" I get the "Variables
retain their value from one request to the next" problem mentioned in
the cgi_to_mod_perl FAQ. However, I don't understand really what the
docs are telling me.
The following is part of the program:
#!/usr/bin/perl -w
use strict ;
&GetFormInput ;
my $mfg = $field{'mfg'} ;
my $model = $field{'model'} ;
my $desc = $field{'desc'} ;
my $retail = $field{'retail'} ;
open (DATAFILE, ">>/tmp/inv_update.dat") ||
die "Error: problem opening datafile" ;
print DATAFILE "Manufacturor= $mfg\n" ;
print DATAFILE "Model number= $model\n" ;
print DATAFILE "Description= $desc\n" ;
print DATAFILE "Retail= $retail\n" ;
print DATAFILE "\n\n";
print DATAFILE "******************************************\n\n" ;
close (DATAFILE) ||
die "Error: problem closing file" ;
# Here I output a response web page
sub GetFormInput {
my ($buf);
if ($ENV{'REQUEST_METHOD'} eq 'POST') {
read(STDIN,$buf,$ENV{'CONTENT_LENGTH'});
}
else {
$buf=$ENV{'QUERY_STRING'};
}
if ($buf eq "") {
return 0 ;
}
else {
my @fval=split(/&/,$buf);
foreach my $i (0 .. $#fval){
my ($name,$val)=split (/=/,$fval[$i],2);
$val=~tr/+/ /;
$val=~ s/%(..)/pack("c",hex($1))/ge;
$name=~tr/+/ /;
$name=~ s/%(..)/pack("c",hex($1))/ge;
if (!defined($field{$name})) {
$field{$name}=$val;
}
else {
$field{$name} .= ",$val";
}
}
}
return 1;
}
the full script is here:
http://store.mcguckin.com/~beardj/perl_script.txt
I have been getting 3 or 4 different error messages that repeat. These
are the more common:
Global symbol "field" requires explicit package name at
/home/httpd/exec/inv_update.pl line 9.
[Fri Oct 2 09:03:19 1998] [error] Undefined subroutine
&Apache::ROOT::exec::inv_5fupdate_2epl::handler called at
/usr/lib/perl5/site_perl/Apache/Registry.pm line 141.
Subroutine GetFormInput redefined at /home/httpd/exec/inv_update.pl line
104.
I've tried putting $|=1; at the top of the script and with slight
changes in behavior but still it's not right.
I know that some of this stuff can be done with CGI.pm but I'm trying to
understand at a little bit of why things do what they do.
Anyway, any help is appreciated.
Cheers,
Jeff
------------------------------
Date: 02 Oct 1998 07:16:07 -0500
From: Jim Woodgate <jdw@dev.tivoli.com>
Subject: Re: connecting to a Mysql via command line ok FAILs with perl
Message-Id: <obk92j2m7s.fsf@alder.dev.tivoli.com>
randy.paries@avex.com writes:
> use Mysql;
>
> $dbh = Mysql->connect("node.com","unitdb","foo","username");
> if ( $dbh ){
> print "Connected to DB\n";
> }else{
> print "Connect Failed [$dbh]\n";
> }
I don't have that module (using DBD::mysql instead), check out the
docs for a way to print out the Error String. It will probably be
something simple like Mysql::ErrStr. Put that string at the end of
your Connect Failed message and it should tell you exactly what the
problem is...
--
Jim Woodgate
Tivoli Systems
E-Mail: jdw@dev.tivoli.com
------------------------------
Date: Fri, 02 Oct 1998 10:34:34 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: DEL in PERL
Message-Id: <fl_aggie-0210981034350001@aggie.coaps.fsu.edu>
In article <6v05mm$j4f$1@supernews.com>, "Computer Guru"
<computerguru@mailexcite.com> wrote:
+ Hello
+ How would I write the following in Perl for Win95
+ I am trying to find all files on the HD which end in *.bak and then delete
+ them. I was tring to do this as a DOS batch script but noticed DOS does not
+ have this capability...I checked my manuals but could not find out how to do
+ this..would I need a grep statement or something? Thanx
Possibly...perhaps this may work...Note to the Guru: unlink() is perl's
file remover...
#!/usr/freeware/bin/perl
eval 'exec /usr/freeware/bin/perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
require "find.pl";
# Traverse desired filesystems
&find('/','*.bak');
exit;
sub wanted {
(($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
unlink($_);
}
I'll admit it...I cheated. This is the output from
"find2perl / '*.bak' -exec rm -f {} \;"
James
------------------------------
Date: 02 Oct 1998 18:29:19 +0300
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: Delete file command?
Message-Id: <oeepvcbdltc.fsf@alpha.hut.fi>
"Mark Polakow" <mpolakow@emergemarketing.com> writes:
> What is the Perl/Unix command to delete a file.
> Win32 uses unlink($path);
> but this doesn't seem to work on Unix.
Yes it does. In fact it is the Unix way, which Win32 has adopted...
One problem is that you are not checking what goes wrong:
unlink($path) or die "unlink($path) failed: $!\n";
Always, ALWAYS, check the success/failure of system/library calls.
> Do the file permissions have to be set a certain way?
You need to have writing permission to the directory the file you are
trying to unlink is in.
> Much thanks in advance...
>
>
--
$jhi++; # http://www.iki.fi/~jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen
------------------------------
Date: 02 Oct 1998 17:41:30 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: "brettr" <brettr@centuryinter.net>
Subject: Re: eq on if statement causing problems with string
Message-Id: <m34stn55ud.fsf@joshua.panix.com>
"brettr" <brettr@centuryinter.net> writes:
> However, like the statement is above, the else part runs. I've
> looked at both strings and they are exactly alike.
How do you know? One good way to check is to print out both just
before the comparison. For example:
print "<$string_1>\n<$string_2>\n";
I'll bet you a million zorkmids that there's a newline, or a space, or
something in one of your strings. I'm confident about this because I'm
*fairly* certain that the Perl eq operator works as advertised.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Fri, 02 Oct 1998 14:51:17 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Hangs - Netscape Enterprise Server 3.51 / Sybase web.sql 1.2 / Solaris 2.6
Message-Id: <3614E5F1.B57BF139@bbnplanet.com>
scott_mcintosh@my-dejanews.com wrote:
> Actually they weren't interested in helping us because we were using
> the wrong version of Solaris. i.e. they didn't want our to see
> our stack. We've since fallen back to a much older configuration
> (NS Commerce Server on Solaris 2.5.1), and things are a lot better.
> But I wanted to make sure Sybase got some bad press -- perhaps it
> will motivate them to support the latest Solaris OS. Thanks for your
> comments nonetheless.
You know, that kind of attitude just makes me livid. I mean, why should
you have to take a step down to run _their_ product that _you_ paid them
money for?? Ridiculous!! GRRRRR!!!! We have the advantage of being a
large web hosting company with big clients and sites so we get a bit
more support than the average bear, but still, that makes me pop a vein
just thinking about it. Free software has better support, better
performance and a better attitude.
> Well, Sybase's wel.sql product uses Perl as the language and adds
> features to muck the the database. So all web.sql programmers are also
> Perl programmers. We're running everything on Solaris, and I suspect
> it might be a light weight process problem in Solaris.
Ok, well, the word perl was in there ;). There are a number of kernel
deadlocking issues with 2.6 and other thread issues....very possibly the
cause. Of course, Sun swears these will be fixed in 2.7. Heh.
e.
Would I live my life over again?
Make the same unforgivable mistakes?
Yes, given half a chance. Yes -R. Carver-
------------------------------
Date: Fri, 02 Oct 1998 14:57:18 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Hangs - Netscape Enterprise Server 3.51 / Sybase web.sql 1.2 / Solaris 2.6
Message-Id: <3614E759.B464FC07@bbnplanet.com>
Adam Turoff wrote:
> Just what does web.sql do that promises to make your life easier than
> using straight perl?
Marketing darling, marketing.
> Would you rather pay Sybase to blow you off, or get your job done and
> use DBI?
Because a lot of times you don't have a choice. The admin and/or the
programmer/developer often doesn't have the choice of the tool or
implementation. Tell me, why do we have a multi-million dollar client
who quibbles over purchasing 256mb of ram that their site desperately
needs _and_ uses FrontPage as their web publishing solution then
complains that their site is slow and hard to manage? My world would be
a much better place of the techies called the shots. :)
/me dreams of calling client and saying 'YOU, outta the gene pool, NOW!'
*sigh*
e.
Would I live my life over again?
Make the same unforgivable mistakes?
Yes, given half a chance. Yes -R. Carver-
------------------------------
Date: 2 Oct 1998 14:01:57 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Hashes - defined or not?
Message-Id: <6v2mcl$gi2$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited authors via email]
In comp.lang.perl.misc,
Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at> writes:
:Re: Hashes - defined or not?, pds <pds@datcon.co.uk> said:
:The parens put %hash in a list context.
No, not really.
See what perlfunc says about using defined on aggregates.
In short, don't write
if (defined %hash) { }
but rather simply
if (%hash) { }
--tom
--
Unix is defined by whatever is running on Dennis Ritchie's machine.
------------------------------
Date: Fri, 02 Oct 1998 09:36:01 -0500
From: Tk Soh <r28629@email.sps.mot.com>
Subject: Re: Hashes - defined or not?
Message-Id: <3614E4D1.619A7494@email.sps.mot.com>
Tony Curtis wrote:
>
> Re: Hashes - defined or not?, pds <pds@datcon.co.uk> said:
>
> my %hash;
> print "hash is defined\n" if defined %hash;
>
This didn't work for me. Camel book says 'This function [defined EXPR]
returns a Boolean value saying whether EXPR has a real value or not'.
This is what I got in the debuggger:
DB<6> {my %hash=(somthing=>undef);print 'defined' if defined %hash}
defined
DB<7> {my %hash; print 'defined' if defined %hash}
DB<8>
Did I answer the question???
-Tk
------------------------------
Date: Fri, 02 Oct 1998 16:59:36 +0200
From: "Bas A. Schulte" <bas@yournews.nl>
Subject: Help needed with fcntl in perl
Message-Id: <3614EA58.B39A4C8B@yournews.nl>
Hi all,
while trying to toy with some samples from Stevens' Advanced Programming
in the Unix environment in perl, I've run across something I can't seem
to figure out. This is the piece of C code I'm trying to do in perl:
struct flock lock;
lock.l_type = F_WRLCK;
lock.l_start = 0;
lock.l_whence = SEEK_SET;
lock.l_l_len = 0;
fcntl(fd,F_SETLK,&lock);
I just can't seem to be able to do it. IO::File, POSIX::open, built-in
perl i/o, pack, somehow it doesn't add up for me ;)
Anyone help out?
Regards,
Bas.
------------------------------
Date: Fri, 02 Oct 1998 14:47:46 GMT
From: nguyen.van@imvi.bls.com
Subject: Help with perl code
Message-Id: <6v2p2i$aa6$1@nnrp1.dejanews.com>
I have a problem with code. I think that it's supposed to work
based on my logical but don't know why the program
just stopped at the middle. Following is my codes.
-----------------------------------------------------------------
----------------------------------------------------------------- #!
/opt/bin/perl -w print "Please enter access files to process: "; while (<>) #
read a list of serires access files from the command line. { chomp $_; # cut
the new line character "\n". @FILES = split (" ", $_); # split spaces
between the files from input and # make the input to be an array. foreach
$file (@FILES) # read one file from input at a time. { print "$file\n" if
(-e $file); # print the output, one file per line print "$file doesn't exist
\n" if (!-e $file);
#The following process can be done by using File:Copy module
#Next time, better use this module next time for speed.
#The below code lines are used to open a file and cp to another.
open (IN, $file) or die "couldn't open $file: $!";
open (OUT, ">>trunc_file") or die "couldn't create trunc_file:
$!";
foreach $each_line (<IN>)
{
print OUT $each_line if ($each_line =~ /crno=/);
}
close (IN) or die "couldn't close $FILE: $!";
close (OUT) or die "couldn't close $trunc_file: $!";
}
} #THE PROGRAM JUST STOPPED RIGHT HERE. IF RUN ONLY THE BELOW CODES, PROGRAM
#WORK WELL. ANYTHING IS WRONG WITH THIS? ANY BETTER SUGESSTIONS.
open (HANDLE_TRUNC, "trunc_file") or die "Couldn't open trunc_file: $!";
open (HANDLE_AOL, ">aol_out") or die "couldn't create aol_out: $!"; open
(HANDLE_MSIE, ">msie_out") or die "couldn't create msie_out: $!"; open
(HANDLE_NETSCAPE, ">netscape_out") or die "couldn't create netscape_o ut:
$!";
foreach (<HANDLE_TRUNC>)
{
printf HANDLE_AOL ("%10s %7s\n" ,$1, $2) if ( $_ =~
/\b(crno=\d{2
,})\b.*\b(AOL\s\d\.\d+)\b/);
printf HANDLE_MSIE ("%10s %7s\n" ,$1, $2) if ( $_ =~
/\b(crno=\d{
2,})\b.*\b(MSIE\s\d\.\d+)\b.*\b/ and !/(AOL)\s\d\.\d+/);
printf HANDLE_NETSCAPE ("%10s %7s\n" ,$1, $2) if ( $_ =~
/\b(crno
=\d{2,})\b.*\b(Mozilla\/\d\.\d+)\b/ and !/(AOL|MSIE)\s\d\.\d+/);
}
close ( HANDLE_TRUNC) or die "couldn't close new_file: $!";
close ( HANDLE_AOL ) or die "couldn't close aol_out: $!";
close ( HANDLE_MSIE ) or die "couldn't close msie_out: $!";
close ( HANDLE_NETSCAPE ) or die "couldn't close netscape_out: $!";
exit;
Thanks
Van Nguyen
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 2 Oct 1998 13:56:15 GMT
From: masa@thunder.temple.edu (Masa Suzuki)
Subject: How much would you charge for your programming?
Message-Id: <6v2m1v$da3$1@cronkite.ocis.temple.edu>
How much would programmers generally charge for the following
programs?
1) Perl script in CGI environment
that logs visitors' email addresses
2) Perl Script in CGI environment on a secured server
that accepts credit card number and Email the info
(encrypted by PGP).
3) Perl Script in CGI enironment
that performs a "shopping cart".
I have never charged anyone but would like to know the average
pricing for programs like above. Any info will be appreciated.
Masa
------------------------------
Date: Fri, 02 Oct 1998 09:37:43 -0500
From: Tk Soh <r28629@email.sps.mot.com>
Subject: Re: How much would you charge for your programming?
Message-Id: <3614E537.A42EBACF@email.sps.mot.com>
Masa Suzuki wrote:
>
> How much would programmers generally charge for the following
> programs?
[...]
> I have never charged anyone but would like to know the average
> pricing for programs like above. Any info will be appreciated.
>
> Masa
What about dping it for free? ;)
------------------------------
Date: Fri, 02 Oct 1998 15:19:36 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: How much would you charge for your programming?
Message-Id: <3614EC94.25FB0E86@bbnplanet.com>
Masa Suzuki wrote:
> 1) Perl script in CGI environment
> that logs visitors' email addresses
Nothing to very little. Simple to do, freebies on the net.
> 2) Perl Script in CGI environment on a secured server
> that accepts credit card number and Email the info
> (encrypted by PGP).
Unless you are a professional I would recommend that you defer to one.
For this gig you would also need a legal document removing you from
liability should anyone hack the site. Were I to charge for this I would
do a flat scale depending on the complexity so its hard to say. I would
hack it for $400-500/hr.
> 3) Perl Script in CGI enironment
> that performs a "shopping cart".
Nothing to very little. Simple to do, freebies on the net.
e.
Would I live my life over again?
Make the same unforgivable mistakes?
Yes, given half a chance. Yes -R. Carver-
------------------------------
Date: Fri, 02 Oct 1998 10:04:26 -0400
From: John Porter <jdporter@min.net>
Subject: Re: how to pass FORM variable to second cgi?
Message-Id: <3614DD6A.3D8E5927@min.net>
Shambo Pfaff wrote:
>
> I want an HTML form to send two variables, one which is a generic text
> string, another which dictates which second cgi script gets this text
> string. I've gotten to the point where I can get my cgi script to reead
> the input from the form,
Sounds like a lot of work.
use CGI;
my $cgi = new CGI;
> but I can't figure out how to trigger the second
> cgi script based on the variable from the first script.
> $string = $FORM{'string'};
> $cgitorun = $FORM{'cgittorun'};
Problem #1: you're not using CGI.pm.
> The $cgitorun variable triggers the cgi selected by the user
> (cgi-bin/mycgi.cgi, for example), and $string sends that value to the
> second cgi.
> I've been messing around with
> system(perl $cgitorun);
> but can't figure out how to pass it the $string variable from the form.
The exact answer depends on what you want to do with the output
from the second cgi script. Are you throwing it away? Or are
you using it as the output from the first script? Or is it
incorporated into the output from the first script?
In any case, CGI.pm makes it easy to pass around form variables
as a whole record. For example, you can save them to a file:
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $cgi = new CGI;
open F,"> $file" or die "$file: $!";
$cgi->save(*F);
close F;
With the variables saved in this way, it is easy to read them
back into a cgi script programmatically:
open F,"< $file" or die...
$cgi = CGI->new(*F);
close F;
or you can leave the (second) cgi script as it is, and feed it
the record from the command line:
% second.cgi < form-vars.dat
(or whatever).
Putting it all together, something like this might work:
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $cgi = new CGI;
open F,"> $file" or die "$file: $!";
$cgi->save(*F);
close F;
system("$second_cgi < $file");
This sends the output of the second program to stdout (which is
to say, to the browser). By using pipes, you can capture that
output.
@output = `$second_cgi < $file`;
--
John "Many Jars" Porter
baby mother hospital scissors creature judgment butcher engineer
------------------------------
Date: Fri, 2 Oct 1998 14:23:31 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: I hate it when I do that.
Message-Id: <F07En7.H1o@world.std.com>
Jonathan Feinberg <jdf@pobox.com> writes:
>aml@world.std.com (Andrew M. Langmead) writes:
>> no UnderScore;
>Eewww. I certainly do use implicit $_ all the time. I can't imagine
>Perl without it.
Sorry, didn't mean to offend. Its just that there is a school of
thought that in writing substantial programs one should avoid implicit
$_. I don't necessarily agree with it, but I do see their
point. (Although I'd probably feel comforable with the rule "assign to
an explicit variable instead of $_ if you can no longer see in your
text editor both where $_ gets set and where it is used without
scrolling.") If you were either in that camp, or straddling on the
edge, it would be a good way of enforcing the rule.
--
Andrew Langmead
------------------------------
Date: Fri, 02 Oct 1998 11:00:33 -0400
From: George Jetson <gjetson@spacely.com>
Subject: Re: I have installed Linux. Now what?
Message-Id: <3614EA91.40E9@spacely.com>
Dan Bialek wrote:
>
> Dear Clever Linux People,
>
> I have installed Red Hat onto my PC, and now I am unable to get it do
> anything useful. How do I use
> the various editors, so that I can write basic Perl programs from my new
> example book and run them?
> I am at complete loss. I fired up the emacs in X windows, but I really
> have no idea what I am doing. I apologize for my ignorance, but if
> anyone can shine flashlight of help this way, I would be ever thankful.
> Please respond via email.
At the risk of starting an editor war, I would suggest that you look
around for an editor called nedit. If you can find a binary package of
it, instead of compiling it yourself, I think you would like it much
better.
(To those who might respond "Wrong! nedit uses Motif, and Motif is
commercial." I will respond, "True, but you can use LessTif 0.85 or
greater. Works fine for me.")
nedit is very much like Windows text editors. While many people would
consider that a drawback, I suspect you are coming to the Linux world
from Windows 95, and you would find this user interface to be more like
what you are used to.
Hope this helps
------------------------------
Date: Fri, 02 Oct 1998 08:32:38 -0600
From: Jeff Beard <jeffb@mcguckin.com>
Subject: Re: IDE for Perl
Message-Id: <3614E406.88A7410C@mcguckin.com>
If you use a microsquish OS, then checkout Perl builder:
http://www.solutionsoft.com
If you are on Unix then the best I've found is either Visual SlickEdit
or maybe Crisp but these are really just souped-up text editors with
syntax highlighting.
Cheers,
Jeff
Marcin Kolbuszewski wrote:
>
> Perl is a mature OO language now and would benefit (at least in my
> opinion) from some sort of GUI driven environment to do development.
> Although it may be contrary to the spirit of the language and many
> purists
> will call me names, I think a simple class browser would help
> development of
> applications.
>
> For example we've just started modelling and prototyping a quite large
> OO
> system in Perl. We feel just like C++ people in late 80s or Smalltalk
> people before
> PARC times...
>
> Have you seen anything even remotely resembling an IDE for Perl?
>
> Marcin Kolbuszewski
------------------------------
Date: 2 Oct 1998 15:27:37 GMT
From: <bbense+comp.lang.perl.modules.comp.lang.perl.misc.Oct.02.98@telemark.stanford.edu> ;
Subject: Re: Is Net::FTP (libnet-1.0605) threadsafe?
Message-Id: <6v2rd9$ra6$1@nntp.Stanford.EDU>
In article <3613D74F.A9D341EA@NOSPAMcthompson.org>,
Chris Thompson <ct@NOSPAMcthompson.org> wrote:
>I forgot to mention one thing, the Net::FTP requests are running INSIDE
>a thread.
>
- - There is a bug in the threading code that causes core dumps when
used with some library code deep in IO::Socket which Net::FTP uses.
The development version of perl 5.005_52 + a patch, is supposed to
fix this problem.
- - Booker C. Bense
Version: 2.6.2
iQCVAwUBNhTw5gD83u1ILnWNAQEYxgP/brwCF2UkxKjrhlCIu4Km3xh8i1nijAJE
Aapk+o/dNloo3r7tduo7IXRkTVlphPHYtS40IBdjc2jlFFAJE4Un6cEy3AIMH5N8
1Swu3eTK7t0exvmz2UpsOMWRXa66mGUk9DbTMm8ftawh7EQykntMNDDhhXyvqAuC
tqbJP5CDdgU=
=uxcx
-----END PGP SIGNATURE-----
------------------------------
Date: Fri, 02 Oct 1998 07:33:07 -0700
From: garry4@earthlink.net (Garrett Paine)
Subject: Modem port - Mac
Message-Id: <garry4-0210980733070001@cbl-garry4.hs.earthlink.net>
Hi,
Using MacPerl 5.0x, I'm trying to get some Perl that runs on a Linix box
to run on my Mac. The code will allow me to run the Lego Robotics
Invention System. :-) The code syntax checks OK but when run halts with
the code to open the serial device highlighted.
Any pointers (or solutions) as to how the Mac ports are defined in MacPerl?
Thanks! Garry
------------------------------
Date: Fri, 02 Oct 1998 15:18:49 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: need a regular expressions expert...
Message-Id: <6v2qsp$d0c$1@nnrp1.dejanews.com>
In article <6v24cv$ic1$1@nnrp1.dejanews.com>,
sir_roland@my-dejanews.com wrote:
> Alan Davis wrote:
> >
> > I have a need to have a program spit back any string that DOESN'T start
> > with "BAD", but I cannot use perl's inherent "!" syntax.
>
> Folks, read more carefully, he is seeking help for regexps, but not for
> *perl* regexps, clear? He is just using perl to figure out the RE and
> then plug it into some other RE matcher.
>
> Anyway, try this RE:
>
> ^([^B]|B[^A]|BA[^D])
>
> which spells: "Match lines that don't start with `B' or lines
> that start with `B' but don't have an `A' in the second place or
> lines that start with `BA' but don't have `D' in the third place."
What's wrong with the
print unless /^BAD/;
that was recommended by several, which says :
" print it unless it starts with 'BAD' "
Why not print on the 'else' side of an if?
if (/^BAD/) { 1; } else { print; }
which says :
" if it starts with 'BAD', fine, but if not, print it "
Surely, one or both of these could be accomplished in most any
language. Either of these, both in "eyeing" the regex,
and when "translated" to English, are a lot clearer than:
if (/^([^B]|B[^A]|BA[^D])/) { print; }
or the "translation" you sight above. (to me, at least :)
Patrick Timmins
$monger{Omaha}[0]
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 02 Oct 1998 14:19:08 GMT
From: droby@copyright.com
Subject: Re: Need IP Address Sort Subroutine
Message-Id: <6v2ncr$7p4$1@nnrp1.dejanews.com>
In article <la3e97qvch.fsf@erh.ericsson.se>,
Michal Rutka <erhmiru@erh.ericsson.se> wrote:
> droby@copyright.com writes:
> > If Laplace and Fourier can have transforms named after them, why can't
Randal?
>
> OK. He can. Are you happy now?
>
Yes. Thank you ever so much.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 02 Oct 1998 15:08:50 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Omaha Perl Mongers - First Meeting !
Message-Id: <3614EA0D.F8216D69@bbnplanet.com>
Patrick Timmins wrote:
> the Gateway to the West, beautiful Omaha, Nebraska
Um, Darlin', since I'm from St. Louis, and we got that arch thingie, I
think you may be a little confused. :) Omaha is sorta north and west of
there...prarie dog country. No gateways.
> ( follow the 'Omaha, the Beautiful' link to see the top 10 reasons
> why Omaha should host the year 2000 Perl Conference! )
Oh, gack, think I scheduled a dental appointment for then.
e.
Would I live my life over again?
Make the same unforgivable mistakes?
Yes, given half a chance. Yes -R. Carver-
------------------------------
Date: Fri, 02 Oct 1998 15:01:20 GMT
From: jzobel@my-dejanews.com (Joachim Zobel)
Subject: Re: Passing Perl Var To JavaScript - How?
Message-Id: <36147b6b.1607516@dilbert.crrrwg.de>
ralph@primemail.com (Ralph Freshour) wrote:
>What I have thus far:
>(snippet of code in my javascript)
>
>function addToList(inform)
> if (inform.usingName == "no")
> {
> alert("\\nYou must use a first name\\n");
> continue;
> }
>
>
><INPUT TYPE="HIDDEN" NAME="usingName" VALUE="$usingName">
>
Where's the perl?! There must be something like
print "<INPUT TYPE=\"HIDDEN\" NAME=\"usingName\"
VALUE=\"$usingName\">";
>
>Am I passing it correctly by using a Hidden Field?
Should be a working soloution. But any
print $usingName;
in the right place will do. You have to print the value of $usingName
somewhere into the HTML you sent to the client.
Hth
Joachim
"I read the news today oh boy" - The Beatles - A Day In The Life
Also this message has a valid From header, replies
to user@kud.com where user = jzobel are preferred.
------------------------------
Date: Fri, 02 Oct 1998 15:22:35 GMT
From: dsaff@tvisions.com
Subject: Re: Passing Perl Var To JavaScript - How?
Message-Id: <6v2r3q$d4n$1@nnrp1.dejanews.com>
In article <3611a18c.7462898@news.mindspring.com>,
ralph@primemail.com wrote:
> I have a perl/cgi form with some JavaScript in it - I'm trying to pass
> a perl variable to a javascript function and cannot quite figure out
> how to do this. My perl code reads a variable ($usingName) out of a
> file on the server side and I need to pass this value to my JS for
> some checking.
>
> What I have thus far:
>
> (snippet of code in my javascript)
>
> function addToList(inform)
> if (inform.usingName == "no")
> {
> alert("\\nYou must use a first name\\n");
> continue;
> }
>
> <INPUT TYPE="HIDDEN" NAME="usingName" VALUE="$usingName">
>
> Am I passing it correctly by using a Hidden Field?
>
> Or do I need to be passing the usingName arg to the function
> addToList?
It sounds like you're reading a value from a server-side file, and then
including it in an HTML form you pass to the client. Tell me if I'm wrong.
If that's so, then I think possibly the simplest thing to do is simply to
embed the value of $usingName into your JavaScript, like so:
print qq(
function addToList(inform)
if ($usingName == "no")
{
alert("\\nYou must use a first name\\n");
continue;
}
);
(Don't you need braces around your JavaScript function definition? I might be
wrong there.) Well, hope that helps.
David Saff‰
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 02 Oct 1998 16:04:33 +0200
From: Coornaert David <dcoorna@dbm.ulb.ac.be>
Subject: problem after fork and httpd waiting ! help me out !
Message-Id: <3614DD70.837707F5@dbm.ulb.ac.be>
hi all,
I have a perl script which forks,
the child goes onto a "long time" computation
while the parent goes on issuing the necessary html to the client.
this works perfect in the shell
BUT, when the apache httpd launches the script, it waits for the child
to end before it sends the html generarted by the parent..
Any turn-around ?
apparently the parent shows up as zombie in "top", but it's not really a
zombie, it just disappears as the child process ends up
hmm also, I tought of starting the child process as a batch but that's
definately not a solution..
anyhelp appreciated
David,
=;B^)
------------------------------
Date: Fri, 02 Oct 1998 07:12:35 -0700
From: Brendan Johnston <bjohnsto@usa.net>
Subject: Re: sendmail.pl
Message-Id: <3614DF53.4D58DD4E@usa.net>
On NT (and 95) I send mail directly from perl to our SMTP server.
There is a package for this in perl called SMTP. It came in my
distribution.
Here is some sample code copied from the docs:
#!/usr/local/bin/perl -w
use Net::SMTP;
$smtp = Net::SMTP->new('mailhost');
$smtp->mail($ENV{USER});
$smtp->to('postmaster');
$smtp->data();
$smtp->datasend("To: postmaster\n");
$smtp->datasend("\n");
$smtp->datasend("A simple test message\n");
$smtp->dataend();
$smtp->quit;
When I used it I added a subject line and other fills.
It seems to work well.
Brendan Johnston
Elaine -HappyFunBall- Ashton wrote:
>
> francesx@my-dejanews.com wrote:
>
> > I want to call up the sendmail.pl program from a perl script on NT. To send
> > input of a form via email.
>
> Uh, the last time I checked (though things change and I could be wrong)
> Sendmail doesn't run on NT. UNIX isn't NT so you might need to see what
> MUA will send mail on NT.
>
> e.
>
> Would I live my life over again?
> Make the same unforgivable mistakes?
> Yes, given half a chance. Yes -R. Carver-
------------------------------
Date: 02 Oct 1998 10:36:14 -0400
From: Ala Qumsieh <aqumsieh@tigre.matrox.com>
Subject: Re: Trimming Long Scalar Variables
Message-Id: <x3yk92jdo9t.fsf@tigre.matrox.com>
Jesse Rosenberger <jesse@savalas.com> writes:
>
> Hey everyone,
> How would you get Perl to trim a long variable value down to a
> certain specified length?
>
another FAQ:
How can I access/change the first N letters of a string?
(shame on you! but anyway ..)
use substr()
$short_var = substr $long_var, $offset, $length;
--
Ala Qumsieh | No .. not Just Another
ASIC Design Engineer | Perl Hacker!!!!!
Matrox Graphics Inc. |
Montreal, Quebec | (Not yet!)
------------------------------
Date: Fri, 2 Oct 1998 11:06:28 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Word wrap for Perl
Message-Id: <1dg9q80.1af1tglxtjiazN@roxboro0-014.dyn.interpath.net>
Stuart Thorn <stuart@euronova.com> wrote:
********* Start quote of Stuart *********
Look on CPAN for Text::Wrap
Simpler than Text::Format
--------------------
use Text::Wrap qw(wrap $columns);
$columns = 40; # or whatever
my $longString = q'>I am looking for just some function that will take a
string that is
>multiline. And I give it a delimeter of 72, the size of the string to
>word wrapping. Can anyone help me?
>
>Justin Archie
>';
my $wrappedString = wrap( '', '', $longString );
********* End quote of Stuart *********
Actually that dosn't look too good when executed (it doesn't keep the
quote prefix).
The output from wrap is:
>I am looking for just some function
that will take a
string that is
>multiline. And I give it a delimeter
of 72, the size of the string to
>word wrapping. Can anyone help me?
>
>Justin Archie
>
I've got a couple of functions which do handle wrapping quoted text if
anybody is interested.
My output is, given the same input string would be:
> I am looking for just some function
> that will take a
string that is
> multiline. And I give it a delimeter
> of 72, the size of the string to word
> wrapping. Can anyone help me?
>
> Justin Archie
>
(the line "string that is" isn't prefixed because it's not prefixed in
the input).
--
John Moreno
------------------------------
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 3873
**************************************