[8023] in Perl-Users-Digest
Perl-Users Digest, Issue: 1648 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 15 15:08:06 1998
Date: Thu, 15 Jan 98 12:00:25 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 15 Jan 1998 Volume: 8 Number: 1648
Today's topics:
Re: Can I create a Linked List in Perl (Abigail)
Re: Can one Use Image Maps? (brian d foy)
Re: Could use some perl help! (brian d foy)
Critique My Code! (Please) dg50@chrysler.com
Re: Critique My Code! (Please) <jason@primal.ucdavis.edu>
Re: Displaying GIFs - oops (brian d foy)
Re: Displaying GIFs - THX <rootbeer@teleport.com>
Re: Duplicating standard output/error <joseph@5sigma.com>
Re: Getting Perl Programs to print out bit by bit <joseph@5sigma.com>
Re: Help ! (brian d foy)
Re: Help! with dbmopen and hash evaluation Perl 5.002 <joseph@5sigma.com>
Last change script <rlluhman@netins.net>
Re: Last change script (brian d foy)
Re: Limiting simultaneous users <joseph@5sigma.com>
Logical 'and' in regex? (Frank)
Re: Logical 'and' in regex? <joseph@5sigma.com>
Re: Looking for HTML template script <bob@unews.com>
Make test error when compiling perl 5.004004 for SunOS <errolf@nortel.ca>
NT: opendir and UNC names <mallwitz@intershop.de>
output as hex <djpaul@fnet.gr>
Re: perl -- a language for LEARNING programming? (Jason R. Weston)
Re: perl -- a language for LEARNING programming? (Steve Linberg)
Re: Perl and HTTP (brian d foy)
Perl and socket connections from PC's??? (JohnCurtis)
Quick Perl tutorial? <jgoss@ultranet.com>
Simple script for posting data and reading result <y-pisan@nwu.edu>
Re: source into binary code <dboorstein@ixl.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 15 Jan 1998 18:50:28 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Can I create a Linked List in Perl
Message-Id: <69llpk$be8$1@client3.news.psi.net>
Chipmunk (rjk@coos.dartmouth.edu) wrote on 1598 September 1993 in
<URL: news:34BD9B23.F666731C@coos.dartmouth.edu>:
++
++ As I stated in my response to John Porter, Perl arrays are
++ as functional as C-style linked lists.
They might be as functional, but using arrays instead of linked lists
isn't always as efficient, as splice() in general take time linear
to the size of the array. Linked lists *do* have their place.
Here's a simple implementation, all operations are O (1):
use constant NEXT => 2;
use constant PREV => 0;
sub new_node {[undef, shift, undef]}
sub add_node {
my ($list, $node) = @_;
$node -> [NEXT] = $list -> [NEXT];
$node -> [PREV] = $list;
$list -> [NEXT] = $node;
$node -> [NEXT] -> [PREV] = $node if $node -> [NEXT];
$list;
}
sub ins_node {
my ($list, $node) = @_;
$node -> [PREV] = $list -> [PREV];
$node -> [NEXT] = $list;
$list -> [PREV] = $node;
$node -> [PREV] -> [NEXT] = $node if $node -> [PREV];
$list;
}
sub next_node {shift -> [NEXT]}
sub prev_node {shift -> [PREV]}
sub del_node {
my $node = shift;
$node -> [NEXT] -> [PREV] = $node -> [PREV] if $node -> [NEXT];
$node -> [PREV] -> [NEXT] = $node -> [NEXT] if $node -> [PREV];
$node -> [NEXT] = undef;
$node -> [PREV] = undef;
$node;
}
An OO version is left as an exercise to the reader.
Abigail
--
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'
------------------------------
Date: Thu, 15 Jan 1998 13:16:44 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Can one Use Image Maps?
Message-Id: <comdog-1501981316440001@news.panix.com>
Keywords: just another new york perl hacker
In article <34BDB3CB.FA8A6931@pitnet.net>, EntreprenuerOnline <melton@pitnet.net> posted:
> This may sound like a newbie question but CAN & HOW does one use Image
> maps in Perl 5 generated pages?
data are data. perl doesn't care what they are. output any HTML
that you like, but be aware of that the browser may not be
resolving references as you think it is when the HTML comes from
a script (<BASE> can usually fix that up).
good luck :)
--
brian d foy <http://computerdog.com>
------------------------------
Date: Thu, 15 Jan 1998 13:21:11 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Could use some perl help!
Message-Id: <comdog-1501981321110001@news.panix.com>
Keywords: just another new york perl hacker
In article <EMtq93.6vJ@world.std.com>, yi@world.std.com (Marty Lebowitz) posted:
> Anyone out there with perl knowledge able to help out by making a minor
> mod (if its more, we can talk about it!), to an existing routine?
we can't help you until you explain the modification and post a
bit of code.
--
brian d foy <http://computerdog.com>
------------------------------
Date: Thu, 15 Jan 1998 12:01:46 -0600
From: dg50@chrysler.com
Subject: Critique My Code! (Please)
Message-Id: <884886677.30605317@dejanews.com>
Here's a little (heh - it got a little bloated) utility I wrote to strip
those annoying ^M characters from the ends of files imported from MS/DOG
or WinDoze.
Sure, it's overkill, but I'm releasing it into the public domain, and
want it to be robust. ;)
What I'd like though, is some constructive de-construction of my code.
Have a look, and tell me where I can make speed improvements, take
shortcuts, etc to make it smaller/faster/better.
Thanks,
DG
(watch out for linewrap in the following)
----------8<----------Clip'n'Save----------8<----------Clip'n'Save--------------
#!/usr/bin/perl
use File::Copy; #to circumvent calling the shell
use Getopt::Long; #for POSIX options parsing
$version = "V1.0.0";
$last_updated = "January 15, 1998";
sub print_usage { print STDERR "remCR.pl: A utility to strip out those
annoying ^M chars from the ends of Billy Gates\'s text files\n\n"; print
STDERR "Useage: remCR.pl [--version] [--help] [-r] (filename) [filename2]
[filename3] ...\n"; print STDERR " Options:\n"; print STDERR " -r :
Recurse into subdirectories\n"; print STDERR " --help : Print this
message\n"; print STDERR " --version : Print version info\n\n"; }
sub parse_file {
return if ($opt_version || $opt_help);
my $infile = shift @_;
print "remCR.pl - Parsing File: $infile\n";
if (! -e $infile) {
print STDERR "remCR.pl ERROR: File $infile does not exist!\n";
}
elsif (! -r $infile) {
print STDERR "remCR.pl ERROR: File $infile is not readable!\n";
}
elsif (! -w $infile) {
print STDERR "remCR.pl ERROR: File $infile is not writeable!\n";
}
elsif (-d $infile) {
if (!$opt_r) {
print STDERR "remCR.pl ERROR: File $infile is a directory.
Skipping...\n";
}
else {
opendir INDIR, "$infile" or die "remCR.pl ERROR: Couldn\'t open
directory $infile!\n";
@allfiles = grep !/^\.\.?$/, readdir INDIR;
closedir INDIR;
foreach (@allfiles) { &parse_file("$infile/$_"); } } } elsif (! -T
$infile) { print STDERR "remCR.pl ERROR: File $infile does not appear to
be a text file!\n"; } else { open IN, "$infile" or die "remCR.pl
ERROR: Still couldn\'t read file $infile !\n"; open OUT,
">/tmp/remCR.tmp" or die "remCR ERROR: Couldn\'t open temp file
/tmp/remCr.tmp!\n";
while ($buffer = <IN>) {
$buffer =~ s/\r$//;
print OUT "$buffer";
}
close IN;
close OUT;
copy ("/tmp/remCR.tmp", "$infile") or print STDERR "remCR.pl ERROR:
Copying temp file over old file failed!\n"; unlink ("/tmp/remCR.tmp") or
print STDERR "remCR.pl ERROR: Could not delete temp file!\n"; } }
if (! @ARGV) {
&print_usage;
exit;
}
&GetOptions("r", "version", "help", "<>", \&parse_file);
if ($opt_version) {
print STDERR "remCR.pl Version $version $last_updated\n";
print STDERR " Dennis Grant\n";
print STDERR " dg50\@chrysler.com\n";
exit;
}
if ($opt_help) {
&print_usage;
exit;
}
print STDERR "remCR.pl - Done!\n";
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Thu, 15 Jan 1998 11:00:09 -0800
From: Jason Christian <jason@primal.ucdavis.edu>
Subject: Re: Critique My Code! (Please)
Message-Id: <Pine.OSF.3.95.980115105251.23380G-100000@primal.ucdavis.edu>
On Thu, 15 Jan 1998 dg50@chrysler.com wrote:
^^^^^^^---------vvvvvvv !
> Here's a little (heh - it got a little bloated) utility I wrote to strip
> those annoying ^M characters from the ends of files imported from MS/DOG
> or WinDoze.
>
> Sure, it's overkill, but I'm releasing it into the public domain, and
> want it to be robust. ;)
>
> What I'd like though, is some constructive de-construction of my code.
> Have a look, and tell me where I can make speed improvements, take
> shortcuts, etc to make it smaller/faster/better.
I dunno about faster and better, being a dumb economist who can
judge the price of everything and the value of nothing, but I usually just
write
perl -pi.bak -e 's/\cM$//' <listofGatesiana>
Seems to work for me.
---------------------------------------------------------------------------
Jason Christian University of California, Davis
jason@primal.ucdavis.edu Agricultural and Resource Economics
Office:(530)752-1357 FAX:(530)752-5614 Davis, CA 95616
------------------------------
Date: Thu, 15 Jan 1998 13:11:11 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Displaying GIFs - oops
Message-Id: <comdog-1501981311110001@news.panix.com>
Keywords: just another new york perl hacker
In article <qz$9801151223@qz.little-neck.ny.us>, Eli the Bearded <*@qz.to> posted:
> UUencoding also has a defiency
> for that sort of thing in that "-" and ">" are valid characters in the
> output mapping, the base64 encoding used by mime uses a character set
> without " ", "-", or ">" avoiding these problems.
i'll use MIME::Base64 in the future. aren't modules great? sounds like
it's time for an HTML preprocessor to do this automatically. :)
--
brian d foy <http://computerdog.com>
can't find the other pages he did this to.
------------------------------
Date: Thu, 15 Jan 1998 11:12:31 -0800
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Displaying GIFs - THX
Message-Id: <Pine.GSO.3.96.980115111141.5044S-100000@user2.teleport.com>
On Thu, 15 Jan 1998, Patrick Stacey wrote:
> open(IMAGE,"<".$gif_image);
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
Thanks.
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Thu, 15 Jan 1998 11:19:09 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Duplicating standard output/error
Message-Id: <34BE52E7.D94C948D@5sigma.com>
You could use the tee command, but that wouldn't necessarily
be all that efficient. Better, probably, to capture stdout
with a pipe and explicitly write to both destinations:
open CMD, "command |" or die "game over, man: $!";
while (<CMD>) {
print $_; # goes to screen
push @log, $_; # line goes into array @log
}
I don't know of any technique for "splitting" a pipe at the
operating system level.
-joseph
http://www.effectiveperl.com
Samuel Ockman wrote:
>
> I'm working on a program where I ask a lot of questions, and then run a
> lot of commands using system. After finishing asking the questions, I'd
> like to get an exact copy of what is displayed on the screen (on both
> stdout and stderr). It seems like the best way to do this would be to
> alias stdout (and stderr) so they point to both themselves, and a file
> open for writing. But I don't know how to do this. Anyone have any
> ideas?
------------------------------
Date: Thu, 15 Jan 1998 11:22:48 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Getting Perl Programs to print out bit by bit
Message-Id: <34BE53C2.B036C179@5sigma.com>
The key concepts here are "unbuffered" and "non-parsed headers."
Look through the index of any good CGI programming book. This
might be the sort of thing you would find in a list of CGI
programming FAQs. :-)
-joseph
Ben Holness wrote:
> I would like to know if it is possible for a perl program to print out
> bit-by-bit.
------------------------------
Date: Thu, 15 Jan 1998 13:24:16 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Help !
Message-Id: <comdog-1501981324160001@news.panix.com>
Keywords: just another new york perl hacker
In article <884846069.570818580@dejanews.com>, languge@gol.com posted:
> Hi Everyone, very new to all this , my friend
> told me you may help...
>
>
> I am an English teacher, I want to have
> students click on multiple answer questions,
> from my page, and their answers are auto
> emailed to me .
> Is there anywhere that I can get a sample to
> cut and paste into my body of HTML
are you looking for help with HTML? if so, a newsgroup that deals with
HTML might be more appropriate. other than that, there are plenty of
quiz type things on the net, so a bit of surfing should give you
plenty of examples.
good luck :)
--
brian d foy <http://computerdog.com>
------------------------------
Date: Thu, 15 Jan 1998 11:32:31 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Help! with dbmopen and hash evaluation Perl 5.002
Message-Id: <34BE5608.A3807028@5sigma.com>
This code:
dbmopen %HASH, "blah", 0666;
print "scalar HASH = ", scalar(%HASH), "\n";
seems to work fine.
However, I would recommend using scalar(keys %hash) to get the
size of a hash. Using a hash name in a scalar context may well work
but it is not a common practice.
-joseph
http://www.effectiveperl.com
Burris Jackes wrote:
>
> All,
>
> I am new to perl and am trying to manage some files using dbmopen. I
> run something like this:
>
> > dbmopen %HASH, "/path/filename", 0666;
>
> Now, I would like to find out if there are any entries in this database,
> and if not, show a message to that effect.[...]a
------------------------------
Date: Thu, 15 Jan 1998 12:00:04 -0600
From: "Rick" <rlluhman@netins.net>
Subject: Last change script
Message-Id: <69lilm$c8d$1@news.iastate.edu>
Anyone know of a script that can be used on a WEB page to let someone know
when a different text file was last changed.
RICK
------------------------------
Date: Thu, 15 Jan 1998 13:39:52 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Last change script
Message-Id: <comdog-1501981339520001@news.panix.com>
Keywords: just another new york perl hacker
In article <69lilm$c8d$1@news.iastate.edu>, "Rick" <rlluhman@netins.net> posted:
> Anyone know of a script that can be used on a WEB page to let someone know
> when a different text file was last changed.
yes. however, if you plan on going the SSI route, you can simply
use appropriate directive to do the same. see the docs for your
server's implementation of server side includes for the details.
good luck :)
--
brian d foy <http://computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Thu, 15 Jan 1998 12:17:21 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Limiting simultaneous users
Message-Id: <34BE608A.89CA3B47@5sigma.com>
Some operating systems, like Solaris, have built-in file locking.
All you need to do is set the right bit: chmod +l in the case of
Solaris 2.5.1. If you don't want I/O to block indefinitely,
you can always set an alarm. I don't often hear this alternative
to flock, fcntl, etc. suggested.
Just my $.02 worth.
If you (Rick) really do want to control the number of simultaneous
accesses to a script or something similar, that turns out to be
pretty tricky to implement robustly. Things like semaphores don't
work well because you can't avoid things like a process incrementing
a semaphore and then dying unexpectedly. Same things for lock files.
What you have to do is create a daemon process that arbitrates
simultaneous access. The daemon can then take care of contingencies
like revoking and re-issuing permissions that have become stale.
-joseph
http://www.effectiveperl.com
Tom Phoenix wrote:
>
> On Wed, 14 Jan 1998, Rick Johnson wrote:
>
> > I have a script which is basically a "classified ads script" but the
> > number of users who are trying to access the script at the same time is
> > so substantail that it seems to crash the script.
>
> I think you could use the methods in Randal's fourth Web Techniques
> column, which explains how to use flock() to avoid problems when multiple
> processes need to modify one file. Hope this helps!
------------------------------
Date: Thu, 15 Jan 1998 19:03:11 GMT
From: FHeasley@chemistry.com (Frank)
Subject: Logical 'and' in regex?
Message-Id: <34be581a.10537912@news.halcyon.com>
The following expression is essentially a logical "or":
$breakfast =~ /bacon|eggs|hashbrowns|juice/;
however, suppose I want ALL of the above for breakfast? Is there a
similar construct that AND's all of the items?
Of course, one could evaluate every item, but that's a rather clumsy
way to do it.
The following illustrates the question, but fails:
$breakfast =~ /bacon&&eggs&&hashbrowns&&juice/;
Is there a better way to do this?
Frank
------------------------------
Date: Thu, 15 Jan 1998 12:26:33 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Logical 'and' in regex?
Message-Id: <34BE62B1.C2A8B027@5sigma.com>
Frank wrote:
>
> The following expression is essentially a logical "or":
>
> $breakfast =~ /bacon|eggs|hashbrowns|juice/;
>
> however, suppose I want ALL of the above for breakfast? Is there a
> similar construct that AND's all of the items?
>
> Of course, one could evaluate every item, but that's a rather clumsy
> way to do it.
You think so? When the "alternative" is $breakfast =~
/(?=.*?bacon)(?=.*?eggs)(?=.*?hashbrowns)(?=.*?juice)/?
-joseph
http://www.effectiveperl.com
------------------------------
Date: Thu, 15 Jan 1998 13:08:39 -0600
From: "Bob" <bob@unews.com>
Subject: Re: Looking for HTML template script
Message-Id: <69lmr1$145$1@ns3.umkc.edu>
Thanks for start.
Bob
------------------------------
Date: Thu, 15 Jan 1998 13:10:10 -0500
From: Errol Anthony Fernandes <errolf@nortel.ca>
Subject: Make test error when compiling perl 5.004004 for SunOS
Message-Id: <34BE5102.236733A@nortel.ca>
Hi,
(you can send any helpful information to errolf@nortel.ca)
I am trying to compile perl 5.004_04 for my platform.
Here is all the uname information...
SunOS bcarsfa3 SunOS 4.1.3_U1 1 sun4m
I run Configure using all of the defaults for everything except a couple
of path names. That shouldn't affect anything.
I'm compiling using Cygnus gcc version 2.7-97r1
The configure seems to work fine as well as the make.
However in the make test....
lib/odbm.........................FAILED at test 0
I then run ./perl harness and the same test spits out....
lib/odbm............dubious
Test returned status 0 (wstat 138, 0x8a)
test program seems to have generated a core
I have compiled this version of Perl for 4 other operating systems
(Solaris 2.5.1, Dec Unix 4.0, HP-UX 9.05 and HP-UX 10.20) so I am very
puzzled as to why this error occurs..
I assume it has something to do with connecting to a database because I
continued
to install it and when I was installing my mSQL perl the make tests gave
me many
"dubious errors" as well.
-----------------------------------------------------------------------------------------------
This is my output of ./myconfig
Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
Platform:
osname=sunos, osvers=4.1.3_u1, archname=sun4-sunos
uname='sunos bcars942 4.1.3_u1 1 sun4m '
hint=recommended, useposix=true, d_sigaction=define
bincompat3=y useperlio=undef d_sfio=undef
Compiler:
cc='gcc', optimize='-O', gccversion=2.7-97r1
cppflags=''
ccflags =''
stdchar='unsigned char', d_stdstdio=define, usevfork=true
voidflags=15, castflags=0, d_casti32=define, d_castneg=define
intsize=4, alignbytes=8, usemymalloc=y, prototype=define
Linker and Libraries:
ld='ld', ldflags =''
libpth=/lib /usr/lib /usr/ucblib
libs=-lnsl -ldbm -ldl -lm -lc -lposix
libc=/lib/libc.so.1.9, so=so
useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-fpic', lddlflags='-assert nodefinitions'
------------------------------
Date: Thu, 15 Jan 1998 20:27:00 +0100
From: Christian Mallwitz <mallwitz@intershop.de>
Subject: NT: opendir and UNC names
Message-Id: <34BE6304.47F4033E@intershop.de>
Hi folks,
I stumbled accros some strange behavior using perl 5.004 on NT.
I try to read directories using (open|read|close)dir.
If the directory is a mapped drived everything is fine.
The problem starts if I start using UNC names.
opendir() failes if the directory is just \\server\share
with "can't open directory: No such file or directory."
It works if the directory is something like \\server\share\dir
To make my point clear I have attached a script. My computer (NTLUKAS)
has
a share NTLUKAS. This is the same as d: (my system drive).
cases: 1, 2, 5 are ok
cases: 3, 4 fail
Any ideas?
Christian
PS: please respond via email as well as to c.l.p.m
################################################################
my(@UNC) =
(
"d:\\", # 1
"d:\\WINNT", # 2
"\\\\NTLUKAS\\NTLUKAS", # 3
"\\\\NTLUKAS\\NTLUKAS\\", # 4
"\\\\NTLUKAS\\NTLUKAS\\WINNT", # 5
);
my($i, @dir, $entry);
################################################################
foreach $i (@UNC)
{
print "$i\n";
if (!opendir(DIR, "$i")) { warn "can't open directory
$i: $!\n\n"; next; }
if (scalar (@dir = readdir(DIR)) == 0) { warn "can't read directory
$i: $!\n\n"; next; }
closedir(DIR);
if ($#dir == -1)
{
printf "%-60s empty\n", $i;
}
foreach $entry (@dir)
{
printf "%-60s \n", "$i - $entry" if $entry =~ /^j/i; #
glob("j*.*")
}
print "\n";
}
################################################################
------------------------------
Date: Wed, 14 Jan 1998 18:16:07 -0800
From: DjPaul <djpaul@fnet.gr>
Subject: output as hex
Message-Id: <34BD7166.B117F38B@fnet.gr>
I'm trying to convert an ascii array to hexadecimal format and save it
in a file (or another array) as binary information.
I tried to use "\x" before the values but did not worked.
I also used pack() function with "h" and "H" templates, but did not
worked well either. (i.e I wanted the long 17000000 converted to hex and
used pack("H4",170000000), but the result was 170a (?) ).
Does anybody knows any way to do this?
Thank you,
Paul
------------------------------
Date: 15 Jan 1998 18:33:47 GMT
From: notsew@wwa.com (Jason R. Weston)
Subject: Re: perl -- a language for LEARNING programming?
Message-Id: <69lkqb$dnb$1@hirame.wwa.com>
Why C rather than C++?
: Perl will spoil you with its flexibility. I'd say learn C first. At the
: risk of incurring flames, I'd say that every professional programmer
: should know C. It's an excellent base and it will really make you
: appreciate Perl! :)
: --
: slinberg .com
: @crocker
: Try that one, spambots!
------------------------------
Date: Thu, 15 Jan 1998 14:02:06 -0500
From: slinberg-bitme@crocker.com (Steve Linberg)
Subject: Re: perl -- a language for LEARNING programming?
Message-Id: <slinberg-bitme-1501981402070001@projdirc.literacy.upenn.edu>
In article <69lkqb$dnb$1@hirame.wwa.com>, notsew@wwa.com (Jason R. Weston)
wrote:
> Why C rather than C++?
>
> : Perl will spoil you with its flexibility. I'd say learn C first. At the
> : risk of incurring flames, I'd say that every professional programmer
> : should know C. It's an excellent base and it will really make you
> : appreciate Perl! :)
Partly for historical reasons - C's where it all began. Although the jump
from C to C++ is non-trivial, I think it would be easier than going
straight to C++. I'm not a huge fan of C++ myself, being a somewhat of a
holdover from the procedural days... Java is a much more complete object
model than C++, if that's what you're after.
However, to each his own! Every good hacker makes his/her own choices,
ultimately.
------------------------------
Date: Thu, 15 Jan 1998 13:13:12 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl and HTTP
Message-Id: <comdog-1501981313120001@news.panix.com>
Keywords: just another new york perl hacker
In article <69lcbh$fto$1@soap.uunet.pipex.com>, fdriver@rnib.org.uk (Frank Driver) posted:
> For some reason when I run my perl script I get the following error
> "&main::AF_INET called at /bin/goto.pl line 93.
did you
use Socket;
and follow the directions?
--
brian d foy <http://computerdog.com>
------------------------------
Date: 15 Jan 1998 12:38:14 GMT
From: johncurtis@aol.com (JohnCurtis)
Subject: Perl and socket connections from PC's???
Message-Id: <19980115123800.HAA09154@ladder02.news.aol.com>
I have written some client/server PERL programs to run on HP/UX. They work
great and do exactly what I want them to do. However when I try to create a
Visual Basic client (using Winsock control) to connect to the same server
process the output from the VB App appears to get buffered.
I have posted this to the Visual Basic Guru's but have gotten no responses,
anyone have any ideas? There doesn't seem to be any way to control the
flushing of the output on the socket under VB ....
John
------------------------------
Date: Thu, 15 Jan 1998 13:51:06 -0500
From: Jim Goss <jgoss@ultranet.com>
Subject: Quick Perl tutorial?
Message-Id: <34BE5A9A.DBE4312A@ultranet.com>
Hi all,
I hope this isn't covered in any of the sources I checked and missed
it...
I'm looking to learn the basics of perl so I can whip together
some scripts. I don't need to use it a lot, nor do I need to
do anything complex, just enough to do some quick and dirty
deeds on occasion. I don't want to spend hours learning the
language, so I was wondering if there's a good quick tutorial
anywhere covering the basics. Anything oriented towards those
familiar with C would be useful as well.
Thanks,
Jim
------------------------------
Date: 15 Jan 1998 12:42:01 -0600
From: Yusuf Pisan <y-pisan@nwu.edu>
Subject: Simple script for posting data and reading result
Message-Id: <wkvhvl37gm.fsf@nwu.edu>
Could somebody suggest a simple perl4/perl5 script to 'POST' some data
to a search engine and read back the result?
I looked at htttp://www.perl.com/ but could not seem to find any
modules that was intended for this purpose.
Any help would be appreciated. Please post and mail your responses.
Yusuf
------------------------------
Date: Thu, 15 Jan 1998 13:49:53 -0500
From: Dan Boorstein <dboorstein@ixl.com>
To: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: source into binary code
Message-Id: <34BE5A51.BD424C7E@ixl.com>
Andrew Johnson wrote:
>
> Dan Boorstein wrote:
> !
> ! Tom Christiansen wrote:
> ! > Compiling produces no security.
> !
> ! taken from the merriam webster dictionary:
> !
> ! security - "measures taken to guard against espionage or sabotage,
> ! crime, attack, or escape"
> !
> ! obscure - "not readily understood or clearly expressed"
> !
> ! i'm not submitting that compiling is good security, only that it
> ! is security. based on this definition, or one from your favorite
> ! dictionary, do you agree or disagree with tom c's original
> ! statement?
>
> I agree with Tom C's original statement.
>
> if you have a security problem (or don't know if you do) with
> a script, then just trying to hide the problem by compiling
> a) does not fix the problem
i never said it would
> b) only hides it from people who know as little about such
> things as you
exactly my point. it is a barrier in gaining knowledge. that is
security. not foolproof, not even good, but still security.
key cryptography works exactly as you state in 'b'. it hides information
from those who know less about such things (i.e., the key).
>
> ! second, the blanket statements that have followed concerning
> ! poorness of security through obscurity i believe to be in error
> ! as well. isn't key based cryptography security through obscurity?
> ! sure, it's on the other end of a wide spectrum, but is an act of
> ! obscuring nonetheless.
>
> but such key cryptography measures are generally intentionally
> designed to be difficult to break...
i agree whole-heartedly.
> having the raw source code
> to a PGP type application is not going to help you read someone's
> encrypted data ...
not necessarily. what if they made a mistake in their encryption
algorithm and you don't know how to disassemble code? if you
can read the source code then you're one very large step ahead.
> compilation is not designed to be a good (or
> any kind of) encryption system,
> and thinking that it provides some
> measure of encryption is simply false security.
sorry i disagree. encryption is encoding. it does not mean
encoding for the sake of security, though that is a likely usage. do you
disagree that compilation is good at encoding source code into machine
or byte code?
cheers,
dan
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.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 1648
**************************************